From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH RFC] xen: arm: Log a warning message when a deprecated hypercall is used Date: Tue, 20 Jan 2015 11:11:45 +0000 Message-ID: <1421752305.10440.218.camel@citrix.com> References: <1421751134-9172-1-git-send-email-ian.campbell@citrix.com> <54BE44720200007800056F02@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <54BE44720200007800056F02@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich 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 Tue, 2015-01-20 at 11:05 +0000, Jan Beulich wrote: > >>> On 20.01.15 at 11:52, wrote: > > RFC since I'm not sure how extreme our reaction ought to be here, e.g. > > I considered domain_crash() or even panic() when in a debug build. A > > XENLOG_DEBUG message is about the most benign of the options. > > And I think it shouldn't be more than that in the first round. We > may want to consider logging a message on x86 too, but of > course only optionally depending on a command line option. OK. > > --- a/xen/arch/arm/traps.c > > +++ b/xen/arch/arm/traps.c > > @@ -1148,6 +1148,22 @@ die: > > } > > #endif > > > > +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. > > @@ -1167,15 +1183,29 @@ typedef struct { > > .fn = (arm_hypercall_fn_t) &do_arm_ ## _name, \ > > .nr_args = _nr_args, \ > > } > > +/* > > + * Only use this for hypercalls which were deprecated (i.e. replaced > > + * by something else) before Xen on ARM was created, i.e. *not* for > > + * hypercalls which are simply not yet used on ARM. > > + */ > > +#define HYPERCALL_DEPRECATED(_name, _nr_args) \ > > + [ __HYPERVISOR_##_name ] = { \ > > + .fn = (arm_hypercall_fn_t) &do_deprecated_hypercall, \ > > ... and the redundant &. It's consistent with the other variants of this macro. Ian.