Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp586890ybi; Fri, 7 Jun 2019 13:09:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqwMHaSAOFW47nt+eiVTO6ZF+4HB4lfNVQRD7dK0W5W6VVMzwPh7alutzchk/mWKPUl6TVJq X-Received: by 2002:a17:902:f204:: with SMTP id gn4mr39449320plb.3.1559938182784; Fri, 07 Jun 2019 13:09:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559938182; cv=none; d=google.com; s=arc-20160816; b=aejru0W7C+S60s3wGEQzN27Qm2r5AVd2+4KVrZ4J87MQJfKb1cIoTf1IDQ7+uJoIU2 ha3woDBijMTTcroT1CVN3HAx7apuVPt4AnBTIltraL+Qa1s5P9yUS0Oy+walOzjQFRJJ HM9x3lY03EwfEQ4SpKj7DASe0JujBoMdWv1aMG7Dpn1kPVduj3wzhXY8ivfGlMfSgA9R c8O1PQYbI6UDPWnRRAJ6arKJ49T2viGC/BBHaB0GznT1wmrGeJBuSGIz/f1o720x9rHU LEXZwO/weDrzBla+aupNKaycka99x9+2vUQX26GiODVGh5iu1BDwV/JTUdeO9wKIOHbv dEIg== 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:mime-version :references:in-reply-to:date:to:from:subject:message-id; bh=n/ovFP11O8q6ZHjiRlA4PMy2pv31Pw4CkyK6Pr4NpCI=; b=uq8fP0Z4KLcT5hazsdAiP6I5uyFwWngZQM8K4W9h20HJx3iegHAFUYarJOqTcbdmUq 9O4WVdQh9+O2w7RIa6WD1D8b27bcpTQEC79dJQpR6Ma+6XF7hfns5SrpqVRiLOaKMFIZ UeCZdA0v0Ur0xL+T7xM6FEiKqWxSnoJW+BThcz/Y6y4nrR/9QVIM8Baxe/zvJ0PlIbfO 6230H26/K5xVwbzsCcE3QqJkMTSG3kJ/gJZTdYl43ko9FwGvtzv3LUaKXKrRHuNf7i1c 2OZGhuSKNOfTQtNKsYrcJLUuHvMkTQY02P/FnPJ98QAlSDdPGv02WdHqdjL9q0m+Dipy Kqfg== 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 f187si2956573pfb.265.2019.06.07.13.09.26; Fri, 07 Jun 2019 13:09:42 -0700 (PDT) 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 S1730033AbfFGTbv (ORCPT + 99 others); Fri, 7 Jun 2019 15:31:51 -0400 Received: from mga12.intel.com ([192.55.52.136]:5427 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729268AbfFGTbu (ORCPT ); Fri, 7 Jun 2019 15:31:50 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jun 2019 12:31:49 -0700 X-ExtLoop1: 1 Received: from yyu32-desk1.sc.intel.com ([143.183.136.147]) by orsmga005.jf.intel.com with ESMTP; 07 Jun 2019 12:31:48 -0700 Message-ID: <997ef050c13e3654dee6a862d810cffcafce249b.camel@intel.com> Subject: Re: [PATCH v7 03/14] x86/cet/ibt: Add IBT legacy code bitmap setup function From: Yu-cheng Yu To: Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin Date: Fri, 07 Jun 2019 12:23:46 -0700 In-Reply-To: References: <20190606200926.4029-1-yu-cheng.yu@intel.com> <20190606200926.4029-4-yu-cheng.yu@intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2019-06-07 at 12:03 -0700, Dave Hansen wrote: > On 6/6/19 1:09 PM, Yu-cheng Yu wrote: > > + modify_fpu_regs_begin(); > > + rdmsrl(MSR_IA32_U_CET, r); > > + r |= (MSR_IA32_CET_LEG_IW_EN | bitmap); > > + wrmsrl(MSR_IA32_U_CET, r); > > + modify_fpu_regs_end(); > > Isn't there a bunch of other stuff in this MSR? It seems like the > bitmap value would allow overwriting lots of bits in the MSR that have > nothing to do with the bitmap... in a prctl() that's supposed to only be > dealing with the bitmap. Yes, the bitmap address should have been masked, although it is checked for page alignment (which has the same effect). I will fix it. Yu-cheng