Re: [PATCH v4 resend 1/2] rtmutex: update rt-mutex-design

2017-07-30 Thread Alex Shi
On 07/31/2017 09:50 AM, Alex Shi wrote: > -Reviewers: Ingo Molnar, Thomas Gleixner, Thomas Duetsch, and Randy Dunlap > +Original Reviewers: Ingo Molnar, Thomas Gleixner, Thomas Duetsch, and > + Randy Dunlap > +Update (7/6/2017) Reviewers: Steven Rostedt and Sebastian Siewior >

[PATCH v2 resend 2/2] rtmutex: update rt-mutex

2017-07-30 Thread Alex Shi
The rtmutex remove a pending owner bit in in rt_mutex::owner, in commit 8161239a8bcc ("rtmutex: Simplify PI algorithm and make highest prio task get lock") But the document was changed accordingly. Updating it to a meaningful state. BTW, as 'Steven Rostedt' mentioned: There is still technically a

[PATCH v4 resend 1/2] rtmutex: update rt-mutex-design

2017-07-30 Thread Alex Shi
The rt-mutex-design documents didn't gotten meaningful update from its first version. Even after owner's pending bit was removed in commit 8161239a8bcc ("rtmutex: Simplify PI algorithm and make highest prio task get lock") and priority list 'plist' changed to rbtree. And Peter Zijlstra did some cle

Re: [RFC PATCH v2 04/38] KVM: arm/arm64: Check if nested virtualization is in use

2017-07-30 Thread Christoffer Dall
On Tue, Jul 18, 2017 at 11:58:30AM -0500, Jintack Lim wrote: > Nested virtualizaion is in use only if all three conditions are met: > - The architecture supports nested virtualization. > - The kernel parameter is set. > - The userspace uses nested virtualiztion feature. > > Signed-off-by: Jintack

Re: [RFC PATCH v2 02/38] KVM: arm/arm64: Enable nested virtualization via command-line

2017-07-30 Thread Christoffer Dall
On Tue, Jul 18, 2017 at 11:58:28AM -0500, Jintack Lim wrote: > Add a new kernel parameter(kvm-arm.nested) to enable KVM/ARM nested > virtualization support. This kernel parameter on arm architecture is > ignored since nested virtualization is not supported on arm. > > Note that this kernel paramet

Re: [RFC PATCH v2 08/38] KVM: arm64: Add EL2 special registers to vcpu context

2017-07-30 Thread Christoffer Dall
On Tue, Jul 18, 2017 at 11:58:34AM -0500, Jintack Lim wrote: > To support the virtual EL2 execution, we need to maintain the EL2 > special registers such as SPSR_EL2, ELR_EL2 and SP_EL2 in vcpu context. > > Note that SP_EL2 is not accessible in EL2, so we don't need a trap > handler for this regis

Re: [RFC PATCH v2 16/38] KVM: arm64: Support to inject exceptions to the virtual EL2

2017-07-30 Thread Christoffer Dall
On Tue, Jul 18, 2017 at 11:58:42AM -0500, Jintack Lim wrote: The subject should be changed to "KVM: arm64: Support injecting exceptions to virtual EL2" > Support inject synchronous exceptions to the virtual EL2 as injecting > described in ARM ARM AArch64.TakeException(). > > This can be easily

Re: [RFC PATCH v2 14/38] KVM: arm64: Synchronize EL1 system registers on virtual EL2 entry and exit

2017-07-30 Thread Christoffer Dall
On Tue, Jul 18, 2017 at 11:58:40AM -0500, Jintack Lim wrote: > When running in virtual EL2 we use the shadow EL1 systerm register array > for the save/restore process, so that hardware and especially the memory > subsystem behaves as code written for EL2 expects while really running > in EL1. > >

Re: [RFC PATCH v2 25/38] KVM: arm64: Respect virtual CPTR_EL2.TFP setting

2017-07-30 Thread Christoffer Dall
On Tue, Jul 18, 2017 at 11:58:51AM -0500, Jintack Lim wrote: > Forward traps due to FP/ASIMD register accesses to the virtual EL2 if > virtual CPTR_EL2.TFP is set. Note that if TFP bit is set, then even > accesses to FP/ASIMD register from EL2 as well as NS EL0/1 will trap to > EL2. So, we don't ch

Re: [RFC PATCH v2 20/38] KVM: arm64: Handle eret instruction traps

2017-07-30 Thread Christoffer Dall
On Tue, Jul 18, 2017 at 11:58:46AM -0500, Jintack Lim wrote: > When HCR.NV bit is set, eret instructions trap to EL2 with EC code 0x1A. > Emulate eret instructions by setting pc and pstate. It may be worth noting in the commit message that this is all we have to do, because the rest of the logic w

Re: [RFC PATCH v2 21/38] KVM: arm64: Set a handler for the system instruction traps

2017-07-30 Thread Christoffer Dall
On Tue, Jul 18, 2017 at 11:58:47AM -0500, Jintack Lim wrote: > When HCR.NV bit is set, execution of the EL2 translation regime address > aranslation instructions and TLB maintenance instructions are trapped to translation > EL2. In addition, execution of the EL1 translation regime address > arans

Re: [RFC PATCH v2 22/38] KVM: arm64: Handle PSCI call via smc from the guest

2017-07-30 Thread Christoffer Dall
On Tue, Jul 18, 2017 at 11:58:48AM -0500, Jintack Lim wrote: > VMs used to execute hvc #0 for the psci call if EL3 is not implemented. > However, when we come to provide the virtual EL2 mode to the VM, the > host OS inside the VM calls kvm_call_hyp() which is also hvc #0. So, > it's hard to differe

Re: [RFC PATCH v2 24/38] KVM: arm64: Respect virtual HCR_EL2.TWX setting

2017-07-30 Thread Christoffer Dall
On Tue, Jul 18, 2017 at 11:58:50AM -0500, Jintack Lim wrote: > Forward exceptions due to WFI or WFE instructions to the virtual EL2 if > they are not coming from the virtual EL2 and virtual HCR_EL2.TWX is set. > > Signed-off-by: Jintack Lim > --- > arch/arm64/include/asm/kvm_host.h | 1 + > arc

Re: [RFC PATCH v2 04/38] KVM: arm/arm64: Check if nested virtualization is in use

2017-07-30 Thread Christoffer Dall
On Tue, Jul 18, 2017 at 11:58:30AM -0500, Jintack Lim wrote: > Nested virtualizaion is in use only if all three conditions are met: > - The architecture supports nested virtualization. > - The kernel parameter is set. > - The userspace uses nested virtualiztion feature. > > Signed-off-by: Jintack

Re: [RFC PATCH v2 10/38] KVM: arm/arm64: Add a framework to prepare virtual EL2 execution

2017-07-30 Thread Christoffer Dall
On Tue, Jul 18, 2017 at 11:58:36AM -0500, Jintack Lim wrote: > From: Christoffer Dall > > Add functions setting up and restoring the guest's context on each entry > and exit. These functions will come in handy when we want to use > different context for normal EL0/EL1 and virtual EL2 execution. >