Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6776imm; Tue, 31 Jul 2018 12:46:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfo2wu0/XV/mtdvA4R0E+C6XDQ/qhaAJfHYQQXnwsH+2heam/5nK4BUKLirkP53AWQMauOB X-Received: by 2002:a17:902:4081:: with SMTP id c1-v6mr21724220pld.169.1533066410563; Tue, 31 Jul 2018 12:46:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533066410; cv=none; d=google.com; s=arc-20160816; b=MUmuQ6eCfuOJB5jhG3etEVkVLcy/tAxJI1bpQxvuwL3vKHrjIGxyvnFjxQEJ7zFeHp aszgCYrHE6B7I/8UHIiX2J8Jc4IQ9VTH6t9BxMuB0JI19QLAI5SLTozxw3qejK3Bsbuv WaUl+lsa8nIuFPrIMoP9+qKWFY64OFMoIz0UL+JMHCs1kV/PXcKRID2OA44WL2qHeIeW T4ILBjdqwhCBH1msk3lWNK8ZzlUfDAIF64mhkUbiaY3Qy3MVWeGqT9c//UuvDjbcZCTC PZUuItBAaCVNM30gFK3Oy14DqPJdZwF8XvQt5dXrHJX+6lxUGccl5OZBORBIhHxowe9s MCQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=EuHpOeMUo5DXZ6tyQ2djq28y+38zkz3hDM3lR2Hs4rE=; b=yJd7vvO8wiAiiLfk2kAj31JMiVxktDMYLpWzg1UaWYKUuiFLVi2rTaOEaLyt3HU/x5 8eyAfCThqiKvfFuqiHcH5MCQAyDK3xsOD59BAE47TalRV+KVjvrSOxxa7o6NN+ohWsnl qSK9mujwEsE/lKNkIATgEvrFK0azjMuRfMq60J5jDgiW9u8/1i/0lCC7cleN+BimEaT6 XihgqpT8zRneBl4wqln0dgbNPyzTJFRPsgJXriBSFHucfrpArfb7+7WsdcM0XwyGBW60 G6oO3QRB7ZCqxWVrw1uRX3hbLnPaJutgg7Px8jLxMiTe56yqqLzb4R3P3JkvorPR7sd9 liwQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u19-v6si13588789pgk.100.2018.07.31.12.46.29; Tue, 31 Jul 2018 12:46:50 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732384AbeGaV0R (ORCPT + 99 others); Tue, 31 Jul 2018 17:26:17 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:60359 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729924AbeGaV0Q (ORCPT ); Tue, 31 Jul 2018 17:26:16 -0400 Received: from p4fea5a5a.dip0.t-ipconnect.de ([79.234.90.90] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fkaZE-0002Wu-1k; Tue, 31 Jul 2018 21:44:24 +0200 Date: Tue, 31 Jul 2018 21:44:20 +0200 (CEST) From: Thomas Gleixner To: "Prakhya, Sai Praneeth" cc: "linux-kernel@vger.kernel.org" , "x86@kernel.org" , "Chen, Tim C" , "Hansen, Dave" , "Shankar, Ravi V" , Ingo Molnar Subject: RE: [PATCH V2] x86/speculation: Support Enhanced IBRS on future CPUs In-Reply-To: Message-ID: References: <1532978396-2197-1-git-send-email-sai.praneeth.prakhya@intel.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 31 Jul 2018, Prakhya, Sai Praneeth wrote: > > The feature strings are automatically generated from the define. The comment > > can be used to supress them by an empty "" string or to modify them by a > > "override" string at the beginning of the comment. > > I overlooked "override" part. Sorry! about that. Nothing to be sorry about. I just knew it because I stumbled over it my self quite some time ago. > > > > > + /* Ensure SPEC_CTRL_IBRS is set after VMEXIT from a guest */ > > > > > + x86_spec_ctrl_base |= SPEC_CTRL_IBRS; > > > > > > > > And what exactly writes the MSR? > > > > > > > > > > While booting, x86_spec_ctrl_setup_ap() does that and after VMEXIT > > > x86_spec_ctrl_restore_host(). > > > > > > As x86_spec_ctrl_setup_ap() does wrmsrl(MSR_IA32_SPEC_CTRL, > > > x86_spec_ctrl_base), I thought writing here would be redundant. > > > > x86_spec_ctrl_setup_ap() is only called on the AP but not on the BP. So the boot > > processor will not have it set, unless something else writes the MSR. So you > > really want to have an explicit write there. > > Yes, that makes sense. > But on the machine, I see IBRS bit set on all cores. As you said, someone else might > be writing the MSR. I will try to find that out and will update the patch accordingly. > > I initially suspected it to be __ssb_select_mitigation() as I have > "spec_store_bypass_disable=on" in the kernel command line, but turns out it's not so. > I will update you more on this. There are lots of places like the firmware mitigation stuff and other things which write that MSR. And because the bit is set in x86_spec_ctrl_base it will be on at some point and stay so. Writing it explicitely at the point where it is set makes it independent of other mechanisms which touch that MSR and Just Works. Thanks, tglx