Re: [PATCH] KVM: PPC: Apply paravirt to all vcpu

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

 



On 11/22/2011 03:45 PM, Yoder Stuart-B08248 wrote:
> Hmm...not sure which approach makes sense.
> 
> So to make sure I understand Scott's proposal the sequence would
> be something like:
> 
>    -after secondaries CPUs are released from spin and can
>     determine they are running under KVM they:
>       -disable interrupts
>       -set a flag indicating they are waiting for paravirt
>        patching to complete
>       -spin in a loop until a flag is set that indicates
>        paravirt patch is complete
>       -make the paravirt hcall
> 
>   -boot CPU
>       -waits for all secondaries to set the 'waiting for 
>        paravirt' flag
>       -makes the paravirt hcall
>       -patches the kernel
>       -sets 'paravirt complete' flag
> 
> Is that basically correct?

That's not my proposal.

My proposal is just to add something like this at the end of
kvm_map_magic_page():

if (not the cpu doing the patching) {
	while (!kvm_patching_done)
		cpu_relax();
}

And even that is only really worth it if there are races besides SPRG3-7
to worry about.  Using the privileged version of SPRG3-7 inside the
kernel would avoid needing anything special for KVM, and would make SPRG
access slightly simpler than they are now (no separate W/R versions to
keep track of) -- I'm not sure why the kernel bothers with the user-read
version of the SPRs in the first place.

-Scott

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux