Re: [Xen-devel] [PATCH v2] x86/mm: also flush TLB when putting writable foreign page reference

2017-04-25 Thread Tim Deegan
Hi, At 02:59 -0600 on 25 Apr (1493089158), Jan Beulich wrote: > Jann's explanation of the problem: > > "start situation: > - domain A and domain B are PV domains > - domain A and B both have currently scheduled vCPUs, and the vCPUs >are not scheduled away > - domain A has XSM_TARGET access

Re: [Xen-devel] [PATCH v2] x86/mm: also flush TLB when putting writable foreign page reference

2017-04-26 Thread Tim Deegan
At 05:59 -0600 on 25 Apr (1493099950), Jan Beulich wrote: > >>> On 25.04.17 at 12:59, wrote: > > Hi, > > > > At 02:59 -0600 on 25 Apr (1493089158), Jan Beulich wrote: > >> Jann's explanation of the problem: > >> > >> "start situation: > >> - domain A and domain B are PV domains > >> - domain A

Re: [Xen-devel] [PATCH v2] x86/mm: also flush TLB when putting writable foreign page reference

2017-04-26 Thread Tim Deegan
At 08:07 -0600 on 26 Apr (1493194043), Jan Beulich wrote: > >>> On 25.04.17 at 12:59, wrote: > > Hi, > > > > At 02:59 -0600 on 25 Apr (1493089158), Jan Beulich wrote: > >> Jann's explanation of the problem: > >> > >> "start situation: > >> - domain A and domain B are PV domains > >> - domain A

Re: [Xen-devel] [PATCH v2] x86/mm: also flush TLB when putting writable foreign page reference

2017-04-27 Thread Tim Deegan
uld highly doubt (but if it's that what > you're after, I could certainly collect a few numbers). I think that would be a good idea, just as a sanity-check. But apart from that the patch looks correct to me, so: Reviewed-by: Tim Deegan for v2 (not v1). Cheers, Tim. __

Re: [Xen-devel] [PATCH v2] x86/mm: also flush TLB when putting writable foreign page reference

2017-05-02 Thread Tim Deegan
At 04:52 -0600 on 28 Apr (1493355160), Jan Beulich wrote: > >>> On 27.04.17 at 11:51, wrote: > > At 03:23 -0600 on 27 Apr (1493263380), Jan Beulich wrote: > >> ... it wouldn't better be the other way around: We use the patch > >> in its current (or even v1) form, and try to do something about > >>

Re: [Xen-devel] [PATCH v2] x86/mm: also flush TLB when putting writable foreign page reference

2017-05-02 Thread Tim Deegan
At 02:50 -0600 on 02 May (1493693403), Jan Beulich wrote: > >>> On 02.05.17 at 10:32, wrote: > > At 04:52 -0600 on 28 Apr (1493355160), Jan Beulich wrote: > >> >>> On 27.04.17 at 11:51, wrote: > >> > At 03:23 -0600 on 27 Apr (1493263380), Jan Beulich wrote: > >> >> ... it wouldn't better be the o

Re: [Xen-devel] [PATCH] xen/hvm: fix hypervisor crash with hvm_save_one()

2017-05-02 Thread Tim Deegan
ICS the underflow happens when the per-type handler returns no data at all (because all VCPUs are offline). With the commit message fixed, Reviewed-by: Tim Deegan ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH V2] xen/hvm: fix hypervisor crash with hvm_save_one()

2017-05-02 Thread Tim Deegan
n Cojocaru I actually preferred the first patch :P but this is fine. Acked-by: Tim Deegan > diff --git a/xen/common/hvm/save.c b/xen/common/hvm/save.c > index 78706f5..3bdd124 100644 > --- a/xen/common/hvm/save.c > +++ b/xen/common/hvm/save.c > @@ -113,6 +113,9 @@ int hvm

Re: [Xen-devel] [PATCH V2] xen/hvm: fix hypervisor crash with hvm_save_one()

2017-05-03 Thread Tim Deegan
At 00:31 -0600 on 03 May (1493771502), Jan Beulich wrote: > Hmm, with both of you being of that opinion, I've taken another > look. I think I see now why you think that way (this being data > from an internal producer, overflow/underflow are not a primary > concern), so I'll withdraw my objection t

Re: [Xen-devel] [PATCH V2] xen/hvm: fix hypervisor crash with hvm_save_one()

2017-05-03 Thread Tim Deegan
At 10:15 +0100 on 03 May (1493806508), Tim Deegan wrote: > At 00:31 -0600 on 03 May (1493771502), Jan Beulich wrote: > > +else if ( ctxt.cur > sizeof(*desc) ) > > { > > uint32_t off; > > -const struct hvm_save_descriptor *desc; &

Re: [Xen-devel] [PATCH 3/7] x86/mm: Further restrict permissions on some virtual mappings

2017-05-03 Thread Tim Deegan
d Only mappings of the M2P (compat and regular) don't need to be >writeable or executable. > * The PV GDT mappings don't need to be executable. > > Reported-by: Jann Horn > Signed-off-by: Andrew Cooper Reviewed-by: Tim Deegan _

Re: [Xen-devel] Security support scope (apropos of Xen and CNA)

2017-05-05 Thread Tim Deegan
At 13:53 +0100 on 04 May (1493905990), Ian Jackson wrote: > To become a CNA (CVE Numbering Authority), which we would like to do, > we need to provide MITRE's CNA programme with a definition of the > scope of our CNA. That should be the scope of our general security > support, clearly. > > At the

Re: [Xen-devel] Security support scope (apropos of Xen and CNA)

2017-05-05 Thread Tim Deegan
Hi, At 09:59 +0100 on 05 May (1493978382), Lars Kurth wrote: > > On 5 May 2017, at 09:43, Tim Deegan wrote: > > - Only features listed as Supported in MAINTAINERS get support. > > This seems related to George's proposal of the scope. I am not sure > MAINTAINERS is

Re: [Xen-devel] [PATCH for-next] x86/shadow: Use ERR_PTR infrastructure for sh_emulate_map_dest()

2017-05-10 Thread Tim Deegan
; other changes. > > Signed-off-by: Andrew Cooper s/sturct/struct/ Reviewed-by: Tim Deegan ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH for-4.9] x86/pagewalk: Fix determination of Protection Key access rights

