Re: [PATCH] arm/xen: Enable user access to the kernel before issuing a privcmd call

2015-09-11 Thread Julien Grall
Hi Ian, On 11/09/15 15:29, Ian Campbell wrote: >> After the commit a5e090acbf545c0a3b04080f8a488b17ec41fe02 "ARM: >> software-based priviledged-no-access support", the kernel can't access > > "privileged" That was a typo in the commit title of the patch. So I won't fix this one. All the others

Re: [PATCH] arm/xen: Enable user access to the kernel before issuing a privcmd call

2015-09-11 Thread Julien Grall
On 11/09/15 16:25, Russell King - ARM Linux wrote: > On Fri, Sep 11, 2015 at 03:56:38PM +0100, Julien Grall wrote: >> Well, we can't assume that the function will be called with uaccess >> disabled. > > Please explain your reasoning. I think I was confused about the usage of uaccess. Thank you

Re: [PATCH] arm/xen: Enable user access to the kernel before issuing a privcmd call

2015-09-11 Thread Russell King - ARM Linux
On Fri, Sep 11, 2015 at 03:56:38PM +0100, Julien Grall wrote: > Well, we can't assume that the function will be called with uaccess > disabled. Please explain your reasoning. The reason copy_from_user() et.al. need to save and restore the DACR is because the DACR may be in one of two states on

Re: [PATCH] arm/xen: Enable user access to the kernel before issuing a privcmd call

2015-09-11 Thread Russell King - ARM Linux
On Fri, Sep 11, 2015 at 03:45:29PM +0100, Julien Grall wrote: > Looking to the uaccess_save macro: > > .macro uaccess_save, tmp > #ifdef CONFIG_CPU_SW_DOMAIN_PAN > mrc p15, 0, \tmp, c3, c0, 0 > str \tmp, [sp, #S_FRAME_SIZE] > #endif > .endm > > > It's

Re: [PATCH] arm/xen: Enable user access to the kernel before issuing a privcmd call

2015-09-11 Thread Julien Grall
On 11/09/15 15:55, Ian Campbell wrote: > On Fri, 2015-09-11 at 15:45 +0100, Julien Grall wrote: >> On 11/09/15 15:29, Ian Campbell wrote: >>> On Fri, 2015-09-11 at 15:16 +0100, Julien Grall wrote: When Xen is copyin data to/from the guest it will check if the kernel >>> >>> "copying" >>>

Re: [PATCH] arm/xen: Enable user access to the kernel before issuing a privcmd call

2015-09-11 Thread Ian Campbell
On Fri, 2015-09-11 at 15:45 +0100, Julien Grall wrote: > On 11/09/15 15:29, Ian Campbell wrote: > > On Fri, 2015-09-11 at 15:16 +0100, Julien Grall wrote: > > > When Xen is copyin data to/from the guest it will check if the kernel > > > > "copying" > > > > > has the right to do the access. If

Re: [PATCH] arm/xen: Enable user access to the kernel before issuing a privcmd call

2015-09-11 Thread Julien Grall
On 11/09/15 15:29, Ian Campbell wrote: > On Fri, 2015-09-11 at 15:16 +0100, Julien Grall wrote: >> When Xen is copyin data to/from the guest it will check if the kernel > > "copying" > >> has the right to do the access. If not, the hypercall will return an >> error. >> >> After the commit

Re: [PATCH] arm/xen: Enable user access to the kernel before issuing a privcmd call

2015-09-11 Thread Ian Campbell
On Fri, 2015-09-11 at 15:16 +0100, Julien Grall wrote: > When Xen is copyin data to/from the guest it will check if the kernel "copying" > has the right to do the access. If not, the hypercall will return an > error. > > After the commit a5e090acbf545c0a3b04080f8a488b17ec41fe02 "ARM: >

[PATCH] arm/xen: Enable user access to the kernel before issuing a privcmd call

2015-09-11 Thread Julien Grall
When Xen is copyin data to/from the guest it will check if the kernel has the right to do the access. If not, the hypercall will return an error. After the commit a5e090acbf545c0a3b04080f8a488b17ec41fe02 "ARM: software-based priviledged-no-access support", the kernel can't access anymore the user

