Message ID | 20240110012705.506918-1-seanjc@google.com |
---|---|
Headers |
Return-Path: <linux-kernel+bounces-21626-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2411:b0:101:2151:f287 with SMTP id m17csp516842dyi; Tue, 9 Jan 2024 17:28:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+/FgPFy8BayRS5ewOL9OL5p371VRbSCMmtFIPRwRCXuSqiThaGC6WXmpP4/ARdwdDLqdL X-Received: by 2002:a05:620a:678:b0:783:2432:5cd2 with SMTP id a24-20020a05620a067800b0078324325cd2mr312569qkh.122.1704850080302; Tue, 09 Jan 2024 17:28:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704850080; cv=none; d=google.com; s=arc-20160816; b=mVMs9OULaxiRV3E13pO2p5+TgeTFHj3VBxSJuemLQ4TtaJZrFS55nAHiAiQSJGi8Ob I0JzhQ37UHoXe8Xw6z7C87TsimVU8EplDU26vyBvf2+4GaOve5/g2RIko1D6LgkWkQZ9 BwshdovCRGnKnQtwjsdgWpYZ/FEGbzmEbvI1GnWTT2KlwV2dB6idHQ5CIe9M6zlJ4X/I wq+AhK95OxND1E5cogC8ls5qcPYu+J9E4Y8OPQCG1zk1hUIokID/iRwPiLLQRovIg5yC j6Mtu+HUn7XQa1MAIO7Z/Onwatvmm5OeSLqJtIC5T6xI4+UwQrlKlTOBHy0ScTc4DboA MFAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:reply-to:dkim-signature; bh=h6w363icKNKqhEvrbPXdZyhOPYeC1XcMC/VyRfjkT0w=; fh=5gy8eLL9j0mBq5w7XH+Mzaa/H0RFuTaOFYvX0+V/1sM=; b=ARvSOGLav8vVVnQXZZVsXrq3JIQhn9Bz34jkl/CDKedlUFSLiAOwFjWP1ehm2eFDqE XqFAhRp3lrgIOr4iFjG8eEd1Qx1s6bImw48XgFHrcfnlvf9AWaNV/1LpJGzT7MX7Fc19 +btowRZDPJ2ExEsJywHSY5tci/CAYX9q6qd55SdGlfadM0ruNx52bAOB2yMIZSeyL2OB Hke62x4pF5VJ56/8qP1ltDKu2sh2qrcWJMidacFmlRXHkc2fuLi/KG71/gdE0ThwwPuJ y1uRR70p+Q/Goso94yu8vq6VGwUew0uLA4JshVaAyrKfzj3NfZjEAbVenGwSR3eetwNX KHHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Xzu5YXqt; spf=pass (google.com: domain of linux-kernel+bounces-21626-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21626-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id v8-20020a05620a0a8800b00783223599f2si3204887qkg.133.2024.01.09.17.28.00 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 17:28:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21626-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Xzu5YXqt; spf=pass (google.com: domain of linux-kernel+bounces-21626-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21626-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 03CA91C25281 for <ouuuleilei@gmail.com>; Wed, 10 Jan 2024 01:28:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8B734613D; Wed, 10 Jan 2024 01:27:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Xzu5YXqt" Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 78E8828EA for <linux-kernel@vger.kernel.org>; Wed, 10 Jan 2024 01:27:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-1d4966f020dso21000295ad.0 for <linux-kernel@vger.kernel.org>; Tue, 09 Jan 2024 17:27:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1704850028; x=1705454828; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:reply-to:from:to:cc :subject:date:message-id:reply-to; bh=h6w363icKNKqhEvrbPXdZyhOPYeC1XcMC/VyRfjkT0w=; b=Xzu5YXqt4hwzHeuanO6gNOdRAtU407RXVA/KCoapNa45RRXH2lFTuyLnc+q2mUYblh Vyj1dE5go+/m9I7I6LuX1qtkQ5i/VlujjEvZjsz4hKqo5garLoX1rHlGZHVVLKkgGH4Q 8n6DUC36xw3u7j+EiLtSfRJkA9raOF4XYdtSHVdciWxAlLVP9R+YLtsrKw7RvHM3HIJO GYSMx242P2kSeaYnVTv6Gogo+mTko6T+NiejsD32qWcWj9AzYUgDmTbs4Q2UxBOigmka 9b5Bdp2T0QD3/dtLSHObZ55W9Uptn0oqutoWq8317W22FXhEyH803vGOS9gW8V9vZ050 M/Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704850028; x=1705454828; h=cc:to:from:subject:message-id:mime-version:date:reply-to :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=h6w363icKNKqhEvrbPXdZyhOPYeC1XcMC/VyRfjkT0w=; b=UhD7w9aMPtLLO/N/9rGzL+sXPct7lT75PJB7ao4VpDQqeakRdPFiowTS8yuBgE0ut1 +A6K5TDgcpyKM0lHL46j5MHWhKbkf4SD+jUAsxbw98YcG76yl+D/ONGwrrF8W5I1++D6 xZtUdUsBeUv23BuwPVMQ9L8ggoEwikfGGap0JwwG6UM1ebq5/69LrKQZaXX628oM5JOH xWvbBKqjZKz7U90AEWss9qqdixBuENY22rZf0481PxbMX/vypV+Qi8+HDusKnRVNKWKJ kmWfJKqEnaRJE+LUlug2YBaKe3FAit+d8UpuarMFMwDaZNxdWNvj96fE/QGSvYf/6SXQ HTgQ== X-Gm-Message-State: AOJu0YzHOZ7AHGWY2cqczuJsrI1F801nnP21X2RYKHguuZZYtcW8W5lQ Wp5PeRx+Bb5Ngn5k98cdOOdax4R99UtILEayng== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:903:245:b0:1d4:ca30:874d with SMTP id j5-20020a170903024500b001d4ca30874dmr1365plh.9.1704850027825; Tue, 09 Jan 2024 17:27:07 -0800 (PST) Reply-To: Sean Christopherson <seanjc@google.com> Date: Tue, 9 Jan 2024 17:26:59 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> Mime-Version: 1.0 X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog Message-ID: <20240110012705.506918-1-seanjc@google.com> Subject: [PATCH 0/6] KVM: x86: Clean up "force immediate exit" code From: Sean Christopherson <seanjc@google.com> To: Sean Christopherson <seanjc@google.com>, Paolo Bonzini <pbonzini@redhat.com> Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Maxim Levitsky <mlevitsk@redhat.com> Content-Type: text/plain; charset="UTF-8" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787664878280554085 X-GMAIL-MSGID: 1787664878280554085 |
Series |
KVM: x86: Clean up "force immediate exit" code
|
|
Message
Sean Christopherson
Jan. 10, 2024, 1:26 a.m. UTC
Plumb "force_immediate_exit" into the kvm_entry() tracepoint, as suggested by Maxim, and then follow that up with cleanups that are made possible by having force_immediate_exit made available to .vcpu_run(), e.g. VMX can use the on-stack param instead of what is effectively a temporary field in vcpu_vmx. Sean Christopherson (6): KVM: x86: Plumb "force_immediate_exit" into kvm_entry() tracepoint KVM: VMX: Re-enter guest in fastpath for "spurious" preemption timer exits KVM: VMX: Handle forced exit due to preemption timer in fastpath KVM: x86: Move handling of is_guest_mode() into fastpath exit handlers KVM: VMX: Handle KVM-induced preemption timer exits in fastpath for L2 KVM: x86: Fully defer to vendor code to decide how to force immediate exit arch/x86/include/asm/kvm-x86-ops.h | 1 - arch/x86/include/asm/kvm_host.h | 6 +-- arch/x86/kvm/svm/svm.c | 18 ++++--- arch/x86/kvm/trace.h | 9 ++-- arch/x86/kvm/vmx/vmx.c | 80 +++++++++++++++++++----------- arch/x86/kvm/vmx/vmx.h | 2 - arch/x86/kvm/x86.c | 12 +---- 7 files changed, 72 insertions(+), 56 deletions(-) base-commit: 1c6d984f523f67ecfad1083bb04c55d91977bb15
Comments
On Tue, 09 Jan 2024 17:26:59 -0800, Sean Christopherson wrote: > Plumb "force_immediate_exit" into the kvm_entry() tracepoint, as > suggested by Maxim, and then follow that up with cleanups that are made > possible by having force_immediate_exit made available to .vcpu_run(), > e.g. VMX can use the on-stack param instead of what is effectively a > temporary field in vcpu_vmx. > > Sean Christopherson (6): > KVM: x86: Plumb "force_immediate_exit" into kvm_entry() tracepoint > KVM: VMX: Re-enter guest in fastpath for "spurious" preemption timer > exits > KVM: VMX: Handle forced exit due to preemption timer in fastpath > KVM: x86: Move handling of is_guest_mode() into fastpath exit handlers > KVM: VMX: Handle KVM-induced preemption timer exits in fastpath for L2 > KVM: x86: Fully defer to vendor code to decide how to force immediate > exit > > [...] Applied to kvm-x86 misc, thanks! [1/6] KVM: x86: Plumb "force_immediate_exit" into kvm_entry() tracepoint https://github.com/kvm-x86/linux/commit/9c9025ea003a [2/6] KVM: VMX: Re-enter guest in fastpath for "spurious" preemption timer exits https://github.com/kvm-x86/linux/commit/e6b5d16bbd2d [3/6] KVM: VMX: Handle forced exit due to preemption timer in fastpath https://github.com/kvm-x86/linux/commit/11776aa0cfa7 [4/6] KVM: x86: Move handling of is_guest_mode() into fastpath exit handlers https://github.com/kvm-x86/linux/commit/bf1a49436ea3 [5/6] KVM: VMX: Handle KVM-induced preemption timer exits in fastpath for L2 https://github.com/kvm-x86/linux/commit/7b3d1bbf8d68 [6/6] KVM: x86: Fully defer to vendor code to decide how to force immediate exit https://github.com/kvm-x86/linux/commit/0ec3d6d1f169 -- https://github.com/kvm-x86/linux/tree/next