On Mon, Feb 22, 2021 at 12:35:21PM +0100, Roger Pau Monné wrote: > On Mon, Feb 22, 2021 at 11:27:07AM +0100, Jan Beulich wrote: > > Now that we guard the entire Xen VA space against speculative abuse > > through hypervisor accesses to guest memory, the argument translation > > area's VA also needs to live outside this range, at least for 32-bit PV > > guests. To avoid extra is_hvm_*() conditionals, use the alternative VA > > uniformly. > > Since you are double mapping the per-domain virtual area, won't it > make more sense to map it just once outside of the Xen virtual space > area? (so it's always using PML4_ADDR(511))
Right, that's not possible for PV 64bit domains because it's guest owned linear address space in that case. It seems like paravirt_ctxt_switch_to will modify the root_pgt to set the PERDOMAIN_VIRT_START entry, does the same need to be done for PERDOMAIN2_VIRT_START? I would also consider giving the slot a more meaningful name, as PERDOMAIN2_VIRT_START makes it seem like a new per-domain scratch space, when it's just a different mapping of the existing physical memory. Maybe PERDOMAIN_MIRROR_VIRT_START? Or PERDOMAIN_XLAT_VIRT_START? Thanks, Roger.