Skip to content

Commit 02eab44

Browse files
committed
Merge branch 'for-next/misc' into for-next/core
* for-next/misc: arm64/mm: use GENMASK_ULL for TTBR_BADDR_MASK_52 arm64: numa: Don't check node against MAX_NUMNODES arm64: mm: Remove assembly DMA cache maintenance wrappers arm64/mm: Define defer_reserve_crashkernel() arm64: fix oops in concurrently setting insn_emulation sysctls arm64: Do not forget syscall when starting a new thread. arm64: boot: add zstd support
2 parents 8184a8b + 19198ab commit 02eab44

File tree

11 files changed

+36
-68
lines changed

11 files changed

+36
-68
lines changed

arch/arm64/boot/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
OBJCOPYFLAGS_Image :=-O binary -R .note -R .note.gnu.build-id -R .comment -S
1818

19-
targets := Image Image.bz2 Image.gz Image.lz4 Image.lzma Image.lzo
19+
targets := Image Image.bz2 Image.gz Image.lz4 Image.lzma Image.lzo Image.zst
2020

2121
$(obj)/Image: vmlinux FORCE
2222
$(call if_changed,objcopy)
@@ -35,3 +35,6 @@ $(obj)/Image.lzma: $(obj)/Image FORCE
3535

3636
$(obj)/Image.lzo: $(obj)/Image FORCE
3737
$(call if_changed,lzo)
38+
39+
$(obj)/Image.zst: $(obj)/Image FORCE
40+
$(call if_changed,zstd)

arch/arm64/include/asm/cacheflush.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,6 @@ static inline void flush_icache_range(unsigned long start, unsigned long end)
104104
}
105105
#define flush_icache_range flush_icache_range
106106

107-
/*
108-
* Cache maintenance functions used by the DMA API. No to be used directly.
109-
*/
110-
extern void __dma_map_area(const void *, size_t, int);
111-
extern void __dma_unmap_area(const void *, size_t, int);
112-
extern void __dma_flush_area(const void *, size_t);
113-
114107
/*
115108
* Copy user data from/to a page which is mapped into a different
116109
* processes address space. Really, we want to allow our "user

arch/arm64/include/asm/memory.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,11 @@ static inline void *phys_to_virt(phys_addr_t x)
351351
})
352352

353353
void dump_mem_limit(void);
354+
355+
static inline bool defer_reserve_crashkernel(void)
356+
{
357+
return IS_ENABLED(CONFIG_ZONE_DMA) || IS_ENABLED(CONFIG_ZONE_DMA32);
358+
}
354359
#endif /* !ASSEMBLY */
355360

356361
/*

arch/arm64/include/asm/pgtable-hwdef.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,10 +281,9 @@
281281
*/
282282
#ifdef CONFIG_ARM64_PA_BITS_52
283283
/*
284-
* This should be GENMASK_ULL(47, 2).
285284
* TTBR_ELx[1] is RES0 in this configuration.
286285
*/
287-
#define TTBR_BADDR_MASK_52 (((UL(1) << 46) - 1) << 2)
286+
#define TTBR_BADDR_MASK_52 GENMASK_ULL(47, 2)
288287
#endif
289288

290289
#ifdef CONFIG_ARM64_VA_BITS_52

arch/arm64/include/asm/processor.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,9 @@ void tls_preserve_current_state(void);
272272

273273
static inline void start_thread_common(struct pt_regs *regs, unsigned long pc)
274274
{
275+
s32 previous_syscall = regs->syscallno;
275276
memset(regs, 0, sizeof(*regs));
276-
forget_syscall(regs);
277+
regs->syscallno = previous_syscall;
277278
regs->pc = pc;
278279

279280
if (system_uses_irq_prio_masking())

arch/arm64/kernel/acpi_numa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void __init acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa)
109109
pxm = pa->proximity_domain;
110110
node = acpi_map_pxm_to_node(pxm);
111111

