Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: Sean Christopherson <seanjc@google.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, Alex Williamson <alex@shazbot.org>,
	Steffen Eiden <seiden@linux.ibm.com>
Cc: Arnd Bergmann <arnd@arndb.de>, "H. Peter Anvin" <hpa@zytor.com>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	Liam Merwick <liam.merwick@oracle.com>,
	Michael Roth <michael.roth@amd.com>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Maxim Levitsky <mlevitsk@redhat.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] KVM, SEV: fix merge conflict
Date: Tue, 19 May 2026 22:28:36 +0200	[thread overview]
Message-ID: <20260519202851.1339906-1-arnd@kernel.org> (raw)

From: Arnd Bergmann <arnd@arndb.de>

A conflict between two patches leads to build failure for
the reference countingg in 'struct kvm', which moved into
the kvm_refcount structure:

arch/x86/kvm/svm/sev.c: In function 'kvm_lockdep_assert_sev_lock_held':
arch/x86/kvm/svm/sev.c:118:32: error: 'struct kvm' has no member named 'users_count'
  118 |         if (!refcount_read(&kvm->users_count))

Resolve this by changing the added reference the same way as
the other ones.

Fixes: 422c363f58a8 ("KVM, vfio: remove symbol_get(kvm_get_kvm_safe) from vfio")
Fixes: ba903f738249 ("KVM: SEV: Assert that kvm->lock is held when querying SEV+ support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/x86/kvm/svm/sev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
index 04accfaefd0d..63b57f3b3800 100644
--- a/arch/x86/kvm/svm/sev.c
+++ b/arch/x86/kvm/svm/sev.c
@@ -115,7 +115,7 @@ static __always_inline void kvm_lockdep_assert_sev_lock_held(struct kvm *kvm)
 	 * Querying SEV+ support is safe if there are no other references, i.e.
 	 * if concurrent initialization of SEV+ is impossible.
 	 */
-	if (!refcount_read(&kvm->users_count))
+	if (!refcount_read(&kvm->rc.users_count))
 		return;
 
 	/*
-- 
2.39.5


             reply	other threads:[~2026-05-19 20:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-19 20:28 Arnd Bergmann [this message]
2026-05-19 21:26 ` [PATCH] KVM, SEV: fix merge conflict Sean Christopherson
2026-05-20  5:50   ` Arnd Bergmann
2026-05-20  3:41 ` kernel test robot
2026-05-20  4:15 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260519202851.1339906-1-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=alex@shazbot.org \
    --cc=arnd@arndb.de \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=liam.merwick@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.roth@amd.com \
    --cc=mingo@redhat.com \
    --cc=mlevitsk@redhat.com \
    --cc=nikunj@amd.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=seiden@linux.ibm.com \
    --cc=tglx@kernel.org \
    --cc=thomas.lendacky@amd.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox