On 28/05/2019 11:32, Juergen Gross wrote: > Instead of dynamically decide whether the previous vcpu was using full
"deciding" > or default GDT just add a percpu variable for that purpose. This at "was using a full or default GDT, just add" > once removes the need for testing vcpu_ids to differ twice. > > Cache the need_full_gdt(nd) value in a local variable. What's the point of doing this? I know the logic is rather complicated in __context_switch(), but at least it is visually consistent. After this change, it is asymmetric and harder to follow. > > Signed-off-by: Juergen Gross <jgr...@suse.com> > Reviewed-by: Jan Beulich <jbeul...@suse.com> > --- > RFC V2: new patch (split from previous one) > V1: init percpu flag at cpu startup > rename variable (Jan Beulich) > --- > xen/arch/x86/cpu/common.c | 3 +++ > xen/arch/x86/domain.c | 16 +++++++++++----- > xen/include/asm-x86/desc.h | 1 + > 3 files changed, 15 insertions(+), 5 deletions(-) > > diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c > index 33f5d32557..8b90356fe5 100644 > --- a/xen/arch/x86/cpu/common.c > +++ b/xen/arch/x86/cpu/common.c > @@ -49,6 +49,8 @@ unsigned int vaddr_bits __read_mostly = VADDR_BITS; > static unsigned int cleared_caps[NCAPINTS]; > static unsigned int forced_caps[NCAPINTS]; > > +DEFINE_PER_CPU(bool, full_gdt_loaded); > + > void __init setup_clear_cpu_cap(unsigned int cap) > { > const uint32_t *dfs; > @@ -745,6 +747,7 @@ void load_system_tables(void) > offsetof(struct tss_struct, __cacheline_filler) - 1, > SYS_DESC_tss_busy); > > + per_cpu(full_gdt_loaded, cpu) = false; Indentation. (Although I've got half a mind to do a blanket convert of files like this to Xen style. They are almost completely diverged from their Linux heritage.) ~Andrew _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel