Skip to content

Commit bec0771

Browse files
committed
Merge tag 's390-6.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull more s390 updates from Alexander Gordeev: - Support MMIO read/write tracing - Enable THP swapping and THP migration - Unmask SLCF bit ("stateless command filtering") introduced with CEX8 cards, so that user space applications like lszcrypt could evaluate and list this feature - Fix the value of high_memory variable, so it considers possible tailing offline memory blocks - Make vmem_pte_alloc() consistent and always allocate memory of PAGE_SIZE for page tables. This ensures a page table occupies the whole page, as the rest of the code assumes - Fix kernel image end address in the decompressor debug output - Fix a typo in debug_sprintf_format_fn() comment * tag 's390-6.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/debug: Fix typo in debug_sprintf_format_fn() comment s390/boot: Fix startup debugging log s390/mm: Allocate page table with PAGE_SIZE granularity s390/mm: Enable THP_SWAP and THP_MIGRATION s390: Support CONFIG_TRACE_MMIO_ACCESS s390/mm: Set high_memory at the end of the identity mapping s390/ap: Unmask SLCF bit in card and queue ap functions sysfs
2 parents b1e06c1 + 2baf16f commit bec0771

File tree

8 files changed

+60
-7
lines changed

8 files changed

+60
-7
lines changed

arch/s390/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ config S390
7474
select ARCH_ENABLE_MEMORY_HOTPLUG if SPARSEMEM
7575
select ARCH_ENABLE_MEMORY_HOTREMOVE
7676
select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2
77+
select ARCH_ENABLE_THP_MIGRATION if TRANSPARENT_HUGEPAGE
7778
select ARCH_HAS_CPU_FINALIZE_INIT
7879
select ARCH_HAS_CURRENT_STACK_POINTER
7980
select ARCH_HAS_DEBUG_VIRTUAL
@@ -102,6 +103,7 @@ config S390
102103
select ARCH_HAS_UBSAN
103104
select ARCH_HAS_VDSO_TIME_DATA
104105
select ARCH_HAVE_NMI_SAFE_CMPXCHG
106+
select ARCH_HAVE_TRACE_MMIO_ACCESS
105107
select ARCH_INLINE_READ_LOCK
106108
select ARCH_INLINE_READ_LOCK_BH
107109
select ARCH_INLINE_READ_LOCK_IRQ
@@ -150,6 +152,7 @@ config S390
150152
select ARCH_WANT_KERNEL_PMD_MKWRITE
151153
select ARCH_WANT_LD_ORPHAN_WARN
152154
select ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP
155+
select ARCH_WANTS_THP_SWAP
153156
select BUILDTIME_TABLE_SORT
154157
select CLONE_BACKWARDS2
155158
select DCACHE_WORD_ACCESS if !KMSAN

