Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-29 Thread Roger Pau Monné
On Fri, May 29, 2020 at 02:37:24PM +0100, Julien Grall wrote: > Hi, > > On 29/05/2020 14:26, Roger Pau Monné wrote: > > TBH I would just remove the error message on Arm from the current > > hypercall, I don't think it's useful. > The message is part of the helpers get_page_from_gva() which is

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-29 Thread Bertrand Marquis
> On 29 May 2020, at 15:15, Julien Grall wrote: > > > > On 29/05/2020 15:02, Bertrand Marquis wrote: >>> On 29 May 2020, at 10:43, Julien Grall wrote: >>> >>> Hi Bertrand, >>> >>> On 29/05/2020 09:13, Bertrand Marquis wrote: Hi Julien, > On 28 May 2020, at 19:54, Julien Grall

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-29 Thread Julien Grall
On 29/05/2020 15:02, Bertrand Marquis wrote: On 29 May 2020, at 10:43, Julien Grall wrote: Hi Bertrand, On 29/05/2020 09:13, Bertrand Marquis wrote: Hi Julien, On 28 May 2020, at 19:54, Julien Grall wrote: Hi Bertrand, Thank you for the patch. On 28/05/2020 16:25, Bertrand Marquis

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-29 Thread Bertrand Marquis
> On 29 May 2020, at 10:43, Julien Grall wrote: > > Hi Bertrand, > > On 29/05/2020 09:13, Bertrand Marquis wrote: >> Hi Julien, >>> On 28 May 2020, at 19:54, Julien Grall wrote: >>> >>> Hi Bertrand, >>> >>> Thank you for the patch. >>> >>> On 28/05/2020 16:25, Bertrand Marquis wrote:

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-29 Thread Bertrand Marquis
> On 29 May 2020, at 10:27, Roger Pau Monné wrote: > > On Fri, May 29, 2020 at 09:18:42AM +, Bertrand Marquis wrote: >> Hi Jan, >> >>> On 29 May 2020, at 09:45, Jan Beulich wrote: >>> >>> On 29.05.2020 10:13, Bertrand Marquis wrote: > On 28 May 2020, at 19:54, Julien Grall wrote:

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-29 Thread Julien Grall
Hi, On 29/05/2020 14:26, Roger Pau Monné wrote: TBH I would just remove the error message on Arm from the current hypercall, I don't think it's useful. The message is part of the helpers get_page_from_gva() which is also used by copy_{to, from}_guest. While it may not be useful in the context

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-29 Thread Roger Pau Monné
On Fri, May 29, 2020 at 08:32:51AM +, Bertrand Marquis wrote: > Hi Jan > > > On 29 May 2020, at 08:35, Jan Beulich wrote: > > > > On 28.05.2020 20:54, Julien Grall wrote: > >> On 28/05/2020 16:25, Bertrand Marquis wrote: > >>> At the moment on Arm, a Linux guest running with KTPI enabled

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-29 Thread Roger Pau Monné
On Fri, May 29, 2020 at 11:59:40AM +0100, Julien Grall wrote: > Hi Jan, > > On 29/05/2020 08:35, Jan Beulich wrote: > > On 28.05.2020 20:54, Julien Grall wrote: > > > On 28/05/2020 16:25, Bertrand Marquis wrote: > > > > At the moment on Arm, a Linux guest running with KTPI enabled will > > > >

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-29 Thread Julien Grall
Hi Jan, On 29/05/2020 08:35, Jan Beulich wrote: On 28.05.2020 20:54, Julien Grall wrote: On 28/05/2020 16:25, Bertrand Marquis wrote: At the moment on Arm, a Linux guest running with KTPI enabled will cause the following error when a context switch happens in user mode: (XEN) p2m.c:1890:

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-29 Thread Julien Grall
Hi, On 29/05/2020 10:18, Bertrand Marquis wrote: On 29 May 2020, at 09:45, Jan Beulich wrote: On 29.05.2020 10:13, Bertrand Marquis wrote: On 28 May 2020, at 19:54, Julien Grall wrote: AFAICT, there is no restriction on when the runstate hypercall can be called. So this can even be called

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-29 Thread Hongyan Xia
On Fri, 2020-05-29 at 08:13 +, Bertrand Marquis wrote: > Hi Julien, > > > On 28 May 2020, at 19:54, Julien Grall wrote: > > > > Hi Bertrand, > > > > Thank you for the patch. > > > > On 28/05/2020 16:25, Bertrand Marquis wrote: > > > At the moment on Arm, a Linux guest running with KTPI

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-29 Thread Julien Grall
Hi Bertrand, On 29/05/2020 09:13, Bertrand Marquis wrote: Hi Julien, On 28 May 2020, at 19:54, Julien Grall wrote: Hi Bertrand, Thank you for the patch. On 28/05/2020 16:25, Bertrand Marquis wrote: At the moment on Arm, a Linux guest running with KTPI enabled will cause the following

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-29 Thread Jan Beulich
On 29.05.2020 11:18, Bertrand Marquis wrote: > Hi Jan, > >> On 29 May 2020, at 09:45, Jan Beulich wrote: >> >> On 29.05.2020 10:13, Bertrand Marquis wrote: On 28 May 2020, at 19:54, Julien Grall wrote: AFAICT, there is no restriction on when the runstate hypercall can be called.

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-29 Thread Roger Pau Monné
On Fri, May 29, 2020 at 09:18:42AM +, Bertrand Marquis wrote: > Hi Jan, > > > On 29 May 2020, at 09:45, Jan Beulich wrote: > > > > On 29.05.2020 10:13, Bertrand Marquis wrote: > >>> On 28 May 2020, at 19:54, Julien Grall wrote: > >>> AFAICT, there is no restriction on when the runstate

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-29 Thread Bertrand Marquis
Hi Jan, > On 29 May 2020, at 09:45, Jan Beulich wrote: > > On 29.05.2020 10:13, Bertrand Marquis wrote: >>> On 28 May 2020, at 19:54, Julien Grall wrote: >>> AFAICT, there is no restriction on when the runstate hypercall can be >>> called. So this can even be called before the vCPU is brought

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-29 Thread Jan Beulich
On 29.05.2020 10:13, Bertrand Marquis wrote: >> On 28 May 2020, at 19:54, Julien Grall wrote: >> AFAICT, there is no restriction on when the runstate hypercall can be >> called. So this can even be called before the vCPU is brought up. > > I understand the remark but it still feels very weird

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-29 Thread Jan Beulich
On 29.05.2020 10:32, Bertrand Marquis wrote: > So the only way to solve the KPTI issue would actually be to create a new > hypercall and keep the current bug/problem ? That's my view on it at least, yes. Jan

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-29 Thread Bertrand Marquis
Hi Jan > On 29 May 2020, at 08:35, Jan Beulich wrote: > > On 28.05.2020 20:54, Julien Grall wrote: >> On 28/05/2020 16:25, Bertrand Marquis wrote: >>> At the moment on Arm, a Linux guest running with KTPI enabled will >>> cause the following error when a context switch happens in user mode: >>>

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-29 Thread Bertrand Marquis
> On 29 May 2020, at 08:19, Roger Pau Monné wrote: > > On Thu, May 28, 2020 at 07:54:35PM +0100, Julien Grall wrote: >> Hi Bertrand, >> >> Thank you for the patch. >> >> On 28/05/2020 16:25, Bertrand Marquis wrote: >>> +static int map_runstate_area(struct vcpu *v, >>> +

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-29 Thread Bertrand Marquis
> On 28 May 2020, at 20:12, Julien Grall wrote: > > Hi, > > On 28/05/2020 18:19, Bertrand Marquis wrote: + +return 0; +} + int domain_kill(struct domain *d) { int rc = 0; @@ -727,7 +788,10 @@ int domain_kill(struct domain *d) if (

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-29 Thread Bertrand Marquis
Hi Julien, > On 28 May 2020, at 19:54, Julien Grall wrote: > > Hi Bertrand, > > Thank you for the patch. > > On 28/05/2020 16:25, Bertrand Marquis wrote: >> At the moment on Arm, a Linux guest running with KTPI enabled will >> cause the following error when a context switch happens in user

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-29 Thread Jan Beulich
On 28.05.2020 20:54, Julien Grall wrote: > On 28/05/2020 16:25, Bertrand Marquis wrote: >> At the moment on Arm, a Linux guest running with KTPI enabled will >> cause the following error when a context switch happens in user mode: >> (XEN) p2m.c:1890: d1v0: Failed to walk page-table va

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-29 Thread Roger Pau Monné
On Thu, May 28, 2020 at 07:54:35PM +0100, Julien Grall wrote: > Hi Bertrand, > > Thank you for the patch. > > On 28/05/2020 16:25, Bertrand Marquis wrote: > > +static int map_runstate_area(struct vcpu *v, > > +struct vcpu_register_runstate_memory_area *area) > > +{ > > +

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-28 Thread Julien Grall
Hi, On 28/05/2020 18:19, Bertrand Marquis wrote: + +return 0; +} + int domain_kill(struct domain *d) { int rc = 0; @@ -727,7 +788,10 @@ int domain_kill(struct domain *d) if ( cpupool_move_domain(d, cpupool0) ) return -ERESTART; for_each_vcpu ( d, v ) +

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-28 Thread Julien Grall
Hi Bertrand, Thank you for the patch. On 28/05/2020 16:25, Bertrand Marquis wrote: At the moment on Arm, a Linux guest running with KTPI enabled will cause the following error when a context switch happens in user mode: (XEN) p2m.c:1890: d1v0: Failed to walk page-table va 0xff837ebe0cd0

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-28 Thread Bertrand Marquis
> On 28 May 2020, at 17:53, Roger Pau Monné wrote: > > On Thu, May 28, 2020 at 04:25:31PM +0100, Bertrand Marquis wrote: >> At the moment on Arm, a Linux guest running with KTPI enabled will >> cause the following error when a context switch happens in user mode: >> (XEN) p2m.c:1890: d1v0:

Re: [RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-28 Thread Roger Pau Monné
On Thu, May 28, 2020 at 04:25:31PM +0100, Bertrand Marquis wrote: > At the moment on Arm, a Linux guest running with KTPI enabled will > cause the following error when a context switch happens in user mode: > (XEN) p2m.c:1890: d1v0: Failed to walk page-table va 0xff837ebe0cd0 > > This patch

[RFC PATCH 1/1] xen: Use a global mapping for runstate

2020-05-28 Thread Bertrand Marquis
At the moment on Arm, a Linux guest running with KTPI enabled will cause the following error when a context switch happens in user mode: (XEN) p2m.c:1890: d1v0: Failed to walk page-table va 0xff837ebe0cd0 This patch is modifying runstate handling to map the area given by the guest inside Xen