Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1006931pxb; Tue, 9 Nov 2021 03:43:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwSBnuRAOhE1vK6asJxg3AFphR7KhKkkrrVFlOa14S6PgDQ9bIQjbBFvxU07LoVYVm7VlDl X-Received: by 2002:a05:6638:1346:: with SMTP id u6mr5105429jad.126.1636458190303; Tue, 09 Nov 2021 03:43:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636458190; cv=none; d=google.com; s=arc-20160816; b=dZWPOq+tNSRaq4NxaecKPmhhrhkfTcvL28Ik7lNAG7xbO9bVXTf0X3o+bS5BsDyivn f+L1yZEkB5N7hWvPL7kp1RNM6RBpqY/KhoqA29xc9cKnQpOv0NuQpWUqQXymKM4bzUlm //9bjSzSmOT4/hZppoCtGDo2SW19kaUJlqOCap7oFvUEBMkPN7a9jCo7b03nYzD28rrt sxPPIM85BYVc1qR3VQ5Ls7FC3xSIzFqrYB4mAb51zASfCuN0uBIPGXa7yDaLEpmqHtd3 pRnoo/ui8g6uy6dcspje5SeD5+AQngr8ldCf/uG2J9Q7SDL4ugsTBQyfpEztNh61wYNy K6uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=1+K2DVKOFTv6zJj3P2tlCMYZGpaMiCNTrYZWnpyj3TU=; b=PaHS13T8+z6SmcZIJ0ghD4mbUYcn9t4GjH74UQGueV70WzNMKkG3aGK733zMr/KM+0 3XKQiIdIEYTszX5QyaU+oKohISASXvGXYpjQ5cd+MfbKJ1mbPO71ll9hYeZxNJHgM6EX 8VqxiPnrvVEnv+n5102stOdqrieM3qHeKX9N2sSK05TMc5vqnCFyiWyD5915WbDt4PdF 3cy8yO4UJswaUR9FGzPDpM0ak2C/k+zX89/JuwLKMXyS5c/ucz9AnWp+Nnu7Ki1TjEV3 l6kiT6cwH8BRzjuEKCz7FkvfSROpXssyum6eIXyHs+Btd7xazXsB74damB9syLmX4+TO tdwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=YpViJGhR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g9si43434110iow.41.2021.11.09.03.42.53; Tue, 09 Nov 2021 03:43:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=YpViJGhR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229879AbhKIBvD (ORCPT + 99 others); Mon, 8 Nov 2021 20:51:03 -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-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