From: "Jan Beulich" Subject: Re: [PATCH RFC] xen: arm: Log a warning message when a deprecated hypercall is used Date: Tue, 20 Jan 2015 13:03:39 +0000 Message-ID: <54BE603B02000078000570AA@mail.emea.novell.com> References: <1421751134-9172-1-git-send-email-ian.campbell@citrix.com> <54BE44720200007800056F02@mail.emea.novell.com> <1421752305.10440.218.camel@citrix.com> <54BE47DF0200007800056F7F@mail.emea.novell.com> <1421755541.10440.250.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1421755541.10440.250.camel@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Keir Fraser , Ard Biesheuvel , julien.grall@linaro.org, tim@xen.org, xen-devel@lists.xen.org, Anthony PERARD , stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org >>> On 20.01.15 at 13:05, wrote: > On Tue, 2015-01-20 at 11:19 +0000, Jan Beulich wrote: >> >>> On 20.01.15 at 12:11, wrote: >> > On Tue, 2015-01-20 at 11:05 +0000, Jan Beulich wrote: >> >> >>> On 20.01.15 at 11:52, wrote: >> >> > +static register_t do_deprecated_hypercall(void) >> >> > +{ >> >> > + struct cpu_user_regs *regs = guest_cpu_user_regs(); >> >> > + const register_t op = >> >> > +#ifdef CONFIG_ARM_64 >> >> > + !is_32bit_domain(current->domain) ? >> >> > + regs->x16 >> >> > + : >> >> > +#endif >> >> > + regs->r12; >> >> > + >> >> > + gdprintk(XENLOG_DEBUG, "%pv: deprecated hypercall %ld\n", >> >> > + current, (unsigned long)op); >> >> >> >> If this was x86 code, I'd complain about the cast... >> > >> > The correct format code is PRIregister (since register_t can be 32- or >> > 64-bit for arm32 vs arm64 respectively), but it is in hex and xen.h >> > lists __HYPERVISOR_* in decimal so that's what I wanted to print for >> > each of manually looking. >> >> Which makes sense. I'd rather question whether PRIregister is >> badly defined then, in that it not just specifies an eventual size >> prefix. I.e. have it be just like C99's PRIx64 and alike, commonly >> implemented by a (library internal) abstraction just holding the >> necessary size prefix. > > Yes, it probably is, it's just that 99% of the time hex is what we want > so we haven't hit the activation energy to go and fix them. > > Your suggestion is PRIxREGISTER and PRIdREGISTER etc, right? PRIxREG etc perhaps. > There are several other non-ARM specific ones, PRIpaddr, PRI_xen_pfn and > PRI_xen_ulong etc (which may well have been added by me too during the > ARM port, so I won't claim them as precedent). Should we be changing > them all? I suppose paddr and pfn are less likely to be desired in > decimal. Right - out of these only the ulong one may want to get relaxed. Jan