[Xen-devel] [PATCH 6/9] x86/vvmx: Remove operand reading from decode_vmx_inst()

2017-10-26 Thread Euan Harris
Use operand_read() to read memory operands instead of using the value read by decode_vmx_inst() in the following functions: * nvmx_handle_invept() * nvmx_handle_invvpid() * nvmx_handle_vmclear() * nvmx_handle_vmptrld() * nvmx_handle_vmxon() * nvmx_handle_vmwrite() Signed-off-by: Euan

[Xen-devel] [PATCH 1/9] x86/vvmx: Remove enum vmx_regs_enc

2017-10-26 Thread Euan Harris
This is the standard register encoding, is not VVMX-specific and is only used in a couple of places. Signed-off-by: Euan Harris <euan.har...@citrix.com> --- xen/arch/x86/hvm/vmx/vvmx.c| 8 xen/include/asm-x86/hvm/vmx/vvmx.h | 22 -- 2 files chan

[Xen-devel] [PATCH 5/9] x86/vvmx: Replace direct calls to reg_read() with operand_read()

2017-10-26 Thread Euan Harris
Use operand_read() to read register operands in the following functions: * nvmx_handle_vmread() * nvmx_handle_vmwrite() * nvmx_handle_invept() Direct reading of memory operands will be replaced in a separate patch. Signed-off-by: Euan Harris <euan.har...@citrix.com> --- xen/arch/x86/h

[Xen-devel] [PATCH 4/9] x86/vvmx: Remove unnecessary VMX operand reads

2017-10-26 Thread Euan Harris
* vpid is never used in nvmx_handle_invept() so there is no point in reading it. * vmptrst's operand is the memory address to which to write the VMCS pointer. gpa is the pointer to write. Reading the address into gpa is meaningless. Signed-off-by: Euan Harris <euan.

[Xen-devel] [PATCH 9/9] x86/vvmx: Use hvm_copy_{to, from}_guest_virt() to read operands

2017-10-26 Thread Euan Harris
(), which use well-tested memory access code used in various other parts of the hypervisor. Signed-off-by: Euan Harris <euan.har...@citrix.com> --- xen/arch/x86/hvm/vmx/vvmx.c | 80 +++-- 1 file changed, 26 insertions(+), 54 deletions(-) diff --git

[Xen-devel] [PATCH 2/9] x86/vvmx: Unify operands in struct vmx_inst_decoded

2017-10-26 Thread Euan Harris
e always map to op[0].type in this patch because previously operand 2 could only be a register and so type was never checked when accessing it. Signed-off-by: Euan Harris <euan.har...@citrix.com> --- xen/arch/x86/hvm/vmx/vvmx.c | 52 - 1 file chan

[Xen-devel] [PATCH 0/9] x86/vvmx: Read instruction operands correctly on VM exit

2017-10-26 Thread Euan Harris
and use them to read memory operands in place of the incorrect segmentation logic in decode_vmx_inst(). Euan Harris (9): x86/vvmx: Remove enum vmx_regs_enc x86/vvmx: Unify operands in struct vmx_inst_decoded x86/vvmx: Extract operand reading logic into operand_read() x86/vvmx: Remove

[Xen-devel] [PATCH 7/9] x86/vvmx: Use correct sizes when reading operands

2017-10-26 Thread Euan Harris
reading fixed-size operands, we pass the size of the variable into which the operand is to be read. Signed-off-by: Euan Harris <euan.har...@citrix.com> --- xen/arch/x86/hvm/vmx/vvmx.c | 48 +++-- 1 file changed, 25 insertions(+), 23 deletions(-) diff

[Xen-devel] [PATCH 3/9] x86/vvmx: Extract operand reading logic into operand_read()

2017-10-26 Thread Euan Harris
should not change the overall behaviour of the code. Signed-off-by: Euan Harris <euan.har...@citrix.com> --- xen/arch/x86/hvm/vmx/vvmx.c | 59 - 1 file changed, 47 insertions(+), 12 deletions(-) diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x

[Xen-devel] [PATCH 8/9] x86/hvm: Add hvm_copy_{to, from}_guest_virt() helpers

2017-10-26 Thread Euan Harris
hvm_copy_{to,from}_guest_virt() copy data to and from a guest, performing segmentatino and paging checks on the provided seg:offset virtual address. Signed-off-by: Euan Harris <euan.har...@citrix.com> --- xen/arch/x86/hvm/hvm.c| 57 +++ xen/i

