[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 1/3] arm/arm64/xen: use C inlines for privcmd_call
On Thu, Nov 21, 2019 at 01:48:03PM -0500, Pavel Tatashin wrote: > privcmd_call requires to enable access to userspace for the > duration of the hypercall. > > Currently, this is done via assembly macros. Change it to C > inlines instead. > > Signed-off-by: Pavel Tatashin <pasha.tatashin@xxxxxxxxxx> > --- > arch/arm/include/asm/assembler.h | 2 +- > arch/arm/include/asm/uaccess.h | 32 ++++++++++++++++++++++++++------ > arch/arm/xen/enlighten.c | 2 +- > arch/arm/xen/hypercall.S | 15 ++------------- > arch/arm64/xen/hypercall.S | 19 ++----------------- > include/xen/arm/hypercall.h | 23 ++++++++++++++++++++--- > 6 files changed, 52 insertions(+), 41 deletions(-) > > diff --git a/arch/arm/include/asm/assembler.h > b/arch/arm/include/asm/assembler.h > index 99929122dad7..8e9262a0f016 100644 > --- a/arch/arm/include/asm/assembler.h > +++ b/arch/arm/include/asm/assembler.h > @@ -480,7 +480,7 @@ THUMB( orr \reg , \reg , #PSR_T_BIT ) > .macro uaccess_disable, tmp, isb=1 > #ifdef CONFIG_CPU_SW_DOMAIN_PAN > /* > - * Whenever we re-enter userspace, the domains should always be > + * Whenever we re-enter kernel, the domains should always be > * set appropriately. > */ > mov \tmp, #DACR_UACCESS_DISABLE > diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h > index 98c6b91be4a8..79d4efa3eb62 100644 > --- a/arch/arm/include/asm/uaccess.h > +++ b/arch/arm/include/asm/uaccess.h > @@ -16,6 +16,23 @@ > > #include <asm/extable.h> > > +#ifdef CONFIG_CPU_SW_DOMAIN_PAN > +static __always_inline void uaccess_enable(void) > +{ > + unsigned long val = DACR_UACCESS_ENABLE; > + > + asm volatile("mcr p15, 0, %0, c3, c0, 0" : : "r" (val)); > + isb(); > +} > + > +static __always_inline void uaccess_disable(void) > +{ > + unsigned long val = DACR_UACCESS_ENABLE; > + > + asm volatile("mcr p15, 0, %0, c3, c0, 0" : : "r" (val)); > + isb(); > +} Rather than inventing these, why not use uaccess_save_and_enable().. uaccess_restore() around the Xen call? -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |