Message ID | 20241010182427.1434605-51-seanjc@google.com (mailing list archive) |
---|---|
State | Handled Elsewhere |
Headers | show
Return-Path: <linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 27EC8CFC5FD for <linux-riscv@archiver.kernel.org>; Thu, 10 Oct 2024 19:22:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID :References:Mime-Version:In-Reply-To:Date:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AM40cmduuKQ+NYae/zEfKYDNmevDcOhMyFqI1Q/YOMQ=; b=Ptt05d/qhNmpbN C2Vvj+UMB4DEf/Qg8nnh2uWE75XCKsz8nHK05CDkJ2EX4msin9xtpfTUBgHPxawZ8tAe77I2W1yUR MlnKgVcNdUmi7srQzaZSOxaCq+lSGbTteAu8xsGxtI1t7fMpNXrAo48z26KAv4jrUzM6JhMlU6aLJ AGkVnGwFTI28kCQ7vgZABwJnfTTdgT20+CZYDiWAr43MMAO+rAshIZUd5HsDJpHAqeuNes896acvT BJA1J5JUoLWjagtDe8z5EUFhSj2cEi5OQjFwb25S/9gFlLh8ghOD+RRb3bxhl1PEtPRWtGAgANbCY j9O02G409eUFX6C/YZzA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syyjv-0000000E5ke-3Fm0; Thu, 10 Oct 2024 19:22:23 +0000 Received: from mail-pg1-x54a.google.com ([2607:f8b0:4864:20::54a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syxs1-0000000Dr16-1bUF for linux-riscv@lists.infradead.org; Thu, 10 Oct 2024 18:26:42 +0000 Received: by mail-pg1-x54a.google.com with SMTP id 41be03b00d2f7-5e4df21f22dso1173234a12.0 for <linux-riscv@lists.infradead.org>; Thu, 10 Oct 2024 11:26:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1728584800; x=1729189600; darn=lists.infradead.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:reply-to:from:to:cc:subject:date :message-id:reply-to; bh=iay4RI/uPKTQE0By5qqA//dP+sG5w7++36T/RHxbCNM=; b=elSopkBGV/LG/XHB/FpT5FQ1XT7+s8gQjY51jYXfFfnx0SB95Fq9HirqWw0fsoteYW Bffj+ulNayw15y81/0D2n6Yv0IDMpZGIOP92+zOPG2I+hWzmnSL6j82Db+Nnuc+If0F+ jRQFR5zcK+C9bg3YuwgbQ6dacmJfuU9Yzf5hjvl0BdTAcz0oc/hsnwzTI6VTwzB1N359 yYxZs5N9ir8CnrpandHwL87esEKL7WNWT1uDtaC+el7gvgzBd+WfI6Ag1K5EEQ/8XTqN hmhMLcy6QLvFtNVMU8MuYmQBYmGdxbPvlTqSq9ZDA868gww6BrArZnM7UTRqLXqpeVdC 26wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728584800; x=1729189600; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:reply-to:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=iay4RI/uPKTQE0By5qqA//dP+sG5w7++36T/RHxbCNM=; b=vEBROiZ4WjfNGIYBqpociiCFfY8rGcMIyAsn/9PeAGT05WhOrTgmNBHQWzmsc8Hele +PpU7hO7/Hzp8RWAd6tadtfZBA5yWdWcivD78cEG+R2tFbs9EhBFTwmxP1tBch5bdv9R V+Wk3Dqxkxp0HXtFB+S3xjm620bAywwuiYxuKW0nHYnM+PBBuDijirEct49+s8bcWNZZ z5/qqLgPia8E/2ldIzQLS/CofMf4dUwQsWkbP/w2XP6roJN2VsLPoazKeCemzANfGWXe DghcNAWnhs0tgNxEALPd/MxdEcewDMCCMj9AcJg8JeN9VQPIR/mbr+iqsORcn4aJLQ2y XNgQ== X-Forwarded-Encrypted: i=1; AJvYcCWjG4oqmsTYtqLd8NDirLXt7xmxrgZFeAujEC+Gp0m61n3pAFCzZ2w5x4bOqMUEs/A32U6+9ivnBXCtnw==@lists.infradead.org X-Gm-Message-State: AOJu0Yzj3lh51eDrS+WIDDDmIE08niWrcLNAAcLre5/UOd4pX+/1dqvO AV87YLovfEFKcgAbdSgs5bGFNhobEYp5cPYYe104Oi3FuuNuT4ubQNGNRXDgQGI437GrOYlWpXS OSg== X-Google-Smtp-Source: AGHT+IEd4uxjZrUyEQQM0MU+jkiJqh3LQboji5/ZXtrCgOTVgrRv0yMO5ln1NKE0y5PwnoqkXxjnsp8xFDc= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:9d:3983:ac13:c240]) (user=seanjc job=sendgmr) by 2002:a17:90a:fe86:b0:2da:872e:9ea4 with SMTP id 98e67ed59e1d1-2e2f0d7e9d7mr54a91.3.1728584798284; Thu, 10 Oct 2024 11:26:38 -0700 (PDT) Date: Thu, 10 Oct 2024 11:23:52 -0700 In-Reply-To: <20241010182427.1434605-1-seanjc@google.com> Mime-Version: 1.0 References: <20241010182427.1434605-1-seanjc@google.com> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog Message-ID: <20241010182427.1434605-51-seanjc@google.com> Subject: [PATCH v13 50/85] KVM: VMX: Hold mmu_lock until page is released when updating APIC access page From: Sean Christopherson <seanjc@google.com> To: Paolo Bonzini <pbonzini@redhat.com>, Marc Zyngier <maz@kernel.org>, Oliver Upton <oliver.upton@linux.dev>, Tianrui Zhao <zhaotianrui@loongson.cn>, Bibo Mao <maobibo@loongson.cn>, Huacai Chen <chenhuacai@kernel.org>, Michael Ellerman <mpe@ellerman.id.au>, Anup Patel <anup@brainfault.org>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Christian Borntraeger <borntraeger@linux.ibm.com>, Janosch Frank <frankja@linux.ibm.com>, Claudio Imbrenda <imbrenda@linux.ibm.com>, Sean Christopherson <seanjc@google.com> Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, " =?utf-8?q?Alex_Benn=C3=A9e?= " <alex.bennee@linaro.org>, Yan Zhao <yan.y.zhao@intel.com>, David Matlack <dmatlack@google.com>, David Stevens <stevensd@chromium.org>, Andrew Jones <ajones@ventanamicro.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241010_112641_505693_98A2815A X-CRM114-Status: GOOD ( 12.67 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-riscv.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-riscv>, <mailto:linux-riscv-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-riscv/> List-Post: <mailto:linux-riscv@lists.infradead.org> List-Help: <mailto:linux-riscv-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-riscv>, <mailto:linux-riscv-request@lists.infradead.org?subject=subscribe> Reply-To: Sean Christopherson <seanjc@google.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-riscv" <linux-riscv-bounces@lists.infradead.org> Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org |
Series |
KVM: Stop grabbing references to PFNMAP'd pages
|
expand
|
Context | Check | Description |
---|---|---|
conchuod/vmtest-fixes-PR | fail | merge-conflict |
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index 1a4438358c5e..851be0820e04 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -6832,25 +6832,22 @@ void vmx_set_apic_access_page_addr(struct kvm_vcpu *vcpu) return; read_lock(&vcpu->kvm->mmu_lock); - if (mmu_invalidate_retry_gfn(kvm, mmu_seq, gfn)) { + if (mmu_invalidate_retry_gfn(kvm, mmu_seq, gfn)) kvm_make_request(KVM_REQ_APIC_PAGE_RELOAD, vcpu); - read_unlock(&vcpu->kvm->mmu_lock); - goto out; - } + else + vmcs_write64(APIC_ACCESS_ADDR, pfn_to_hpa(pfn)); - vmcs_write64(APIC_ACCESS_ADDR, pfn_to_hpa(pfn)); - read_unlock(&vcpu->kvm->mmu_lock); - - /* - * No need for a manual TLB flush at this point, KVM has already done a - * flush if there were SPTEs pointing at the previous page. - */ -out: /* * Do not pin apic access page in memory, the MMU notifier * will call us again if it is migrated or swapped out. */ kvm_release_pfn_clean(pfn); + + /* + * No need for a manual TLB flush at this point, KVM has already done a + * flush if there were SPTEs pointing at the previous page. + */ + read_unlock(&vcpu->kvm->mmu_lock); } void vmx_hwapic_isr_update(int max_isr)