Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1588098ybt; Thu, 9 Jul 2020 10:24:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXh8pdV1cH+UgK9aAhwfiIlbYPEpOEFI92AHSYmCxcn7FD15tJeuv70kYZX+8Vb2Isje80 X-Received: by 2002:a50:9a62:: with SMTP id o89mr65076387edb.54.1594315449129; Thu, 09 Jul 2020 10:24:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594315449; cv=none; d=google.com; s=arc-20160816; b=uEViUkNGMM2U7SHw6/v8EDTisSLvHb/M8uJlaJrtJBrcSs1C3wR+d02f2c2mxznPEW vPM1Pq7F6HVLk20Gt5Uk0fWwGI8JDelh6xeSmdTLoJF+Fa3ditIqp5QeGHFg6glyO14b unk+dvVw5qQaEljdVsaxDSDkO4ncoRvQgOOTry/imOSYCoX49PgfsUdUK/GogsKBeV1O AilPb8+pUhR8IBZnAgix83xwiLvrVLM5HenyrUUa8p//Ik/rMgMu/SCVivgLX0hwJAi9 kjoZKCEm+Us5GWjiyQy7k/+K4OdphvNcWw67yB/G79D9ock2srhMBwE3U3NUzljAfCXx s6GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=QfbeKlIO0rvmOmH/fXg5wm5BC2aAKsXNn27bZMELkkA=; b=cTNacCVVoc67iwH9z3GhtwqimysE6g65/JE1/oA+UMx0ke/08vRG0Kiknud9pMSoVt 0IWAe8nDCZImoo+bQgtK4LbvCIN88f+52qlLf39ZIStV7tT4FlKmP+tWYR8blYME7zWz /Gtolw7wo7AuUish2iVRy48GkjtYARzetQF0aRQEdVOi+aKpcdk2UuPprjutgoX5RdyW aPpN9zYUUVhzb0Q+hfxswyp6Wqh8S+UvDbz2pjSKgHdfVc/ObEHn7FHqR9R3mfVhVuKe 2YuG/Ni1vSQeGyXHH2rVSSuGuhCRC7h+mS52fuRHl9Sh+k9HSa7kNesoHo3LLDHqIWJW 575g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=GWkyDewu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gj23si2478299ejb.21.2020.07.09.10.23.46; Thu, 09 Jul 2020 10:24:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=GWkyDewu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727768AbgGIRXf (ORCPT + 99 others); Thu, 9 Jul 2020 13:23:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727003AbgGIRXe (ORCPT ); Thu, 9 Jul 2020 13:23:34 -0400 Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66B62C08C5DC for ; Thu, 9 Jul 2020 10:23:34 -0700 (PDT) Received: by mail-il1-x144.google.com with SMTP id e18so2684570ilr.7 for ; Thu, 09 Jul 2020 10:23:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QfbeKlIO0rvmOmH/fXg5wm5BC2aAKsXNn27bZMELkkA=; b=GWkyDewuHzKA6IQtYRZQUeIzpZj+ZYxSI0F9LmC/PLWYgpBkO48MXGFg9nUoAhQ+HE lbVLBP1zDndsm/GU4u8AnwOO4A0FDbAGqJBRuZPNqXGY05ivRZ9Kk1YTTUtnPMJJWt38 4avyd4g6Pp+Z3U1xBwmEz1bTTp1Gfy8s86LnXvR4Hxp/HlSjLpg/sJa/yziKWDT6EMdU qjJvc48zjau7NB7HLZbiGDp/ZNZGn7foAYWVkA+kMfVTHetM9Isf1+2ZHNupi4kkkK2E CiCgKcROUwb5G5PDtlBGKtgqbS3j9wc0OIhEa/zmgNkXSGJCFODMLImqOGeX69nNY4Kc aecA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QfbeKlIO0rvmOmH/fXg5wm5BC2aAKsXNn27bZMELkkA=; b=NyMFTmTlyg56tOsNQ8+xeP88a9RN9/YJr/h8AEyYcn+ivp2spxqOUuiQOJOImD34al /DSr6W+znZuJBym+LLMJppVnIpP5roJWShAMdUZNKj4wkVkAnvVhkzpOstOrk81J61kt Lt1Od2T/B4OEcvx9hdHwMcT3SB40NXai/DEU082i+gkBMIyqAG8C2SltoxZXW1GJXl2b gfJib+5gbaVyqKa/K0SFS2fWg61p+jmFg9w5mWsUksyRkWRI+Jnhsu07qAkMpQ/rK/41 82MLqQryuUkI1dtby5qLrjkeClc1BycN1Fdr1URGd3p0UUgtPxv4rJPvAnZpJbYBt9ha lC6Q== X-Gm-Message-State: AOAM530H9xEFJNFteDbH2ejutLniqK9vJECw/GK9Y0xdifNBGBizNYBr RhDa8xagRk+TCsZUuX6qlZH8toKrMto/pAGp4iXbwQ== X-Received: by 2002:a92:c989:: with SMTP id y9mr38849091iln.108.1594315413474; Thu, 09 Jul 2020 10:23:33 -0700 (PDT) MIME-Version: 1.0 References: <20200709171507.1819-1-pbonzini@redhat.com> In-Reply-To: <20200709171507.1819-1-pbonzini@redhat.com> From: Jim Mattson Date: Thu, 9 Jul 2020 10:23:22 -0700 Message-ID: Subject: Re: [PATCH] KVM: nVMX: fixes for preemption timer migration To: Paolo Bonzini Cc: LKML , kvm list , Bandan Das , Makarand Sonare Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 9, 2020 at 10:15 AM Paolo Bonzini wrote: > > Commit 850448f35aaf ("KVM: nVMX: Fix VMX preemption timer migration", > 2020-06-01) accidentally broke nVMX live migration from older version > by changing the userspace ABI. Restore it and, while at it, ensure > that vmx->nested.has_preemption_timer_deadline is always initialized > according to the KVM_STATE_VMX_PREEMPTION_TIMER_DEADLINE flag. > > Cc: Makarand Sonare > Fixes: 850448f35aaf ("KVM: nVMX: Fix VMX preemption timer migration") > Signed-off-by: Paolo Bonzini > --- > arch/x86/include/uapi/asm/kvm.h | 5 +++-- > arch/x86/kvm/vmx/nested.c | 3 ++- > 2 files changed, 5 insertions(+), 3 deletions(-) > > diff --git a/arch/x86/include/uapi/asm/kvm.h b/arch/x86/include/uapi/asm/kvm.h > index 17c5a038f42d..0780f97c1850 100644 > --- a/arch/x86/include/uapi/asm/kvm.h > +++ b/arch/x86/include/uapi/asm/kvm.h > @@ -408,14 +408,15 @@ struct kvm_vmx_nested_state_data { > }; > > struct kvm_vmx_nested_state_hdr { > - __u32 flags; > __u64 vmxon_pa; > __u64 vmcs12_pa; > - __u64 preemption_timer_deadline; > > struct { > __u16 flags; > } smm; > + > + __u32 flags; > + __u64 preemption_timer_deadline; > }; > > struct kvm_svm_nested_state_data { > diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c > index b26655104d4a..3fc2411edc92 100644 > --- a/arch/x86/kvm/vmx/nested.c > +++ b/arch/x86/kvm/vmx/nested.c > @@ -6180,7 +6180,8 @@ static int vmx_set_nested_state(struct kvm_vcpu *vcpu, > vmx->nested.has_preemption_timer_deadline = true; > vmx->nested.preemption_timer_deadline = > kvm_state->hdr.vmx.preemption_timer_deadline; > - } > + } else > + vmx->nested.has_preemption_timer_deadline = false; Doesn't the coding standard require braces around the else clause? Reviewed-by: Jim Mattson