Return-path: Received: from userp2120.oracle.com ([156.151.31.85]) by Galois.linutronix.de with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fJ8VO-0007RN-3s for speck@linutronix.de; Thu, 17 May 2018 04:18:58 +0200 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4H2GGJu116883 for ; Thu, 17 May 2018 02:18:51 GMT Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2hx29w78fj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 17 May 2018 02:18:51 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w4H2Iog1000379 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 17 May 2018 02:18:50 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w4H2IoxC015685 for ; Thu, 17 May 2018 02:18:50 GMT Date: Wed, 16 May 2018 22:18:49 -0400 From: Konrad Rzeszutek Wilk Subject: [MODERATED] Re: [patch 15/15] SSB updates V17 15 Message-ID: <20180517021849.GK10272@char.us.oracle.com> References: <20180516135132.687640705@linutronix.de> <20180516135210.593218929@linutronix.de> MIME-Version: 1.0 In-Reply-To: <20180516135210.593218929@linutronix.de> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: > @@ -4251,6 +4258,16 @@ static int svm_set_msr(struct kvm_vcpu * > break; > set_msr_interception(svm->msrpm, MSR_IA32_PRED_CMD, 0, 1); > break; > + case MSR_AMD64_VIRT_SPEC_CTRL: > + if (!msr->host_initiated && > + !guest_cpuid_has(vcpu, X86_FEATURE_VIRT_SSBD)) > + return 1; > + > + if (data & ~SPEC_CTRL_SSBD) > + return 1; > + > + svm->virt_spec_ctrl = data; You need to save virt_spec_ctrl content for migration purposes. It was introduced in "x86/bugs, KVM: Extend speculation control for VIRT_SPEC_CTRL" but not actually used so this patch is probably the best place to define it. That is add this MSR in the 'msrs_to_save' or perhaps 'emulated_msrs'? And naturally test if migration does work :-) > + break; > case MSR_STAR: > svm->vmcb->save.star = data; > break; >