On 16.06.2023 15:10, Roger Pau Monne wrote: > Introduce a helper based on the current Xen guest_cpuid code in order > to fetch a cpuid leaf from a policy. The newly introduced function in > cpuid.c should not be directly called and instead the provided > x86_cpuid_get_leaf macro should be used that will properly deal with > const and non-const inputs. > > Also add a test to check that the introduced helper doesn't go over > the bounds of the policy. > > Note the code in x86_cpuid_copy_from_buffer is not switched to use the > new function because of the boundary checks against the max fields of > the policy, which might not be properly set at the point where > x86_cpuid_copy_from_buffer get called, for example when filling an > empty policy from scratch. > > Signed-off-by: Roger Pau Monné <roger....@citrix.com> > --- > Changes since v6: > - Add more tests. > - Drop Jan R-b.
Feel free to re-instate. Jan