Skip to content

Commit 8d93b7a

Browse files
committed
Merge branch 'for-next/fpsimd' into for-next/core
* for-next/fpsimd: arm64: cpufeature: Warn if we attempt to read a zero width field arm64: cpufeature: Add missing .field_width for GIC system registers arm64: signal: nofpsimd: Do not allocate fp/simd context when not available arm64: cpufeature: Always specify and use a field width for capabilities arm64: Always use individual bits in CPACR floating point enables arm64: Define CPACR_EL1_FPEN similarly to other floating point controls
2 parents 515e5da + f2c2812 commit 8d93b7a

7 files changed

Lines changed: 126 additions & 81 deletions

File tree

arch/arm64/include/asm/cpufeature.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ struct arm64_cpu_capabilities {
356356
struct { /* Feature register checking */
357357
u32 sys_reg;
358358
u8 field_pos;
359+
u8 field_width;
359360
u8 min_field_value;
360361
u8 hwcap_type;
361362
bool sign;
@@ -576,6 +577,8 @@ static inline u64 arm64_ftr_reg_user_value(const struct arm64_ftr_reg *reg)
576577
static inline int __attribute_const__
577578
cpuid_feature_extract_field_width(u64 features, int field, int width, bool sign)
578579
{
580+
if (WARN_ON_ONCE(!width))
581+
width = 4;
579582
return (sign) ?
580583
cpuid_feature_extract_signed_field_width(features, field, width) :
581584
cpuid_feature_extract_unsigned_field_width(features, field, width);

arch/arm64/include/asm/kvm_arm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,8 @@
355355
ECN(SOFTSTP_CUR), ECN(WATCHPT_LOW), ECN(WATCHPT_CUR), \
356356
ECN(BKPT32), ECN(VECTOR32), ECN(BRK64)
357357

358-
#define CPACR_EL1_FPEN (3 << 20)
359358
#define CPACR_EL1_TTA (1 << 28)
360-
#define CPACR_EL1_DEFAULT (CPACR_EL1_FPEN | CPACR_EL1_ZEN_EL1EN)
359+
#define CPACR_EL1_DEFAULT (CPACR_EL1_FPEN_EL0EN | CPACR_EL1_FPEN_EL1EN |\
360+
CPACR_EL1_ZEN_EL1EN)
361361

362362
#endif /* __ARM64_KVM_ARM_H__ */

arch/arm64/include/asm/sysreg.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,9 +1109,11 @@
11091109
#define ZCR_ELx_LEN_SIZE 9
11101110
#define ZCR_ELx_LEN_MASK 0x1ff
11111111

1112+
#define CPACR_EL1_FPEN_EL1EN (BIT(20)) /* enable EL1 access */
1113+
#define CPACR_EL1_FPEN_EL0EN (BIT(21)) /* enable EL0 access, if EL1EN set */
1114+
11121115
#define CPACR_EL1_ZEN_EL1EN (BIT(16)) /* enable EL1 access */
11131116
#define CPACR_EL1_ZEN_EL0EN (BIT(17)) /* enable EL0 access, if EL1EN set */
1114-
#define CPACR_EL1_ZEN (CPACR_EL1_ZEN_EL1EN | CPACR_EL1_ZEN_EL0EN)
11151117

11161118
/* GCR_EL1 Definitions */
11171119
#define SYS_GCR_EL1_RRND (BIT(16))

0 commit comments

Comments
 (0)