[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [RFC v2 2/6] xen/arm: Introduce platform_hvc
On Tue, 7 Feb 2017, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" <edgar.iglesias@xxxxxxxxxx> > > Introduce platform_hvc as a way to handle hypercalls that > Xen does not know about in a platform specific way. This > is particularly useful for implementing the SiP (SoC > implementation specific) service calls. > > Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xxxxxxxxxx> > --- > xen/arch/arm/platform.c | 8 ++++++++ > xen/arch/arm/traps.c | 3 +++ > xen/include/asm-arm/platform.h | 5 +++++ > 3 files changed, 16 insertions(+) > > diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c > index 0af6d57..90ea6b8 100644 > --- a/xen/arch/arm/platform.c > +++ b/xen/arch/arm/platform.c > @@ -127,6 +127,14 @@ void platform_poweroff(void) > platform->poweroff(); > } > > +bool platform_hvc(struct cpu_user_regs *regs) This is fine, but we need a different name for it, as it can be used to handle both HVC and SMC calls. Maybe "firmware_call"? > +{ > + if ( platform && platform->hvc ) > + return platform->hvc(regs); > + > + return false; > +} > + > bool_t platform_has_quirk(uint32_t quirk) > { > uint32_t quirks = 0; > diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c > index c5a4d41..33950d9 100644 > --- a/xen/arch/arm/traps.c > +++ b/xen/arch/arm/traps.c > @@ -44,6 +44,7 @@ > #include <asm/cpufeature.h> > #include <asm/flushtlb.h> > #include <asm/monitor.h> > +#include <asm/platform.h> > > #include "decode.h" > #include "vtimer.h" > @@ -1430,6 +1431,8 @@ static void do_trap_psci(struct cpu_user_regs *regs) > } > break; > default: > + if ( platform_hvc(regs) ) > + return; > domain_crash_synchronous(); > return; > } > diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h > index 08010ba..4d51f0a 100644 > --- a/xen/include/asm-arm/platform.h > +++ b/xen/include/asm-arm/platform.h > @@ -26,6 +26,10 @@ struct platform_desc { > void (*reset)(void); > /* Platform power-off */ > void (*poweroff)(void); > + /* Platform specific HVC handler. > + * Returns true if the call was handled and false if not. > + */ > + bool (*hvc)(struct cpu_user_regs *regs); > /* > * Platform quirks > * Defined has a function because a platform can support multiple > @@ -55,6 +59,7 @@ int platform_cpu_up(int cpu); > #endif > void platform_reset(void); > void platform_poweroff(void); > +bool platform_hvc(struct cpu_user_regs *regs); > bool_t platform_has_quirk(uint32_t quirk); > bool_t platform_device_is_blacklisted(const struct dt_device_node *node); _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |