On 18.08.2023 09:39, Julien Grall wrote: > On 18/08/2023 07:33, Jan Beulich wrote: >> As an aside I wonder why they're here: They look like definitions of >> processor registers, which aren't under our (Xen's) control. > > I agree they are not under Xen's control. However, they are used by the > toolstack and IIRC back then they were not available in any other headers. > > Note that they are only available by the tools and the hypervisor (see > #ifdef above).
Yes, I did notice that (or else I would have used stronger wording). >> I ask in >> part because the presence of such constants may then be taken as >> justification to add similar things in new ports. Yet such definitions >> shouldn't be put here. > > From my understanding we are using the public headers to provide > macros/defines that are used by both the toolstack and the hypervisor. > If they are not meant to be exposed to the guest, then they will be > protected with "#if defined(__XEN__) || defined(__XEN_TOOLS__)". > > I think we are in a similar situation here. So it is not clear where > they should be put if we need to share them between the hypervisor and > the toolstack. On x86 we simply arrange for certain hypervisor headers to be re-usable from the toolstack. See in particular arch/x86/include/asm/x86-*.h. And of course everything under include/xen/lib/x86/, but those are our own definitions, not ones meant to solely express relevant hw spec aspects. Jan