Re: [PATCH v2 02/17] kvm: x86: Avoid taking MMU lock in kvm_mmu_sync_roots if no sync is needed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 13/06/2018 00:52, Junaid Shahid wrote:
>  		sp = page_header(root);
> +
> +		/*
> +		 * Even if another VCPU was marking the SP as unsync-ed
> +		 * simultaneously, any guest page table changes are not
> +		 * guaranteed to be visible anyway until this VCPU issues a TLB
> +		 * flush strictly after those changes are made. We only need to
> +		 * ensure that the other CPU sets these flags before any actual
> +		 * changes to the page tables are made. The comments in
> +		 * mmu_need_write_protect() describe what could go wrong if this
> +		 * requirement isn't satisfied.
> +		 */
> +		smp_rmb();

This is actually an smp_read_barrier_depends(), which is possibly more
self-documenting.  I can do the replacement myself.

Paolo

> +		if (!sp->unsync && !sp->unsync_children)
> +			return;
> +




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux