Re: [Xen-devel] [PATCH v2 2/2] x86/desc: Build boot_{, compat_}gdt[] in C

2019-08-12 Thread Andrew Cooper
On 12/08/2019 08:32, Jan Beulich wrote: > On 09.08.2019 12:40, Jan Beulich wrote: >> There is plenty more cleanup which can be done in the future.  As we are >> 64-bit, there is no need for load_TR() to keep the TSS in sync >> between the two >> GDTs, which means it can drop all sgdt/lgdt instructi

Re: [Xen-devel] [PATCH v2 2/2] x86/desc: Build boot_{, compat_}gdt[] in C

2019-08-12 Thread Jan Beulich
On 09.08.2019 12:40, Jan Beulich wrote: There is plenty more cleanup which can be done in the future.  As we are 64-bit, there is no need for load_TR() to keep the TSS in sync between the two GDTs, which means it can drop all sgdt/lgdt instructions. I'm trying to figure what exactly you mean he

Re: [Xen-devel] [PATCH v2 2/2] x86/desc: Build boot_{, compat_}gdt[] in C

2019-08-09 Thread Andrew Cooper
On 09/08/2019 14:18, Jan Beulich wrote: > On 09.08.2019 15:07, Andrew Cooper wrote: >> On 09/08/2019 13:43, Jan Beulich wrote: >>> On 09.08.2019 14:19, Andrew Cooper wrote: On 09/08/2019 11:40, Jan Beulich wrote: > --- /dev/null > +++ b/xen/arch/x86/desc.c > @@ -0,0 +1,109 @@ >

Re: [Xen-devel] [PATCH v2 2/2] x86/desc: Build boot_{, compat_}gdt[] in C

2019-08-09 Thread Jan Beulich
On 09.08.2019 15:07, Andrew Cooper wrote: On 09/08/2019 13:43, Jan Beulich wrote: On 09.08.2019 14:19, Andrew Cooper wrote: On 09/08/2019 11:40, Jan Beulich wrote: --- /dev/null +++ b/xen/arch/x86/desc.c @@ -0,0 +1,109 @@ + +#define SEL2GDT(sel) (((sel) >> 3) - FIRST_RESERVED_GDT_ENTRY) + +__s

Re: [Xen-devel] [PATCH v2 2/2] x86/desc: Build boot_{, compat_}gdt[] in C

2019-08-09 Thread Andrew Cooper
On 09/08/2019 13:43, Jan Beulich wrote: > On 09.08.2019 14:19, Andrew Cooper wrote: >> On 09/08/2019 11:40, Jan Beulich wrote: >>> Signed-off-by: Andrew Cooper >>> >>> Introduce SEL2GDT(). Correct GDT indices in public header. >> >> "Correct" here is ambiguous because it implies there is a breakag

Re: [Xen-devel] [PATCH v2 2/2] x86/desc: Build boot_{, compat_}gdt[] in C

2019-08-09 Thread Jan Beulich
On 09.08.2019 14:19, Andrew Cooper wrote: On 09/08/2019 11:40, Jan Beulich wrote: Signed-off-by: Andrew Cooper Introduce SEL2GDT(). Correct GDT indices in public header. "Correct" here is ambiguous because it implies there is a breakage. You appear to have reversed FLAT_RING3_CS64 and DS32

Re: [Xen-devel] [PATCH v2 2/2] x86/desc: Build boot_{, compat_}gdt[] in C

2019-08-09 Thread Andrew Cooper
On 09/08/2019 11:40, Jan Beulich wrote: > Signed-off-by: Andrew Cooper > > Introduce SEL2GDT(). Correct GDT indices in public header. "Correct" here is ambiguous because it implies there is a breakage. You appear to have reversed FLAT_RING3_CS64 and DS32 (retaining the original comments) and cha

[Xen-devel] [PATCH v2 2/2] x86/desc: Build boot_{, compat_}gdt[] in C

2019-08-09 Thread Jan Beulich
From: Andrew Cooper ... where we can at least get the compiler to fill in the surrounding space without having to do it manually. This also results in the symbols having proper type/size information in the debug symbols. Reorder 'raw' in the seg_desc_t union to allow for easier initialisation.