Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp414472ybf; Wed, 26 Feb 2020 15:41:19 -0800 (PST) X-Google-Smtp-Source: APXvYqxDkfcKEkMdCZxPRSuWlFrHoaTz/E+yHfvFA2neNzR8kTAf6jRTcA71szNpE99c9Dm2FjbN X-Received: by 2002:aca:dd05:: with SMTP id u5mr1216928oig.91.1582760478895; Wed, 26 Feb 2020 15:41:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582760478; cv=none; d=google.com; s=arc-20160816; b=Aq48sTYPwlAgwsqML/DHTACnjWh/zdQYUsCv1MmOZRsPEx/jb598kQJYJ1JMFrMeJq Ztt5F9GF54ClA+L2QuwXzDARS84JT1IURy71NLZ2l/ujHkc2rZPj8tFoTeFkqc64PI9S zqnAdu6OHEQ8BjxQlCk2KDsBZsiaBVAynUm4r4VIoKXHsSA2mFfSZtfndZOqczkRw/XC rVzVMYSpW6nZTZd87XKN+FQ7LPhHmHWcwBWFePllfK0mEwkfn7TT9BIv0YbRVPfZP6BE WhV96dlEwQXoGCqielmtWqBzTQFH5sUWm1v8xUWO39jyfIOIcQv2UvOBj284wMg5uWeV 3+LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=QCb5Nlx+PZ8sUcUQ29JhFP0X6ugBoZXyMlGsGvQaHkM=; b=W8xSoXbGUXvBOgo/pNAiE6GFHB9Ahbb5z0s7R5y4XK2SDhjImJKob7T6TtvbWtDoiX +nDWTdJily6AJ5cZrFIJxwFXOcxer3Fll2qc71MGwT9/kZ2+zm0RuQ4DdRzgsVOARONl DLjuf0tHIytfK/XC6QARiLFrDy3dIKYRG8zE1WfC2eBiG6GqNs+HDv0gQH+6uDJwwEtB sO79Flt8zrPfJETIIaW7zrekhxVGYkNXaWVpRxLR4kGFD6ESjxfEhuJKICyqI+sm9vDD Ih7AapvrkjDIFoXmQkVdL5H+GaRpn2DBkNRRNQVojFKtFDJjkAQSyN19Re0CdwnDyJZD KyIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z15si543563otm.168.2020.02.26.15.41.06; Wed, 26 Feb 2020 15:41:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728003AbgBZXkc (ORCPT + 99 others); Wed, 26 Feb 2020 18:40:32 -0500 Received: from mga17.intel.com ([192.55.52.151]:38495 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727935AbgBZXkb (ORCPT ); Wed, 26 Feb 2020 18:40:31 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Feb 2020 15:40:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,489,1574150400"; d="scan'208";a="350513012" Received: from jekeller-mobl1.amr.corp.intel.com (HELO [134.134.177.84]) ([134.134.177.84]) by fmsmga001.fm.intel.com with ESMTP; 26 Feb 2020 15:40:30 -0800 Subject: Re: [PATCH] x86/pkeys: Manually set X86_FEATURE_OSPKE to preserve existing changes To: Dave Hansen , Sean Christopherson , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org Cc: "H. Peter Anvin" , linux-kernel@vger.kernel.org, Dave Hansen References: <20200226231615.13664-1-sean.j.christopherson@intel.com> <950b249a-f47d-0adc-80dd-68d397e4de4f@intel.com> From: Jacob Keller Organization: Intel Corporation Message-ID: <3d869bdf-5ca7-d2ea-cc85-eb461b37b207@intel.com> Date: Wed, 26 Feb 2020 15:40:30 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <950b249a-f47d-0adc-80dd-68d397e4de4f@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/26/2020 3:32 PM, Dave Hansen wrote: > On 2/26/20 3:16 PM, Sean Christopherson wrote: >> Explicitly set X86_FEATURE_OSPKE via set_cpu_cap() instead of calling >> get_cpu_cap() to pull the feature bit from CPUID after enabling CR4.PKE. > > First of all, > > Acked-by: Dave Hansen > > I don't remember whether it was you or someone else inside Intel, but > someone was tripping over this recently. > > I do think we need a bit more care in how we deal with dynamic CPUID > bits. I think you'd agree that it's a bit haphazard. For instance, I > went looking for where we set X86_FEATURE_OSXSAVE after the > > cr4_set_bits(X86_CR4_OSXSAVE); > > inside fpu__init_cpu_xstate() makes it appear. I couldn't find one, not > that we would notice since we suppress it from /proc/cpuinfo. > I tripped over it. It's possible someone else has as well, but I haven't heard from anyone else. Thanks, Jake