From: "Jan Beulich" Subject: Re: headers.chk failing under certain circumstances. Date: Tue, 13 Dec 2011 14:17:18 +0000 Message-ID: <4EE76C7E0200007800067541@nat28.tlf.novell.com> References: <4EE75560.4090703@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4EE75560.4090703@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Andrew Cooper Cc: KeirFraser , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org >>> On 13.12.11 at 14:38, Andrew Cooper wrote: > To fix the current 32/64bit interaction errors with the kexec > hypercalls, I need to use uint64_aligned_t as a datatype. For the > normal compile, this is all fine, but as header.chk does not define > __XEN__ or __XEN_TOOLS__, the declaration of uint64_aligned_t is never > made, leading to the check failing. > > There are other hypercall interfaces which use these datatypes: domctl, > sysctl and hvm_op, but these header files are explicitly filtered out > from the prerequisites for header.chk. This is really intentional for the domctl and sysctl cases - these are "internal" interfaces (between the tools and the hypervisor), and hence can be more relaxed in style. Pretty much the same goes for the hvm op definitions - we simply assume that users of this use a compiler capable of dealing with this (I'm not fully convinced this is The Right Thing To Do, but it's the status quo at least). > Given that uint64_aligned_t is a > sensible datatype to be using with the hypercall interface, fixing the > check seems to be the correct solution. Sensible or not, you would have to find a way to define such a type in a compiler-independent (i.e. ANSI conforming) manner, and I'm afraid you won't be able to. > In your oppinion, which is the best course of action? To define __XEN__ > or __XEN_TOOLS__ as part of the check (this throws up other errors as > part of the check process, suggesting that the header files are hiding > ansi non-conformance in certain blocks), or dont predicate the > definition of uint64_aligned_t on the presence of the above defines? __XEN__ and __XEN_TOOLS__ must specifically not be defined for these checks (and these symbols indeed get used to frame certain definitions that are considered "internal" as outlined above - obviously, by framing any definition this way we hide them from "foreign" consumers *and* the [pointless in this case] style checking). So bottom line is - no, you can't use uint64_aligned_t as much as any other non-ANSI extension. Preventing anyone to try is what the check was introduced for. Jan