2017-05-16 Thread Tim Deegan
At 17:51 +0100 on 16 May (1494957116), Andrew Cooper wrote: > c/s 4c5d78a10 was accidentally buggy when handling Protection Keys. > Protection keys applies to all user translations, not just accesses which > originate from user mode. Reviewed-by: Tim Deegan Does the test for write-p

Re: [Xen-devel] [PATCH v2 for-4.9] x86/pagewalk: Fix determination of Protection Key access rights

2017-05-18 Thread Tim Deegan
. I think this would be clearer as "all data accesses to user-mode addresses". > PKRU WD applies to any data write, not just to >mapping which are writable. However, a supervisor access without CR0.WP >bypasses any protection from protection keys. > &g

Re: [Xen-devel] [PATCH 01/24] xen/mm: Don't use _{g, m}fn for defining INVALID_{G, M}FN

2017-06-14 Thread Tim Deegan
or: initializer element is not constant > #define INVALID_MFN _mfn(~0UL) > > Signed-off-by: Julien Grall Acked-by: Tim Deegan > I know that this solution will not work for non-debug build. I would > like input from the community on way to fix it nicely. It seems to WFM: htt

Re: [Xen-devel] [PATCH v2 3/6] xen: RCU/x86/ARM: discount CPUs that were idle when grace period started.

