Re: [PATCH 1/3] x86/emul: Adjust comments in x86-types.h
Andrew Cooper <[email protected]>
| Newsgroups | gmane.comp.emulators.xen.devel |
|---|---|
| Message-ID | <[email protected]> |
On 17/08/2026 7:11 am, Jan Beulich wrote: > On 14.08.2026 20:58, Andrew Cooper wrote: >> x86_segment enumerates segments, not segment registers. Adjust the comment to >> make this clearer. >> >> Fix a stray tab with the closing #endif. >> >> No functional change. >> >> Signed-off-by: Andrew Cooper <[email protected]> > Acked-by: Jan Beulich <[email protected]> Thanks. > > I wonder though if we wouldn't better ... > >> --- a/xen/arch/x86/include/asm/x86-types.h >> +++ b/xen/arch/x86/include/asm/x86-types.h >> @@ -16,9 +16,10 @@ >> #endif >> >> /* >> - * Comprehensive enumeration of x86 segment registers. Various bits of code >> - * rely on this order (general purpose before system, tr at the beginning of >> - * system). >> + * x86 Segments. > ... insert "(kind of)" here: "sys" and "none" aren't really "segments", System segments absolutely are segments. The VMCB/VMCS layouts hint at it, and various bits of microcode reverse engineering show explicitly that they're considered segments (or at least, address spaces) at the microarchitecture level. "none" is fine without further explanation. "linear" is the weird one but there's a comment explaining it. > and iirc we said we may need to gain one more such pseudo-segment here to deal > with WR{,U}SS. Most likely yes, but again that's going to come with a comment. We're probably going to need a phys segment at some point too, depending on how exactly we want to fit VMLOAD/VMSAVE into the emulator. This too is a segment as far as microcode is concerned. I don't think qualifying "(kind of)" is an improvement here. ~Andrew