112-
if (node == NUMA_NO_NODE || node >= MAX_NUMNODES) {
112+
if (node == NUMA_NO_NODE) {
113113
pr_err("SRAT: Too many proximity domains %d\n", pxm);
114114
bad_srat();
115115
return;

arch/arm64/kernel/armv8_deprecated.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ struct insn_emulation {
5959
static LIST_HEAD(insn_emulation);
6060
static int nr_insn_emulated __initdata;
6161
static DEFINE_RAW_SPINLOCK(insn_emulation_lock);
62+
static DEFINE_MUTEX(insn_emulation_mutex);
6263

6364
static void register_emulation_hooks(struct insn_emulation_ops *ops)
6465
{
@@ -207,10 +208,10 @@ static int emulation_proc_handler(struct ctl_table *table, int write,
207208
loff_t *ppos)
208209
{
209210
int ret = 0;
210-
struct insn_emulation *insn = (struct insn_emulation *) table->data;
211+
struct insn_emulation *insn = container_of(table->data, struct insn_emulation, current_mode);
211212
enum insn_emulation_mode prev_mode = insn->current_mode;
212213

213-
table->data = &insn->current_mode;
214+
mutex_lock(&insn_emulation_mutex);
214215
ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
215216

216217
if (ret || !write || prev_mode == insn->current_mode)
@@ -223,7 +224,7 @@ static int emulation_proc_handler(struct ctl_table *table, int write,
223224
update_insn_emulation_mode(insn, INSN_UNDEF);
224225
}
225226
ret:
226-
table->data = insn;
227+
mutex_unlock(&insn_emulation_mutex);
227228
return ret;
228229
}
229230

@@ -247,7 +248,7 @@ static void __init register_insn_emulation_sysctl(void)
247248
sysctl->maxlen = sizeof(int);
248249

249250
sysctl->procname = insn->ops->name;
250-
sysctl->data = insn;
251+
sysctl->data = &insn->current_mode;
251252
sysctl->extra1 = &insn->min;
252253
sysctl->extra2 = &insn->max;
253254
sysctl->proc_handler = emulation_proc_handler;

arch/arm64/mm/cache.S

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -194,44 +194,3 @@ SYM_FUNC_START(__pi_dcache_clean_pop)
194194
ret
195195
SYM_FUNC_END(__pi_dcache_clean_pop)
196196
SYM_FUNC_ALIAS(dcache_clean_pop, __pi_dcache_clean_pop)
197-
198-
/*
199-
* __dma_flush_area(start, size)
200-
*
201-
* clean & invalidate D / U line
202-
*
203-
* - start - virtual start address of region
204-
* - size - size in question
205-
*/
206-
SYM_FUNC_START(__pi___dma_flush_area)
207-
add x1, x0, x1
208-
dcache_by_line_op civac, sy, x0, x1, x2, x3
209-
ret
210-
SYM_FUNC_END(__pi___dma_flush_area)
211-
SYM_FUNC_ALIAS(__dma_flush_area, __pi___dma_flush_area)
212-
213-
/*
214-
* __dma_map_area(start, size, dir)
215-
* - start - kernel virtual start address
216-
* - size - size of region
217-
* - dir - DMA direction
218-
*/
219-
SYM_FUNC_START(__pi___dma_map_area)
220-
add x1, x0, x1
221-
b __pi_dcache_clean_poc
222-
SYM_FUNC_END(__pi___dma_map_area)
223-
SYM_FUNC_ALIAS(__dma_map_area, __pi___dma_map_area)
224-
225-
/*
226-
* __dma_unmap_area(start, size, dir)
227-
* - start - kernel virtual start address
228-
* - size - size of region
229-
* - dir - DMA direction
230-
*/
231-
SYM_FUNC_START(__pi___dma_unmap_area)
232-
add x1, x0, x1
233-
cmp w2, #DMA_TO_DEVICE
234-
b.ne __pi_dcache_inval_poc
235-
ret
236-
SYM_FUNC_END(__pi___dma_unmap_area)
237-
SYM_FUNC_ALIAS(__dma_unmap_area, __pi___dma_unmap_area)

arch/arm64/mm/dma-mapping.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,29 @@
1414
#include <asm/xen/xen-ops.h>
1515

1616
void arch_sync_dma_for_device(phys_addr_t paddr, size_t size,
17-
enum dma_data_direction dir)
17+
enum dma_data_direction dir)
1818
{
19-
__dma_map_area(phys_to_virt(paddr), size, dir);
19+
unsigned long start = (unsigned long)phys_to_virt(paddr);
20+
21+
dcache_clean_poc(start, start + size);
2022
}
2123

2224
void arch_sync_dma_for_cpu(phys_addr_t paddr, size_t size,
23-
enum dma_data_direction dir)
25+
enum dma_data_direction dir)
2426
{
25-
__dma_unmap_area(phys_to_virt(paddr), size, dir);
27+
unsigned long start = (unsigned long)phys_to_virt(paddr);
28+
29+
if (dir == DMA_TO_DEVICE)
30+
return;
31+
32+
dcache_inval_poc(start, start + size);
2633
}
2734

2835
void arch_dma_prep_coherent(struct page *page, size_t size)
2936
{
30-
__dma_flush_area(page_address(page), size);
37+
unsigned long start = (unsigned long)page_address(page);
38+
39+
dcache_clean_inval_poc(start, start + size);
3140
}
3241

3342
#ifdef CONFIG_IOMMU_DMA

arch/arm64/mm/init.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ void __init arm64_memblock_init(void)
389389

390390
early_init_fdt_scan_reserved_mem();
391391

392-
if (!IS_ENABLED(CONFIG_ZONE_DMA) && !IS_ENABLED(CONFIG_ZONE_DMA32))
392+
if (!defer_reserve_crashkernel())
393393
reserve_crashkernel();
394394

395395
high_memory = __va(memblock_end_of_DRAM() - 1) + 1;
@@ -438,7 +438,7 @@ void __init bootmem_init(void)
438438
* request_standard_resources() depends on crashkernel's memory being
439439
* reserved, so do it here.
440440
*/
441-
if (IS_ENABLED(CONFIG_ZONE_DMA) || IS_ENABLED(CONFIG_ZONE_DMA32))
441+
if (defer_reserve_crashkernel())
442442
reserve_crashkernel();
443443

444444
memblock_dump_all();

0 commit comments

Comments
 (0)