mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
KVM: guest_memfd: Drop superfluous WRITE_ONCE() when binding a memslot
Drop the superfluous WRITE_ONCE() when setting a memslot's guest_memfd file
during initial binding, as the memslot *must* be inactive and unreachable.
The superfluous WRITE_ONCE() was added by commit 67b43038ce ("KVM:
guest_memfd: Remove RCU-protected attribute from slot->gmem.file") to
maintain rough "parity" with the existing rcu_assign_pointer(), not
realizing that the only reason rcu_assign_pointer() was used was to make
sparse and other checkers happy.
Cc: Yan Zhao <yan.y.zhao@intel.com>
Reviewed-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Ackerley Tng <ackerleytng@google.com>
Reviewed-by: Yan Zhao <yan.y.zhao@intel.com>
Link: https://patch.msgid.link/20260922001332.1121266-7-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
This commit is contained in:
parent
3fe5d2944e
commit
48252615eb
|
|
@ -678,7 +678,7 @@ int kvm_gmem_prepare_memory_region(struct kvm *kvm, struct kvm_memory_slot *slot
|
|||
* kvm_gmem_bind() must occur on a new memslot. Because the memslot
|
||||
* is not visible yet, kvm_gmem_get_pfn() is guaranteed to see the file.
|
||||
*/
|
||||
WRITE_ONCE(slot->gmem.file, file);
|
||||
slot->gmem.file = file;
|
||||
slot->gmem.pgoff = offset >> PAGE_SHIFT;
|
||||
if (kvm_gmem_supports_mmap(inode))
|
||||
slot->flags |= KVM_MEMSLOT_GMEM_ONLY;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user