2017-08-17 Thread Tim Deegan
Hi, This looks good to me. I have one question: At 18:45 +0200 on 16 Aug (1502909149), Dario Faggioli wrote: > @@ -474,7 +484,41 @@ static struct notifier_block cpu_nfb = { > void __init rcu_init(void) > { > void *cpu = (void *)(long)smp_processor_id(); > + > +cpumask_setall(&rcu_ctrl

Re: [Xen-devel] [PATCH v2 1/4] x86/mcheck: Minor cleanup to amd_nonfatal

2017-08-18 Thread Tim Deegan
At 12:22 +0100 on 16 Aug (1502886127), Andrew Cooper wrote: > * Drop trailing whitespace. > * Move amd_nonfatal_mcheck_init() into .init.text and drop a trailing > return. > * Drop unnecessary wmb()'s. Because of Xen's implementation, they are only > compiler barriers anyway, and each w

Re: [Xen-devel] [PATCH v2 2/4] xen/x86: Drop unnecessary barriers

2017-08-18 Thread Tim Deegan
At 12:22 +0100 on 16 Aug (1502886128), Andrew Cooper wrote: > diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c > index c9c2252..1e3dfaf 100644 > --- a/xen/arch/x86/mm/shadow/multi.c > +++ b/xen/arch/x86/mm/shadow/multi.c > @@ -3112,7 +3112,6 @@ static int sh_page_fault(s

Re: [Xen-devel] [PATCH v2 2/4] xen/x86: Drop unnecessary barriers

2017-08-18 Thread Tim Deegan
At 14:55 +0100 on 18 Aug (1503068128), Tim Deegan wrote: > At 12:22 +0100 on 16 Aug (1502886128), Andrew Cooper wrote: > > diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c > > index c9c2252..1e3dfaf 100644 > > --- a/xen/arch/x86/mm/shadow/multi.c &

[Xen-devel] [PATCH] xen/x86/shadow: adjust barriers around gtable_dirty_version.

2017-08-18 Thread Tim Deegan
Signed-off-by: Tim Deegan --- xen/arch/x86/mm/shadow/multi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c index c9c2252..f8a8928 100644 --- a/xen/arch/x86/mm/shadow/multi.c +++ b/xen/arch/x86/mm/shad

Re: [Xen-devel] [PATCH v2 2/4] xen/x86: Drop unnecessary barriers

2017-08-18 Thread Tim Deegan
At 01:48 -0600 on 17 Aug (1502934495), Jan Beulich wrote: > >>> On 16.08.17 at 18:47, wrote: > > On 16/08/17 16:23, Jan Beulich wrote: > > On 16.08.17 at 13:22, wrote: > >>> --- a/xen/arch/x86/mm/shadow/multi.c > >>> +++ b/xen/arch/x86/mm/shadow/multi.c > >>> @@ -3112,7 +3112,6 @@ static int

Re: [Xen-devel] [PATCH v2 2/4] xen/x86: Drop unnecessary barriers

2017-08-18 Thread Tim Deegan
At 15:47 +0100 on 18 Aug (1503071247), Tim Deegan wrote: > At 01:48 -0600 on 17 Aug (1502934495), Jan Beulich wrote: > > >>> On 16.08.17 at 18:47, wrote: > > > atomic_read() is not free to be reordered by the compiler. It is an asm > > > volatile with a vo

Re: [Xen-devel] [PATCH v2 2/4] xen/x86: Drop unnecessary barriers

2017-08-18 Thread Tim Deegan
At 09:04 -0600 on 18 Aug (1503047077), Jan Beulich wrote: > >>> On 18.08.17 at 16:47, wrote: > > At 01:48 -0600 on 17 Aug (1502934495), Jan Beulich wrote: > >> >>> On 16.08.17 at 18:47, wrote: > >> > On 16/08/17 16:23, Jan Beulich wrote: > >> > On 16.08.17 at 13:22, wrote: > >> >>> --- a/xen

Re: [Xen-devel] [PATCH v3 0/6] xen: RCU: x86/ARM: Add support of rcu_idle_{enter, exit}

2017-08-19 Thread Tim Deegan
the grace > period, and we simplify the code (a.k.a. 'win-win' :-D). Thanks! Reviewed-by: Tim Deegan ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH RFC 2/2] x86/mm: PG_translate implies PG_refcounts

2017-08-24 Thread Tim Deegan
_refcounts > are replaced by calls to paging_mode_translate. Would it be a good idea to merge all three and have only PG_external? > Signed-off-by: Wei Liu Acked-by: Tim Deegan with one adjustment: > /* common paging mode bits */ > #define PG_mode_shift 10 > -/* Refcounts

Re: [Xen-devel] [PATCH RFC 1/2] xen: remove CONFIG_PAGING_ASSISTANCE

2017-08-24 Thread Tim Deegan
xen/paging.h. > > > > Signed-off-by: Wei Liu > > This is something I certainly would want Tim to see (and perhaps > approve). Thanks. I see and approve. :) Acked-by: Tim Deegan ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH RFC 2/2] x86/mm: PG_translate implies PG_refcounts

2017-08-24 Thread Tim Deegan
At 11:05 +0100 on 24 Aug (1503572736), Wei Liu wrote: > On Thu, Aug 24, 2017 at 11:02:33AM +0100, Tim Deegan wrote: > > At 16:58 +0100 on 23 Aug (1503507504), Wei Liu wrote: > > > After 404595352 ("x86/paging: Enforce PG_external == PG_translate == > > >

Re: [Xen-devel] [PATCH 3/3] x86/mm: Introduce and use l?e_{get, from}_mfn()

2017-08-24 Thread Tim Deegan
At 14:14 +0100 on 24 Aug (1503584097), Andrew Cooper wrote: > This avoids the explicit boxing/unboxing of mfn_t in relevant codepaths. > > Signed-off-by: Andrew Cooper Acked-by: Tim Deegan ___ Xen-devel mailing list Xen-devel@lists.xen.

Re: [Xen-devel] [PATCH 1/5] x86/pv: Switch {fill, zap}_ro_mpt() to using mfn_t

2017-08-29 Thread Tim Deegan
At 12:19 +0100 on 29 Aug (1504009152), Andrew Cooper wrote: > And update all affected callers. Fix the fill_ro_mpt() prototype to be bool > like its implementation. > > Signed-off-by: Andrew Cooper Acked-by: Tim Deegan ___ Xen-devel

Re: [Xen-devel] [PATCH 2/2] x86/mm: Use mfn_t for make_cr3()

2017-08-30 Thread Tim Deegan
At 13:19 +0100 on 30 Aug (1504099173), Andrew Cooper wrote: > No functional change. > > Signed-off-by: Andrew Cooper Acked-by: Tim Deegan ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH] x86/shadow: Clarify the safety of guest-linear mapping construction

2017-09-03 Thread Tim Deegan
omment and some clarifying assertions. > > Also, there is no longer support for translate != external, so drop the clause > as it is dead. > > Finally, correct the comment for sh_install_xen_entries_in_l2h(). We need to > add Xen mappings into l2h for 3-on-any PV guests. > > Signe

Re: [Xen-devel] [PATCH] x86/mm: Consolidate all Xen L4 slot writing into init_xen_l4_slots()

2017-09-03 Thread Tim Deegan
: ROOT_PAGETABLE_XEN_SLOTS); > + > +memcpy(&l4t[l4_table_offset(XEN_VIRT_START)], > + &idle_pg_table[l4_table_offset(XEN_VIRT_START)], > + (ROOT_PAGETABLE_FIRST_XEN_SLOT + slots - > + l4_table

Re: [Xen-devel] [PATCH v2 0/4] Various XSA followups

2017-09-08 Thread Tim Deegan
pings For the shadow pagetable changes in patches 1 and 2: Acked-by: Tim Deegan ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH] x86: Make use of pagetable_get_mfn() where appropriate

2017-10-06 Thread Tim Deegan
At 19:36 +0100 on 28 Sep (1506627400), Andrew Cooper wrote: > ... instead of the opencoded _mfn(pagetable_get_pfn(...)) construct. > > Fix two overly long lines; no functional change. > > Signed-off-by: Andrew Cooper Acked-by: Tim Deegan

Re: [Xen-devel] [PATCH 0/7] xen: Convert __page_to_mfn and __mfn_to_page to use typesafe MFN

2017-10-06 Thread Tim Deegan
to make __page_to_mfn and __mfn_to_page using typesafe > MFN. > > The first 6 patches will convert of the code to use typesafe MFN, easing > the tree-wide conversion in patch 7. x86 shadow code changes Acked-by: Tim Deegan ___ Xen-devel mai

Re: [Xen-devel] [PATCH for 4.10 0/3] XSA-243 followup

2017-10-14 Thread Tim Deegan
ve PV l4 table setup code" and "x86/mm: factor out > pv_arch_init_memory" > x86/mm: Consolidate all Xen L2 slot writing into > init_xen_pae_l2_slots() > x86/mm: Consolidate all Xen L4 slot writing into init_xen_l4_slots() Acked-by: Tim Deegan __

Re: [Xen-devel] [PATCH] mm/shadow: fix declaration of fetch_type_names

2017-10-17 Thread Tim Deegan
At 11:23 +0100 on 17 Oct (1508239433), Roger Pau Monne wrote: > fetch_type_names usage is guarded by SHADOW_DEBUG_PROPAGATE in > SHADOW_DEBUG, fix the declaration so it's also guarded by > SHADOW_DEBUG_PROPAGATE instead of DEBUG_TRACE_DUMP. > > Signed-off-by: Roger Pau M

Re: [Xen-devel] [PATCH v3 for-next 4/4] xen: Convert __page_to_mfn and __mfn_to_page to use typesafe MFN

2017-11-02 Thread Tim Deegan
t of the callers are now switched to _mfn(domain_page_to_mfn(...)). > > Signed-off-by: Julien Grall Acked-by: Tim Deegan ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH] x86/pagewalk: Remove opt_allow_superpage check from guest_can_use_l2_superpages()

