Re: [RFC PATCH 6/6] kvm: Implement SIGSEGV sentinel for Pkey recovery

Dave Hansen <[email protected]>
Newsgroups gmane.comp.emulators.kvm.devel,gmane.comp.emulators.qemu
Message-ID <[email protected]>
On 8/18/26 13:44, Jacky Li wrote:
> +    if ((fpstate_64->sw_reserved.xstate_bv & XSTATE_PKRU) == 0) {
> +        return false;
> +    }
Cool stuff!

A few little nits on the XSAVE handling.

It's subtle, but this wouldn't quite work for pkru when in its init
state. I guess the argument is that pkru=0 wouldn't cause a SIGSEGV in
the first place so this code wouldn't ever get run. But, if it were me,
I'd probably warn or _something_ if I ended up with
(xstate_bv&XSTATE_PKRU)==0.

I'd probably also at least _check_ for the compacted format. Basically
make sure that XCOMP_BV==0, too. This isn't strictly necessary. But it
would help me win a bet with a colleague, so would be much appreciated! ;)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.