[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: x86: Declarations for compat_set_{cx,px}_pminfo()



On 2024-11-18 22:41, Andrew Cooper wrote:
Hello,

Eclair reports Rule 8.4 violations for these two.  They're real
violations, but fixing them is proving challenging.

Because of how x86_64/platform_hypercall.c sets up some defines and
includes ../platform_hypercall.c, the declarations of
compat_set_{cx,px}_pminfo() of pmstat.h become compat ones.

Therefore the real hypercall handler does see a correct declaration.

However, the implementation in cpufreq.c does not get the compat-ified
version of pmstat.h, so misses the declaration and thus the violation.

Worse however is the fact that cpufreq.c depends on not having the:

#define xen_processor_performance compat_processor_performance

in scope while it's transforming between the two formats, meaning we
can't simply reuse pmstat.h with suitable defines.

Any clever ideas for how to untangle this mess, before I go for the
brute force approach of an #if COMPAT section in the main hypercall handler?


Yeah, that is why these were among the last ones. I'm afraid I didn't come up with a reasonable to deal with this either.

You can find attached a tentative patch I made (not build tested, and also based on an older tree). A last resort may be to special-case those declarations, but that's undesirable.

--
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)

Attachment: R8.4.patch
Description: Text Data


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.