arch/s390/boot/startup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ static unsigned long setup_kernel_memory_layout(unsigned long kernel_size)
384384
kernel_start = round_down(kernel_end - kernel_size, THREAD_SIZE);
385385
boot_debug("Randomization range: 0x%016lx-0x%016lx\n", vmax - kaslr_len, vmax);
386386
boot_debug("kernel image: 0x%016lx-0x%016lx (kaslr)\n", kernel_start,
387-
kernel_size + kernel_size);
387+
kernel_start + kernel_size);
388388
} else if (vmax < __NO_KASLR_END_KERNEL || vsize > __NO_KASLR_END_KERNEL) {
389389
kernel_start = round_down(vmax - kernel_size, THREAD_SIZE);
390390
boot_debug("kernel image: 0x%016lx-0x%016lx (constrained)\n", kernel_start,

arch/s390/include/asm/ap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ struct ap_tapq_hwinfo {
103103
unsigned int accel : 1; /* A */
104104
unsigned int ep11 : 1; /* X */
105105
unsigned int apxa : 1; /* APXA */
106-
unsigned int : 1;
106+
unsigned int slcf : 1; /* Cmd filtering avail. */
107107
unsigned int class : 8;
108108
unsigned int bs : 2; /* SE bind/assoc */
109109
unsigned int : 14;

arch/s390/include/asm/pgtable.h

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,12 @@ static inline pmd_t pmd_clear_soft_dirty(pmd_t pmd)
963963
return clear_pmd_bit(pmd, __pgprot(_SEGMENT_ENTRY_SOFT_DIRTY));
964964
}
965965

966+
#ifdef CONFIG_ARCH_ENABLE_THP_MIGRATION
967+
#define pmd_swp_soft_dirty(pmd) pmd_soft_dirty(pmd)
968+
#define pmd_swp_mksoft_dirty(pmd) pmd_mksoft_dirty(pmd)
969+
#define pmd_swp_clear_soft_dirty(pmd) pmd_clear_soft_dirty(pmd)
970+
#endif
971+
966972
/*
967973
* query functions pte_write/pte_dirty/pte_young only work if
968974
* pte_present() is true. Undefined behaviour if not..
@@ -1979,6 +1985,45 @@ static inline unsigned long __swp_offset_rste(swp_entry_t entry)
19791985

19801986
#define __rste_to_swp_entry(rste) ((swp_entry_t) { rste })
19811987

1988+
/*
1989+
* s390 has different layout for PTE and region / segment table entries (RSTE).
1990+
* This is also true for swap entries, and their swap type and offset encoding.
1991+
* For hugetlbfs PTE_MARKER support, s390 has internal __swp_type_rste() and
1992+
* __swp_offset_rste() helpers to correctly handle RSTE swap entries.
1993+
*
1994+
* But common swap code does not know about this difference, and only uses
1995+
* __swp_type(), __swp_offset() and __swp_entry() helpers for conversion between
1996+
* arch-dependent and arch-independent representation of swp_entry_t for all
1997+
* pagetable levels. On s390, those helpers only work for PTE swap entries.
1998+
*
1999+
* Therefore, implement __pmd_to_swp_entry() to build a fake PTE swap entry
2000+
* and return the arch-dependent representation of that. Correspondingly,
2001+
* implement __swp_entry_to_pmd() to convert that into a proper PMD swap
2002+
* entry again. With this, the arch-dependent swp_entry_t representation will
2003+
* always look like a PTE swap entry in common code.
2004+
*
2005+
* This is somewhat similar to fake PTEs in hugetlbfs code for s390, but only
2006+
* requires conversion of the swap type and offset, and not all the possible
2007+
* PTE bits.
2008+
*/
2009+
static inline swp_entry_t __pmd_to_swp_entry(pmd_t pmd)
2010+
{
2011+
swp_entry_t arch_entry;
2012+
pte_t pte;
2013+
2014+
arch_entry = __rste_to_swp_entry(pmd_val(pmd));
2015+
pte = mk_swap_pte(__swp_type_rste(arch_entry), __swp_offset_rste(arch_entry));
2016+
return __pte_to_swp_entry(pte);
2017+
}
2018+
2019+
static inline pmd_t __swp_entry_to_pmd(swp_entry_t arch_entry)
2020+
{
2021+
pmd_t pmd;
2022+
2023+
pmd = __pmd(mk_swap_rste(__swp_type(arch_entry), __swp_offset(arch_entry)));
2024+
return pmd;
2025+
}
2026+
19822027
extern int vmem_add_mapping(unsigned long start, unsigned long size);
19832028
extern void vmem_remove_mapping(unsigned long start, unsigned long size);
19842029
extern int __vmem_map_4k_page(unsigned long addr, unsigned long phys, pgprot_t prot, bool alloc);

arch/s390/kernel/debug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1677,7 +1677,7 @@ EXPORT_SYMBOL(debug_dflt_header_fn);
16771677

16781678
/*
16791679
* prints debug data sprintf-formatted:
1680-
* debug_sprinf_event/exception calls must be used together with this view
1680+
* debug_sprintf_event/exception calls must be used together with this view
16811681
*/
16821682

16831683
#define DEBUG_SPRINTF_MAX_ARGS 10

arch/s390/kernel/setup.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,11 @@ static void __init memblock_add_physmem_info(void)
719719
memblock_set_node(0, ULONG_MAX, &memblock.memory, 0);
720720
}
721721

722+
static void __init setup_high_memory(void)
723+
{
724+
high_memory = __va(ident_map_size);
725+
}
726+
722727
/*
723728
* Reserve memory used for lowcore.
724729
*/
@@ -951,6 +956,7 @@ void __init setup_arch(char **cmdline_p)
951956

952957
free_physmem_info();
953958
setup_memory_end();
959+
setup_high_memory();
954960
memblock_dump_all();
955961
setup_memory();
956962

arch/s390/mm/vmem.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,12 @@ void *vmem_crst_alloc(unsigned long val)
6464

6565
pte_t __ref *vmem_pte_alloc(void)
6666
{
67-
unsigned long size = PTRS_PER_PTE * sizeof(pte_t);
6867
pte_t *pte;
6968

7069
if (slab_is_available())
71-
pte = (pte_t *) page_table_alloc(&init_mm);
70+
pte = (pte_t *)page_table_alloc(&init_mm);
7271
else
73-
pte = (pte_t *) memblock_alloc(size, size);
72+
pte = (pte_t *)memblock_alloc(PAGE_SIZE, PAGE_SIZE);
7473
if (!pte)
7574
return NULL;
7675
memset64((u64 *)pte, _PAGE_INVALID, PTRS_PER_PTE);

drivers/s390/crypto/ap_bus.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ struct ap_card {
180180
atomic64_t total_request_count; /* # requests ever for this AP device.*/
181181
};
182182

183-
#define TAPQ_CARD_HWINFO_MASK 0xFEFF0000FFFF0F0FUL
183+
#define TAPQ_CARD_HWINFO_MASK 0xFFFF0000FFFF0F0FUL
184184
#define ASSOC_IDX_INVALID 0x10000
185185

186186
#define to_ap_card(x) container_of((x), struct ap_card, ap_dev.device)

0 commit comments

Comments
 (0)