[Xen-devel] [PATCH 11/11] x86/altp2m: alternate p2m memory events.

2015-01-09 Thread Ed White
e p2m. Signed-off-by: Ed White --- xen/arch/x86/mm/hap/altp2m_hap.c | 53 ++-- xen/arch/x86/mm/p2m.c| 18 -- xen/common/mem_access.c | 1 + xen/include/asm-arm/p2m.h| 7 ++ xen/include/asm-x86/p2m.h| 4 +++

[Xen-devel] [PATCH 09/11] x86/altp2m: define and implement alternate p2m HVMOP types.

2015-01-09 Thread Ed White
Signed-off-by: Ed White --- xen/arch/x86/hvm/hvm.c | 217 xen/include/public/hvm/hvm_op.h | 68 + 2 files changed, 285 insertions(+) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index e6f64a3..afe16bf 100644 --- a

[Xen-devel] [PATCH 01/11] VMX: VMFUNC and #VE definitions and detection.

2015-01-09 Thread Ed White
. Signed-off-by: Ed White --- docs/misc/xen-command-line.markdown | 7 +++ xen/arch/x86/hvm/vmx/vmcs.c | 40 + xen/arch/x86/mm/p2m-ept.c | 1 - xen/include/asm-x86/hvm/vmx/vmcs.h | 16 +++ xen/include/asm-x86/hvm/vmx/vmx.h | 13

[Xen-devel] [PATCH 06/11] VMX/altp2m: add code to support EPTP switching and #VE.

2015-01-09 Thread Ed White
Implement and hook up the code to enable VMX support of VMFUNC and #VE. VMFUNC leaf 0 (EPTP switching) and #VE are emulated on hardware that doesn't support them. Signed-off-by: Ed White --- xen/arch/x86/hvm/vmx/vmx.c | 138 + 1 file changed

[Xen-devel] [PATCH 05/11] x86/altp2m: basic data structures and support routines.

2015-01-09 Thread Ed White
terator in hap_enable() does need to handle 512, so that is now uint16_t. Signed-off-by: Ed White --- xen/arch/x86/hvm/Makefile | 3 +- xen/arch/x86/hvm/altp2mhvm.c| 77 +++ xen/arch/x86/hvm/hvm.c | 21 xen/arch/x86/mm/hap/Makefile

[Xen-devel] [PATCH 03/11] x86/HVM: Hardware alternate p2m support detection.

2015-01-09 Thread Ed White
As implemented here, only supported on platforms with VMX HAP. Signed-off-by: Ed White --- xen/arch/x86/hvm/hvm.c| 8 xen/arch/x86/hvm/vmx/vmx.c| 1 + xen/include/asm-x86/hvm/hvm.h | 6 ++ 3 files changed, 15 insertions(+) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch

[Xen-devel] [PATCH 02/11] VMX: implement suppress #VE.

2015-01-09 Thread Ed White
ceive it; and even then for most EPT violations only the hypervisor is able to handle the violation. Signed-off-by: Ed White --- xen/arch/x86/mm/p2m-ept.c | 34 +- xen/include/asm-x86/hvm/vmx/vmx.h | 1 + 2 files changed, 34 insertions(+), 1 deletion(-)

[Xen-devel] [PATCH 08/11] x86/altp2m: add remaining support routines.

2015-01-09 Thread Ed White
Add the remaining routines required to support enabling the alternate p2m functionality. Signed-off-by: Ed White --- xen/arch/x86/hvm/hvm.c | 12 ++ xen/arch/x86/mm/hap/altp2m_hap.c| 76 xen/arch/x86/mm/p2m.c | 339

[Xen-devel] [PATCH 04/11] x86/MM: Improve p2m type checks.

2015-01-09 Thread Ed White
The alternate p2m code will introduce a new p2m type. In preparation for using that new type, introduce the type indicator here and fix all the checks that assume !nestedp2m == hostp2m to explicitly check for hostp2m. Signed-off-by: Ed White --- xen/arch/x86/hvm/hvm.c | 2 +- xen/arch

[Xen-devel] [PATCH 07/11] x86/altp2m: introduce p2m_ram_rw_ve type.

2015-01-09 Thread Ed White
This is treated exactly like p2m_ram_rw, except that suppress_ve is not set in the EPTE. Signed-off-by: Ed White --- xen/arch/x86/mm/p2m-ept.c | 3 ++- xen/include/asm-x86/p2m.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m

Re: [Xen-devel] [PATCH 00/11] Alternate p2m: support multiple copies of host p2m

2015-01-09 Thread Ed White
On 01/09/2015 02:06 PM, Andrew Cooper wrote: > On 09/01/2015 21:26, Ed White wrote: >> This set of patches adds support to hvm domains for EPTP switching by >> creating >> multiple copies of the host p2m (currently limited to 10 copies). >> >> The primary use of

Re: [Xen-devel] [PATCH 00/11] Alternate p2m: support multiple copies of host p2m

2015-01-09 Thread Ed White
On 01/09/2015 02:41 PM, Andrew Cooper wrote: > On 09/01/2015 22:21, Ed White wrote: >> On 01/09/2015 02:06 PM, Andrew Cooper wrote: >>> On 09/01/2015 21:26, Ed White wrote: >>>> This set of patches adds support to hvm domains for EPTP switching by >>>>

Re: [Xen-devel] [PATCH 00/11] Alternate p2m: support multiple copies of host p2m

