From: Dave Hansen <dave.hansen@intel.com>
To: "Yang, Weijiang" <weijiang.yang@intel.com>,
tglx@linutronix.de, x86@kernel.org, seanjc@google.com,
pbonzini@redhat.com, linux-kernel@vger.kernel.org,
kvm@vger.kernel.org
Cc: peterz@infradead.org, chao.gao@intel.com,
rick.p.edgecombe@intel.com, mlevitsk@redhat.com,
john.allen@amd.com
Subject: Re: [PATCH 0/6] Introduce CET supervisor state support
Date: Thu, 11 Jul 2024 13:58:30 -0700 [thread overview]
Message-ID: <1c2fd06e-2e97-4724-80ab-8695aa4334e7@intel.com> (raw)
In-Reply-To: <67c5a358-0e40-4b2f-b679-33dd0dfe73fb@intel.com>
On 7/8/24 20:17, Yang, Weijiang wrote:
> So I'm not sure whether XFEATURE_MASK_KERNEL_DYNAMIC and related changes
> are worth or not for this series.
>
> Could you share your thoughts?
First of all, I really do appreciate when folks make the effort to _try_
to draw their own conclusions before asking the maintainers to share
theirs. Next time, OK? ;)
But here goes. So we've basically got three cases. Here's a fancy table:
> https://docs.google.com/spreadsheets/d/e/2PACX-1vROHIgrtHzUJmdlzT7D7tuVzgM8AMlK2XlorvFIJvk-I0NjD7A-T_qntjz7cUJlCScfWGtSfPK30Xtu/pubhtml
... and the same in ASCII
Case |IA32_XSS[12] | Space | RFBM[12] | Drop%
-----+-------------+-------+----------+------
1 | 0 | None | 0 | 0.0%
2 | 1 | None | 0 | 0.2%
3 | 1 | 24B? | 1 | 0.2%
Case 1 is the baseline of course. Case 2 avoids allocating space for
CET and also leans on the kernel to set RFBM[12]==0 and tell the
hardware not to write CET-S state. Case 3 wastes the CET-S space in
each task and also leans on the hardware init optimization to avoid
writing out CET-S space on each XSAVES.
#1 is: 0 lines of code.
#2 is: 5 files changed, 90 insertions(+), 27 deletions(-)
#3 is: very few lines of code, nearing zero
#2 and #3 have the same performance.
So we're down to choosing between
* $BYTES space in 'struct fpu' (on hardware supporting CET-S)
or
* ~100 loc
$BYTES is 24, right? Did I get anything wrong?
So, here's my stake in the ground: I think the 100 lines of code is
probably worth it. But I also hate complicating the FPU code, so I'm
also somewhat drawn to just eating the 24 bytes and moving on.
But I'm still in the "case 2" camp.
Anybody disagree?
next prev parent reply other threads:[~2024-07-11 20:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-31 9:03 Yang Weijiang
2024-05-31 9:03 ` [PATCH 1/6] x86/fpu/xstate: Always preserve non-user xfeatures/flags in __state_perm Yang Weijiang
2024-05-31 9:03 ` [PATCH 2/6] x86/fpu/xstate: Add CET supervisor mode state support Yang Weijiang
2024-05-31 9:03 ` [PATCH 3/6] x86/fpu/xstate: Introduce XFEATURE_MASK_KERNEL_DYNAMIC xfeature set Yang Weijiang
2024-05-31 9:03 ` [PATCH 4/6] x86/fpu/xstate: Introduce fpu_guest_cfg for guest FPU configuration Yang Weijiang
2024-05-31 9:03 ` [PATCH 5/6] x86/fpu/xstate: Create guest fpstate with guest specific config Yang Weijiang
2024-05-31 9:03 ` [PATCH 6/6] x86/fpu/xstate: Warn if CET supervisor state is detected in normal fpstate Yang Weijiang
2024-07-09 3:17 ` [PATCH 0/6] Introduce CET supervisor state support Yang, Weijiang
2024-07-11 20:58 ` Dave Hansen [this message]
2024-07-11 22:11 ` Edgecombe, Rick P
2024-07-11 22:30 ` Dave Hansen
2024-07-11 22:55 ` Edgecombe, Rick P
2024-07-12 14:36 ` Dave Hansen
2024-07-12 6:27 ` Yang, Weijiang
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=1c2fd06e-2e97-4724-80ab-8695aa4334e7@intel.com \
--to=dave.hansen@intel.com \
--cc=chao.gao@intel.com \
--cc=john.allen@amd.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mlevitsk@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=rick.p.edgecombe@intel.com \
--cc=seanjc@google.com \
--cc=tglx@linutronix.de \
--cc=weijiang.yang@intel.com \
--cc=x86@kernel.org \
/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
all inboxes | Powered by JetHome®