arm64: KVM: Obey RES0/1 reserved bits when setting CPTR_EL2
authorDave Martin <Dave.Martin@arm.com>
Tue, 19 Jan 2016 16:20:18 +0000 (16:20 +0000)
committerMarc Zyngier <marc.zyngier@arm.com>
Sun, 24 Jan 2016 21:55:58 +0000 (21:55 +0000)
commita7e0ac295d964086af3bf98352614f33c381213e
tree7529af0368e5df69e650d5fda9ba73b6667406c7
parent8fc153cda9c9e6aed2a4a7235970dd6c6cb6e954
arm64: KVM: Obey RES0/1 reserved bits when setting CPTR_EL2

Some bits in CPTR are defined as RES1 in the architecture.  Setting
these bits to zero may unintentionally enable future architecture
extensions, allowing guests to use them without supervision by the host.

This would be bad: for forwards compatibility, this patch makes
sure the affected bits are always written with 1, not 0.

This patch only addresses CPTR_EL2.  Initialisation of other system
registers may still need review.

Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm64/include/asm/kvm_arm.h
arch/arm64/kvm/hyp/switch.c