2015-01-12 Thread Ed White
On 01/12/2015 02:00 AM, Jan Beulich wrote: On 10.01.15 at 00:04, wrote: >> On 01/09/2015 02:41 PM, Andrew Cooper wrote: >>> Having some non-OS part of the guest swap the EPT tables and >>> accidentally turn a DMA buffer read-only is not going to end well. >>> >> >> The agent can certainly do

Re: [Xen-devel] [PATCH 00/11] Alternate p2m: support multiple copies of host p2m

2015-01-12 Thread Ed White
On 01/12/2015 04:17 AM, Ian Jackson wrote: > Ed White writes ("[PATCH 00/11] Alternate p2m: support multiple copies of > host p2m"): >> This set of patches adds support to hvm domains for EPTP switching >> by creating multiple copies of the host p2m (curre

Re: [Xen-devel] [PATCH 02/11] VMX: implement suppress #VE.

2015-01-12 Thread Ed White
On 01/12/2015 08:43 AM, Andrew Cooper wrote: > On 09/01/15 21:26, Ed White wrote: >> In preparation for selectively enabling hardware #VE in a later patch, >> set suppress #VE on all EPTE's on #VE-capable hardware. >> >> Suppress #VE should always be the default con

Re: [Xen-devel] [PATCH 03/11] x86/HVM: Hardware alternate p2m support detection.

2015-01-12 Thread Ed White
On 01/12/2015 09:08 AM, Andrew Cooper wrote: > On 09/01/15 21:26, Ed White wrote: >> As implemented here, only supported on platforms with VMX HAP. >> >> Signed-off-by: Ed White >> --- >> xen/arch/x86/hvm/hvm.c| 8 >> xen/arch/x86/hvm/vmx

Re: [Xen-devel] [PATCH 00/11] Alternate p2m: support multiple copies of host p2m

2015-01-12 Thread Ed White
On 01/12/2015 09:43 AM, Ian Jackson wrote: > Ed White writes ("Re: [PATCH 00/11] Alternate p2m: support multiple copies of > host p2m"): >> On 01/12/2015 04:17 AM, Ian Jackson wrote: >>> Are there tools parts to come later ? >> >> I copied you because ge

Re: [Xen-devel] [PATCH 00/11] Alternate p2m: support multiple copies of host p2m

2015-01-12 Thread Ed White
On 01/12/2015 10:00 AM, Ian Jackson wrote: > Ed White writes ("Re: [PATCH 00/11] Alternate p2m: support multiple copies of > host p2m"): >> The hypercalls are all there. My testing is all done in a Windows >> domU with the tests running inside that domain, so I couldn

Re: [Xen-devel] [PATCH 00/11] Alternate p2m: support multiple copies of host p2m

2015-01-13 Thread Ed White
On 01/13/2015 12:56 AM, Jan Beulich wrote: On 12.01.15 at 18:36, wrote: >> On 01/12/2015 02:00 AM, Jan Beulich wrote: >> On 10.01.15 at 00:04, wrote: On 01/09/2015 02:41 PM, Andrew Cooper wrote: > Having some non-OS part of the guest swap the EPT tables and > accidentally tu

Re: [Xen-devel] [PATCH 00/11] Alternate p2m: support multiple copies of host p2m

2015-01-13 Thread Ed White
On 01/13/2015 02:21 AM, Tamas K Lengyel wrote: > On Mon, Jan 12, 2015 at 7:31 PM, Ed White wrote: >> On 01/12/2015 10:00 AM, Ian Jackson wrote: >>> Ed White writes ("Re: [PATCH 00/11] Alternate p2m: support multiple copies >>> of host p2m"): >>>>

Re: [Xen-devel] [PATCH 02/11] VMX: implement suppress #VE.

2015-01-13 Thread Ed White
On 01/12/2015 09:45 AM, Ed White wrote: > On 01/12/2015 08:43 AM, Andrew Cooper wrote: >> On 09/01/15 21:26, Ed White wrote: >>> In preparation for selectively enabling hardware #VE in a later patch, >>> set suppress #VE on all EPTE's on #VE-capable hardware. >&

Re: [Xen-devel] [PATCH 01/11] VMX: VMFUNC and #VE definitions and detection.

2015-01-13 Thread Ed White
On 01/12/2015 05:06 AM, Andrew Cooper wrote: > On 09/01/15 21:26, Ed White wrote: >> Currently, neither is enabled globally but may be enabled on a per-VCPU >> basis by the altp2m code. >> >> Everything can be force-disabled globally by specifying vmfunc=0 on the >&g

Re: [Xen-devel] [PATCH 04/11] x86/MM: Improve p2m type checks.

2015-01-13 Thread Ed White
On 01/12/2015 09:48 AM, Andrew Cooper wrote: > On 09/01/15 21:26, Ed White wrote: >> diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h >> index 5f7fe71..8193901 100644 >> --- a/xen/include/asm-x86/p2m.h >> +++ b/xen/include/asm-x86/p2m.h >> @@ -

Re: [Xen-devel] [PATCH 05/11] x86/altp2m: basic data structures and support routines.

2015-01-13 Thread Ed White
On 01/13/2015 03:28 AM, Andrew Cooper wrote: > On 09/01/15 21:26, Ed White wrote: >> Add the basic data structures needed to support alternate p2m's and >> the functions to initialise them and tear them down. >> >> Although Intel hardware can handle 512 EPTP'

Re: [Xen-devel] [PATCH 00/11] Alternate p2m: support multiple copies of host p2m

2015-01-13 Thread Ed White
On 01/13/2015 11:01 AM, Andrew Cooper wrote: > On 09/01/15 21:26, Ed White wrote: >> This set of patches adds support to hvm domains for EPTP switching by >> creating >> multiple copies of the host p2m (currently limited to 10 copies). >> >> The primary use of thi

Re: [Xen-devel] [PATCH 00/11] Alternate p2m: support multiple copies of host p2m

2015-01-13 Thread Ed White
On 01/13/2015 12:45 PM, Andrew Cooper wrote: > On 13/01/15 20:02, Ed White wrote: >> On 01/13/2015 11:01 AM, Andrew Cooper wrote: >>> On 09/01/15 21:26, Ed White wrote: >>>> This set of patches adds support to hvm domains for EPTP switching by >>>> cre

Re: [Xen-devel] [PATCH 00/11] Alternate p2m: support multiple copies of host p2m

2015-01-14 Thread Ed White
On 01/14/2015 03:28 AM, Tamas K Lengyel wrote: > On Wed, Jan 14, 2015 at 12:09 PM, Jan Beulich wrote: >>>>> On 14.01.15 at 11:31, wrote: >>> On Wed, Jan 14, 2015 at 8:04 AM, Jan Beulich wrote: >>>>>>> Ed White 01/13/15 10:32 PM >>> >

Re: [Xen-devel] [PATCH 00/11] Alternate p2m: support multiple copies of host p2m

2015-01-15 Thread Ed White
On 01/15/2015 12:16 AM, Jan Beulich wrote: On 14.01.15 at 18:35, wrote: >> On 01/14/2015 03:28 AM, Tamas K Lengyel wrote: >>> At the mem_access trap point you can swap in an altp2m where the >>> gfn->mfn mapping is the one where the breakpoints are hidden, >>> singlestep, then swap the origin

Re: [Xen-devel] [PATCH 00/11] Alternate p2m: support multiple copies of host p2m

2015-01-15 Thread Ed White
On 01/15/2015 02:39 AM, Tamas K Lengyel wrote: >> There are ways of avoiding the >> single-step too, although I don't think that falls within the scope >> of this conversation. >> >> Ed > > I would be very interested in knowing how we can avoid the singlestep > phase. Are you envisioning using thi

Re: [Xen-devel] [PATCH 00/11] Alternate p2m: support multiple copies of host p2m

2015-01-15 Thread Ed White
On 01/15/2015 08:15 AM, Tim Deegan wrote: > Hello, > > Thanks for sending this series - in particular, thank you for sending > it early in the release cycle! I'll review some of the patches > individually but since I expect there will be some changes to come in > future versions I'm not going to

Re: [Xen-devel] [PATCH 00/11] Alternate p2m: support multiple copies of host p2m

2015-01-15 Thread Ed White
On 01/15/2015 09:45 AM, Tim Deegan wrote: > At 09:28 -0800 on 15 Jan (1421310487), Ed White wrote: >> On 01/15/2015 12:16 AM, Jan Beulich wrote: >>>>>> On 14.01.15 at 18:35, wrote: >>>> On 01/14/2015 03:28 AM, Tamas K Lengyel wrote: >>>>>

Re: [Xen-devel] [PATCH 02/11] VMX: implement suppress #VE.

2015-01-15 Thread Ed White
On 01/15/2015 08:25 AM, Tim Deegan wrote: > Hi, > > At 13:26 -0800 on 09 Jan (1420806392), Ed White wrote: >> static inline bool_t is_epte_valid(ept_entry_t *e) >> { >> -return (e->epte != 0 && e->sa_p2mt != p2m_invalid); >> +ret

Re: [Xen-devel] [PATCH 05/11] x86/altp2m: basic data structures and support routines.

2015-01-15 Thread Ed White
On 01/15/2015 08:53 AM, Jan Beulich wrote: >>>> On 15.01.15 at 17:48, wrote: >> At 13:26 -0800 on 09 Jan (1420806395), Ed White wrote: >>> +/* Init alternate p2m data */ >>> +if ( (d->arch.altp2m_eptp = alloc_xenheap_page()) == NULL

Re: [Xen-devel] [PATCH 06/11] VMX/altp2m: add code to support EPTP switching and #VE.

2015-01-15 Thread Ed White
On 01/15/2015 08:56 AM, Tim Deegan wrote: > Hi, > > At 13:26 -0800 on 09 Jan (1420806396), Ed White wrote: >> @@ -2551,6 +2640,17 @@ static void vmx_vmexit_ud_intercept(struct >> cpu_user_regs *regs) >> hvm_inject_hw_exception(TRAP_invalid_op

Re: [Xen-devel] [PATCH 07/11] x86/altp2m: introduce p2m_ram_rw_ve type.

2015-01-15 Thread Ed White
On 01/15/2015 09:03 AM, Tim Deegan wrote: > At 13:26 -0800 on 09 Jan (1420806397), Ed White wrote: >> This is treated exactly like p2m_ram_rw, except that suppress_ve is not >> set in the EPTE. > > I don't think this is going to work -- you probably want to support

Re: [Xen-devel] [PATCH 09/11] x86/altp2m: define and implement alternate p2m HVMOP types.

2015-01-15 Thread Ed White
On 01/15/2015 09:09 AM, Tim Deegan wrote: > Hi, > > These _definitely_ need XSM checks, otherwise any domain can call them > on any other! I think you can probably copy the other p2m-munging > operations to see how to make a sensible default policy. Understood. I'll look at this subject again, b

Re: [Xen-devel] [PATCH 10/11] x86/altp2m: fix log-dirty handling.

2015-01-15 Thread Ed White
On 01/15/2015 09:20 AM, Tim Deegan wrote: > Hi, > > The locking chages look OK at first glance, but... > > At 13:26 -0800 on 09 Jan (1420806400), Ed White wrote: >> @@ -793,6 +793,10 @@ int p2m_change_type_one(struct domain *d, unsigned long >> gfn, >>

Re: [Xen-devel] [PATCH 08/11] x86/altp2m: add remaining support routines.

2015-01-15 Thread Ed White
On 01/15/2015 09:25 AM, Tim Deegan wrote: > Hi, > > At 13:26 -0800 on 09 Jan (1420806398), Ed White wrote: >> +int >> +altp2mhvm_hap_nested_page_fault(struct vcpu *v, paddr_t gpa, >> +unsigned long gla, struct npfec npfec) >> +{ >

Re: [Xen-devel] [PATCH 08/11] x86/altp2m: add remaining support routines.

2015-01-15 Thread Ed White
On 01/15/2015 09:33 AM, Tim Deegan wrote: > Hi, > > Sorry for the fractured replies - my notes are confused about which > functions were defined where. > > At 13:26 -0800 on 09 Jan (1420806398), Ed White wrote: >> +bool_t p2m_change_altp2m_pfn(struct

Re: [Xen-devel] [PATCH 00/11] Alternate p2m: support multiple copies of host p2m

2015-01-16 Thread Ed White
On 01/15/2015 11:35 PM, Jan Beulich wrote: On 15.01.15 at 18:28, wrote: >> On 01/15/2015 12:16 AM, Jan Beulich wrote: >> On 14.01.15 at 18:35, wrote: Right. The key observation is that at any single point in time, a given hardware thread can be fetching an instruction or readin

Re: [Xen-devel] [PATCH 00/11] Alternate p2m: support multiple copies of host p2m

2015-01-16 Thread Ed White
On 01/16/2015 12:12 AM, Jan Beulich wrote: On 15.01.15 at 19:23, wrote: >> On 01/15/2015 08:15 AM, Tim Deegan wrote: >>> - Feature compatibilty/completeness. You pointed out yourself that >>> it doesn't work with nested HVM or migration. I think I'd have to >>> add mem_event/access/pagi

Re: [Xen-devel] [PATCH 07/11] x86/altp2m: introduce p2m_ram_rw_ve type.

2015-01-16 Thread Ed White
On 01/16/2015 12:20 AM, Jan Beulich wrote: >>>> On 15.01.15 at 21:38, wrote: >> On 01/15/2015 09:03 AM, Tim Deegan wrote: >>> At 13:26 -0800 on 09 Jan (1420806397), Ed White wrote: >>>> This is treated exactly like p2m_ram_rw, except that suppress_ve is no

Re: [Xen-devel] [PATCH 08/11] x86/altp2m: add remaining support routines.

2015-01-16 Thread Ed White
On 01/16/2015 12:24 AM, Jan Beulich wrote: >>>> On 15.01.15 at 22:00, wrote: >> On 01/15/2015 09:33 AM, Tim Deegan wrote: >>> Hi, >>> >>> Sorry for the fractured replies - my notes are confused about which >>> functions were defined where. &

Re: [Xen-devel] [PATCH 00/11] Alternate p2m: support multiple copies of host p2m

2015-01-16 Thread Ed White
On 01/16/2015 02:43 AM, Tamas K Lengyel wrote: > On Thu, Jan 15, 2015 at 6:31 PM, Ed White wrote: >> On 01/15/2015 02:39 AM, Tamas K Lengyel wrote: >>>> There are ways of avoiding the >>>> single-step too, although I don't think that falls within the scope &

Re: [Xen-devel] [PATCH 06/11] VMX/altp2m: add code to support EPTP switching and #VE.

2015-01-16 Thread Ed White
On 01/16/2015 09:50 AM, Tim Deegan wrote: > At 10:55 -0800 on 15 Jan (1421315724), Ed White wrote: >> On 01/15/2015 08:56 AM, Tim Deegan wrote: >>> Hi, >>> >>> At 13:26 -0800 on 09 Jan (1420806396), Ed White wrote: >>>> @@ -2551,6 +2640,

Re: [Xen-devel] [PATCH 07/11] x86/altp2m: introduce p2m_ram_rw_ve type.

2015-01-16 Thread Ed White
On 01/16/2015 09:52 AM, Tim Deegan wrote: > At 12:38 -0800 on 15 Jan (1421321902), Ed White wrote: >> On 01/15/2015 09:03 AM, Tim Deegan wrote: >>> At 13:26 -0800 on 09 Jan (1420806397), Ed White wrote: >>>> This is treated exactly like p2m_ram_rw, except that supp

Re: [Xen-devel] [PATCH 00/11] Alternate p2m: support multiple copies of host p2m

2015-01-16 Thread Ed White
> >> As I said in discussion with Andrew, my aim was to make it possible >> for these same changes to be extensible to AMD processors if they >> support multiple copies of whatever their EPT equivalent is, by >> simply emulating VMFUNC and #VE. That's why there are some wrappers >> in the implemen

Re: [Xen-devel] [PATCH 00/11] Alternate p2m: support multiple copies of host p2m

2015-01-16 Thread Ed White
> > I would have thought, from the tone of your earlier comments, that > you were aiming for a bar somewhat higher than "as good as > nestedp2m". :) I hope you'll also understand that given how well that > has turned out, we shouldn't necessarily apply the same standard to > new code as we did t

[Xen-devel] [PATCH v5 03/15] VMX: implement suppress #VE.

2015-07-13 Thread Ed White
t EPT violations only the hypervisor is able to handle the violation. Signed-off-by: Ed White Reviewed-by: Andrew Cooper Reviewed-by: George Dunlap Acked-by: Jun Nakajima --- xen/arch/x86/mm/p2m-ept.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/xen/arch/x

[Xen-devel] [PATCH v5 02/15] VMX: VMFUNC and #VE definitions and detection.

2015-07-13 Thread Ed White
Currently, neither is enabled globally but may be enabled on a per-VCPU basis by the altp2m code. Remove the check for EPTE bit 63 == zero in ept_split_super_page(), as that bit is now hardware-defined. Signed-off-by: Ed White Reviewed-by: Andrew Cooper Acked-by: George Dunlap Acked-by: Jun

[Xen-devel] [PATCH v5 01/15] common/domain: Helpers to pause a domain while in context

2015-07-13 Thread Ed White
From: Andrew Cooper For use on codepaths which would need to use domain_pause() but might be in the target domain's context. In the case that the target domain is in context, all other vcpus are paused. Signed-off-by: Andrew Cooper --- xen/common/domain.c | 28

[Xen-devel] [PATCH v5 04/15] x86/HVM: Hardware alternate p2m support detection.

2015-07-13 Thread Ed White
As implemented here, only supported on platforms with VMX HAP. By default this functionality is force-disabled, it can be enabled by specifying altp2m=1 on the Xen command line. Signed-off-by: Ed White Reviewed-by: Andrew Cooper --- docs/misc/xen-command-line.markdown | 7 +++ xen/arch

[Xen-devel] [PATCH v5 00/15] Alternate p2m: support multiple copies of host p2m

2015-07-13 Thread Ed White
ll be of interest to everyone copied here. I've copied everyone on this initial mailing to give context. Andrew Cooper (1): common/domain: Helpers to pause a domain while in context Ed White (9): VMX: VMFUNC and #VE definitions and detection. VMX: implement suppress #VE. x86/HVM: Hardwar

[Xen-devel] [PATCH v5 08/15] x86/altp2m: add control of suppress_ve.

2015-07-13 Thread Ed White
From: George Dunlap The existing ept_set_entry() and ept_get_entry() routines are extended to optionally set/get suppress_ve. Passing -1 will set suppress_ve on new p2m entries, or retain suppress_ve flag on existing entries. Signed-off-by: George Dunlap Signed-off-by: Ravi Sahita Reviewed-b

[Xen-devel] [PATCH v5 09/15] x86/altp2m: alternate p2m memory events.

2015-07-13 Thread Ed White
Add a flag to indicate that a memory event occurred in an alternate p2m and a field containing the p2m index. Allow any event response to switch to a different alternate p2m using the same flag and field. Modify p2m_mem_access_check() to handle alternate p2m's. Signed-off-by: Ed White Ack

[Xen-devel] [PATCH v5 06/15] VMX/altp2m: add code to support EPTP switching and #VE.

2015-07-13 Thread Ed White
Implement and hook up the code to enable VMX support of VMFUNC and #VE. VMFUNC leaf 0 (EPTP switching) emulation is added in a later patch. Signed-off-by: Ed White Reviewed-by: Andrew Cooper Acked-by: Jun Nakajima --- xen/arch/x86/hvm/vmx/vmx.c | 138

[Xen-devel] [PATCH v5 07/15] VMX: add VMFUNC leaf 0 (EPTP switching) to emulator.

2015-07-13 Thread Ed White
From: Ravi Sahita Signed-off-by: Ravi Sahita --- xen/arch/x86/hvm/emulate.c | 19 +++-- xen/arch/x86/hvm/vmx/vmx.c | 38 ++ xen/arch/x86/x86_emulate/x86_emulate.c | 19 +++-- xen/arch/x86/x86_emulate/x86_emulate.h |

[Xen-devel] [PATCH v5 05/15] x86/altp2m: basic data structures and support routines.

2015-07-13 Thread Ed White
holding the host p2m lock. Signed-off-by: Ed White Reviewed-by: Andrew Cooper --- xen/arch/x86/hvm/Makefile| 1 + xen/arch/x86/hvm/altp2m.c| 77 + xen/arch/x86/hvm/hvm.c | 21 xen/arch/x86/mm/hap/hap.c| 38 ++-

[Xen-devel] [PATCH v5 10/15] x86/altp2m: add remaining support routines.

2015-07-13 Thread Ed White
Add the remaining routines required to support enabling the alternate p2m functionality. Signed-off-by: Ed White Reviewed-by: Andrew Cooper --- xen/arch/x86/hvm/hvm.c | 58 +- xen/arch/x86/mm/hap/Makefile | 1 + xen/arch/x86/mm/hap/altp2m_hap.c | 98 ++ xen/arch

[Xen-devel] [PATCH v5 12/15] x86/altp2m: Add altp2mhvm HVM domain parameter.

2015-07-13 Thread Ed White
The altp2mhvm and nestedhvm parameters are mutually exclusive and cannot be set together. Signed-off-by: Ed White Reviewed-by: Andrew Cooper Acked-by: Wei Liu --- docs/man/xl.cfg.pod.5 | 12 tools/libxl/libxl.h | 6 ++ tools/libxl/libxl_create.c

[Xen-devel] [PATCH v5 11/15] x86/altp2m: define and implement alternate p2m HVMOP types.

2015-07-13 Thread Ed White
Signed-off-by: Ed White --- xen/arch/x86/hvm/hvm.c | 142 xen/include/public/hvm/hvm_op.h | 82 +++ 2 files changed, 224 insertions(+) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index a9f4b1b..df6c6b6

[Xen-devel] [PATCH v5 13/15] x86/altp2m: XSM hooks for altp2m HVM ops

2015-07-13 Thread Ed White
From: Ravi Sahita Signed-off-by: Ravi Sahita Acked-by: Daniel De Graaf --- tools/flask/policy/policy/modules/xen/xen.if | 4 ++-- xen/arch/x86/hvm/hvm.c | 6 ++ xen/include/xsm/dummy.h | 12 xen/include/xsm/xsm.h

[Xen-devel] [PATCH v5 14/15] tools/libxc: add support to altp2m hvmops

2015-07-13 Thread Ed White
From: Tamas K Lengyel Wrappers to issue altp2m hvmops. Signed-off-by: Tamas K Lengyel Signed-off-by: Ravi Sahita Acked-by: Ian Campbell --- tools/libxc/Makefile | 1 + tools/libxc/include/xenctrl.h | 21 tools/libxc/xc_altp2m.c | 237 +++

[Xen-devel] [PATCH v5 15/15] tools/xen-access: altp2m testcases

2015-07-13 Thread Ed White
From: Tamas K Lengyel Working altp2m test-case. Extended the test tool to support singlestepping to better highlight the core feature of altp2m view switching. Signed-off-by: Tamas K Lengyel Signed-off-by: Ed White Reviewed-by: Razvan Cojocaru --- tools/tests/xen-access/xen-access.c | 173

[Xen-devel] [PATCH v6 01/15] common/domain: Helpers to pause a domain while in context

2015-07-20 Thread Ed White
From: Andrew Cooper For use on codepaths which would need to use domain_pause() but might be in the target domain's context. In the case that the target domain is in context, all other vcpus are paused. Signed-off-by: Andrew Cooper --- xen/common/domain.c | 28

[Xen-devel] [PATCH v6 00/15] Alternate p2m: support multiple copies of host p2m

2015-07-20 Thread Ed White
ve context. Andrew Cooper (1): common/domain: Helpers to pause a domain while in context Ed White (9): VMX: VMFUNC and #VE definitions and detection. VMX: implement suppress #VE. x86/HVM: Hardware alternate p2m support detection. x86/altp2m: basic data structures and support routin

[Xen-devel] [PATCH v6 03/15] VMX: implement suppress #VE.

2015-07-20 Thread Ed White
t EPT violations only the hypervisor is able to handle the violation. Signed-off-by: Ed White Acked-by: George Dunlap --- xen/arch/x86/mm/p2m-ept.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c index 9a

[Xen-devel] [PATCH v6 02/15] VMX: VMFUNC and #VE definitions and detection.

2015-07-20 Thread Ed White
Currently, neither is enabled globally but may be enabled on a per-VCPU basis by the altp2m code. Remove the check for EPTE bit 63 == zero in ept_split_super_page(), as that bit is now hardware-defined. Signed-off-by: Ed White Reviewed-by: Andrew Cooper Acked-by: George Dunlap Acked-by: Jun

[Xen-devel] [PATCH v6 05/15] x86/altp2m: basic data structures and support routines.

2015-07-20 Thread Ed White
holding the host p2m lock. Signed-off-by: Ed White --- xen/arch/x86/hvm/Makefile| 1 + xen/arch/x86/hvm/altp2m.c| 77 + xen/arch/x86/hvm/hvm.c | 21 xen/arch/x86/mm/hap/hap.c| 38 ++- xen/arch/x86/mm/mm

[Xen-devel] [PATCH v6 04/15] x86/HVM: Hardware alternate p2m support detection.

2015-07-20 Thread Ed White
As implemented here, only supported on platforms with VMX HAP. By default this functionality is force-disabled, it can be enabled by specifying altp2m=1 on the Xen command line. Signed-off-by: Ed White Reviewed-by: Andrew Cooper --- docs/misc/xen-command-line.markdown | 7 +++ xen/arch

[Xen-devel] [PATCH v6 06/15] VMX/altp2m: add code to support EPTP switching and #VE.

2015-07-20 Thread Ed White
Implement and hook up the code to enable VMX support of VMFUNC and #VE. VMFUNC leaf 0 (EPTP switching) emulation is added in a later patch. Signed-off-by: Ed White Reviewed-by: Andrew Cooper Acked-by: Jun Nakajima --- xen/arch/x86/hvm/vmx/vmx.c | 139

[Xen-devel] [PATCH v6 08/15] x86/altp2m: add control of suppress_ve.

2015-07-20 Thread Ed White
From: George Dunlap The existing ept_set_entry() and ept_get_entry() routines are extended to optionally set/get suppress_ve. Passing -1 will set suppress_ve on new p2m entries, or retain suppress_ve flag on existing entries. Signed-off-by: George Dunlap Signed-off-by: Ravi Sahita Reviewed-b

[Xen-devel] [PATCH v6 09/15] x86/altp2m: alternate p2m memory events.

2015-07-20 Thread Ed White
Add a flag to indicate that a memory event occurred in an alternate p2m and a field containing the p2m index. Allow any event response to switch to a different alternate p2m using the same flag and field. Modify p2m_mem_access_check() to handle alternate p2m's. Signed-off-by: Ed White Ack

[Xen-devel] [PATCH v6 07/15] VMX: add VMFUNC leaf 0 (EPTP switching) to emulator.

2015-07-20 Thread Ed White
From: Ravi Sahita Signed-off-by: Ravi Sahita --- xen/arch/x86/hvm/emulate.c | 18 +++-- xen/arch/x86/hvm/vmx/vmx.c | 36 ++ xen/arch/x86/x86_emulate/x86_emulate.c | 19 -- xen/arch/x86/x86_emulate/x86_emulate.h

[Xen-devel] [PATCH v6 11/15] x86/altp2m: define and implement alternate p2m HVMOP types.

2015-07-20 Thread Ed White
Signed-off-by: Ed White --- xen/arch/x86/hvm/hvm.c | 139 xen/include/public/hvm/hvm_op.h | 89 + 2 files changed, 228 insertions(+) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 38cf0c6..15973b4

[Xen-devel] [PATCH v6 15/15] tools/xen-access: altp2m testcases

2015-07-20 Thread Ed White
From: Tamas K Lengyel Working altp2m test-case. Extended the test tool to support singlestepping to better highlight the core feature of altp2m view switching. Signed-off-by: Tamas K Lengyel Signed-off-by: Ed White Reviewed-by: Razvan Cojocaru Acked-by: Wei Liu --- tools/tests/xen-access

[Xen-devel] [PATCH v6 10/15] x86/altp2m: add remaining support routines.

2015-07-20 Thread Ed White
Add the remaining routines required to support enabling the alternate p2m functionality. Signed-off-by: Ed White Reviewed-by: Andrew Cooper --- xen/arch/x86/hvm/hvm.c | 58 +- xen/arch/x86/mm/hap/Makefile | 1 + xen/arch/x86/mm/hap/altp2m_hap.c | 98 ++ xen/arch

[Xen-devel] [PATCH v6 12/15] x86/altp2m: Add altp2mhvm HVM domain parameter.

2015-07-20 Thread Ed White
The altp2mhvm and nestedhvm parameters are mutually exclusive and cannot be set together. Signed-off-by: Ed White Reviewed-by: Andrew Cooper Acked-by: Wei Liu --- docs/man/xl.cfg.pod.5 | 12 tools/libxl/libxl.h | 6 ++ tools/libxl/libxl_create.c

[Xen-devel] [PATCH v6 14/15] tools/libxc: add support to altp2m hvmops

2015-07-20 Thread Ed White
From: Tamas K Lengyel Wrappers to issue altp2m hvmops. Signed-off-by: Tamas K Lengyel Signed-off-by: Ravi Sahita Acked-by: Ian Campbell --- tools/libxc/Makefile | 1 + tools/libxc/include/xenctrl.h | 22 tools/libxc/xc_altp2m.c | 248 ++

[Xen-devel] [PATCH v6 13/15] x86/altp2m: XSM hooks for altp2m HVM ops

2015-07-20 Thread Ed White
From: Ravi Sahita Signed-off-by: Ravi Sahita Acked-by: Daniel De Graaf --- tools/flask/policy/policy/modules/xen/xen.if | 4 ++-- xen/arch/x86/hvm/hvm.c | 6 ++ xen/include/xsm/dummy.h | 12 xen/include/xsm/xsm.h

[Xen-devel] [PATCH v7 01/15] common/domain: Helpers to pause a domain while in context

2015-07-22 Thread Ed White
From: Andrew Cooper For use on codepaths which would need to use domain_pause() but might be in the target domain's context. In the case that the target domain is in context, all other vcpus are paused. Signed-off-by: Andrew Cooper Reviewed-by: George Dunlap --- Changes since v6: add

[Xen-devel] [PATCH v7 00/15] Alternate p2m: support multiple copies of host p2m

2015-07-22 Thread Ed White
on toolstack support for cross-domain testing with a slightly earlier patch series, and we hope he will submit that support. Not all of the patches will be of interest to everyone copied here. I've copied everyone on this initial mailing to give context. Andrew Cooper (1): common/do

[Xen-devel] [PATCH v7 02/15] VMX: VMFUNC and #VE definitions and detection.

2015-07-22 Thread Ed White
Currently, neither is enabled globally but may be enabled on a per-VCPU basis by the altp2m code. Remove the check for EPTE bit 63 == zero in ept_split_super_page(), as that bit is now hardware-defined. Signed-off-by: Ed White Reviewed-by: Andrew Cooper Acked-by: George Dunlap Acked-by: Jun

[Xen-devel] [PATCH v7 04/15] x86/HVM: Hardware alternate p2m support detection.

2015-07-22 Thread Ed White
As implemented here, only supported on platforms with VMX HAP. By default this functionality is force-disabled, it can be enabled by specifying altp2m=1 on the Xen command line. Signed-off-by: Ed White Reviewed-by: Andrew Cooper --- Changes since v6: no changes docs/misc/xen-command

[Xen-devel] [PATCH v7 06/15] VMX/altp2m: add code to support EPTP switching and #VE.

2015-07-22 Thread Ed White
Implement and hook up the code to enable VMX support of VMFUNC and #VE. VMFUNC leaf 0 (EPTP switching) emulation is added in a later patch. Signed-off-by: Ed White Reviewed-by: Andrew Cooper Acked-by: Jun Nakajima --- Changes since v6: remove casts around p2midx handling fix

[Xen-devel] [PATCH v7 03/15] VMX: implement suppress #VE.

2015-07-22 Thread Ed White
t EPT violations only the hypervisor is able to handle the violation. Signed-off-by: Ed White Acked-by: George Dunlap Acked-by: Jun Nakajima --- Changes since v6: add Jun's ack xen/arch/x86/mm/p2m-ept.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff -

[Xen-devel] [PATCH v7 05/15] x86/altp2m: basic data structures and support routines.

2015-07-22 Thread Ed White
lso splits the p2m lock into one lock type for altp2m's and another type for all other p2m's. The purpose of this is to place the altp2m list lock between the types, so the list lock can be acquired whilst holding the host p2m lock. Signed-off-by: Ed White --- Changes since v6:

[Xen-devel] [PATCH v7 07/15] VMX: add VMFUNC leaf 0 (EPTP switching) to emulator.

2015-07-22 Thread Ed White
From: Ravi Sahita Signed-off-by: Ravi Sahita Acked-by: Jan Beulich --- Changes since v6: remove incorrect cast add Jan's ack xen/arch/x86/hvm/emulate.c | 18 +++-- xen/arch/x86/hvm/vmx/vmx.c | 36 ++ xen/arch

[Xen-devel] [PATCH v7 09/15] x86/altp2m: alternate p2m memory events.

2015-07-22 Thread Ed White
Add a flag to indicate that a memory event occurred in an alternate p2m and a field containing the p2m index. Allow any event response to switch to a different alternate p2m using the same flag and field. Modify p2m_mem_access_check() to handle alternate p2m's. Signed-off-by: Ed White Ack

[Xen-devel] [PATCH v7 10/15] x86/altp2m: add remaining support routines.

2015-07-22 Thread Ed White
Add the remaining routines required to support enabling the alternate p2m functionality. Signed-off-by: Ed White Reviewed-by: Andrew Cooper --- Changes since v6: rename altp2m lazy copier, make bool_t, use __put_gfn throughout, and move to p2m.c, eliminating altp2m_hap.c

[Xen-devel] [PATCH v7 08/15] x86/altp2m: add control of suppress_ve.

2015-07-22 Thread Ed White
From: George Dunlap The existing ept_set_entry() and ept_get_entry() routines are extended to optionally set/get suppress_ve. Passing -1 will set suppress_ve on new p2m entries, or retain suppress_ve flag on existing entries. Signed-off-by: George Dunlap Signed-off-by: Ravi Sahita Reviewed-b

[Xen-devel] [PATCH v7 11/15] x86/altp2m: define and implement alternate p2m HVMOP types.

2015-07-22 Thread Ed White
Signed-off-by: Ed White Acked-by: Jan Beulich --- Changes since v6: fix cmd range check rework domain locking add Jan's ack xen/arch/x86/hvm/hvm.c | 138 xen/include/public/hvm/hvm_op.h

[Xen-devel] [PATCH v7 12/15] x86/altp2m: Add altp2mhvm HVM domain parameter.

2015-07-22 Thread Ed White
The altp2mhvm and nestedhvm parameters are mutually exclusive and cannot be set together. Signed-off-by: Ed White Reviewed-by: Andrew Cooper Acked-by: Wei Liu --- Changes since v6: no changes docs/man/xl.cfg.pod.5 | 12 tools/libxl/libxl.h | 6

[Xen-devel] [PATCH v7 14/15] tools/libxc: add support to altp2m hvmops

2015-07-22 Thread Ed White
From: Tamas K Lengyel Wrappers to issue altp2m hvmops. Signed-off-by: Tamas K Lengyel Signed-off-by: Ravi Sahita Acked-by: Ian Campbell --- Changes since v6: no changes tools/libxc/Makefile | 1 + tools/libxc/include/xenctrl.h | 22 tools/libxc/xc_altp2m.c |

[Xen-devel] [PATCH v7 13/15] x86/altp2m: XSM hooks for altp2m HVM ops

2015-07-22 Thread Ed White
From: Ravi Sahita Signed-off-by: Ravi Sahita Acked-by: Daniel De Graaf --- Changes since v6: no changes tools/flask/policy/policy/modules/xen/xen.if | 4 ++-- xen/arch/x86/hvm/hvm.c | 6 ++ xen/include/xsm/dummy.h | 12 xe

[Xen-devel] [PATCH v7 15/15] tools/xen-access: altp2m testcases

2015-07-22 Thread Ed White
From: Tamas K Lengyel Working altp2m test-case. Extended the test tool to support singlestepping to better highlight the core feature of altp2m view switching. Signed-off-by: Tamas K Lengyel Signed-off-by: Ed White Reviewed-by: Razvan Cojocaru Acked-by: Wei Liu --- Changes since v6

Re: [Xen-devel] [PATCH 00/11] Alternate p2m: support multiple copies of host p2m

2015-01-19 Thread Ed White
On 01/17/2015 01:49 AM, Tim Deegan wrote: > At 13:43 -0800 on 16 Jan (1421412191), Ed White wrote: >> I've tried to make all my work consistent with existing code >> and design in the same vein or same source file, regardless of my >> opinion of that existing content, un

Re: [Xen-devel] [PATCH 07/11] x86/altp2m: introduce p2m_ram_rw_ve type.

2015-01-19 Thread Ed White
>>> Without you explaining to us the full details of the in-domain >>> agent model, I'm afraid this is going to remain dubious and the >>> question hard to answer. In particular, if you indeed want to >>> prohibit that behavior on _all_ other p2m types, how would >>> subsequently changing the imple

Re: [Xen-devel] [PATCH 00/11] Alternate p2m: support multiple copies of host p2m

2015-01-19 Thread Ed White
> Or: declare in the interface that the altp2ms are soft state that can > be dropped on migration, with some suitable callback (#VE injection?) > to the guest when an altp2m 'view' is not available. That depends on > whether the in-guest agent can reconstruct the state it needs from > scratch. >

Re: [Xen-devel] [PATCH 00/11] Alternate p2m: support multiple copies of host p2m

2015-01-20 Thread Ed White
On 01/20/2015 12:47 AM, Jan Beulich wrote: On 19.01.15 at 22:54, wrote: >> There's also the issue that access permissions >> are soft state and can be reverted to default in certain cases. > > Some instances of which have got removed during the 4.5 cycle, > and at least some of the remaining

<    1   2   3   >