[Xen-devel] [PATCH v3 2/3] python: Extract registered watch search logic from xspy_read_watch()

2017-09-22 Thread Euan Harris
. Signed-off-by: Euan Harris <euan.har...@citrix.com> Reviewed-by: Wei Liu <wei.l...@citrix.com> Acked-by: Marek Marczykowski-Górecki <marma...@invisiblethingslab.com> --- Changed since v1: * Remove stray newline * Fix indentation --- tools/python/xen/low

[Xen-devel] [PATCH v3 1/3] python: Add binding for xs_fileno()

2017-09-22 Thread Euan Harris
xs_fileno() returns a file descriptor which receives events when Xenstore watches fire. Exposing this in the Python bindings is a prerequisite for writing event-driven clients in Python. Signed-off-by: Euan Harris <euan.har...@citrix.com> Reviewed-by: Konrad Rzeszutek Wilk <

[Xen-devel] [PATCH v3 3/3] python: Add binding for non-blocking xs_check_watch()

2017-09-22 Thread Euan Harris
xs_check_watch() checks for watch notifications without blocking. Together with the binding for xs_fileno(), this makes it possible to write event-driven clients in Python. Signed-off-by: Euan Harris <euan.har...@citrix.com> Reviewed-by: Wei Liu <wei.l...@citrix.com> Acked-by: Marek

[Xen-devel] [PATCH v3 0/3] python: Add non-blocking Xenstore watch bindings

2017-09-22 Thread Euan Harris
sh.check_watch() in a generator, but this is easier to do in Python than in the C bindings. Euan Harris (3): python: Add binding for xs_fileno() python: Extract registered watch search logic from xspy_read_watch() python: Add binding for non-blocking xs_check_watch() tools/python/xen/lowlevel/

[Xen-devel] [PATCH v2 3/3] python: Add binding for non-blocking xs_check_watch()

2017-09-21 Thread Euan Harris
xs_check_watch() checks for watch notifications without blocking. Together with the binding for xs_fileno(), this makes it possible to write event-driven clients in Python. Signed-off-by: Euan Harris <euan.har...@citrix.com> Reviewed-by: Wei Liu <wei.l...@citrix.com> --- tool

[Xen-devel] [PATCH v2 0/3] python: Add non-blocking Xenstore watch bindings

2017-09-21 Thread Euan Harris
sh.check_watch() in a generator, but this is easier to do in Python than in the C bindings. Euan Harris (3): python: Add binding for xs_fileno() python: Extract registered watch search logic from xspy_read_watch() python: Add binding for non-blocking xs_check_watch() tools/python/xen/lowlevel/

[Xen-devel] [PATCH v2 1/3] python: Add binding for xs_fileno()

2017-09-21 Thread Euan Harris
xs_fileno() returns a file descriptor which receives events when Xenstore watches fire. Exposing this in the Python bindings is a prerequisite for writing event-driven clients in Python. Signed-off-by: Euan Harris <euan.har...@citrix.com> Reviewed-by: Konrad Rzeszutek Wilk <

[Xen-devel] [PATCH v2 2/3] python: Extract registered watch search logic from xspy_read_watch()

2017-09-21 Thread Euan Harris
. Signed-off-by: Euan Harris <euan.har...@citrix.com> Reviewed-by: Wei Liu <wei.l...@citrix.com> --- Changed since v1: * Remove stray newline * Fix indentation tools/python/xen/lowlevel/xs/xs.c | 60 --- 1 file changed, 37 insertions(+), 23 deletions(-)

[Xen-devel] [PATCH 2/3] python: Extract registered watch search logic from xspy_read_watch()

2017-09-15 Thread Euan Harris
. Signed-off-by: Euan Harris <euan.har...@citrix.com> --- tools/python/xen/lowlevel/xs/xs.c | 61 --- 1 file changed, 38 insertions(+), 23 deletions(-) diff --git a/tools/python/xen/lowlevel/xs/xs.c b/tools/python/xen/lowlevel/xs/xs.c index 9f1b916..a4b50a0

[Xen-devel] [PATCH 0/3] python: Add non-blocking Xenstore watch bindings

2017-09-15 Thread Euan Harris
sh.check_watch() in a generator, but this is easier to do in Python than in the C bindings. Euan Harris (3): python: Add wrapper for xs_fileno() python: Extract registered watch search logic from xspy_read_watch() python: Add binding for non-blocking xs_check_watch() tools/python/xen/lowlevel/

[Xen-devel] [PATCH 1/3] python: Add binding for xs_fileno()

