On 12.08.2019 12:29, Andrew Cooper wrote:
On 12/08/2019 08:23, Jan Beulich wrote:
@@ -747,16 +747,10 @@ void load_system_tables(void)
.bitmap = IOBMP_INVALID_OFFSET,
};
- _set_tssldt_desc(
- gdt + TSS_ENTRY,
- (unsigned long)tss,
- offsetof(struct tss_struct, __cacheline_filler) - 1,
- SYS_DESC_tss_avail);
- _set_tssldt_desc(
- compat_gdt + TSS_ENTRY,
- (unsigned long)tss,
- offsetof(struct tss_struct, __cacheline_filler) - 1,
- SYS_DESC_tss_busy);
+ _set_tssldt_desc(gdt + TSS_ENTRY, (unsigned long)tss,
+ sizeof(*tss) - 1, SYS_DESC_tss_avail);
+ _set_tssldt_desc(compat_gdt + TSS_ENTRY, (unsigned long)tss,
+ sizeof(*tss) - 1, SYS_DESC_tss_busy);
Do you think it is worth having a BUILD_BUG_ON(sizeof(*tss) < 0x67),
just to confirm that the load wont fault?
Not sure - it feels like going a little overboard with checks. Feel
free to add one though if you're really convinced it helps, but
then please with 0x68 in place of 0x67. (I'm about to leave now,
so if you want me to add anything and/or commit it, it would have
to wait two weeks.)
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel