Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Dave Kleikamp <dave.kleikamp@oracle.com>,
	Babu Moger <babu.moger@amd.com>,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org
Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
	x86@kernel.org, hpa@zytor.com, dave.hansen@linux.intel.com,
	luto@kernel.org, peterz@infradead.org, shuah@kernel.org,
	jroedel@suse.de, ubizjak@gmail.com, viro@zeniv.linux.org.uk,
	jpa@git.mail.kapsi.fi, fenghua.yu@intel.com,
	kan.liang@linux.intel.com, akpm@linux-foundation.org,
	rppt@kernel.org, Fan_Yang@sjtu.edu.cn, anshuman.khandual@arm.com,
	b.thiel@posteo.de, jgross@suse.com, keescook@chromium.org,
	seanjc@google.com, mh@glandium.org, sashal@kernel.org,
	krisman@collabora.com, chang.seok.bae@intel.com,
	0x7f454c46@gmail.com, jhubbard@nvidia.com,
	sandipan@linux.ibm.com, ziy@nvidia.com,
	kirill.shutemov@linux.intel.com, suxingxing@loongson.cn,
	harish@linux.ibm.com, rong.a.chen@intel.com, linuxram@us.ibm.com,
	bauerman@linux.ibm.com
Subject: Re: x86/fpu/xsave: protection key test failures
Date: Tue, 25 May 2021 15:28:56 -0700	[thread overview]
Message-ID: <c7016a57-062a-a9f6-10dc-aafd9c8eb19f@intel.com> (raw)
In-Reply-To: <18af2b84-b350-6bde-9aef-c0266d604e4a@oracle.com>

On 5/25/21 3:22 PM, Dave Kleikamp wrote:
> On 5/25/21 5:18 PM, Dave Hansen wrote:
>> What values do PKRU and the shadow have when the test fails?  Is PKRU 0?
>>   Any idea how xfeatures&0x200 got clear?
> 
> I did observe that PKRU is 0 right before the failure.
> 
> Shouldn't this still be a valid value?

It's architecturall *valid* in the hardware for sure, but nothing in the
tests or the kernel should ever set PKRU=0.  The selftest is noticing
that it ends up at a value that's entirely unexpected and properly
bugging out.

The reason I'm suspecting an XRSTOR is that the kernel always calls

	XRSTOR(RFBM=-1)

setting all of the bits in the Requested Feature BitMap (RFBM).  If
RFBM[X]=1 and XSTATE_BV[i]=0 (XSTATE_BV is 'xfeatures' in the traces),
then the state component is set to its initial configuration, which for
PKRU is 0.

That's why I'm asking how xfeatures&0x200 got clear.

  reply	other threads:[~2021-05-25 22:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-25 21:37 x86/fpu/xsave: protection key test failures Babu Moger
2021-05-25 22:18 ` Dave Hansen
2021-05-25 22:22   ` Dave Kleikamp
2021-05-25 22:28     ` Dave Hansen [this message]
2021-05-26  0:03   ` Babu Moger
2021-05-26  0:20     ` Dave Hansen
2021-05-26 15:25       ` Babu Moger
2021-05-26 15:50         ` Dave Kleikamp
2021-05-26 16:06         ` Dave Hansen
2021-05-26 17:03           ` Babu Moger
2021-05-26  0:36 ` Andy Lutomirski
2021-05-26 21:14   ` Babu Moger
2021-05-26 21:17     ` Andy Lutomirski

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=c7016a57-062a-a9f6-10dc-aafd9c8eb19f@intel.com \
    --to=dave.hansen@intel.com \
    --cc=0x7f454c46@gmail.com \
    --cc=Fan_Yang@sjtu.edu.cn \
    --cc=akpm@linux-foundation.org \
    --cc=anshuman.khandual@arm.com \
    --cc=b.thiel@posteo.de \
    --cc=babu.moger@amd.com \
    --cc=bauerman@linux.ibm.com \
    --cc=bp@alien8.de \
    --cc=chang.seok.bae@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dave.kleikamp@oracle.com \
    --cc=fenghua.yu@intel.com \
    --cc=harish@linux.ibm.com \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=jhubbard@nvidia.com \
    --cc=jpa@git.mail.kapsi.fi \
    --cc=jroedel@suse.de \
    --cc=kan.liang@linux.intel.com \
    --cc=keescook@chromium.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=krisman@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linuxram@us.ibm.com \
    --cc=luto@kernel.org \
    --cc=mh@glandium.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rong.a.chen@intel.com \
    --cc=rppt@kernel.org \
    --cc=sandipan@linux.ibm.com \
    --cc=sashal@kernel.org \
    --cc=seanjc@google.com \
    --cc=shuah@kernel.org \
    --cc=suxingxing@loongson.cn \
    --cc=tglx@linutronix.de \
    --cc=ubizjak@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=x86@kernel.org \
    --cc=ziy@nvidia.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