Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp2447024ybj; Mon, 23 Sep 2019 04:05:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQXsIfo0lOb8b7mWEa0ONRPhQhacYEKaUSyd//I6HN1J507H+H1bKfUGTua9sSYkb+kk/o X-Received: by 2002:aa7:cb46:: with SMTP id w6mr37803577edt.238.1569236742073; Mon, 23 Sep 2019 04:05:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569236742; cv=none; d=google.com; s=arc-20160816; b=xsRUWOJCe8z2EARC/qkxnTeEwGEfaaTG0dImY1l94FFer+V2OzAvSOV1bFPdY4Hv+V ukcFg04dhmhFKm9UgHtI18piSnqwnXo29eh3YjIe159ipXZjGOb0TBuBJlS4Xx6D1oFy KPI0ViHPC+1iX1yPAMjjZlC/C2wx7YEcVtwr1fnzetXlmqzxRqB/Zqa96YyiEhYWiMl8 1jXQ/hNNd8R4QvYZRMJkY5Wb1IY5VTwkMMOAR8L/7t1lfFgmCBBbK6mv8uScsa1H2FqX FyOiYve9Me+c/mLWBYhXhD7j4fuI5AeqZ/oh+hw4Mu2LQUHAnvkSk5m4NbjyACOOm05Z n/fQ== 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=6UAMst5qZ9vzoVoNNUHkGiKgFyEWCIXmip70O87feTE=; b=nyB/rSWVYHE+yhVObdO7DJ66htnzylCA5JZ3zqi5PU2E7ohI/0CRVjiolx4puiAfjv 89i05d9+dW3yIqwr1mHi7DuO7FrrRYIrkkgmjv5JkNu7C60S/4IwKZeTuXIBqqvEBm4o S/5nBRiFR0oXymQhsxLpqb0bce2YVTsnF/eyLtJhKoTkKHhcsdo1rjn2axNSP08F5r+O M2wMxnklOZF8XT+SyrdxqF7LrRnOc+lqQXRnNKBfeE7RDu0Em93OhIYX0DPKbo41J+I6 xlRBT6tuh/OU5no+2e2ydRV5UDaU1OZ/2rbDnqQd7p5C7dlEbFNw6IglfOxL2rLjlHct 3Odw== 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 z2si6609674edd.390.2019.09.23.04.05.18; Mon, 23 Sep 2019 04:05:42 -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 S1730172AbfITVZM (ORCPT + 99 others); Fri, 20 Sep 2019 17:25:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51034 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730149AbfITVZM (ORCPT ); Fri, 20 Sep 2019 17:25:12 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 80A1C18C4270; Fri, 20 Sep 2019 21:25:12 +0000 (UTC) Received: from mail (ovpn-120-159.rdu2.redhat.com [10.10.120.159]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 239AA1001B2D; Fri, 20 Sep 2019 21:25:10 +0000 (UTC) From: Andrea Arcangeli To: Paolo Bonzini Cc: Vitaly Kuznetsov , "Dr. David Alan Gilbert" , Marcelo Tosatti , Peter Xu , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/17] KVM: monolithic: x86: handle the request_immediate_exit variation Date: Fri, 20 Sep 2019 17:24:55 -0400 Message-Id: <20190920212509.2578-4-aarcange@redhat.com> In-Reply-To: <20190920212509.2578-1-aarcange@redhat.com> References: <20190920212509.2578-1-aarcange@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.62]); Fri, 20 Sep 2019 21:25:12 +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_ops.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/vmx/vmx_ops.c b/arch/x86/kvm/vmx/vmx_ops.c index cdcad73935d9..25d441432901 100644 --- a/arch/x86/kvm/vmx/vmx_ops.c +++ b/arch/x86/kvm/vmx/vmx_ops.c @@ -498,7 +498,10 @@ int kvm_x86_ops_check_nested_events(struct kvm_vcpu *vcpu, bool external_intr) void kvm_x86_ops_request_immediate_exit(struct kvm_vcpu *vcpu) { - vmx_request_immediate_exit(vcpu); + if (likely(enable_preemption_timer)) + vmx_request_immediate_exit(vcpu); + else + __kvm_request_immediate_exit(vcpu); } void kvm_x86_ops_sched_in(struct kvm_vcpu *kvm, int cpu)