mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 01:53:29 +02:00
KVM: arm64: Enforce absence of FEAT_HCX on HCRX_EL2
Add the dependency between the HCRX_EL2 register and FEAT_HCX. Reviewed-by: Oliver Upton <oliver.upton@linux.dev> Signed-off-by: Marc Zyngier <maz@kernel.org>
This commit is contained in:
parent
338a41e83c
commit
c99d62771f
|
|
@ -214,6 +214,7 @@ struct reg_feat_map_desc {
|
|||
#define FEAT_FGT ID_AA64MMFR0_EL1, FGT, IMP
|
||||
#define FEAT_FGT2 ID_AA64MMFR0_EL1, FGT, FGT2
|
||||
#define FEAT_MTPMU ID_AA64DFR0_EL1, MTPMU, IMP
|
||||
#define FEAT_HCX ID_AA64MMFR1_EL1, HCX, IMP
|
||||
|
||||
static bool not_feat_aa64el3(struct kvm *kvm)
|
||||
{
|
||||
|
|
@ -929,6 +930,10 @@ static const struct reg_bits_to_feat_map hcrx_feat_map[] = {
|
|||
NEEDS_FEAT(HCRX_EL2_EnAS0, FEAT_LS64_ACCDATA),
|
||||
};
|
||||
|
||||
|
||||
static const DECLARE_FEAT_MAP(hcrx_desc, __HCRX_EL2,
|
||||
hcrx_feat_map, FEAT_HCX);
|
||||
|
||||
static const struct reg_bits_to_feat_map hcr_feat_map[] = {
|
||||
NEEDS_FEAT(HCR_EL2_TID0, FEAT_AA32EL0),
|
||||
NEEDS_FEAT_FIXED(HCR_EL2_RW, compute_hcr_rw),
|
||||
|
|
@ -1181,8 +1186,7 @@ void __init check_feature_map(void)
|
|||
check_reg_desc(&hfgitr2_desc);
|
||||
check_reg_desc(&hdfgrtr2_desc);
|
||||
check_reg_desc(&hdfgwtr2_desc);
|
||||
check_feat_map(hcrx_feat_map, ARRAY_SIZE(hcrx_feat_map),
|
||||
__HCRX_EL2_RES0, "HCRX_EL2");
|
||||
check_reg_desc(&hcrx_desc);
|
||||
check_feat_map(hcr_feat_map, ARRAY_SIZE(hcr_feat_map),
|
||||
HCR_EL2_RES0, "HCR_EL2");
|
||||
check_feat_map(sctlr2_feat_map, ARRAY_SIZE(sctlr2_feat_map),
|
||||
|
|
@ -1383,9 +1387,7 @@ void get_reg_fixed_bits(struct kvm *kvm, enum vcpu_sysreg reg, u64 *res0, u64 *r
|
|||
*res1 = HDFGWTR2_EL2_RES1;
|
||||
break;
|
||||
case HCRX_EL2:
|
||||
*res0 = compute_res0_bits(kvm, hcrx_feat_map,
|
||||
ARRAY_SIZE(hcrx_feat_map), 0, 0);
|
||||
*res0 |= __HCRX_EL2_RES0;
|
||||
*res0 = compute_reg_res0_bits(kvm, &hcrx_desc, 0, 0);
|
||||
*res1 = __HCRX_EL2_RES1;
|
||||
break;
|
||||
case HCR_EL2:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user