Skip to content

Commit 0edc60f

Browse files
Marc Zyngieroupton
authored andcommitted
KVM: arm64: nv: Add TCPAC/TTA to CPTR->CPACR conversion helper
We are missing the propagation of CPTR_EL2.{TCPAC,TTA} into the CPACR format. Make sure we preserve these bits. Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
1 parent 5326303 commit 0edc60f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

arch/arm64/include/asm/kvm_nested.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static inline u64 translate_tcr_el2_to_tcr_el1(u64 tcr)
3232

3333
static inline u64 translate_cptr_el2_to_cpacr_el1(u64 cptr_el2)
3434
{
35-
u64 cpacr_el1 = 0;
35+
u64 cpacr_el1 = CPACR_ELx_RES1;
3636

3737
if (cptr_el2 & CPTR_EL2_TTA)
3838
cpacr_el1 |= CPACR_ELx_TTA;
@@ -41,6 +41,8 @@ static inline u64 translate_cptr_el2_to_cpacr_el1(u64 cptr_el2)
4141
if (!(cptr_el2 & CPTR_EL2_TZ))
4242
cpacr_el1 |= CPACR_ELx_ZEN;
4343

44+
cpacr_el1 |= cptr_el2 & (CPTR_EL2_TCPAC | CPTR_EL2_TAM);
45+
4446
return cpacr_el1;
4547
}
4648

0 commit comments

Comments
 (0)