Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp4955901ybn; Sat, 28 Sep 2019 10:28:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxiBoAv2+v5iNvy38/aGdxECx7mwD5OVtLfPa/zQe9qrZ8bOXQOQ/MRdLU/FqRem1SMo+Qo X-Received: by 2002:a17:906:fc0c:: with SMTP id ov12mr12536507ejb.86.1569691692906; Sat, 28 Sep 2019 10:28:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569691692; cv=none; d=google.com; s=arc-20160816; b=Tcop+flf9Yf+4qd5Z6RK4K/JB8+1NoXYg0piXL7mZJFHMofqM/0vD4tlKZs3ajeXlB tGe3Y2M7EWImsxAVL/VjR5jRQx5mjad0oV5LS+8jNo+m8Yudr0WCU2EPaGhZJYJzV8Cm 2/APUQzRofEq6k21RCxNLZLEkRhV/EdQjm03E3+MLTgiv4cGGMhiqSxv9p0bKn7AF2Ji VqpeYzA8mWuqFUx1g25JPtPZrNL4IiNMTxlc5OBVzoKLQ6BVHCkYu+Sdm5sdzQKR4KyC miDwxHnbQIeHbu5yW7wFxgkn6GLhrors+sWS4r7BOfTW/19cdjy+FTX99O+rG4+cPmUy qx1A== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=BmYzsvF7rsm8KDV0FjjgA3hsD7S1Oe3uW/uUif3iCkI=; b=xTkoHKixWM24JhBSAspUt8hOtjK5LTXiAYayuKGWc3wW65gvhtiU2xnAyaXIPMobHd ATGQeObW4yjZHepUwoi4Qa59JNbUZqu4/J/YKCdCBdFO/jJuHfey52x1jg2HH6q3Gw7Y LWiX6qshkj1/n6l3nzSYHZIr/01VSvBigSiYrMG7YGlKNceUb9zL55ZYo0eSI/F7w50O nJmccRdmqnMTgFLEclj2SCXIiXbv7a28CNTqfOuWAI+BD2+C5Xyhd8+R7uPPVa5TVXh/ +ZDEWTSYO9tI0jgk96LGXtnyIEoZ8rQ/of25gKhiRs9kwQYuE8nfEChjbO+Uy2WyKIRK e8Pg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c48si3784976eda.100.2019.09.28.10.27.48; Sat, 28 Sep 2019 10:28:12 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728640AbfI1RXZ (ORCPT + 99 others); Sat, 28 Sep 2019 13:23:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54322 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726155AbfI1RXY (ORCPT ); Sat, 28 Sep 2019 13:23:24 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 84DA5C010923; Sat, 28 Sep 2019 17:23:24 +0000 (UTC) Received: from mail (ovpn-125-159.rdu2.redhat.com [10.10.125.159]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 623055C1D8; Sat, 28 Sep 2019 17:23:24 +0000 (UTC) From: Andrea Arcangeli To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Paolo Bonzini , Vitaly Kuznetsov , Sean Christopherson Subject: [PATCH 04/14] KVM: monolithic: x86: handle the request_immediate_exit variation Date: Sat, 28 Sep 2019 13:23:13 -0400 Message-Id: <20190928172323.14663-5-aarcange@redhat.com> In-Reply-To: <20190928172323.14663-1-aarcange@redhat.com> References: <20190928172323.14663-1-aarcange@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sat, 28 Sep 2019 17:23:24 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org request_immediate_exit is one of those few cases where the pointer to function of the method isn't fixed at build time and it requires special handling because hardware_setup() may override it at runtime. Signed-off-by: Andrea Arcangeli --- arch/x86/kvm/vmx/vmx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index bb122ab4b96c..aad44e62b20a 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -7022,7 +7022,10 @@ void kvm_x86_set_supported_cpuid(u32 func, struct kvm_cpuid_entry2 *entry) void kvm_x86_request_immediate_exit(struct kvm_vcpu *vcpu) { - to_vmx(vcpu)->req_immediate_exit = true; + if (likely(enable_preemption_timer)) + to_vmx(vcpu)->req_immediate_exit = true; + else + __kvm_request_immediate_exit(vcpu); } int kvm_x86_check_intercept(struct kvm_vcpu *vcpu,