forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 's390-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/g…
…it/s390/linux Pull s390 updates from Vasily Gorbik: - Make use of the IBM z16 processor activity instrumentation facility extension to count neural network processor assist operations: add a new PMU device driver so that perf can make use of this. - Rework memcpy_real() to avoid DAT-off mode. - Rework absolute lowcore access code. - Various small fixes and improvements all over the code. * tag 's390-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/pci: remove unused bus_next field from struct zpci_dev s390/cio: remove unused ccw_device_force_console() declaration s390/pai: Add support for PAI Extension 1 NNPA counters s390/mm: fix no previous prototype warnings in maccess.c s390/mm: uninline copy_oldmem_kernel() function s390/mm,ptdump: add real memory copy page markers s390/mm: rework memcpy_real() to avoid DAT-off mode s390/dump: save IPL CPU registers once DAT is available s390/pci: convert high_memory to physical address s390/smp,ptdump: add absolute lowcore markers s390/smp: rework absolute lowcore access s390/smp: call smp_reinit_ipl_cpu() before scheduler is available s390/ptdump: add missing amode31 markers s390/mm: split lowcore pages with set_memory_4k() s390/mm: remove unused access parameter from do_fault_error() s390/delay: sync comment within __delay() with reality s390: move from strlcpy with unused retval to strscpy
- Loading branch information
Showing
42 changed files
with
1,176 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
#ifndef _ASM_S390_ABS_LOWCORE_H | ||
#define _ASM_S390_ABS_LOWCORE_H | ||
|
||
#include <asm/lowcore.h> | ||
|
||
#define ABS_LOWCORE_MAP_SIZE (NR_CPUS * sizeof(struct lowcore)) | ||
|
||
extern unsigned long __abs_lowcore; | ||
extern bool abs_lowcore_mapped; | ||
|
||
struct lowcore *get_abs_lowcore(unsigned long *flags); | ||
void put_abs_lowcore(struct lowcore *lc, unsigned long flags); | ||
int abs_lowcore_map(int cpu, struct lowcore *lc, bool alloc); | ||
void abs_lowcore_unmap(int cpu); | ||
|
||
#endif /* _ASM_S390_ABS_LOWCORE_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
#ifndef __ASM_S390_MACCESS_H | ||
#define __ASM_S390_MACCESS_H | ||
|
||
#include <linux/types.h> | ||
|
||
struct iov_iter; | ||
|
||
extern unsigned long __memcpy_real_area; | ||
void memcpy_real_init(void); | ||
size_t memcpy_real_iter(struct iov_iter *iter, unsigned long src, size_t count); | ||
int memcpy_real(void *dest, unsigned long src, size_t count); | ||
#ifdef CONFIG_CRASH_DUMP | ||
int copy_oldmem_kernel(void *dst, unsigned long src, size_t count); | ||
#endif | ||
|
||
#endif /* __ASM_S390_MACCESS_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
|
||
#include <linux/pgtable.h> | ||
#include <asm/abs_lowcore.h> | ||
|
||
#define ABS_LOWCORE_UNMAPPED 1 | ||
#define ABS_LOWCORE_LAP_ON 2 | ||
#define ABS_LOWCORE_IRQS_ON 4 | ||
|
||
unsigned long __bootdata_preserved(__abs_lowcore); | ||
bool __ro_after_init abs_lowcore_mapped; | ||
|
||
int abs_lowcore_map(int cpu, struct lowcore *lc, bool alloc) | ||
{ | ||
unsigned long addr = __abs_lowcore + (cpu * sizeof(struct lowcore)); | ||
unsigned long phys = __pa(lc); | ||
int rc, i; | ||
|
||
for (i = 0; i < LC_PAGES; i++) { | ||
rc = __vmem_map_4k_page(addr, phys, PAGE_KERNEL, alloc); | ||
if (rc) { | ||
/* | ||
* Do not unmap allocated page tables in case the | ||
* allocation was not requested. In such a case the | ||
* request is expected coming from an atomic context, | ||
* while the unmap attempt might sleep. | ||
*/ | ||
if (alloc) { | ||
for (--i; i >= 0; i--) { | ||
addr -= PAGE_SIZE; | ||
vmem_unmap_4k_page(addr); | ||
} | ||
} | ||
return rc; | ||
} | ||
addr += PAGE_SIZE; | ||
phys += PAGE_SIZE; | ||
} | ||
return 0; | ||
} | ||
|
||
void abs_lowcore_unmap(int cpu) | ||
{ | ||
unsigned long addr = __abs_lowcore + (cpu * sizeof(struct lowcore)); | ||
int i; | ||
|
||
for (i = 0; i < LC_PAGES; i++) { | ||
vmem_unmap_4k_page(addr); | ||
addr += PAGE_SIZE; | ||
} | ||
} | ||
|
||
struct lowcore *get_abs_lowcore(unsigned long *flags) | ||
{ | ||
unsigned long irq_flags; | ||
union ctlreg0 cr0; | ||
int cpu; | ||
|
||
*flags = 0; | ||
cpu = get_cpu(); | ||
if (abs_lowcore_mapped) { | ||
return ((struct lowcore *)__abs_lowcore) + cpu; | ||
} else { | ||
if (cpu != 0) | ||
panic("Invalid unmapped absolute lowcore access\n"); | ||
local_irq_save(irq_flags); | ||
if (!irqs_disabled_flags(irq_flags)) | ||
*flags |= ABS_LOWCORE_IRQS_ON; | ||
__ctl_store(cr0.val, 0, 0); | ||
if (cr0.lap) { | ||
*flags |= ABS_LOWCORE_LAP_ON; | ||
__ctl_clear_bit(0, 28); | ||
} | ||
*flags |= ABS_LOWCORE_UNMAPPED; | ||
return lowcore_ptr[0]; | ||
} | ||
} | ||
|
||
void put_abs_lowcore(struct lowcore *lc, unsigned long flags) | ||
{ | ||
if (abs_lowcore_mapped) { | ||
if (flags) | ||
panic("Invalid mapped absolute lowcore release\n"); | ||
} else { | ||
if (smp_processor_id() != 0) | ||
panic("Invalid mapped absolute lowcore access\n"); | ||
if (!(flags & ABS_LOWCORE_UNMAPPED)) | ||
panic("Invalid unmapped absolute lowcore release\n"); | ||
if (flags & ABS_LOWCORE_LAP_ON) | ||
__ctl_set_bit(0, 28); | ||
if (flags & ABS_LOWCORE_IRQS_ON) | ||
local_irq_enable(); | ||
} | ||
put_cpu(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.