[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: hypercalls with 64-bit results
On 16.06.2021 20:15, Andrew Cooper wrote: > On 16/06/2021 17:04, Jan Beulich wrote: >> All, >> >> several years back do_memory_op() in libxc was changed to have "long" >> return type. This is because some of the sub-ops return potentially >> large values as the hypercall return value (i.e. not in an argument >> structure field). This change, however, didn't have the intended >> effect from all I can tell, which apparently manifests in the present >> two remaining ovmf failures in the staging osstest flights. Anthony >> tells me that ovmf as of not very long ago puts the shared info page >> at a really high address, thus making the p2m of the guest very large. >> Its size gets returned by XENMEM_maximum_gpfn, as function return >> value. >> >> Since hypercalls from the tool stack are based on ioctl(), and since >> ioctl() has a return type of "int", I'm afraid there's no way we can >> deal with this by adjusting function return types in the libraries. >> Instead we appear to need either a new privcmd ioctl or new XENMEM_* >> subops (for those cases where potentially large values get returned). >> >> Until we manage to deal with this I wonder whether we should suggest >> to the ovmf folks to undo that change. I'm anyway not really >> convinced this aggressive enlarging of the p2m is a good idea. There >> are a number of cases in the hypervisor where we try to reduce GFN >> ranges based on this upper bound, and there in particular is a loop >> in mem-sharing code going all the way up to that limit. EPT P2M >> dumping also has such a loop. > > There are multiple things in here which are disappointing, but I think > they've mostly been known already. > > But I do agree that this is very much another nail in the coffin of the > ioctl ABI. > > For ABIv2, there are many changes needed, and this ioctl ABI was never > going to survive, for other reasons too. Obviously, we can't wait for > ABIv2 to fix this immediate issue. > > However, I think it might be reasonable to wait for ABIv2 until we can > reasonably support VMs larger than 8T(?). But it's not just XENMEM_maximum_gpfn that's affected; that's just the one pointing out the underlying issue. Plus if so, shouldn't we avoid returning values that are going to be truncated (and, as can be seen here, then get perhaps recognized as error codes up the call chain)? > For now, I'd agree with trying to undo the change in OVMF. Anthony, thoughts? Jan
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |