On 26.06.2024 18:28, Alejandro Vallejo wrote: > This greatly simplifies a later patch that makes use of HVM contexts to upload > LAPIC data. The idea is to reuse MTRR setting procedure to avoid code > duplication. It's currently only used for PVH, but there's no real reason to > overcomplicate the toolstack preventing them being set for HVM too when > hvmloader will override them anyway.
Yet then - why set them when hvmloader will do so again? Is it even guaranteed to be no change in (guest) behavior to do so? Plus what about a guest which was configured to have the CPUID bit for MTRRs clear? I think we ought to document this as not supported for PVH (we may actually choose to refuse building such a guest), but in principle the MTRR save/load operations should simply fail for a HVM guest in said configuration. Making such a change in Xen now would, afaict, be benign to the tool stack. After this adjustment it would result in a perceived regression, when there shouldn't be any. Thinking about it, even for PVH it may make sense to allow CPUID.MTRR=0, as long as CPUID.PAT=1, thus forcing it into PAT-only mode. I think we did even discuss this possible configuration before. Jan