Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp14603ybx; Mon, 4 Nov 2019 15:01:27 -0800 (PST) X-Google-Smtp-Source: APXvYqyPnagQae36GqNmzO/5ickOj7bdBzsicePISGcsFgMz6rvdfWkAuYwDVCyEvGbPl/gWLj8c X-Received: by 2002:a50:cb8a:: with SMTP id k10mr28261731edi.21.1572908487131; Mon, 04 Nov 2019 15:01:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572908487; cv=none; d=google.com; s=arc-20160816; b=HUeu7uW3cWMSND/6VoTcWuqdGH9lPMJc+I9Mv2ueEV0eX91LFE+3if9hp+ZzgZARCJ LjjCjAhslP3aJwNweRHp88mBjnuxiaUXvclswgpd8QuuqRzImxTFY1UtvG6okUrgCAtT P1c5StwvjmnIBS0wT5XAUOuUyBRKNOu89ZDW6HtnqMT1Pg8vkIFduqD47oP2mjatUZX4 NGrhf0qgtFSDlxzBHadL6Xz8CvAarX09vcrT6P3eQU/toytzswM2Nsm6YP11OScn3sy3 4TNRjOyAU6nI92JTTBLii5S9nGsewUiOfC7PI5nij9NnbFt8wTOPnfWkDaikT+Pzdu9E GrRg== 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 :dkim-signature; bh=klZ1JFI1Q4aKLy/d85vcSQeQR1jyESDD5tgAOAEg+nk=; b=05woreMzGKm47zlqgA2AbF06Geqro1fvxe85U7NM3e+ZNdjaHr7WAmhgkPj+pAF05w WSXyERTK954COl5HkSNdrN36K2TWmWjdTuWl97JNyobM+xp2EnLGi31XzY1STbWhjqrv 6PPceI2FcJatZwcCRdjga6rAzMEpKoaCxm5pT6RaK82kHvG9S2JX82z1QaoNbp5BwUt5 +bwrkqM44XGwA+S9xeGD/+SBLGCzlo/gApHUaXHswO79sJR1N3dXt/QUoiMvVoQ9NeT5 4VWRpPBfuK1+THy4I7FwCDd0xeNlrkVCO/Tqs1AVi3VKfXEjwqouvKJN9wPLLfEQ7Zu+ VAAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CtPfjDXn; 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=pass (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 p57si7571097edc.295.2019.11.04.15.00.54; Mon, 04 Nov 2019 15:01:27 -0800 (PST) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CtPfjDXn; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730011AbfKDXAM (ORCPT + 99 others); Mon, 4 Nov 2019 18:00:12 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:30185 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729877AbfKDXAL (ORCPT ); Mon, 4 Nov 2019 18:00:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572908410; 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=klZ1JFI1Q4aKLy/d85vcSQeQR1jyESDD5tgAOAEg+nk=; b=CtPfjDXnMstSbUPn260N1AEwt48UcWU0+IBlUVVeQK2Wg6R+MnjSkn4q7AV+sAEt12nM4T FJI1FMslRzNHQg8qED3lL57Adz96h+EQx+glyyk1gjFGTNJ9RzgjI+n4An/USQ2WLEplRv q9uAJZozzGYqWUjuHS4rsKYzln6qppQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-4-I1We5Z-7MSO-xcxC5jZicg-1; Mon, 04 Nov 2019 18:00:06 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 41F7D8017DD; Mon, 4 Nov 2019 23:00:05 +0000 (UTC) Received: from mail (ovpn-121-157.rdu2.redhat.com [10.10.121.157]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CED3760BF3; Mon, 4 Nov 2019 23:00:02 +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/13] KVM: monolithic: x86: handle the request_immediate_exit variation Date: Mon, 4 Nov 2019 17:59:52 -0500 Message-Id: <20191104230001.27774-5-aarcange@redhat.com> In-Reply-To: <20191104230001.27774-1-aarcange@redhat.com> References: <20191104230001.27774-1-aarcange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: I1We5Z-7MSO-xcxC5jZicg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable 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 1a58ae38c8f2..9c5f0c67b899 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -7103,7 +7103,10 @@ void kvm_x86_set_supported_cpuid(u32 func, struct kv= m_cpuid_entry2 *entry) =20 void kvm_x86_request_immediate_exit(struct kvm_vcpu *vcpu) { -=09to_vmx(vcpu)->req_immediate_exit =3D true; +=09if (likely(enable_preemption_timer)) +=09=09to_vmx(vcpu)->req_immediate_exit =3D true; +=09else +=09=09__kvm_request_immediate_exit(vcpu); } =20 int kvm_x86_check_intercept(struct kvm_vcpu *vcpu,