Skip to content

Commit aa18761

Browse files
committed
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Catalin Marinas: - Fix max_pfn calculation when hotplugging memory so that it never decreases - Fix dereference of unused source register in the MOPS SET operation fault handling - Fix NULL calling in do_compat_alignment_fixup() when the 32-bit user space does an unaligned LDREX/STREX - Add the HiSilicon HIP09 processor to the Spectre-BHB affected CPUs - Drop unused code pud accessors (special/mkspecial) * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: Don't call NULL in do_compat_alignment_fixup() arm64: Add support for HIP09 Spectre-BHB mitigation arm64: mm: Drop dead code for pud special bit handling arm64: mops: Do not dereference src reg for a set operation arm64: mm: Correct the update of max_pfn
2 parents 531a62f + c28f31d commit aa18761

File tree

6 files changed

+9
-8
lines changed

6 files changed

+9
-8
lines changed

arch/arm64/include/asm/cputype.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
#define FUJITSU_CPU_PART_A64FX 0x001
133133

134134
#define HISI_CPU_PART_TSV110 0xD01
135+
#define HISI_CPU_PART_HIP09 0xD02
135136

136137
#define APPLE_CPU_PART_M1_ICESTORM 0x022
137138
#define APPLE_CPU_PART_M1_FIRESTORM 0x023
@@ -218,6 +219,7 @@
218219
#define MIDR_NVIDIA_CARMEL MIDR_CPU_MODEL(ARM_CPU_IMP_NVIDIA, NVIDIA_CPU_PART_CARMEL)
219220
#define MIDR_FUJITSU_A64FX MIDR_CPU_MODEL(ARM_CPU_IMP_FUJITSU, FUJITSU_CPU_PART_A64FX)
220221
#define MIDR_HISI_TSV110 MIDR_CPU_MODEL(ARM_CPU_IMP_HISI, HISI_CPU_PART_TSV110)
222+
#define MIDR_HISI_HIP09 MIDR_CPU_MODEL(ARM_CPU_IMP_HISI, HISI_CPU_PART_HIP09)
221223
#define MIDR_APPLE_M1_ICESTORM MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_ICESTORM)
222224
#define MIDR_APPLE_M1_FIRESTORM MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_FIRESTORM)
223225
#define MIDR_APPLE_M1_ICESTORM_PRO MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_ICESTORM_PRO)

arch/arm64/include/asm/pgtable.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -633,11 +633,6 @@ static inline pud_t pud_mkhuge(pud_t pud)
633633
#define pud_pfn(pud) ((__pud_to_phys(pud) & PUD_MASK) >> PAGE_SHIFT)
634634
#define pfn_pud(pfn,prot) __pud(__phys_to_pud_val((phys_addr_t)(pfn) << PAGE_SHIFT) | pgprot_val(prot))
635635

636-
#ifdef CONFIG_ARCH_SUPPORTS_PUD_PFNMAP
637-
#define pud_special(pte) pte_special(pud_pte(pud))
638-
#define pud_mkspecial(pte) pte_pud(pte_mkspecial(pud_pte(pud)))
639-
#endif
640-
641636
#define pmd_pgprot pmd_pgprot
642637
static inline pgprot_t pmd_pgprot(pmd_t pmd)
643638
{

arch/arm64/include/asm/traps.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,9 @@ static inline void arm64_mops_reset_regs(struct user_pt_regs *regs, unsigned lon
109109
int dstreg = ESR_ELx_MOPS_ISS_DESTREG(esr);
110110
int srcreg = ESR_ELx_MOPS_ISS_SRCREG(esr);
111111
int sizereg = ESR_ELx_MOPS_ISS_SIZEREG(esr);
112-
unsigned long dst, src, size;
112+
unsigned long dst, size;
113113

114114
dst = regs->regs[dstreg];
115-
src = regs->regs[srcreg];
116115
size = regs->regs[sizereg];
117116

118117
/*
@@ -129,6 +128,7 @@ static inline void arm64_mops_reset_regs(struct user_pt_regs *regs, unsigned lon
129128
}
130129
} else {
131130
/* CPY* instruction */
131+
unsigned long src = regs->regs[srcreg];
132132
if (!(option_a ^ wrong_option)) {
133133
/* Format is from Option B */
134134
if (regs->pstate & PSR_N_BIT) {

arch/arm64/kernel/compat_alignment.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,8 @@ int do_compat_alignment_fixup(unsigned long addr, struct pt_regs *regs)
368368
return 1;
369369
}
370370

371+
if (!handler)
372+
return 1;
371373
type = handler(addr, instr, regs);
372374

373375
if (type == TYPE_ERROR || type == TYPE_FAULT)

arch/arm64/kernel/proton-pack.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,7 @@ static u8 spectre_bhb_loop_affected(void)
901901
MIDR_ALL_VERSIONS(MIDR_CORTEX_A77),
902902
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N1),
903903
MIDR_ALL_VERSIONS(MIDR_QCOM_KRYO_4XX_GOLD),
904+
MIDR_ALL_VERSIONS(MIDR_HISI_HIP09),
904905
{},
905906
};
906907
static const struct midr_range spectre_bhb_k11_list[] = {

arch/arm64/mm/mmu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,8 @@ int arch_add_memory(int nid, u64 start, u64 size,
13611361
__remove_pgd_mapping(swapper_pg_dir,
13621362
__phys_to_virt(start), size);
13631363
else {
1364-
max_pfn = PFN_UP(start + size);
1364+
/* Address of hotplugged memory can be smaller */
1365+
max_pfn = max(max_pfn, PFN_UP(start + size));
13651366
max_low_pfn = max_pfn;
13661367
}
13671368

0 commit comments

Comments
 (0)