Re: [PATCH] arm/xen: Enable user access to the kernel before issuing a privcmd call

2015-09-11 Thread Julien Grall
Hi Ian, On 11/09/15 15:29, Ian Campbell wrote: >> After the commit a5e090acbf545c0a3b04080f8a488b17ec41fe02 "ARM: >> software-based priviledged-no-access support", the kernel can't access > > "privileged" That was a typo in the commit title of the patch. So I won't fix this one. All the others

Re: [PATCH] arm/xen: Enable user access to the kernel before issuing a privcmd call

2015-09-11 Thread Ian Campbell
On Fri, 2015-09-11 at 15:16 +0100, Julien Grall wrote: > When Xen is copyin data to/from the guest it will check if the kernel "copying" > has the right to do the access. If not, the hypercall will return an > error. > > After the commit a5e090acbf545c0a3b04080f8a488b17ec41fe02 "ARM: >

Re: [PATCH] arm/xen: Enable user access to the kernel before issuing a privcmd call

2015-09-11 Thread Julien Grall
On 11/09/15 15:29, Ian Campbell wrote: > On Fri, 2015-09-11 at 15:16 +0100, Julien Grall wrote: >> When Xen is copyin data to/from the guest it will check if the kernel > > "copying" > >> has the right to do the access. If not, the hypercall will return an >> error. >> >> After the commit

Re: [PATCH] arm/xen: Enable user access to the kernel before issuing a privcmd call

2015-09-11 Thread Julien Grall
On 11/09/15 15:55, Ian Campbell wrote: > On Fri, 2015-09-11 at 15:45 +0100, Julien Grall wrote: >> On 11/09/15 15:29, Ian Campbell wrote: >>> On Fri, 2015-09-11 at 15:16 +0100, Julien Grall wrote: When Xen is copyin data to/from the guest it will check if the kernel >>> >>> "copying" >>>

[PATCH] arm/xen: Enable user access to the kernel before issuing a privcmd call

2015-09-11 Thread Julien Grall
When Xen is copyin data to/from the guest it will check if the kernel has the right to do the access. If not, the hypercall will return an error. After the commit a5e090acbf545c0a3b04080f8a488b17ec41fe02 "ARM: software-based priviledged-no-access support", the kernel can't access anymore the user

Re: [PATCH] arm/xen: Enable user access to the kernel before issuing a privcmd call

2015-09-11 Thread Ian Campbell
On Fri, 2015-09-11 at 15:45 +0100, Julien Grall wrote: > On 11/09/15 15:29, Ian Campbell wrote: > > On Fri, 2015-09-11 at 15:16 +0100, Julien Grall wrote: > > > When Xen is copyin data to/from the guest it will check if the kernel > > > > "copying" > > > > > has the right to do the access. If

Re: [PATCH] arm/xen: Enable user access to the kernel before issuing a privcmd call

2015-09-11 Thread Russell King - ARM Linux
On Fri, Sep 11, 2015 at 03:45:29PM +0100, Julien Grall wrote: > Looking to the uaccess_save macro: > > .macro uaccess_save, tmp > #ifdef CONFIG_CPU_SW_DOMAIN_PAN > mrc p15, 0, \tmp, c3, c0, 0 > str \tmp, [sp, #S_FRAME_SIZE] > #endif > .endm > > > It's

Re: [PATCH] arm/xen: Enable user access to the kernel before issuing a privcmd call

2015-09-11 Thread Russell King - ARM Linux
On Fri, Sep 11, 2015 at 03:56:38PM +0100, Julien Grall wrote: > Well, we can't assume that the function will be called with uaccess > disabled. Please explain your reasoning. The reason copy_from_user() et.al. need to save and restore the DACR is because the DACR may be in one of two states on

Re: [PATCH] arm/xen: Enable user access to the kernel before issuing a privcmd call

2015-09-11 Thread Julien Grall
On 11/09/15 16:25, Russell King - ARM Linux wrote: > On Fri, Sep 11, 2015 at 03:56:38PM +0100, Julien Grall wrote: >> Well, we can't assume that the function will be called with uaccess >> disabled. > > Please explain your reasoning. I think I was confused about the usage of uaccess. Thank you