All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	julien.grall@linaro.org, tim@xen.org, xen-devel@lists.xen.org,
	Anthony PERARD <anthony.perard@citrix.com>,
	stefano.stabellini@eu.citrix.com
Subject: Re: [PATCH RFC] xen: arm: Log a warning message when a deprecated hypercall is used
Date: Tue, 20 Jan 2015 12:05:41 +0000	[thread overview]
Message-ID: <1421755541.10440.250.camel@citrix.com> (raw)
In-Reply-To: <54BE47DF0200007800056F7F@mail.emea.novell.com>

On Tue, 2015-01-20 at 11:19 +0000, Jan Beulich wrote:
> >>> On 20.01.15 at 12:11, <Ian.Campbell@citrix.com> wrote:
> > On Tue, 2015-01-20 at 11:05 +0000, Jan Beulich wrote:
> >> >>> On 20.01.15 at 11:52, <ian.campbell@citrix.com> 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?

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.

Ian

  reply	other threads:[~2015-01-20 12:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-20 10:52 [PATCH RFC] xen: arm: Log a warning message when a deprecated hypercall is used Ian Campbell
2015-01-20 11:05 ` Jan Beulich
2015-01-20 11:11   ` Ian Campbell
2015-01-20 11:19     ` Jan Beulich
2015-01-20 12:05       ` Ian Campbell [this message]
2015-01-20 13:03         ` Jan Beulich
2015-01-20 12:35 ` Julien Grall
2015-01-27 11:51 ` Ard Biesheuvel
2015-01-27 17:14   ` Ian Campbell
2015-02-04  9:41 ` Ard Biesheuvel
2015-02-04 10:16   ` Ian Campbell
2015-06-26 10:19 ` Julien Grall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1421755541.10440.250.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=anthony.perard@citrix.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=julien.grall@linaro.org \
    --cc=keir@xen.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.