Re: [Xen-devel] [PATCH 1/3] arm/arm64/xen: use C inlines for privcmd_call

2019-12-04 Thread Pavel Tatashin
On Fri, Nov 29, 2019 at 10:05 AM Julien Grall wrote: > > Hi, > > On 27/11/2019 18:44, Pavel Tatashin wrote: > > diff --git a/arch/arm64/include/asm/xen/hypercall.h > > b/arch/arm64/include/asm/xen/hypercall.h > > index 3522cbaed316..1a74fb28607f 100644 > > --- a/arch/arm64/include/asm/xen/hyperca

Re: [Xen-devel] [PATCH 1/3] arm/arm64/xen: use C inlines for privcmd_call

2019-12-04 Thread Pavel Tatashin
On Fri, Nov 29, 2019 at 10:10 AM Andrew Cooper wrote: > > On 29/11/2019 15:05, Julien Grall wrote: > > Hi, > > > > On 27/11/2019 18:44, Pavel Tatashin wrote: > >> diff --git a/arch/arm64/include/asm/xen/hypercall.h > >> b/arch/arm64/include/asm/xen/hypercall.h > >> index 3522cbaed316..1a74fb28607f

Re: [Xen-devel] [PATCH 1/3] arm/arm64/xen: use C inlines for privcmd_call

2019-11-29 Thread Andrew Cooper
On 29/11/2019 15:05, Julien Grall wrote: > Hi, > > On 27/11/2019 18:44, Pavel Tatashin wrote: >> diff --git a/arch/arm64/include/asm/xen/hypercall.h >> b/arch/arm64/include/asm/xen/hypercall.h >> index 3522cbaed316..1a74fb28607f 100644 >> --- a/arch/arm64/include/asm/xen/hypercall.h >> +++ b/arch/a

Re: [Xen-devel] [PATCH 1/3] arm/arm64/xen: use C inlines for privcmd_call

2019-11-29 Thread Julien Grall
Hi, On 27/11/2019 18:44, Pavel Tatashin wrote: diff --git a/arch/arm64/include/asm/xen/hypercall.h b/arch/arm64/include/asm/xen/hypercall.h index 3522cbaed316..1a74fb28607f 100644 --- a/arch/arm64/include/asm/xen/hypercall.h +++ b/arch/arm64/include/asm/xen/hypercall.h @@ -1 +1,29 @@ +#ifndef _

[Xen-devel] [PATCH 1/3] arm/arm64/xen: use C inlines for privcmd_call

2019-11-27 Thread Pavel Tatashin
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 Acked-by: Stefano Stabellini --- arch/arm/include/asm/assembler.h | 2 +- arch/arm/include/as

Re: [Xen-devel] [PATCH 1/3] arm/arm64/xen: use C inlines for privcmd_call

2019-11-21 Thread Pavel Tatashin
> > That may be, but be very careful that you only use them in ARMv7-only > > code. Using them elsewhere is unsafe as the domain register is used > > for other purposes, and merely blatting over it (as your > > uaccess_enable and uaccess_disable functions do) is unsafe. > > In fact, I'll turn that

[Xen-devel] [PATCH 1/3] arm/arm64/xen: use C inlines for privcmd_call

2019-11-21 Thread Pavel Tatashin
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 --- arch/arm/include/asm/assembler.h | 2 +- arch/arm/include/asm/uaccess.h | 32 +

Re: [Xen-devel] [PATCH 1/3] arm/arm64/xen: use C inlines for privcmd_call

2019-11-21 Thread Pavel Tatashin
> > +#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_disabl

Re: [Xen-devel] [PATCH 1/3] arm/arm64/xen: use C inlines for privcmd_call

2019-11-21 Thread Russell King - ARM Linux admin
On Thu, Nov 21, 2019 at 07:39:22PM -0500, Pavel Tatashin wrote: > > > That may be, but be very careful that you only use them in ARMv7-only > > > code. Using them elsewhere is unsafe as the domain register is used > > > for other purposes, and merely blatting over it (as your > > > uaccess_enable

Re: [Xen-devel] [PATCH 1/3] arm/arm64/xen: use C inlines for privcmd_call

2019-11-21 Thread Russell King - ARM Linux admin
On Fri, Nov 22, 2019 at 12:34:03AM +, Russell King - ARM Linux admin wrote: > On Thu, Nov 21, 2019 at 07:30:41PM -0500, Pavel Tatashin wrote: > > > > +#ifdef CONFIG_CPU_SW_DOMAIN_PAN > > > > +static __always_inline void uaccess_enable(void) > > > > +{ > > > > + unsigned long val = DACR_UACC

Re: [Xen-devel] [PATCH 1/3] arm/arm64/xen: use C inlines for privcmd_call

2019-11-21 Thread Russell King - ARM Linux admin
On Thu, Nov 21, 2019 at 07:30:41PM -0500, Pavel Tatashin wrote: > > > +#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)); >

Re: [Xen-devel] [PATCH 1/3] arm/arm64/xen: use C inlines for privcmd_call

2019-11-21 Thread Russell King - ARM Linux admin
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 > --- > arch/arm/includ