2017-07-25 Thread Tim Deegan
the walker should accept them. Reviewed-by: Tim Deegan > guest_can_use_l2_superpages() checking opt_allow_superpage is a piece of PV > guest policy enforcement, rather than its intended purpose of meaning "would > hardware tolerate finding an L2 superpage with these control setti

Re: [Xen-devel] [PATCH 3/5] xen: RCU/x86/ARM: discount CPUs that were idle when grace period started.

2017-08-09 Thread Tim Deegan
Hi, At 10:01 +0200 on 27 Jul (1501149684), Dario Faggioli wrote: > In Xen, that is impossible, and that's particularly problematic > when system is idle (or lightly loaded) systems, as CPUs that > are idle may never have the chance to tell RCU about their > quiescence, and grace periods could exte

Re: [Xen-devel] [PATCH 3/5] xen: RCU/x86/ARM: discount CPUs that were idle when grace period started.

2017-08-14 Thread Tim Deegan
Hi, At 11:19 +0200 on 14 Aug (1502709563), Dario Faggioli wrote: > Basically, for the race to occur (in [3]), it is necessary that [2] > (CPU1 doing rcp->cur++) happens after [1] (last call to rcu_pending() > of CPU2, before clearing the mask and going idle). In fact, it that is > not the case, rc

Re: [Xen-devel] [PATCH 3/5] xen: RCU/x86/ARM: discount CPUs that were idle when grace period started.

2017-08-14 Thread Tim Deegan
Hi, At 15:24 +0200 on 14 Aug (1502724279), Dario Faggioli wrote: > On Mon, 2017-08-14 at 11:39 +0100, Tim Deegan wrote: > > At 11:19 +0200 on 14 Aug (1502709563), Dario Faggioli wrote: > > > 3) CPU2 is not in idle_cpumask, and so it will not be in the > > > sampled >

Re: [Xen-devel] [PATCH 3/5] xen: RCU/x86/ARM: discount CPUs that were idle when grace period started.

2017-08-14 Thread Tim Deegan
At 18:21 +0200 on 14 Aug (1502734919), Dario Faggioli wrote: > On Mon, 2017-08-14 at 14:54 +0100, Tim Deegan wrote: > > At 15:24 +0200 on 14 Aug (1502724279), Dario Faggioli wrote: > > > About the former... I'm not sure which check of rcp->cur you're > > &g

Re: [Xen-devel] [PATCH v2 01/16] xen/mm: Don't use _{g, m}fn for defining INVALID_{G, M}FN

2017-06-20 Thread Tim Deegan
At 01:32 -0600 on 20 Jun (1497922345), Jan Beulich wrote: > >>> On 19.06.17 at 18:57, wrote: > > --- a/xen/include/xen/mm.h > > +++ b/xen/include/xen/mm.h > > @@ -56,7 +56,7 @@ > > > > TYPE_SAFE(unsigned long, mfn); > > #define PRI_mfn "05lx" > > -#define INVALID_MFN _mfn(~0UL) >

Re: [Xen-devel] [PATCH v2 01/16] xen/mm: Don't use _{g, m}fn for defining INVALID_{G, M}FN

2017-06-20 Thread Tim Deegan
At 03:36 -0600 on 20 Jun (1497929778), Jan Beulich wrote: > >>> On 20.06.17 at 11:14, wrote: > > At 01:32 -0600 on 20 Jun (1497922345), Jan Beulich wrote: > >> >>> On 19.06.17 at 18:57, wrote: > >> > --- a/xen/include/xen/mm.h > >> > +++ b/xen/include/xen/mm.h > >> > @@ -56,7 +56,7 @@ > >> > >

Re: [Xen-devel] [PATCH 2/6] x86/shadow: Fixes to hvm_emulate_insn_fetch()

2017-06-22 Thread Tim Deegan
ed bytes by mistake. Tim. > Signed-off-by: Andrew Cooper > --- > CC: Tim Deegan > CC: Jan Beulich > --- > xen/arch/x86/mm/shadow/common.c | 10 +++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x8

Re: [Xen-devel] [PATCH 3/6] x86/shadow: Use ERR_PTR infrastructure for sh_emulate_map_dest()

2017-06-22 Thread Tim Deegan
dr); Using "return ~PTR_ERR(addr)" when the usual idiom is "return -PTR_ERR(foo)" is a bit subtle. Still, the code seems to be correct, so if people prefer it, Acked-by: Tim Deegan Cheers, Tim. ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH v2 01/16] xen/mm: Don't use _{g, m}fn for defining INVALID_{G, M}FN

2017-06-23 Thread Tim Deegan
At 09:41 +0100 on 23 Jun (1498210893), Julien Grall wrote: > Hi Jan, > > On 23/06/17 09:30, Jan Beulich wrote: > On 22.06.17 at 20:31, wrote: > >> Hi, > >> > >> On 20/06/17 11:32, Jan Beulich wrote: > >> On 20.06.17 at 12:06, wrote: > At 03:36 -0600 on 20 Jun (1497929778), Jan Beul

Re: [Xen-devel] [PATCH v2 01/16] xen/mm: Don't use _{g, m}fn for defining INVALID_{G, M}FN

2017-06-23 Thread Tim Deegan
At 09:58 +0100 on 23 Jun (1498211910), Tim Deegan wrote: > At 09:41 +0100 on 23 Jun (1498210893), Julien Grall wrote: > > On 23/06/17 09:30, Jan Beulich wrote: > > > > > >> typedef struct > > >> { > > >> unsigned long i; >

Re: [Xen-devel] [PATCH v2 01/16] xen/mm: Don't use _{g, m}fn for defining INVALID_{G, M}FN

2017-06-23 Thread Tim Deegan
At 03:18 -0600 on 23 Jun (1498187924), Jan Beulich wrote: > >>> On 23.06.17 at 10:55, wrote: > > > > > On 23/06/17 09:30, Jan Beulich wrote: > > On 22.06.17 at 20:31, wrote: > >>> Hi, > >>> > >>> On 20/06/17 11:32, Jan Beulich wrote: > >>> On 20.06.17 at 12:06, wrote: > > At 03:36

Re: [Xen-devel] [PATCH 2/2] xen/mm: Introduce {G, M}FN_INVALID_INITIALIZER

2017-06-27 Thread Tim Deegan
mmon > value to initialize a variable and directly passed as an argument. > > Introduce 2 news define {G,M}FN_INVALID_INITIALIZER to be used for > initializing a variable. > > [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64856 > > Signed-off-by: Julien Grall Acked-by:

Re: [Xen-devel] [PATCH 4/4] x86/shadow: Switch to using bool

2017-06-28 Thread Tim Deegan
Hi, At 12:16 +0100 on 28 Jun (1498652182), Andrew Cooper wrote: > sh_pin() has boolean properties, so switch its return type. > > Signed-off-by: Andrew Cooper Good idea, thanks. > -static bool_t > +static bool > sh_write_guest_entry(struct vcpu *v, intpte_t *p, intpte_t new, mfn_t gmfn) Can

Re: [Xen-devel] [PATCH v2 4/4] x86/shadow: Switch to using bool

2017-06-30 Thread Tim Deegan
At 16:40 +0100 on 30 Jun (1498840853), Andrew Cooper wrote: > * sh_pin() has boolean properties, so switch its return type. > * sh_remove_shadows() uses ints everywhere other than its stub. > > Signed-off-by: Andrew Cooper Reviewed-by

Re: [Xen-devel] [PATCH v5 17/23] x86/mm: export base_disallow_mask and l1 mask in asm-x86/mm.h

2017-09-23 Thread Tim Deegan
At 07:52 -0600 on 22 Sep (1506066733), Jan Beulich wrote: > >>> On 14.09.17 at 14:58, wrote: > > The l1 mask needs to stay in x86/mm.c while l{2,3,4} masks are only > > needed by PV code. Both x86 common mm code and PV mm code use > > base_disallow_mask and l1 maks. > > > > Export base_disallow_m

Re: [Xen-devel] [PATCH v2 8/9] x86/pagewalk: Improve the logic behind setting access and dirty bits

2017-03-23 Thread Tim Deegan
At 16:31 + on 16 Mar (1489681902), Andrew Cooper wrote: > --- a/xen/arch/x86/mm/guest_walk.c > +++ b/xen/arch/x86/mm/guest_walk.c > @@ -32,24 +32,28 @@ asm(".file \"" __OBJECT_FILE__ "\""); > #include > #include > > -/* Modify a guest pagetable entry to set the Accessed and Dirty bits. >

Re: [Xen-devel] [PATCH v2 9/9] x86/pagewalk: non-functional cleanup

2017-03-23 Thread Tim Deegan
At 16:31 + on 16 Mar (1489681903), Andrew Cooper wrote: > * Drop trailing whitespace > * Consistently apply Xen style > * Introduce a local variable block > > Signed-off-by: Andrew Cooper Acked-by: Tim Deegan ___ Xen-devel m

Re: [Xen-devel] [PATCH v2 5/9] x86/pagewalk: Helpers for reserved bit handling

2017-03-23 Thread Tim Deegan
At 17:02 + on 23 Mar (1490288548), Andrew Cooper wrote: > On 23/03/17 16:55, Tim Deegan wrote: > > At 16:31 + on 16 Mar (1489681899), Andrew Cooper wrote: > >> Some bits are unconditionally reserved in pagetable entries, or reserved > >> because of alignment re

Re: [Xen-devel] [PATCH v3 5/6] x86/pagewalk: Improve the logic behind setting access and dirty bits

2017-03-27 Thread Tim Deegan
, to make it > easier to follow. > > Alter set_ad_bits() to take properly typed pointers and booleans rather than > integers. > > Signed-off-by: Andrew Cooper > Reviewed-by: Jan Beulich Reviewed-by: Tim Deegan ___ Xen-devel mai

Re: [Xen-devel] [PATCH v2 for-4.9 1/6] x86/hvm: Correct some address space terminology

2017-04-06 Thread Tim Deegan
Reviewed-by: Paul Durrant For the whole series, Acked-by: Tim Deegan ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH 1/2] x86/shadow: More consistent printing for debug messages

2016-09-02 Thread Tim Deegan
calls. The >wrappers already include it. > * Use hex rather than decimal for printing a pagefault error code. > > Signed-off-by: Andrew Cooper Acked-by: Tim Deegan ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH] x86/paging: Make paging_mode_*() predecates behave like predicates

