linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Pengfei Xu <pengfei.xu@intel.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>,
	linux-kselftest <linux-kselftest@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Heng Su <heng.su@intel.com>, Luck Tony <tony.luck@intel.com>,
	Mehta Sohil <sohil.mehta@intel.com>,
	Chen Yu C <yu.c.chen@intel.com>,
	Andy Lutomirski <luto@kernel.org>
Subject: Re: [RFC PATCH v5 1/2] selftests/x86: add xsave test during and after signal handling
Date: Fri, 10 Dec 2021 08:48:08 -0800	[thread overview]
Message-ID: <a271fd86-c618-ced1-e848-c0649b003a16@intel.com> (raw)
In-Reply-To: <YbLb4k3KKYD2TE/6@xpf.sh.intel.com>

On 12/9/21 8:47 PM, Pengfei Xu wrote:
> How about the following changes:
> Will remove set_avx2_ymm() and will only check XSAVE_MASK_FP, XSAVE_MASK_OPMASK
> and XSAVE_MASK_PKRU xstates after signal handling and process switch,

First and foremost, the whole point of these tests is to ensure that the
kernel is properly maintaining register state.  Removing registers from
the test moves *away* from the primary goal of this test.

Second, you just listed three states there.  Have you considered looking
at whether those have the same problem as the XMM/YMM registers?  Please do.

Third (and I've also suggested this before), we should explicitly tell
the compiler not to use the FPU registers.  This is what the kernel
does, and it's what allows us to, for instance, make function calls in
the kernel without clobbering userspace content in XSAVE-managed registers.

If we did that, then we would only have to worry about calls to things
*outside* of the test program, like libc.

  reply	other threads:[~2021-12-10 16:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-03  7:32 [RFC PATCH v5 0/2] Introduce XSAVE feature self-test Pengfei Xu
2021-12-03  7:32 ` [RFC PATCH v5 1/2] selftests/x86: add xsave test during and after signal handling Pengfei Xu
2021-12-09 18:22   ` Dave Hansen
2021-12-10  4:47     ` Pengfei Xu
2021-12-10 16:48       ` Dave Hansen [this message]
2021-12-11  8:02         ` Pengfei Xu
2021-12-13  4:19           ` Pengfei Xu
2021-12-03  7:32 ` [RFC PATCH v5 2/2] selftests/x86: add xsave test after process switch Pengfei Xu

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=a271fd86-c618-ced1-e848-c0649b003a16@intel.com \
    --to=dave.hansen@intel.com \
    --cc=heng.su@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=pengfei.xu@intel.com \
    --cc=skhan@linuxfoundation.org \
    --cc=sohil.mehta@intel.com \
    --cc=tony.luck@intel.com \
    --cc=yu.c.chen@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;
as well as URLs for NNTP newsgroup(s).