tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [PATCH v3 1/2] Fetch XSAVE area component offsets and sizes when initializing x86 CPU

Le 09/06/2019 à 09:33, Michał Górny a écrit :
On Sun, 2019-06-09 at 09:20 +0200, Maxime Villard wrote:
In fact, the whole loop seems wrong: CPUID uses the XCR0_ constants, not the
XSAVE_ constants. Eg HDC is 13 in XCR0_ but 10 in XSAVE_, so you never iterate
over it.

It's intentional.  I only iterate up to XSAVE_MAX_COMPONENT,
i.e. the last component actually used by the kernel.  I don't skip
earlier unused components to avoid index madness but I see no purpose to
go beyond last component actually used.

Ok, that's fine for now and we can revisit that later for future states.
However, maybe rename XSAVE_ -> XCRO_SHIFT_, or something else, to make it
clear that this depends on the hardware layout.

Home | Main Index | Thread Index | Old Index