Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1590422ybt; Thu, 9 Jul 2020 10:27:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzL89TBra/In0KGElzD+l9sgXdMSH/bUGLANBOALASioy86mwwN7bzDdcASqRNYmlGoBQvd X-Received: by 2002:aa7:c442:: with SMTP id n2mr62470892edr.309.1594315631474; Thu, 09 Jul 2020 10:27:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594315631; cv=none; d=google.com; s=arc-20160816; b=fSE051viAC5ah1sW+wh8KJLjmeTzn46M8Pe3va/j9pBelqtlqipy4God6nD61vpZFj KKLlL6I0me0/X6ybeutfQp0bcT8jWhl8HurrE+0qmUbFgYe1e1Nr+cDDO0K9IAYMARZS s93UExkjQUyI+F7F1rDINkNm+tFbSfedYBhFHnOijQ0MfDGlTPdTl0yKtMTW0PSm3G95 EgjXQfiqE84S0z27m+/fh735Zu6LtNMGncdInE9BBk7yvP7ssNRqZ95mw/OR6MYGQb0u GzJ6s3OrN5h12lOUNYgHv4dPLKFmvYO/Us4B0Rc05cALyDHKPyQFt5mYWKbhQeCdOg71 Hvfg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=uFc/trZcRn6id+2Jodje/4+rCQG3ueaY+h99MJwSJZU=; b=DXwrs8vWQIK20c33dYRza5vubeJYkiP3mA5x/EbBU3HZLG/Lb/ESQjph9RtPx4Osrn KGoJdjh2aTlIrRBtpDLfPTA0/GMz6kFkZG3zC26YGUBwgesnzfseWnu9455vYnAXhuLC 4RkDGMDoETpwDvHqLVztcghgRYmBkstdYPU/HM9x8ogdXyoC7idMIeGe+EelRz+WjZyP GDU38MDZD40s4o/7uNy0+foOrO4oEMh1H39RYFXPP+uuE1ngrFfaw3+8TPAig+NSXW7N cqWpXuvgjdklV849WGcnuluhJUCTw657rt0bv9uXA/lnN4E6HESqg6epFWMu6eQGQy7o smqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jVaQKom3; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r12si2151017ejr.473.2020.07.09.10.26.47; Thu, 09 Jul 2020 10:27:11 -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=@redhat.com header.s=mimecast20190719 header.b=jVaQKom3; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728332AbgGIR0N (ORCPT + 99 others); Thu, 9 Jul 2020 13:26:13 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:40272 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727856AbgGIR0M (ORCPT ); Thu, 9 Jul 2020 13:26:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594315570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uFc/trZcRn6id+2Jodje/4+rCQG3ueaY+h99MJwSJZU=; b=jVaQKom3M1mgsz0yC/QyibWAjk84mNpyM7WovGIcOHcWi5f9XjnvQu3E+2T+CyRQKKHGKg L4jVOwjuYaKBC019plmEUJKxqLHTBceRDTqOTuIQ8jOTZ03o6wBzdqpDWPf8LRIl63ep+P htRYpYTJHPn4pIPzHfyN9cHd4ymSU5c= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-194-m9g0hj7INWaITjAPBhqS6w-1; Thu, 09 Jul 2020 13:26:09 -0400 X-MC-Unique: m9g0hj7INWaITjAPBhqS6w-1 Received: by mail-wm1-f70.google.com with SMTP id s134so2836576wme.6 for ; Thu, 09 Jul 2020 10:26:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=uFc/trZcRn6id+2Jodje/4+rCQG3ueaY+h99MJwSJZU=; b=gcLlJ0zljimU1jqkgZlcFGlSVa6g4CfVeXwxwj8QFIgq7Q9AEKO9XT2Uy83uiop8wi HiTFDhlx1CGKfI19obXI6hdSLiZCGppSV3bXjJK0l1jOBa9P6FKqiHzd73d1KFdAT4CB uBdQb/33pMvRb9O0SmOk2XAMd8SxExl8vnyxszkLtURcG5rBo+6O6k8El0Dfx1icuerg Cn5FiT03hIHndY2VLZqgLmX5hWPqaEfKp4LQOvNOA4C4jEilE0nMYvwcIrmltKGHn9nO 3yjAzL2a5EsYkMaJnht2NKMVBUloxlDTCa0ANfJrd40GB9dSPUPfNRCPLioFhLTkZrlI ZvpA== X-Gm-Message-State: AOAM533PTIXdQVx3lugY0SqAU3BQu1kuNcDQ/+lvzMosYEqXkU76+Nk9 eQ+Ya8rYKEPGxeQpw146uLg1oOOMJixdLKprTcGIQtRPY8XUsL/1rH/bmpkS54ijdMslsp7XJ6g 37F5/5kXmYLMAMPHVzJO/WI9W X-Received: by 2002:a7b:c84d:: with SMTP id c13mr1051779wml.170.1594315567632; Thu, 09 Jul 2020 10:26:07 -0700 (PDT) X-Received: by 2002:a7b:c84d:: with SMTP id c13mr1051757wml.170.1594315567351; Thu, 09 Jul 2020 10:26:07 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:9541:9439:cb0f:89c? ([2001:b07:6468:f312:9541:9439:cb0f:89c]) by smtp.gmail.com with ESMTPSA id 26sm5364447wmj.25.2020.07.09.10.26.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Jul 2020 10:26:06 -0700 (PDT) Subject: Re: [PATCH] KVM: nVMX: fixes for preemption timer migration To: Jim Mattson Cc: LKML , kvm list , Bandan Das , Makarand Sonare References: <20200709171507.1819-1-pbonzini@redhat.com> From: Paolo Bonzini Message-ID: <19db6c02-4835-55ba-410f-a85cc4875c71@redhat.com> Date: Thu, 9 Jul 2020 19:26:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/07/20 19:23, Jim Mattson wrote: > 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? Yes, indeed. Paolo > Reviewed-by: Jim Mattson >