From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62F38C433FE for ; Tue, 9 Nov 2021 01:48:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4964D6113D for ; Tue, 9 Nov 2021 01:48:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237342AbhKIBvE (ORCPT ); Mon, 8 Nov 2021 20:51:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231229AbhKIBvC (ORCPT ); Mon, 8 Nov 2021 20:51:02 -0500 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 343C8C061570 for ; Mon, 8 Nov 2021 17:48:17 -0800 (PST) Received: by mail-ed1-x530.google.com with SMTP id g14so69512687edz.2 for ; Mon, 08 Nov 2021 17:48:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1+K2DVKOFTv6zJj3P2tlCMYZGpaMiCNTrYZWnpyj3TU=; b=YpViJGhRGGbw3HKZVVJ8dDOcx4Z22oHf96nvV3o92sw1NRcI++oIekQ+kwN8T5APNE DjnYn1Nmec1KRlhtjhq+ZBx4cjEIuuUDqzjMVedxtR8mYceY0fJ+8cmacqw8ofsFM/oj B7mJhz08GmzD3uL0VYXNKqRxw/QCrppKmUKp7vyoQkguz2hq46FVTv7Np12Yvxhm73y7 tB6MwLFHob58kaG7u+7I5EyrDM3MpFFb/3i695XCiNHlRSrPyzh/7dnJLiDkrc++fJ91 ITrjNUIfl1jxwIiOp691hm7SQx+m+KlAvAfTeSIq+n1DYoiWNwR1BZz4K3G0MoX4qxDl 87qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1+K2DVKOFTv6zJj3P2tlCMYZGpaMiCNTrYZWnpyj3TU=; b=eOmz9KR0E8F1/2yTz6y8bYDfoknJznOFMuHSW1L47vjdoUIwuBLMRR0vZ+fCn2bjMO tW0JnTRRdchIfV2g/0f/cgFpEcXBfXUB+Cfc9/v1B0reRPj4+5Abk+x4k7nU+dvdcJt1 G35Koa51VKvqi55hTKjUTz8rCql1yh+j5/VvuNl1Gcnq94Mf/4Jt5LO08ChgMmWZSSd6 vShc0QFd2eKZVHoohwszyDk9/z6tRdOuJbl7XMi2tdUbxr9crdEN4eFgreoGQ61vM45t oiZ78FqVvoF0c8M848HnHidfpvs50ejc9QQ1grhOCgQq/KtAzek3PUjyfl96DIJJUgVv oOjQ== X-Gm-Message-State: AOAM532mUA9Ji1lqB9TP+4X1F7l2AP6XbTA6y2CKzeyLQ46Orq6eaEq7 S+dmZi62b3pM+tlctChCvbuNdB5iQfrZIbeZq7W0Eg== X-Google-Smtp-Source: ABdhPJxAVjfPG+W7R04rfc5Q+ZIFbFRhqgt5yvRkS9Rx27yUWta7jbDH0JsPt6gQblJQX5hFRg753ZZ6kBp5LdaNYaA= X-Received: by 2002:a50:d984:: with SMTP id w4mr4797521edj.375.1636422495629; Mon, 08 Nov 2021 17:48:15 -0800 (PST) MIME-Version: 1.0 References: <85925a39-37c3-a79a-a084-51f2f291ca9c@intel.com> In-Reply-To: <85925a39-37c3-a79a-a084-51f2f291ca9c@intel.com> From: Brian Geffon Date: Mon, 8 Nov 2021 20:47:39 -0500 Message-ID: Subject: Re: XSAVE / RDPKRU on Intel 11th Gen Core CPUs To: Dave Hansen Cc: Thomas Gleixner , Guenter Roeck , Borislav Petkov , Andy Lutomirski , stable@vger.kernel.org, "the arch/x86 maintainers" , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > One more thing... Does the protection_keys kernel selftest hit any > errors on this same setup? It does a lot of PKRU sanity checking and > I'm a bit surprised it hasn't caught something yet. Hi Dave, This issue does reproduce with the self tests too, my simple test program also fails consistently [1], all it does is spin executing RDPKRU waiting for a context switch to clobber the value. $ ./test unexpected value on iteration 3772082 value:0x55555554 expected:0x55555550 ========================== self tests: $ ./protection_keys_64 has pkeys: 1 startup pkey_reg: 0000000055555550 WARNING: not run as root, can not do hugetlb test test 0 PASSED (iteration 1) test 1 PASSED (iteration 1) test 2 PASSED (iteration 1) test 3 PASSED (iteration 1) test 4 PASSED (iteration 1) test 5 PASSED (iteration 1) protection_keys_64: pkey-helpers.h:127: _read_pkey_reg: Assertion `pkey_reg == shadow_pkey_reg' failed. Aborted (core dumped) $ uname -a Linux localhost 5.13.0-17189-g62fb9874f5da #12 SMP PREEMPT Tue Nov 9 01:29:44 UTC 2021 x86_64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz GenuineIntel GNU/Linux Let me know if I can provide anything else, I'm happy to help troubleshoot this. Thanks, Brian 1. https://gist.github.com/bgaff/e4b5457ab1cf5126fea6327666c63441