2017-09-15 Thread Euan Harris
xs_fileno() returns a file descriptor which receives events when Xenstore watches fire. Exposing this in the Python bindings is a prerequisite for writing event-driven clients in Python. Signed-off-by: Euan Harris <euan.har...@citrix.com> --- tools/python/xen/lowlevel/xs/xs.

[Xen-devel] [PATCH 3/3] python: Add binding for non-blocking xs_check_watch()

2017-09-15 Thread Euan Harris
xs_check_watch() checks for watch notifications without blocking. Together with the binding for xs_fileno(), this makes it possible to write event-driven clients in Python. Signed-off-by: Euan Harris <euan.har...@citrix.com> --- tools/python/xen/lowlevel/xs/xs.

Re: [Xen-devel] [PATCH 2/2] nested vmx: Validate host VMX MSRs before accessing them

2016-06-09 Thread Euan Harris
On Thu, Jun 09, 2016 at 06:47:55AM -0600, Jan Beulich wrote: > > /* > > - * Those MSRs are available only when bit 55 of > > - * MSR_IA32_VMX_BASIC is set. > > + * These MSRs are only available when flags in other MSRs are set. > > + * These prerequisites are listed in the

[Xen-devel] [PATCH 0/2] Validate host VMX MSRs before accessing them

2016-06-09 Thread Euan Harris
. Euan Harris (2): nested vmx: Fix comment typos in nvmx_msr_read_intercept() nested vmx: Validate host VMX MSRs before accessing them xen/arch/x86/hvm/vmx/vvmx.c | 32 +++- 1 file changed, 23 insertions(+), 9 deletions(-) -- 1.7.10.4

[Xen-devel] [PATCH 1/2] nested vmx: Fix comment typos in nvmx_msr_read_intercept()

2016-06-09 Thread Euan Harris
Signed-off-by: Euan Harris <euan.har...@citrix.com> --- xen/arch/x86/hvm/vmx/vvmx.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c index faa8b69..d9493ff 100644 --- a/xen/arch/x86/hvm/vmx/vvmx.c +++

[Xen-devel] [PATCH 2/2] nested vmx: Validate host VMX MSRs before accessing them

2016-06-09 Thread Euan Harris
to crash with a GPF. Signed-off-by: Euan Harris <euan.har...@citrix.com> --- xen/arch/x86/hvm/vmx/vvmx.c | 22 ++ 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c index d9493ff..ddc25bf 100644 --- a/xen/ar

Re: [Xen-devel] [PATCH] nested vmx: Intercept guest rdmsr for MSR_IA32_VMX_VMFUNC

2016-06-07 Thread Euan Harris
On Tue, Jun 07, 2016 at 04:35:28AM -0600, Jan Beulich wrote: > > @@ -2624,7 +2624,7 @@ static int vmx_msr_read_intercept(unsigned int msr, > > uint64_t *msr_content) > > __vmread(GUEST_IA32_DEBUGCTL, msr_content); > > break; > > case IA32_FEATURE_CONTROL_MSR: > > -case

[Xen-devel] [PATCH] nested vmx: Intercept guest rdmsr for MSR_IA32_VMX_VMFUNC

2016-06-07 Thread Euan Harris
Guest reads of MSR_IA32_VMX_VMFUNC should be handled by the logic in vmx_msr_read_intercept(). Otherwise a guest can read the raw host value of this MSR, even if nested vmx is disabled. Signed-off-by: Euan Harris <euan.har...@citrix.com> --- xen/arch/x86/hvm/vmx/vmx.c |2 +- 1 file c

[Xen-devel] [PATCH] doc: Fix nonexistent error code in libxl_event_check example

2015-07-02 Thread Euan Harris
Fix example code in comment.libxl_event_check() can return ERROR_NOT_READY; LIBXL_NOT_READY does not exist. Signed-off-by: Euan Harris euan.har...@citrix.com --- tools/libxl/libxl_event.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libxl/libxl_event.h b/tools

Re: [Xen-devel] Cancelling asynchronous operations in libxl

2015-06-24 Thread Euan Harris
Hi, On Wed, Jan 28, 2015 at 04:57:19PM +, Ian Jackson wrote: Euan Harris writes (Re: Cancelling asynchronous operations in libxl): On Tue, Jan 20, 2015 at 04:38:24PM +, Ian Jackson wrote: * Is an API along these lines going to meet your needs ? The API you propose

[Xen-devel] RFC: Proposal to improve error reporting in libxl

2015-05-20 Thread Euan Harris
Hi, Several of us at Citrix are currently working on rewriting xenopsd - the component of the Xapi toolstack which handles domain creation, destruction, device attachment and so on - to use libxl instead of libxc. One of the problems we have run into is that error reporting in libxl is not

Re: [Xen-devel] [RFC PATCH v2 00/29] libxl: Cancelling asynchronous operations

2015-04-09 Thread Euan Harris
On Tue, Apr 07, 2015 at 06:19:52PM +0100, Ian Jackson wrote: On the contrary, I think many long-running operations, such as suspend and migrations, involve multiple iterations of the libxl event loop. Actual suspend/migrate is done in a helper process; the main process is responsible for

Re: [Xen-devel] [RFC PATCH v2 00/29] libxl: Cancelling asynchronous operations

2015-04-07 Thread Euan Harris
Hi, On Wed, Feb 18, 2015 at 04:10:35PM +, Euan Harris wrote: We had a chat about testing these changes, and integrating them into xenopsd. We agreed that we each had slightly different expectations of what we were going to do, and when. I think we came to the following major conclusions

Re: [Xen-devel] [RFC PATCH v2 00/29] libxl: Cancelling asynchronous operations

2015-03-20 Thread Euan Harris
On Tue, Mar 03, 2015 at 12:08:04PM +, Ian Campbell wrote: I wouldn't recommend testing it yet until I've at least smoke tested it to see that things still work if you don't cancel them. Would review of the series be useful and/or appreciated at this stage? Perhaps the first half

Re: [Xen-devel] [RFC PATCH v2 00/29] libxl: Cancelling asynchronous operations

2015-02-18 Thread Euan Harris
Hi, On Tue, Feb 10, 2015 at 08:09:47PM +, Ian Jackson wrote: I have rebased this onto current staging. I have compiled it but NOT EXECUTED IT AT ALL. Euan, I thought it would be useful to give you something you could start to work on building against. I wouldn't recommend testing it

Re: [Xen-devel] [PATCH] tools: work around collision of -O0 and -D_FORTIFY_SOURCE

2015-02-05 Thread Euan Harris
On Thu, Feb 05, 2015 at 03:26:00PM +, Ian Jackson wrote: Jan Beulich writes (Re: [PATCH] tools: work around collision of -O0 and -D_FORTIFY_SOURCE): For one, PY_XCFLAGS='' wouldn't help, as we get -O0 from the incoming CFLAGS. Sorry, I meant PY_XCFLAGS='' or -O1 (as appropriate).

Re: [Xen-devel] Cancelling asynchronous operations in libxl

2015-01-28 Thread Euan Harris
Hi, On Tue, Jan 20, 2015 at 04:38:24PM +, Ian Jackson wrote: * Is an API along these lines going to meet your needs ? The API you propose for libxl_ao_cancel, as described in the comment in libxl.h, looks reasonable to us.The comment for ERROR_NOTIMPLEMENTED is a bit confusing: under

[Xen-devel] [PATCH] libxl/Makefile: Don't optimize debug builds; add macro debugging information

2014-12-01 Thread Euan Harris
overrides the -O1 flag specified earlier. Also specify -g3, to add macro debugging information which allows gdb to expand macro invocations. This is useful as libxl uses many non-trivial macros. Signed-off-by: Euan Harris euan.har...@citrix.com --- tools/libxl/Makefile |6 ++ 1 files changed, 6

[Xen-devel] [PATCH] libxl: libxl_domain_info: fix typo in error message

2014-12-01 Thread Euan Harris
Signed-off-by: Euan Harris euan.har...@citrix.com --- tools/libxl/libxl.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index f84f7c2..c50c323 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -674,7 +674,7 @@ int

[Xen-devel] libxl: Is the nic param to libxl_network_device_add an (in)_out parameter?

2014-11-18 Thread Euan Harris
Hi, If I call libxl_device_nic_add and pass in a mostly-default libxl_device_nic structure, the function fills in the unspecified default config fields with data for the NIC which it has just created: libxl_device_nic nic; libxl_device_nic_init(nic); /*

[Xen-devel] [PATCH] libxl: Document device parameter of libxl_device_type_add functions

2014-11-18 Thread Euan Harris
The device parameter of libxl_device_type_add is an in/out parameter. Unspecified fields are filled in with appropriate values for the created device when the function returns. Document this behaviour. Signed-off-by: Euan Harris euan.har...@citrix.com --- tools/libxl/libxl.h | 4 1 file