From: Dave Hansen <dave.hansen@intel.com>
To: Jacky Li <jackyli@google.com>, qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Zhao Liu" <zhao1.liu@intel.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@mailo.com>,
"Peter Xu" <peterx@redhat.com>,
kvm@vger.kernel.org, "James Houghton" <jthoughton@google.com>,
"Mingwei Zhang" <mizhang@google.com>,
"Dave Hansen" <dave.hansen@linux.intel.com>,
"Brendan Jackman" <jackmanb@google.com>,
"Reiji Watanabe" <reijiw@google.com>
Subject: Re: [RFC PATCH 6/6] kvm: Implement SIGSEGV sentinel for Pkey recovery
Date: Tue, 18 Aug 2026 14:55:32 -0700 [thread overview]
Message-ID: <b360f0c6-b4fb-4e32-ad75-1b50a8c8a0ad@intel.com> (raw)
In-Reply-To: <20260818-feature-pkey-dev-v1-6-8c0ef96a4da9@google.com>
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! ;)
prev parent reply other threads:[~2026-08-18 21:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 20:44 [RFC PATCH 0/6] Protect VMM from speculative attacks using x86 PKRU Jacky Li
2026-08-18 20:44 ` [RFC PATCH 1/6] x86: Introduce basic PKRU hardware wrappers Jacky Li
2026-08-18 20:44 ` [RFC PATCH 2/6] kvm: Add guest memory Pkey initialization Jacky Li
2026-08-18 22:03 ` Dave Hansen
2026-08-18 20:44 ` [RFC PATCH 3/6] physmem: Tag guest RAMBlocks with Protection Key Jacky Li
2026-08-18 20:44 ` [RFC PATCH 4/6] kvm: Lock guest RAMBlocks via PKRU during host userspace execution Jacky Li
2026-08-18 20:44 ` [RFC PATCH 5/6] x86: Add xstate parsing and PKRU offset detection Jacky Li
2026-08-18 20:44 ` [RFC PATCH 6/6] kvm: Implement SIGSEGV sentinel for Pkey recovery Jacky Li
2026-08-18 21:55 ` Dave Hansen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b360f0c6-b4fb-4e32-ad75-1b50a8c8a0ad@intel.com \
--to=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=jackmanb@google.com \
--cc=jackyli@google.com \
--cc=jthoughton@google.com \
--cc=kvm@vger.kernel.org \
--cc=mizhang@google.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=philmd@mailo.com \
--cc=qemu-devel@nongnu.org \
--cc=reijiw@google.com \
--cc=richard.henderson@linaro.org \
--cc=zhao1.liu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox