RE: [PATCH 4/8] x86/traps: Demand-populate PASID MSR via #GP

From: Luck, Tony
Date: Tue Sep 28 2021 - 22:15:27 EST

>> if (!(xsave->header.xfeatures & fmask)) {
>> xsave->header.xfeatures |= fmask; //<<<<<
>> xsaves(xsave, fmask);
>> }
> I'm not sure why the FPU state is initialized here.
> For updating the PASID state, it's unnecessary to init the PASID state.
> Maybe it is necessary in other cases?

Dave had suggested initializing feature state when it is unknown (could
be garbage). This is my attempt to follow that guidance. I'm not confident
that my tests for "is the state in registers, in memory, or is garbage"
really capture all the cases.