From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from aserp2130.oracle.com ([141.146.126.79]) by Galois.linutronix.de with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fGt1O-000454-0o for speck@linutronix.de; Thu, 10 May 2018 23:22:42 +0200 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4ALLr56112111 for ; Thu, 10 May 2018 21:22:34 GMT Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2hvth992jm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 10 May 2018 21:22:34 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w4ALMYhG014241 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 10 May 2018 21:22:34 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w4ALMXUm018237 for ; Thu, 10 May 2018 21:22:33 GMT Date: Thu, 10 May 2018 17:22:32 -0400 From: Konrad Rzeszutek Wilk Subject: [MODERATED] Re: [patch V11 05/16] SSB 5 Message-ID: <20180510212232.GT27358@char.us.oracle.com> References: <20180502215102.192655950@linutronix.de> <20180502215416.459915781@linutronix.de> <20180510175257.GD13616@tassilo.jf.intel.com> <20180510183058.GJ27358@char.us.oracle.com> <20180510190850.GE13616@tassilo.jf.intel.com> MIME-Version: 1.0 In-Reply-To: <20180510190850.GE13616@tassilo.jf.intel.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: ..snip.. > > > That means only the value of the first write in the guest is saved in vmx->spec_ctrl. > > > > > > But what happens when a later write is different from the first write? > > > > This code: > > > > if (unlikely(!msr_write_intercepted(vcpu, MSR_IA32_SPEC_CTRL))) > > vmx->spec_ctrl = native_read_msr(MSR_IA32_SPEC_CTRL); > > > > Would read it on the VMEXITs. > > Thanks. I missed that. Good that it works. > > Why don't we use the msr save/restore lists for that? That would likely > be faster than a manual msr accesses. It is actually slower. I tried doing it last time with the spectre/meltdown and the performance was way slower than doing it this way. I can dig up the patches - as I think we did the tests on Broadwell but hadn't tried Skylake or such (or maybe it was the other way around). > > -Andi