* [PATCH] KVM: x86/mmu: Remove unused "const u8 *new" for kvm_mmu_track_write()
@ 2023-08-08 11:40 Like Xu
2023-08-08 14:31 ` Sean Christopherson
0 siblings, 1 reply; 2+ messages in thread
From: Like Xu @ 2023-08-08 11:40 UTC (permalink / raw)
To: Sean Christopherson; +Cc: Paolo Bonzini, kvm, linux-kernel
From: Like Xu <likexu@tencent.com>
The incoming parameter @new has not been required since commit 0e0fee5c539b
("kvm: mmu: Fix race in emulated page table writes"). And the callback
kvmgt_page_track_write() registered by KVMGT still formally consumes it.
No functional change intended.
Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Like Xu <likexu@tencent.com>
---
arch/x86/kvm/mmu.h | 3 +--
arch/x86/kvm/mmu/mmu.c | 3 +--
arch/x86/kvm/mmu/page_track.h | 2 +-
3 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kvm/mmu.h b/arch/x86/kvm/mmu.h
index 253fb2093d5d..27531ce6b739 100644
--- a/arch/x86/kvm/mmu.h
+++ b/arch/x86/kvm/mmu.h
@@ -121,8 +121,7 @@ void kvm_mmu_unload(struct kvm_vcpu *vcpu);
void kvm_mmu_free_obsolete_roots(struct kvm_vcpu *vcpu);
void kvm_mmu_sync_roots(struct kvm_vcpu *vcpu);
void kvm_mmu_sync_prev_roots(struct kvm_vcpu *vcpu);
-void kvm_mmu_track_write(struct kvm_vcpu *vcpu, gpa_t gpa, const u8 *new,
- int bytes);
+void kvm_mmu_track_write(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes);
static inline int kvm_mmu_reload(struct kvm_vcpu *vcpu)
{
diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index 9e4cd8b4a202..d742fae074c1 100644
--- a/arch/x86/kvm/mmu/mmu.c
+++ b/arch/x86/kvm/mmu/mmu.c
@@ -5638,8 +5638,7 @@ static u64 *get_written_sptes(struct kvm_mmu_page *sp, gpa_t gpa, int *nspte)
return spte;
}
-void kvm_mmu_track_write(struct kvm_vcpu *vcpu, gpa_t gpa, const u8 *new,
- int bytes)
+void kvm_mmu_track_write(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes)
{
gfn_t gfn = gpa >> PAGE_SHIFT;
struct kvm_mmu_page *sp;
diff --git a/arch/x86/kvm/mmu/page_track.h b/arch/x86/kvm/mmu/page_track.h
index 62f98c6c5af3..ea5dfd53b5c4 100644
--- a/arch/x86/kvm/mmu/page_track.h
+++ b/arch/x86/kvm/mmu/page_track.h
@@ -52,7 +52,7 @@ static inline void kvm_page_track_write(struct kvm_vcpu *vcpu, gpa_t gpa,
{
__kvm_page_track_write(vcpu->kvm, gpa, new, bytes);
- kvm_mmu_track_write(vcpu, gpa, new, bytes);
+ kvm_mmu_track_write(vcpu, gpa, bytes);
}
#endif /* __KVM_X86_PAGE_TRACK_H */
base-commit: 240f736891887939571854bd6d734b6c9291f22e
--
2.41.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] KVM: x86/mmu: Remove unused "const u8 *new" for kvm_mmu_track_write()
2023-08-08 11:40 [PATCH] KVM: x86/mmu: Remove unused "const u8 *new" for kvm_mmu_track_write() Like Xu
@ 2023-08-08 14:31 ` Sean Christopherson
0 siblings, 0 replies; 2+ messages in thread
From: Sean Christopherson @ 2023-08-08 14:31 UTC (permalink / raw)
To: Like Xu; +Cc: Paolo Bonzini, kvm, linux-kernel
On Tue, Aug 08, 2023, Like Xu wrote:
> From: Like Xu <likexu@tencent.com>
>
> The incoming parameter @new has not been required since commit 0e0fee5c539b
> ("kvm: mmu: Fix race in emulated page table writes"). And the callback
> kvmgt_page_track_write() registered by KVMGT still formally consumes it.
>
> No functional change intended.
>
> Suggested-by: Sean Christopherson <seanjc@google.com>
No need to give me credit, you spotted the unnecessary param, all I did was confirm
that it wasn't needed.
> -void kvm_mmu_track_write(struct kvm_vcpu *vcpu, gpa_t gpa, const u8 *new,
> - int bytes)
> +void kvm_mmu_track_write(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes)
> {
> gfn_t gfn = gpa >> PAGE_SHIFT;
> struct kvm_mmu_page *sp;
> diff --git a/arch/x86/kvm/mmu/page_track.h b/arch/x86/kvm/mmu/page_track.h
> index 62f98c6c5af3..ea5dfd53b5c4 100644
> --- a/arch/x86/kvm/mmu/page_track.h
> +++ b/arch/x86/kvm/mmu/page_track.h
> @@ -52,7 +52,7 @@ static inline void kvm_page_track_write(struct kvm_vcpu *vcpu, gpa_t gpa,
Please remove it from the entire kvm_page_track_write() chain. Yes, it will be
a larger patch and need an ack from the KVMGT folks, but there is no reason to
only do a partial cleanup
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-08 20:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-08 11:40 [PATCH] KVM: x86/mmu: Remove unused "const u8 *new" for kvm_mmu_track_write() Like Xu
2023-08-08 14:31 ` Sean Christopherson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).