2016-09-08 Thread Tim Deegan
At 10:55 +0100 on 08 Sep (1473332146), Andrew Cooper wrote: > Signed-off-by: Andrew Cooper s/predecates/predicates/, and Acked-by: Tim Deegan ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH 3/3] Significant changes to decision making; some new roles and minor changes

2016-09-09 Thread Tim Deegan
At 11:56 + on 09 Sep (1473422177), Lars Kurth wrote: > Community Decisions with Funding and Legal Implications > (#funding-and-legal) > --- > > In some cases sub-project local and global decisions **may require > input** from the [Advisory Bo

Re: [Xen-devel] [PATCH] x86/shadow: Use standard C array designators

2016-09-12 Thread Tim Deegan
; > Signed-off-by: Andrew Cooper Acked-by: Tim Deegan ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH] x86/shadow: Correct the behaviour of a guests view of maxphysaddr

2017-02-08 Thread Tim Deegan
Hi, At 12:36 + on 08 Feb (1486557378), Andrew Cooper wrote: > XSA-173 (c/s 8b1764833) introduces gfn_bits, and an upper limit which might be > lower than the real maxphysaddr, to avoid overflowing the superpage shadow > backpointer. > > However, plenty of hardware has a physical address width

Re: [Xen-devel] [PATCH] x86/shadow: Correct the behaviour of a guests view of maxphysaddr

2017-02-08 Thread Tim Deegan
At 15:29 + on 08 Feb (1486567798), Andrew Cooper wrote: > On Intel, a guest can get an PTE shadowed which should have faulted and > didn't (because the smfn is actually within 39 bits) Yes. , while on AMD, a > guest can try to create a PTE which shouldn't fault (because CPUID says > anything

Re: [Xen-devel] [PATCH v2] xen/p2m: Fix p2m_flush_table for non-nested cases

2017-02-08 Thread Tim Deegan
r)); > ASSERT(page_list_empty(&p2m->pod.single)); > > -if ( p2m->np2m_base == P2M_BASE_EADDR ) > +/* No need to flush if it's already empty */ > +if ( p2m->p2m_class == p2m_nested && > +

Re: [Xen-devel] [PATCH v2] x86/shadow: Correct guest behaviour when creating PTEs above maxphysaddr

2017-02-14 Thread Tim Deegan
td.maxphysaddr = max_t(uint8_t, p->extd.maxphysaddr, > (p->basic.pae || p->basic.pse36) ? 36 : > 32); That looks good to me. Reviewed-by: Tim Deegan > >> @@ -360,6 +361,21 @@ void paging_dump_vcpu_info(struct vcpu *v); > >> int paging_set_allocation(s

Re: [Xen-devel] [PATCH] x86/VMX: sanitize VM86 TSS handling

2017-02-14 Thread Tim Deegan
pointer. Both this and the segment limit now take the allocated size > into account. > > Signed-off-by: Jan Beulich This looks pretty good to me. Once the question below is resolved, Reviewed-by: Tim Deegan > --- > TBD: Do we really want to re-init the TSS every time we are about

Re: [Xen-devel] [PATCH] x86/VMX: sanitize VM86 TSS handling

2017-02-14 Thread Tim Deegan
At 06:37 -0700 on 13 Feb (1486967832), Jan Beulich wrote: > >>> On 13.02.17 at 14:19, wrote: > > -tss = mem_alloc(128, 128); > > -memset(tss, 0, 128); > > +tss = mem_alloc(TSS_SIZE, TSS_SIZE); > > tss = mem_alloc(TSS_SIZE, 128); > > is sufficient here, as I've noticed (only) whil

Re: [Xen-devel] [PATCH] x86/VMX: sanitize VM86 TSS handling

2017-02-15 Thread Tim Deegan
At 01:13 -0700 on 15 Feb (1487121231), Jan Beulich wrote: > >>> On 14.02.17 at 18:35, wrote: > > At 06:37 -0700 on 13 Feb (1486967832), Jan Beulich wrote: > >> >>> On 13.02.17 at 14:19, wrote: > >> > -tss = mem_alloc(128, 128); > >> > -memset(tss, 0, 128); > >> > +tss = mem_alloc(TSS_

Re: [Xen-devel] [PATCH] x86/VMX: sanitize VM86 TSS handling

2017-02-15 Thread Tim Deegan
At 01:18 -0700 on 15 Feb (1487121525), Jan Beulich wrote: > >>> On 14.02.17 at 18:33, wrote: > >> TBD: Do we really want to re-init the TSS every time we are about to > >> use it? > > > > No - I think we should init it when the guest writes the param(s) and > > leave it at that. Hvmloader m

Re: [Xen-devel] [PATCH] x86/VMX: sanitize VM86 TSS handling

2017-02-20 Thread Tim Deegan
At 04:49 -0700 on 16 Feb (1487220558), Jan Beulich wrote: > >>> On 16.02.17 at 12:14, wrote: > On 15.02.17 at 12:21, wrote: > >> At 01:18 -0700 on 15 Feb (1487121525), Jan Beulich wrote: > >>> >>> On 14.02.17 at 18:33, wrote: > >>> >> TBD: Do we really want to re-init the TSS every time we

Re: [Xen-devel] [PATCH v3] x86/shadow: Correct guest behaviour when creating PTEs above maxphysaddr

2017-02-20 Thread Tim Deegan
guest_pt.h but it is unused in the > codebase. Repurpose it to perform a guest-specific maxphysaddr check, which > replaces the users of gfn_bits. > > Signed-off-by: Andrew Cooper Reviewed-by: Tim Deegan ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH] x86/mm: Swap mfn_valid() to use mfn_t

2017-02-20 Thread Tim Deegan
nge. > > Signed-off-by: Andrew Cooper Acked-by: Tim Deegan ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH v2] x86/VMX: sanitize VM86 TSS handling

2017-02-20 Thread Tim Deegan
At 05:03 -0700 on 17 Feb (1487307837), Jan Beulich wrote: > The present way of setting this up is flawed: Leaving the I/O bitmap > pointer at zero means that the interrupt redirection bitmap lives > outside (ahead of) the allocated space of the TSS. Similarly setting a > TSS limit of 255 when only

Re: [Xen-devel] [PATCH] x86/paging: Package up the log dirty function pointers

2017-02-20 Thread Tim Deegan
ndrew Cooper Acked-by: Tim Deegan ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH v2] x86/VMX: sanitize VM86 TSS handling

2017-02-20 Thread Tim Deegan
we could freely change their behavior). > Also, since we wouldn't be able to tell size 128 from size 0 with what > you propose, "get" would then possibly return a value different from > what was passed to "set". Sure you could - just keep the client's version and s/0/128/ when setting up the TSS. But let's not bikeshed this any further. Reviewed-by: Tim Deegan ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH 2/3] x86: remove has_hvm_container_{domain/vcpu}

2017-02-24 Thread Tim Deegan
At 15:13 + on 24 Feb (1487949198), Roger Pau Monne wrote: > It is now useless since PVHv1 is removed and PVHv2 is a HVM domain from Xen's > point of view. > > Signed-off-by: Roger Pau Monné Acked-by: Tim Deegan ___ Xen-devel

Re: [Xen-devel] [PATCH] x86/shadow: Fix build with CONFIG_SHADOW_PAGING=n following c/s 45ac805

2017-02-27 Thread Tim Deegan
G run. > > Signed-off-by: Andrew Cooper > --- Acked-by: Tim Deegan ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH 02/15] x86/emul: Simplfy emulation state setup

2016-11-23 Thread Tim Deegan
s it doesn't need > recalculating for each instruction. > > Signed-off-by: Andrew Cooper Shadow code changes Acked-by: Tim Deegan ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH 06/15] x86/emul: Rework emulator event injection

2016-11-23 Thread Tim Deegan
Hi, At 15:38 + on 23 Nov (1479915529), Andrew Cooper wrote: > The emulator needs to gain an understanding of interrupts and exceptions > generated by its actions. > > Move hvm_emulate_ctxt.{exn_pending,trap} into struct x86_emulate_ctxt so they > are visible to the emulator. This removes the

Re: [Xen-devel] [PATCH 09/15] x86/emul: Avoid raising faults behind the emulators back

2016-11-23 Thread Tim Deegan
At 15:38 + on 23 Nov (1479915532), Andrew Cooper wrote: > Introduce a new x86_emul_pagefault() similar to x86_emul_hw_exception(), and > use this instead of hvm_inject_page_fault() from emulation codepaths. > > Replace one hvm_inject_hw_exception() in the shadow emulation codepaths. > > Signe

Re: [Xen-devel] [PATCH 10/15] x86/hvm: Extend the hvm_copy_*() API with a pagefault_info pointer

2016-11-23 Thread Tim Deegan
At 15:38 + on 23 Nov (1479915533), Andrew Cooper wrote: > which is filled with pagefault information should one occur. > > No functional change. > > Signed-off-by: Andrew Cooper > Reviewed-by: Jan Beulich Acked-by: Tim Deegan ___

Re: [Xen-devel] [PATCH 11/15] x86/hvm: Reimplement hvm_copy_*_nofault() in terms of no pagefault_info

2016-11-23 Thread Tim Deegan
At 15:38 + on 23 Nov (1479915534), Andrew Cooper wrote: > No functional change. > > Signed-off-by: Andrew Cooper Shouldn't this also update the comments to describe the new semantics of hvm_copy_*()? Tim. ___ Xen-devel mailing list Xen-devel@lis

Re: [Xen-devel] [PATCH 12/15] x86/hvm: Rename hvm_copy_*_guest_virt() to hvm_copy_*_guest_linear()

2016-11-23 Thread Tim Deegan
At 15:38 + on 23 Nov (1479915535), Andrew Cooper wrote: > The functions use linear addresses, not virtual addresses, as no segmentation > is used. (Lots of other code in Xen makes this mistake.) > > Signed-off-by: Andrew Cooper Acked-by

Re: [Xen-devel] [PATCH 13/15] x86/hvm: Avoid __hvm_copy() raising #PF behind the emulators back

2016-11-23 Thread Tim Deegan
At 15:38 + on 23 Nov (1479915536), Andrew Cooper wrote: > Drop the call to hvm_inject_page_fault() in __hvm_copy(), and require callers > to inject the pagefault themselves. > > No functional change. > > Signed-off-by: Andrew Cooper > index afacd5f..88d4642 100644 > --- a/xen/arch/x86/mm/sh

Re: [Xen-devel] [PATCH 11/15] x86/hvm: Reimplement hvm_copy_*_nofault() in terms of no pagefault_info

2016-11-23 Thread Tim Deegan
At 16:35 + on 23 Nov (1479918931), Tim Deegan wrote: > At 15:38 + on 23 Nov (1479915534), Andrew Cooper wrote: > > No functional change. > > > > Signed-off-by: Andrew Cooper > > Shouldn't this also update the comments to describe the new semantics >

Re: [Xen-devel] [PATCH 06/15] x86/emul: Rework emulator event injection

2016-11-23 Thread Tim Deegan
At 09:33 -0700 on 23 Nov (1479893609), Jan Beulich wrote: > >>> On 23.11.16 at 17:19, wrote: > > Hi, > > > > At 15:38 + on 23 Nov (1479915529), Andrew Cooper wrote: > >> The emulator needs to gain an understanding of interrupts and exceptions > >> generated by its actions. > >> > >> Move hvm

Re: [Xen-devel] [PATCH 09/15] x86/emul: Avoid raising faults behind the emulators back

2016-11-23 Thread Tim Deegan
At 16:40 + on 23 Nov (1479919254), Andrew Cooper wrote: > On 23/11/16 16:31, Tim Deegan wrote: > > At 15:38 + on 23 Nov (1479915532), Andrew Cooper wrote: > >> Introduce a new x86_emul_pagefault() similar to x86_emul_hw_exception(), > >> and > >> use t

Re: [Xen-devel] [PATCH 06/15] x86/emul: Rework emulator event injection

2016-11-24 Thread Tim Deegan
At 17:19 + on 24 Nov (1480007992), Andrew Cooper wrote: > On 24/11/16 17:08, Jan Beulich wrote: > On 24.11.16 at 18:00, wrote: > >> On 24/11/16 14:53, Jan Beulich wrote: > >> On 23.11.16 at 16:38, wrote: > --- a/xen/arch/x86/mm.c > +++ b/xen/arch/x86/mm.c > @@ -5377,7

Re: [Xen-devel] [PATCH 06/15] x86/emul: Rework emulator event injection

2016-11-25 Thread Tim Deegan
At 00:25 -0700 on 25 Nov (1480033543), Jan Beulich wrote: > >>> On 24.11.16 at 18:37, wrote: > > As an interim between now and getting a proper audit hook, would a bool > > permit_traps in x86_emulate_ctxt suffice? > > That's one option; the other would be to do away with only the > exception inj

Re: [Xen-devel] [PATCH v2 01/19] x86/shadow: Fix #PFs from emulated writes crossing a page boundary

2016-11-28 Thread Tim Deegan
frame suffers a pagefault during translation. > > Signed-off-by: Andrew Cooper Acked-by: Tim Deegan ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH v2 02/19] x86/emul: Drop X86EMUL_CMPXCHG_FAILED

2016-11-28 Thread Tim Deegan
at the time. > > It is only used twice; there is no need to call it out differently from other > uses of X86EMUL_RETRY. > > No functional change. > > Signed-off-by: Andrew Cooper Acked-by: Tim Deegan ___ Xen-devel mailing l

Re: [Xen-devel] [PATCH v2 06/19] x86/pv: Implement pv_inject_{event, page_fault, hw_exception}()

2016-11-28 Thread Tim Deegan
c inline wrapper. > reserved_bit_page_fault() is pure code motion. > > No functional change. > > Signed-off-by: Andrew Cooper Acked-by: Tim Deegan with one note: > +if ( vector == TRAP_page_fault ) > +{ > +v->arch.pv_vcpu.ctrlreg[2] = event->cr2; &g

Re: [Xen-devel] [PATCH v2 08/19] x86/emul: Rework emulator event injection

2016-11-28 Thread Tim Deegan
At 11:13 + on 28 Nov (1480331605), Andrew Cooper wrote: > The emulator needs to gain an understanding of interrupts and exceptions > generated by its actions. > > Move hvm_emulate_ctxt.{exn_pending,trap} into struct x86_emulate_ctxt so they > are visible to the emulator. This removes the need

Re: [Xen-devel] [PATCH v2 08/19] x86/emul: Rework emulator event injection

2016-11-28 Thread Tim Deegan
At 12:48 + on 28 Nov (1480337304), Andrew Cooper wrote: > On 28/11/16 12:04, Tim Deegan wrote: > > At 11:13 + on 28 Nov (1480331605), Andrew Cooper wrote: > >> +/* > >> * NB. We do not unshadow on X86EMUL_EXCEPTION. It's not clear that it >

Re: [Xen-devel] [PATCH v2 13/19] x86/shadow: Avoid raising faults behind the emulators back

2016-11-28 Thread Tim Deegan
Hi, At 11:13 + on 28 Nov (1480331610), Andrew Cooper wrote: > Use x86_emul_{hw_exception,pagefault}() rather than > {pv,hvm}_inject_page_fault() and hvm_inject_hw_exception() to cause raised > faults to be known to the emulator. This requires altering the callers of > x86_emulate() to properl

Re: [Xen-devel] [PATCH v2 17/19] x86/hvm: Avoid __hvm_copy() raising #PF behind the emulators back

2016-11-28 Thread Tim Deegan
At 11:13 + on 28 Nov (1480331614), Andrew Cooper wrote: > Drop the call to hvm_inject_page_fault() in __hvm_copy(), and require callers > to inject the pagefault themselves. This seems like it'd be easy to forget to DTRT with the fault, especially in code being ported forward across this serie

  1   2   3   4   5   6   7   >