Re: [PATCH v3] KVM: arm/arm64: Access CNTHCTL_EL2 bit fields correctly

2016-12-06 Thread Christoffer Dall
On Tue, Dec 06, 2016 at 01:09:26PM +, Marc Zyngier wrote: > On 06/12/16 12:16, Christoffer Dall wrote: > > On Tue, Dec 06, 2016 at 01:12:21PM +0100, Christoffer Dall wrote: > >> On Tue, Dec 06, 2016 at 11:17:40AM +, Marc Zyngier wrote: > >>> On 01/12/16 19:32, Jintack Lim wrote: >

Re: [PATCH v3] KVM: arm/arm64: Access CNTHCTL_EL2 bit fields correctly

2016-12-06 Thread Jintack Lim
Hi Christoffer, Thanks for the review. On Tue, Dec 6, 2016 at 7:12 AM, Christoffer Dall wrote: > On Tue, Dec 06, 2016 at 11:17:40AM +, Marc Zyngier wrote: >> On 01/12/16 19:32, Jintack Lim wrote: >> > Current KVM world switch code is unintentionally setting wrong

Re: [PATCH v3] KVM: arm/arm64: Access CNTHCTL_EL2 bit fields correctly

2016-12-06 Thread Jintack Lim
On Tue, Dec 6, 2016 at 6:17 AM, Marc Zyngier wrote: > On 01/12/16 19:32, Jintack Lim wrote: >> Current KVM world switch code is unintentionally setting wrong bits to >> CNTHCTL_EL2 when E2H == 1, which may allow guest OS to access physical >> timer. Bit positions of

Re: [PATCH v3] KVM: arm/arm64: Access CNTHCTL_EL2 bit fields correctly

2016-12-06 Thread Marc Zyngier
On 06/12/16 12:16, Christoffer Dall wrote: > On Tue, Dec 06, 2016 at 01:12:21PM +0100, Christoffer Dall wrote: >> On Tue, Dec 06, 2016 at 11:17:40AM +, Marc Zyngier wrote: >>> On 01/12/16 19:32, Jintack Lim wrote: Current KVM world switch code is unintentionally setting wrong bits to

Re: [PATCH v3] KVM: arm/arm64: Access CNTHCTL_EL2 bit fields correctly

2016-12-06 Thread Christoffer Dall
On Thu, Dec 01, 2016 at 02:32:05PM -0500, Jintack Lim wrote: > Current KVM world switch code is unintentionally setting wrong bits to > CNTHCTL_EL2 when E2H == 1, which may allow guest OS to access physical > timer. Bit positions of CNTHCTL_EL2 are changing depending on > HCR_EL2.E2H bit.

Re: [PATCH v3] KVM: arm/arm64: Access CNTHCTL_EL2 bit fields correctly

2016-12-06 Thread Christoffer Dall
On Tue, Dec 06, 2016 at 01:12:21PM +0100, Christoffer Dall wrote: > On Tue, Dec 06, 2016 at 11:17:40AM +, Marc Zyngier wrote: > > On 01/12/16 19:32, Jintack Lim wrote: > > > Current KVM world switch code is unintentionally setting wrong bits to > > > CNTHCTL_EL2 when E2H == 1, which may allow

Re: [PATCH v3] KVM: arm/arm64: Access CNTHCTL_EL2 bit fields correctly

2016-12-06 Thread Christoffer Dall
On Tue, Dec 06, 2016 at 11:17:40AM +, Marc Zyngier wrote: > On 01/12/16 19:32, Jintack Lim wrote: > > Current KVM world switch code is unintentionally setting wrong bits to > > CNTHCTL_EL2 when E2H == 1, which may allow guest OS to access physical > > timer. Bit positions of CNTHCTL_EL2 are

Re: [PATCH v3] KVM: arm/arm64: Access CNTHCTL_EL2 bit fields correctly

2016-12-06 Thread Marc Zyngier
On 01/12/16 19:32, Jintack Lim wrote: > Current KVM world switch code is unintentionally setting wrong bits to > CNTHCTL_EL2 when E2H == 1, which may allow guest OS to access physical > timer. Bit positions of CNTHCTL_EL2 are changing depending on > HCR_EL2.E2H bit. EL1PCEN and EL1PCTEN are 1st

[PATCH v3] KVM: arm/arm64: Access CNTHCTL_EL2 bit fields correctly

2016-12-01 Thread Jintack Lim
Current KVM world switch code is unintentionally setting wrong bits to CNTHCTL_EL2 when E2H == 1, which may allow guest OS to access physical timer. Bit positions of CNTHCTL_EL2 are changing depending on HCR_EL2.E2H bit. EL1PCEN and EL1PCTEN are 1st and 0th bits when E2H is not set, but they are