mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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
Subject: [PATCH v2 1/7] KVM: x86/mmu: Return a u64 (the old SPTE) from mmu_spte_clear_track_bits()
Date: Fri, 15 Jul 2022 22:42:20 +0000	[thread overview]
Message-ID: <20220715224226.3749507-2-seanjc@google.com> (raw)
In-Reply-To: <20220715224226.3749507-1-seanjc@google.com>

Return a u64, not an int, from mmu_spte_clear_track_bits().  The return
value is the old SPTE value, which is very much a 64-bit value.  The sole
caller that consumes the return value, drop_spte(), already uses a u64.
The only reason that truncating the SPTE value is not problematic is
because drop_spte() only queries the shadow-present bit, which is in the
lower 32 bits.

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kvm/mmu/mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index 52664c3caaab..b2379ede2ed6 100644
--- a/arch/x86/kvm/mmu/mmu.c
+++ b/arch/x86/kvm/mmu/mmu.c
@@ -529,7 +529,7 @@ static bool mmu_spte_update(u64 *sptep, u64 new_spte)
  * state bits, it is used to clear the last level sptep.
  * Returns the old PTE.
  */
-static int mmu_spte_clear_track_bits(struct kvm *kvm, u64 *sptep)
+static u64 mmu_spte_clear_track_bits(struct kvm *kvm, u64 *sptep)
 {
 	kvm_pfn_t pfn;
 	u64 old_spte = *sptep;
-- 
2.37.0.170.g444d1eabd0-goog


  reply	other threads:[~2022-07-15 22:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-15 22:42 [PATCH v2 0/7] KVM: x86: Clean up rmap zap helpers Sean Christopherson
2022-07-15 22:42 ` Sean Christopherson [this message]
2022-07-15 22:42 ` [PATCH v2 2/7] KVM: x86/mmu: Directly "destroy" PTE list when recycling rmaps Sean Christopherson
2022-07-15 22:42 ` [PATCH v2 3/7] KVM: x86/mmu: Drop the "p is for pointer" from rmap helpers Sean Christopherson
2022-07-15 22:42 ` [PATCH v2 4/7] KVM: x86/mmu: Rename __kvm_zap_rmaps() to align with other nomenclature Sean Christopherson
2022-07-15 22:42 ` [PATCH v2 5/7] KVM: x86/mmu: Rename rmap zap helpers to eliminate "unmap" wrapper Sean Christopherson
2022-07-15 22:42 ` [PATCH v2 6/7] KVM: x86/mmu: Rename pte_list_{destroy,remove}() to show they zap SPTEs Sean Christopherson
2022-07-15 22:42 ` [PATCH v2 7/7] KVM: x86/mmu: Remove underscores from __pte_list_remove() Sean Christopherson
2022-07-19 13:15 ` [PATCH v2 0/7] KVM: x86: Clean up rmap zap helpers Paolo Bonzini

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=20220715224226.3749507-2-seanjc@google.com \
    --to=seanjc@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.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

all inboxes | Powered by JetHome®