Skip to content

Commit 6e73bc9

Browse files
author
Marc Zyngier
committed
Merge branch arm64/for-next/sysreg into kvm-arm64/misc-5.15
Merge the arm64/for-next/sysreg branch to avoid merge conflicts in -next and upstream. * arm64/for-next/sysreg: arm64/kexec: Test page size support with new TGRAN range values Signed-off-by: Marc Zyngier <[email protected]>
2 parents 3134cc8 + 79d82cb commit 6e73bc9

File tree

2 files changed

+22
-15
lines changed

2 files changed

+22
-15
lines changed

arch/arm64/include/asm/cpufeature.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,8 @@ static inline bool system_supports_4kb_granule(void)
657657
val = cpuid_feature_extract_unsigned_field(mmfr0,
658658
ID_AA64MMFR0_TGRAN4_SHIFT);
659659

660-
return val == ID_AA64MMFR0_TGRAN4_SUPPORTED;
660+
return (val >= ID_AA64MMFR0_TGRAN4_SUPPORTED_MIN) &&
661+
(val <= ID_AA64MMFR0_TGRAN4_SUPPORTED_MAX);
661662
}
662663

663664
static inline bool system_supports_64kb_granule(void)
@@ -669,7 +670,8 @@ static inline bool system_supports_64kb_granule(void)
669670
val = cpuid_feature_extract_unsigned_field(mmfr0,
670671
ID_AA64MMFR0_TGRAN64_SHIFT);
671672

672-
return val == ID_AA64MMFR0_TGRAN64_SUPPORTED;
673+
return (val >= ID_AA64MMFR0_TGRAN64_SUPPORTED_MIN) &&
674+
(val <= ID_AA64MMFR0_TGRAN64_SUPPORTED_MAX);
673675
}
674676

675677
static inline bool system_supports_16kb_granule(void)
@@ -681,7 +683,8 @@ static inline bool system_supports_16kb_granule(void)
681683
val = cpuid_feature_extract_unsigned_field(mmfr0,
682684
ID_AA64MMFR0_TGRAN16_SHIFT);
683685

684-
return val == ID_AA64MMFR0_TGRAN16_SUPPORTED;
686+
return (val >= ID_AA64MMFR0_TGRAN16_SUPPORTED_MIN) &&
687+
(val <= ID_AA64MMFR0_TGRAN16_SUPPORTED_MAX);
685688
}
686689

687690
static inline bool system_supports_mixed_endian_el0(void)

arch/arm64/include/asm/sysreg.h

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -847,12 +847,16 @@
847847
#define ID_AA64MMFR0_ASID_SHIFT 4
848848
#define ID_AA64MMFR0_PARANGE_SHIFT 0
849849

850-
#define ID_AA64MMFR0_TGRAN4_NI 0xf
851-
#define ID_AA64MMFR0_TGRAN4_SUPPORTED 0x0
852-
#define ID_AA64MMFR0_TGRAN64_NI 0xf
853-
#define ID_AA64MMFR0_TGRAN64_SUPPORTED 0x0
854-
#define ID_AA64MMFR0_TGRAN16_NI 0x0
855-
#define ID_AA64MMFR0_TGRAN16_SUPPORTED 0x1
850+
#define ID_AA64MMFR0_TGRAN4_NI 0xf
851+
#define ID_AA64MMFR0_TGRAN4_SUPPORTED_MIN 0x0
852+
#define ID_AA64MMFR0_TGRAN4_SUPPORTED_MAX 0x7
853+
#define ID_AA64MMFR0_TGRAN64_NI 0xf
854+
#define ID_AA64MMFR0_TGRAN64_SUPPORTED_MIN 0x0
855+
#define ID_AA64MMFR0_TGRAN64_SUPPORTED_MAX 0x7
856+
#define ID_AA64MMFR0_TGRAN16_NI 0x0
857+
#define ID_AA64MMFR0_TGRAN16_SUPPORTED_MIN 0x1
858+
#define ID_AA64MMFR0_TGRAN16_SUPPORTED_MAX 0xf
859+
856860
#define ID_AA64MMFR0_PARANGE_32 0x0
857861
#define ID_AA64MMFR0_PARANGE_36 0x1
858862
#define ID_AA64MMFR0_PARANGE_40 0x2
@@ -1035,19 +1039,19 @@
10351039

10361040
#if defined(CONFIG_ARM64_4K_PAGES)
10371041
#define ID_AA64MMFR0_TGRAN_SHIFT ID_AA64MMFR0_TGRAN4_SHIFT
1042+
#define ID_AA64MMFR0_TGRAN_SUPPORTED_MIN ID_AA64MMFR0_TGRAN4_SUPPORTED_MIN
1043+
#define ID_AA64MMFR0_TGRAN_SUPPORTED_MAX ID_AA64MMFR0_TGRAN4_SUPPORTED_MAX
10381044
#define ID_AA64MMFR0_TGRAN_2_SHIFT ID_AA64MMFR0_TGRAN4_2_SHIFT
1039-
#define ID_AA64MMFR0_TGRAN_SUPPORTED_MIN ID_AA64MMFR0_TGRAN4_SUPPORTED
1040-
#define ID_AA64MMFR0_TGRAN_SUPPORTED_MAX 0x7
10411045
#elif defined(CONFIG_ARM64_16K_PAGES)
10421046
#define ID_AA64MMFR0_TGRAN_SHIFT ID_AA64MMFR0_TGRAN16_SHIFT
1047+
#define ID_AA64MMFR0_TGRAN_SUPPORTED_MIN ID_AA64MMFR0_TGRAN16_SUPPORTED_MIN
1048+
#define ID_AA64MMFR0_TGRAN_SUPPORTED_MAX ID_AA64MMFR0_TGRAN16_SUPPORTED_MAX
10431049
#define ID_AA64MMFR0_TGRAN_2_SHIFT ID_AA64MMFR0_TGRAN16_2_SHIFT
1044-
#define ID_AA64MMFR0_TGRAN_SUPPORTED_MIN ID_AA64MMFR0_TGRAN16_SUPPORTED
1045-
#define ID_AA64MMFR0_TGRAN_SUPPORTED_MAX 0xF
10461050
#elif defined(CONFIG_ARM64_64K_PAGES)
10471051
#define ID_AA64MMFR0_TGRAN_SHIFT ID_AA64MMFR0_TGRAN64_SHIFT
1052+
#define ID_AA64MMFR0_TGRAN_SUPPORTED_MIN ID_AA64MMFR0_TGRAN64_SUPPORTED_MIN
1053+
#define ID_AA64MMFR0_TGRAN_SUPPORTED_MAX ID_AA64MMFR0_TGRAN64_SUPPORTED_MAX
10481054
#define ID_AA64MMFR0_TGRAN_2_SHIFT ID_AA64MMFR0_TGRAN64_2_SHIFT
1049-
#define ID_AA64MMFR0_TGRAN_SUPPORTED_MIN ID_AA64MMFR0_TGRAN64_SUPPORTED
1050-
#define ID_AA64MMFR0_TGRAN_SUPPORTED_MAX 0x7
10511055
#endif
10521056

10531057
#define MVFR2_FPMISC_SHIFT 4

0 commit comments

Comments
 (0)