Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1407416ybf; Thu, 27 Feb 2020 10:21:43 -0800 (PST) X-Google-Smtp-Source: APXvYqyNCjnrFZU/xR1ANvogd/ZkOKCkwIR04vH1M9J5Qcj5nNxzI3e/TY0JIJsWfzn7FrsgIcNr X-Received: by 2002:a05:6808:350:: with SMTP id j16mr254284oie.168.1582827703012; Thu, 27 Feb 2020 10:21:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582827703; cv=none; d=google.com; s=arc-20160816; b=0MD87Tt65mExeATRW/MBzpVd+ScCATtm9ghKFL4G8igDQc2WC3arEmrd0CFsyh02W/ u7s1mJfpdFSLbxBwtDYxFhM08watV7oqEtXzxzyWuQZO21HZ7b0vI3iYiTgbM/panCaD izn+vIAGeJcL8fpcHJVPyC1DT7/2xltKCoW5ts3AgDAZQtvNQIqfQCqM1NfobLEdi/TA LKZuX9oQ+xbjynkAH7bpcSU9wTv0kBA0S408kB//JT4Cuzvnex6vZn8Wnt+5GSamxnU1 p1MLSNdSRX4SuRb9U3lv8GM1c8+XCbzSoYyaF4CIIZu+0qcwGlNFs45A9iDAigmhC05d pYfA== 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=lY0BScJkPh/uS92aRaCWjJDx7QukUz25ubaxFpWqdhg=; b=gOmIlvfO6tla44B+CUpejOs/JTWgZhWaC9+KdyT6ol9G5Hmn/23tGEZa27OYs3kE82 xT6Q7S18ireUgDUEUDbPNoMuDaVFpamIZfDuMRGAxKpm/8aJt4aM3UAzDRtJXdFC5XJg mw6RuD6V278pxlmkRXhl8EfuGXLGEDpa1Rk9HUY/ninG2MSoKcIAkYc396IVQVdh+wBz +yRAZtxb9gDSDzUfjpIFRRSYk4I0PvQRRUT0/LHZOKnhtjT5rDR1xTMJt2A1lbgUxQ4w DtlJhjjB9wUpZEnwCdb3r1Y5cRm4Y98a5U+OVgXhkFs4K48tzgqNXREg4x0OxniilDYO pK9w== 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 d6si321999oic.190.2020.02.27.10.21.08; Thu, 27 Feb 2020 10:21:43 -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 S1729393AbgB0SUi (ORCPT + 99 others); Thu, 27 Feb 2020 13:20:38 -0500 Received: from mga04.intel.com ([192.55.52.120]:17243 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729142AbgB0SUi (ORCPT ); Thu, 27 Feb 2020 13:20:38 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Feb 2020 10:20:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,493,1574150400"; d="scan'208";a="437128240" Received: from unknown (HELO [134.134.177.87]) ([134.134.177.87]) by fmsmga005.fm.intel.com with ESMTP; 27 Feb 2020 10:20:37 -0800 Subject: Re: [PATCH] x86/pkeys: Manually set X86_FEATURE_OSPKE to preserve existing changes To: Borislav Petkov Cc: Sean Christopherson , Thomas Gleixner , Ingo Molnar , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, Dave Hansen References: <20200226231615.13664-1-sean.j.christopherson@intel.com> <20200227180100.GB18629@zn.tnic> From: Jacob Keller Organization: Intel Corporation Message-ID: Date: Thu, 27 Feb 2020 10:20:36 -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: <20200227180100.GB18629@zn.tnic> 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/27/2020 10:01 AM, Borislav Petkov wrote: > On Wed, Feb 26, 2020 at 04:16:13PM -0800, Jacob Keller wrote: >> I tested this and it resolves my report! Thanks for a timely fix. > > Adding your Tested-by. > Yep, thanks. >> I agree with the analysis. Perhaps it would make sense in the long term >> to find a solution where get_cpu_cap can remember what was cleared for >> each CPU and restore those? It already does this using the global >> variables... > > get_cpu_cap() remembers if you use setup_force_cpu_cap() but I agree > that that whole feature bit handling is a bit, hm, "strange". It had its > raisins. Right. Nothing quite equivalent to that for per-CPU changes though. > > FWIW, we had started cleaning those up but then the security nightmares > happened so on the backburner it went... > > Thx. > Completely understandable. Especially since changes here are tricky to get right, this being a case in point. Thanks, Jake