Skip to content

Commit c37fa9d

Browse files
rddunlapJonathan Corbet
authored andcommitted
Documentation: KVM: make corrections to locking.rst
Correct grammar and punctuation. Use "read-only" for consistency. Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Sean Christopherson <seanjc@google.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: kvm@vger.kernel.org Cc: Jonathan Corbet <corbet@lwn.net> Cc: linux-doc@vger.kernel.org Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20230612030810.23376-3-rdunlap@infradead.org
1 parent 4c60d49 commit c37fa9d

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

Documentation/virt/kvm/locking.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ following two cases:
6767
2. Write-Protection: The SPTE is present and the fault is caused by
6868
write-protect. That means we just need to change the W bit of the spte.
6969

70-
What we use to avoid all the race is the Host-writable bit and MMU-writable bit
70+
What we use to avoid all the races is the Host-writable bit and MMU-writable bit
7171
on the spte:
7272

7373
- Host-writable means the gfn is writable in the host kernel page tables and in
@@ -130,7 +130,7 @@ to gfn. For indirect sp, we disabled fast page fault for simplicity.
130130
A solution for indirect sp could be to pin the gfn, for example via
131131
kvm_vcpu_gfn_to_pfn_atomic, before the cmpxchg. After the pinning:
132132

133-
- We have held the refcount of pfn that means the pfn can not be freed and
133+
- We have held the refcount of pfn; that means the pfn can not be freed and
134134
be reused for another gfn.
135135
- The pfn is writable and therefore it cannot be shared between different gfns
136136
by KSM.
@@ -186,22 +186,22 @@ writable between reading spte and updating spte. Like below case:
186186
The Dirty bit is lost in this case.
187187

188188
In order to avoid this kind of issue, we always treat the spte as "volatile"
189-
if it can be updated out of mmu-lock, see spte_has_volatile_bits(), it means,
189+
if it can be updated out of mmu-lock [see spte_has_volatile_bits()]; it means
190190
the spte is always atomically updated in this case.
191191

192192
3) flush tlbs due to spte updated
193193

194-
If the spte is updated from writable to readonly, we should flush all TLBs,
194+
If the spte is updated from writable to read-only, we should flush all TLBs,
195195
otherwise rmap_write_protect will find a read-only spte, even though the
196196
writable spte might be cached on a CPU's TLB.
197197

198198
As mentioned before, the spte can be updated to writable out of mmu-lock on
199-
fast page fault path, in order to easily audit the path, we see if TLBs need
200-
be flushed caused by this reason in mmu_spte_update() since this is a common
199+
fast page fault path. In order to easily audit the path, we see if TLBs needing
200+
to be flushed caused this reason in mmu_spte_update() since this is a common
201201
function to update spte (present -> present).
202202

203203
Since the spte is "volatile" if it can be updated out of mmu-lock, we always
204-
atomically update the spte, the race caused by fast page fault can be avoided,
204+
atomically update the spte and the race caused by fast page fault can be avoided.
205205
See the comments in spte_has_volatile_bits() and mmu_spte_update().
206206

207207
Lockless Access Tracking:
@@ -283,9 +283,9 @@ time it will be set using the Dirty tracking mechanism described above.
283283
:Arch: x86
284284
:Protects: wakeup_vcpus_on_cpu
285285
:Comment: This is a per-CPU lock and it is used for VT-d posted-interrupts.
286-
When VT-d posted-interrupts is supported and the VM has assigned
286+
When VT-d posted-interrupts are supported and the VM has assigned
287287
devices, we put the blocked vCPU on the list blocked_vcpu_on_cpu
288-
protected by blocked_vcpu_on_cpu_lock, when VT-d hardware issues
288+
protected by blocked_vcpu_on_cpu_lock. When VT-d hardware issues
289289
wakeup notification event since external interrupts from the
290290
assigned devices happens, we will find the vCPU on the list to
291291
wakeup.

0 commit comments

Comments
 (0)