Rusty Russell wrote >>> Since >>> this deliberately only uses %eax and %ebx, I can't see anyone having >>> issues with this. >>> >> Well, it doesn't work if the hypervisor wants to use eax/ebx for >> something else or nothing at all. If the hypervisor doesn't conform to >> this model for whatever reason, it still needs to arrange to run some >> code before getting to the pv_startup. >> None of this matters at all if you have a single entry point and a well defined register setup before entering the kernel. > > Err, if they want to boot Linux, they're going to have to figure out > some system for booting. If they really can't use ours, then, yes, > they're going to have to submit a patch with justification of why they > have to do it differently. > > I agree that it's a little ad-hoc, but setting a simple standard fits > well with my ideal of making it easy for implementers, starting with you > two. And we both know Xen doesn't care, so I find your protests lack > oomph 8) > > Zach, I think we should (1) check for ring 0, then (2) check for paging. > That way we don't read CR0 unless we're in ring0, and we keep close to > our general guarantee of "no sensitive insns". > I agree. If you are not running in ring zero, or have paging already enabled, you are almost guaranteed to be running on a hypervisor (*). And by the way, mov to and from control registers are _not_ sensitive instructions as Jeremy said earlier. They trap, and any reasonable hypervisor should handle those traps. (*) We need to check with the Visual Workstation maintainers. They used to enter the kernel from the BIOS with paging already enabled. > (BTW, I committed your previous patch, please mod...). > Ack. Err-- which patch? Zach