public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yan Zhao <yan.y.zhao@intel.com>
To: pbonzini@redhat.com, seanjc@google.com
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	Yan Zhao <yan.y.zhao@intel.com>
Subject: [PATCH 0/2] RCU related fix based on kvm-coco-queue.
Date: Mon,  4 Nov 2024 16:41:37 +0800	[thread overview]
Message-ID: <20241104084137.29855-1-yan.y.zhao@intel.com> (raw)

Hi Paolo and Sean,

The two patches are fixups to RCU related issues reported by sparse.

Patch 1 was reported by kernel test robot related to dereference of
        mirrored sptep.

Patch 2 was a result of running sparse locally with error message:
        "error: incompatible types in comparison expression (different
        address spaces)" in kvm_gmem_get_file() and __kvm_gmem_get_pfn().

        Initially, I wanted to fix it by using rcu_access_pointer() to
        fetch the rcu-protected pointer slot->gmem.file.

        However, after further analysis, I think it's not necessary to
        rely on RCU to protect slot->gmem.file.

Please kindly take a look to see if they are appropriate.

Thanks
Yan


Rick Edgecombe (1):
  KVM: x86/tdp_mmu: Use rcu_dereference() to protect sptep for
    dereferencing

Yan Zhao (1):
  KVM: guest_memfd: Remove RCU-protected attribute from slot->gmem.file

 arch/x86/kvm/mmu/spte.h    |  4 ++--
 arch/x86/kvm/mmu/tdp_mmu.c |  6 +++---
 include/linux/kvm_host.h   |  2 +-
 virt/kvm/guest_memfd.c     | 23 ++++++++++-------------
 4 files changed, 16 insertions(+), 19 deletions(-)


base-commit: 49c492a89914b02fa5011d9ea9848318c6c98dd9
-- 
2.43.2


             reply	other threads:[~2024-11-04  8:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-04  8:41 Yan Zhao [this message]
2024-11-04  8:42 ` [PATCH 1/2] KVM: x86/tdp_mmu: Use rcu_dereference() to protect sptep for dereferencing Yan Zhao
2024-11-04  8:43 ` [PATCH 2/2] KVM: guest_memfd: Remove RCU-protected attribute from slot->gmem.file Yan Zhao
2024-12-22 18:38   ` Paolo Bonzini
2024-12-23  5:43     ` Yan Zhao

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=20241104084137.29855-1-yan.y.zhao@intel.com \
    --to=yan.y.zhao@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    /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