Skip to contentSkip to conversation

virtio-mem: s390x support

PATCH Superseded David Hildenbrand 4 participants 12 messages Sep 10, 2024 – Oct 10, 2024

Subsystems (4)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover virtio-mem: s390x support

Let's finally add s390x support for virtio-mem; my last RFC was sent 4 years ago, and a lot changed in the meantime.

This is based on mm/stable.

I sent out the QEMU part earlier today [1], that contains some more details and a usage example on s390x (last patch).

There is not too much in here: The biggest part is querying a new diag(500) STORAGE_LIMIT hypercall to obtain the proper "max_physmem_end". Once this and the QEMU part will go upstream, it will get documented in [2]

The last two patches are not strictly required but certainly nice-to-have.

Note that -- in contrast to standby memory -- virtio-mem memory must be configured to be automatically onlined as soon as hotplugged. The easiest approach is using the "memhp_default_state=" kernel parameter or by using proper udev rules. More details can be found at [3].

I have reviving+upstreaming a systemd service to handle configuring that on my todo list, but for some reason I keep getting distracted ...

I tested various things, including:
* Various memory hotplug/hotunplug combinations
* Device hotplug/hotunplug
* /proc/iomem output
* reboot
* kexec
* kdump: make sure we don't hotplug memory

One remaining work item is kdump support for virtio-mem memory. I am working on a prototype that will be fairly straight forward, because the virtio-mem driver already supports a special kdump mode and dracut will already include it in the initrd as default. With holiday and conferences coming up I rather sent this out now.

[1] https://lkml.kernel.org/r/[email protected]
[2] https://gitlab.com/davidhildenbrand/s390x-os-virt-spec
[3] https://virtio-mem.gitlab.io/user-guide/user-guide-linux.html

Cc Heiko Carstens <[email protected]>
Cc Vasily Gorbik <[email protected]>
Cc Alexander Gordeev <[email protected]>
Cc Christian Borntraeger <[email protected]>
Cc Sven Schnelle <[email protected]>
Cc Thomas Huth <[email protected]>
Cc Cornelia Huck <[email protected]>
Cc Janosch Frank <[email protected]>
Cc Claudio Imbrenda <[email protected]>
Cc "Michael S. Tsirkin" <[email protected]>
Cc Jason Wang <[email protected]>
Cc Xuan Zhuo <[email protected]>
Cc "Eugenio Pérez" <[email protected]>
Cc Andrew Morton <[email protected]>

David Hildenbrand (5):
s390/kdump: implement is_kdump_kernel() s390/physmem_info: query diag500(STORAGE_LIMIT) to support QEMU/KVM
memory devices
virtio-mem: s390x support
lib/Kconfig.debug: default STRICT_DEVMEM to "y" on s390x s390/sparsemem: reduce section size to 128 MiB

 arch/s390/boot/physmem_info.c        | 46 ++++++++++++++++++++++++++--
 arch/s390/include/asm/kexec.h        |  4 +++
 arch/s390/include/asm/physmem_info.h |  3 ++
 arch/s390/include/asm/sparsemem.h    |  2 +-
 arch/s390/kernel/crash_dump.c        |  6 ++++
 drivers/virtio/Kconfig               | 12 ++++----
 lib/Kconfig.debug                    |  2 +-
 7 files changed, 64 insertions(+), 11 deletions(-)
Signature · 1 line
2.46.0
#1 lore raw

PATCH 1/5 s390/kdump: implement is_kdump_kernel()

s390x currently always results in is_kdump_kernel() == false, because it sets "elfcorehdr_addr = ELFCORE_ADDR_MAX;" early during setup_arch to deactivate the elfcorehdr= kernel parameter.

Let's follow the powerpc example and implement our own logic.

This is required for virtio-mem to reliably identify a kdump environment to not try hotplugging memory.

---
 arch/s390/include/asm/kexec.h | 4 ++++
 arch/s390/kernel/crash_dump.c | 6 ++++++
 2 files changed, 10 insertions(+)
arch/s390/include/asm/kexec.h +4 -0
index 1bd08eb56d5f..bd20543515f5 100644
@@ -94,6 +94,9 @@ void arch_kexec_protect_crashkres(void);
 
 void arch_kexec_unprotect_crashkres(void);
 #define arch_kexec_unprotect_crashkres arch_kexec_unprotect_crashkres
+
+bool is_kdump_kernel(void);
+#define is_kdump_kernel is_kdump_kernel
 #endif
 
 #ifdef CONFIG_KEXEC_FILE
@@ -107,4 +110,5 @@ int arch_kexec_apply_relocations_add(struct purgatory_info *pi,
 int arch_kimage_file_post_load_cleanup(struct kimage *image);
 #define arch_kimage_file_post_load_cleanup arch_kimage_file_post_load_cleanup
 #endif
+
 #endif /*_S390_KEXEC_H */
arch/s390/kernel/crash_dump.c +6 -0
index edae13416196..cca1827d3d2e 100644
@@ -237,6 +237,12 @@ int remap_oldmem_pfn_range(struct vm_area_struct *vma, unsigned long from,
 						       prot);
 }
 
+bool is_kdump_kernel(void)
+{
+	return oldmem_data.start && !is_ipl_type_dump();
+}
+EXPORT_SYMBOL_GPL(is_kdump_kernel);
+
 static const char *nt_name(Elf64_Word type)
 {
 	const char *name = "LINUX";
Signature · 1 line
2.46.0
#2 lore raw

PATCH 2/5 s390/physmem_info: query diag500(STORAGE_LIMIT) to support QEMU/KVM memory devices

In reply to David Hildenbrand

To support memory devices under QEMU/KVM, such as virtio-mem, we have to prepare our kernel virtual address space accordingly and have to know the highest possible physical memory address we might see
later: the storage limit. The good old SCLP interface is not suitable for this use case.

In particular, memory owned by memory devices has no relationship to storage increments, it is always detected using the device driver, and unaware OSes (no driver) must never try making use of that memory. Consequently this memory is located outside of the "maximum storage increment"-indicated memory range.

Let's use our new diag500 STORAGE_LIMIT subcode to query this storage limit that can exceed the "maximum storage increment", and use the existing interfaces (i.e., SCLP) to obtain information about the initial memory that is not owned+managed by memory devices.

If a hypervisor does not support such memory devices, the address exposed through diag500 STORAGE_LIMIT will correspond to the maximum storage increment exposed through SCLP.

To teach kdump on s390x to include memory owned by memory devices, there will be ways to query the relevant memory ranges from the device via a driver running in special kdump mode (like virtio-mem already implements to filter /proc/vmcore access so we don't end up reading from unplugged device blocks).

---
 arch/s390/boot/physmem_info.c        | 46 ++++++++++++++++++++++++++--
 arch/s390/include/asm/physmem_info.h |  3 ++
 2 files changed, 46 insertions(+), 3 deletions(-)
arch/s390/boot/physmem_info.c +43 -3
index 4c9ad8258f7e..9cac8550bdca 100644
@@ -109,6 +109,38 @@ static int diag260(void)
 	return 0;
 }
 
+static int diag500_storage_limit(unsigned long *max_physmem_end)
+{
+	register unsigned long __nr asm("1") = 0x4;
+	register unsigned long __storage_limit asm("2") = 0;
+	unsigned long reg1, reg2;
+	psw_t old;
+
+	asm volatile(
+		"	mvc	0(16,%[psw_old]),0(%[psw_pgm])\n"
+		"	epsw	%[reg1],%[reg2]\n"
+		"	st	%[reg1],0(%[psw_pgm])\n"
+		"	st	%[reg2],4(%[psw_pgm])\n"
+		"	larl	%[reg1],1f\n"
+		"	stg	%[reg1],8(%[psw_pgm])\n"
+		"	diag	2,4,0x500\n"
+		"1:	mvc	0(16,%[psw_pgm]),0(%[psw_old])\n"
+		: [reg1] "=&d" (reg1),
+		  [reg2] "=&a" (reg2),
+		  "+&d" (__storage_limit),
+		  "=Q" (get_lowcore()->program_new_psw),
+		  "=Q" (old)
+		: [psw_old] "a" (&old),
+		  [psw_pgm] "a" (&get_lowcore()->program_new_psw),
+		  "d" (__nr)
+		: "memory");
+	if (!__storage_limit)
+	        return -EINVAL;
+	/* convert inclusive end to exclusive end. */
+	*max_physmem_end = __storage_limit + 1;
+	return 0;
+}
+
 static int tprot(unsigned long addr)
 {
 	unsigned long reg1, reg2;
@@ -157,7 +189,9 @@ unsigned long detect_max_physmem_end(void)
 {
 	unsigned long max_physmem_end = 0;
 
-	if (!sclp_early_get_memsize(&max_physmem_end)) {
+	if (!diag500_storage_limit(&max_physmem_end)) {
+		physmem_info.info_source = MEM_DETECT_DIAG500_STOR_LIMIT;
+	} else if (!sclp_early_get_memsize(&max_physmem_end)) {
 		physmem_info.info_source = MEM_DETECT_SCLP_READ_INFO;
 	} else {
 		max_physmem_end = search_mem_end();
@@ -170,11 +204,17 @@ void detect_physmem_online_ranges(unsigned long max_physmem_end)
 {
 	if (!sclp_early_read_storage_info()) {
 		physmem_info.info_source = MEM_DETECT_SCLP_STOR_INFO;
+		return;
 	} else if (!diag260()) {
 		physmem_info.info_source = MEM_DETECT_DIAG260;
-	} else if (max_physmem_end) {
-		add_physmem_online_range(0, max_physmem_end);
+		return;
+	} else if (physmem_info.info_source == MEM_DETECT_DIAG500_STOR_LIMIT) {
+		max_physmem_end = 0;
+		if (!sclp_early_get_memsize(&max_physmem_end))
+			physmem_info.info_source = MEM_DETECT_SCLP_READ_INFO;
 	}
+	if (max_physmem_end)
+		add_physmem_online_range(0, max_physmem_end);
 }
 
 void physmem_set_usable_limit(unsigned long limit)
arch/s390/include/asm/physmem_info.h +3 -0
index f45cfc8bc233..51b68a43e195 100644
@@ -9,6 +9,7 @@ enum physmem_info_source {
 	MEM_DETECT_NONE = 0,
 	MEM_DETECT_SCLP_STOR_INFO,
 	MEM_DETECT_DIAG260,
+	MEM_DETECT_DIAG500_STOR_LIMIT,
 	MEM_DETECT_SCLP_READ_INFO,
 	MEM_DETECT_BIN_SEARCH
 };
@@ -107,6 +108,8 @@ static inline const char *get_physmem_info_source(void)
 		return "sclp storage info";
 	case MEM_DETECT_DIAG260:
 		return "diag260";
+	case MEM_DETECT_DIAG500_STOR_LIMIT:
+		return "diag500 storage limit";
 	case MEM_DETECT_SCLP_READ_INFO:
 		return "sclp read info";
 	case MEM_DETECT_BIN_SEARCH:
Signature · 1 line
2.46.0
#3 lore raw

PATCH 3/5 virtio-mem: s390x support

In reply to David Hildenbrand

Now that s390x code is prepared for memory devices that reside above the maximum storage increment exposed through SCLP, everything is in place to unlock virtio-mem support.

As virtio-mem in Linux currently supports logically onlining/offlining memory in pageblock granularity, we have an effective hot(un)plug granularity of 1 MiB on s390x.

As virito-mem adds/removes individual Linux memory blocks (256MB), we will currently never use gigantic pages in the identity mapping.

It is worth noting that neither storage keys nor storage attributes (e.g., data / nodat) are touched when onlining memory blocks, which is good because we are not supposed to touch these parts for unplugged device blocks that are logically offline in Linux.

We will currently never initialize storage keys for virtio-mem memory -- IOW, storage_key_init_range() is never called. It could be added in the future when plugging device blocks. But as that function essentially does nothing without modifying the code (changing PAGE_DEFAULT_ACC), that's just fine for now.

kexec should work as intended and just like on other architectures that support virtio-mem: we will never place kexec binaries on virtio-mem memory, and never indicate virtio-mem memory to the 2nd kernel. The device driver in the 2nd kernel can simply reset the device -- turning all memory unplugged, to then start plugging memory and adding them to Linux, without causing trouble because the memory is already used elsewhere.

The special s390x kdump mode, whereby the 2nd kernel creates the ELF core header, won't currently dump virtio-mem memory. The virtio-mem driver has a special kdump mode, from where we can detect memory ranges to dump. Based on this, support for dumping virtio-mem memory can be added in the future fairly easily.

---
 drivers/virtio/Kconfig | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/virtio/Kconfig +6 -6
index 42a48ac763ee..fb320eea70fe 100644
@@ -122,7 +122,7 @@ config VIRTIO_BALLOON
 
 config VIRTIO_MEM
 	tristate "Virtio mem driver"
-	depends on X86_64 || ARM64 || RISCV
+	depends on X86_64 || ARM64 || RISCV || S390
 	depends on VIRTIO
 	depends on MEMORY_HOTPLUG
 	depends on MEMORY_HOTREMOVE
@@ -132,11 +132,11 @@ config VIRTIO_MEM
 	 This driver provides access to virtio-mem paravirtualized memory
 	 devices, allowing to hotplug and hotunplug memory.
 
-	 This driver currently only supports x86-64 and arm64. Although it
-	 should compile on other architectures that implement memory
-	 hot(un)plug, architecture-specific and/or common
-	 code changes may be required for virtio-mem, kdump and kexec to work as
-	 expected.
+	 This driver currently supports x86-64, arm64, riscv and s390x.
+	 Although it should compile on other architectures that implement
+	 memory hot(un)plug, architecture-specific and/or common
+	 code changes may be required for virtio-mem, kdump and kexec to
+	 work as expected.
 
 	 If unsure, say M.
 
Signature · 1 line
2.46.0
maintainer Acked-by on v1 3/5
#4 lore raw
Quoted 30 lines · David Hildenbrand

Now that s390x code is prepared for memory devices that reside above the maximum storage increment exposed through SCLP, everything is in place to unlock virtio-mem support.

As virtio-mem in Linux currently supports logically onlining/offlining memory in pageblock granularity, we have an effective hot(un)plug granularity of 1 MiB on s390x.

As virito-mem adds/removes individual Linux memory blocks (256MB), we will currently never use gigantic pages in the identity mapping.

It is worth noting that neither storage keys nor storage attributes (e.g., data / nodat) are touched when onlining memory blocks, which is good because we are not supposed to touch these parts for unplugged device blocks that are logically offline in Linux.

We will currently never initialize storage keys for virtio-mem memory -- IOW, storage_key_init_range() is never called. It could be added in the future when plugging device blocks. But as that function essentially does nothing without modifying the code (changing PAGE_DEFAULT_ACC), that's just fine for now.

kexec should work as intended and just like on other architectures that support virtio-mem: we will never place kexec binaries on virtio-mem memory, and never indicate virtio-mem memory to the 2nd kernel. The device driver in the 2nd kernel can simply reset the device -- turning all memory unplugged, to then start plugging memory and adding them to Linux, without causing trouble because the memory is already used elsewhere.

Quoted 7 lines

The special s390x kdump mode, whereby the 2nd kernel creates the ELF core header, won't currently dump virtio-mem memory. The virtio-mem driver has a special kdump mode, from where we can detect memory ranges to dump. Based on this, support for dumping virtio-mem memory can be added in the future fairly easily.

Quoted 36 lines
---
 drivers/virtio/Kconfig | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/virtio/Kconfig +6 -6
index 42a48ac763ee..fb320eea70fe 100644
@@ -122,7 +122,7 @@ config VIRTIO_BALLOON
 
 config VIRTIO_MEM
 	tristate "Virtio mem driver"
-	depends on X86_64 || ARM64 || RISCV
+	depends on X86_64 || ARM64 || RISCV || S390
 	depends on VIRTIO
 	depends on MEMORY_HOTPLUG
 	depends on MEMORY_HOTREMOVE
@@ -132,11 +132,11 @@ config VIRTIO_MEM
 	 This driver provides access to virtio-mem paravirtualized memory
 	 devices, allowing to hotplug and hotunplug memory.
 
-	 This driver currently only supports x86-64 and arm64. Although it
-	 should compile on other architectures that implement memory
-	 hot(un)plug, architecture-specific and/or common
-	 code changes may be required for virtio-mem, kdump and kexec to work as
-	 expected.
+	 This driver currently supports x86-64, arm64, riscv and s390x.
+	 Although it should compile on other architectures that implement
+	 memory hot(un)plug, architecture-specific and/or common
+	 code changes may be required for virtio-mem, kdump and kexec to
+	 work as expected.
 
 	 If unsure, say M.
 
Signature · 1 line
2.46.0
#5 lore raw

PATCH 4/5 lib/Kconfig.debug: default STRICT_DEVMEM to "y" on s390x

In reply to David Hildenbrand

virtio-mem currently depends on !DEVMEM | STRICT_DEVMEM. Let's default STRICT_DEVMEM to "y" just like we do for arm64 and x86.

There could be ways in the future to filter access to virtio-mem device memory even without STRICT_DEVMEM, but for now let's just keep it simple.

---
 lib/Kconfig.debug | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Kconfig.debug +1 -1
index a30c03a66172..fce22ce54983 100644
@@ -1887,7 +1887,7 @@ config STRICT_DEVMEM
 	bool "Filter access to /dev/mem"
 	depends on MMU && DEVMEM
 	depends on ARCH_HAS_DEVMEM_IS_ALLOWED || GENERIC_LIB_DEVMEM_IS_ALLOWED
-	default y if PPC || X86 || ARM64
+	default y if PPC || X86 || ARM64 || S390
 	help
 	  If this option is disabled, you allow userspace (root) access to all
 	  of memory, including kernel and userspace memory. Accidental
Signature · 1 line
2.46.0
#6 lore raw

PATCH 5/5 s390/sparsemem: reduce section size to 128 MiB

In reply to David Hildenbrand

Ever since commit 421c175c4d609 ("[S390] Add support for memory hot-add.") we've been using a section size of 256 MiB on s390x and 32 MiB on s390. Before that, we were using a section size of 32 MiB on both architectures.

Likely the reason was that we'd expect a storage increment size of 256 MiB under z/VM back then. As we didn't support memory blocks spanning multiple memory sections, we would have had to handle having multiple memory blocks for a single storage increment, which complicates things. Although that issue reappeared with even bigger storage increment sizes later, nowadays we have memory blocks that can span multiple memory sections and we avoid any such issue completely.

Now that we have a new mechanism to expose additional memory to a VM -- virtio-mem -- reduce the section size to 128 MiB to allow for more flexibility and reduce the metadata overhead when dealing with hot(un)plug granularity smaller than 256 MiB.

128 MiB has been used by x86-64 since the very beginning. arm64 with 4k base pages switched to 128 MiB as well: it's just big enough on these architectures to allows for using a huge page (2 MiB) in the vmemmap in sane setups with sizeof(struct page) == 64 bytes and a huge page mapping in the direct mapping, while still allowing for small hot(un)plug granularity.

For s390x, we could even switch to a 64 MiB section size, as our huge page size is 1 MiB: but the smaller the section size, the more sections we'll have to manage especially on bigger machines. Making it consistent with x86-64 and arm64 feels like te right thing for now.

Note that the smallest memory hot(un)plug granularity is also limited by the memory block size, determined by extracting the memory increment size from SCLP. Under QEMU/KVM, implementing virtio-mem, we expose 0; therefore, we'll end up with a memory block size of 128 MiB with a 128 MiB section size.

---
 arch/s390/include/asm/sparsemem.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/include/asm/sparsemem.h +1 -1
index c549893602ea..ff628c50afac 100644
@@ -2,7 +2,7 @@
 #ifndef _ASM_S390_SPARSEMEM_H
 #define _ASM_S390_SPARSEMEM_H
 
-#define SECTION_SIZE_BITS	28
+#define SECTION_SIZE_BITS	27
 #define MAX_PHYSMEM_BITS	CONFIG_MAX_PHYSMEM_BITS
 
 #endif /* _ASM_S390_SPARSEMEM_H */
Signature · 1 line
2.46.0
#7 lore raw
In reply to David Hildenbrand
Quoted 40 lines · David Hildenbrand

Let's finally add s390x support for virtio-mem; my last RFC was sent 4 years ago, and a lot changed in the meantime.

This is based on mm/stable.

I sent out the QEMU part earlier today [1], that contains some more details and a usage example on s390x (last patch).

There is not too much in here: The biggest part is querying a new diag(500) STORAGE_LIMIT hypercall to obtain the proper "max_physmem_end". Once this and the QEMU part will go upstream, it will get documented in [2]

The last two patches are not strictly required but certainly nice-to-have.

Note that -- in contrast to standby memory -- virtio-mem memory must be configured to be automatically onlined as soon as hotplugged. The easiest approach is using the "memhp_default_state=" kernel parameter or by using proper udev rules. More details can be found at [3].

I have reviving+upstreaming a systemd service to handle configuring that on my todo list, but for some reason I keep getting distracted ...

I tested various things, including:
* Various memory hotplug/hotunplug combinations
* Device hotplug/hotunplug
* /proc/iomem output
* reboot
* kexec
* kdump: make sure we don't hotplug memory

One remaining work item is kdump support for virtio-mem memory. I am working on a prototype that will be fairly straight forward, because the virtio-mem driver already supports a special kdump mode and dracut will already include it in the initrd as default. With holiday and conferences coming up I rather sent this out now.

[1] https://lkml.kernel.org/r/[email protected]
[2] https://gitlab.com/davidhildenbrand/s390x-os-virt-spec
[3] https://virtio-mem.gitlab.io/user-guide/user-guide-linux.html

Quoted 14 lines
Cc Heiko Carstens <[email protected]>
Cc Vasily Gorbik <[email protected]>
Cc Alexander Gordeev <[email protected]>
Cc Christian Borntraeger <[email protected]>
Cc Sven Schnelle <[email protected]>
Cc Thomas Huth <[email protected]>
Cc Cornelia Huck <[email protected]>
Cc Janosch Frank <[email protected]>
Cc Claudio Imbrenda <[email protected]>
Cc "Michael S. Tsirkin" <[email protected]>
Cc Jason Wang <[email protected]>
Cc Xuan Zhuo <[email protected]>
Cc "Eugenio Pérez" <[email protected]>
Cc Andrew Morton <[email protected]>

It's mostly s390 changes, so should be merged through that tree. I acked the only virtio specific patch.

Quoted 19 lines

David Hildenbrand (5):
s390/kdump: implement is_kdump_kernel() s390/physmem_info: query diag500(STORAGE_LIMIT) to support QEMU/KVM
memory devices
virtio-mem: s390x support
lib/Kconfig.debug: default STRICT_DEVMEM to "y" on s390x s390/sparsemem: reduce section size to 128 MiB

 arch/s390/boot/physmem_info.c        | 46 ++++++++++++++++++++++++++--
 arch/s390/include/asm/kexec.h        |  4 +++
 arch/s390/include/asm/physmem_info.h |  3 ++
 arch/s390/include/asm/sparsemem.h    |  2 +-
 arch/s390/kernel/crash_dump.c        |  6 ++++
 drivers/virtio/Kconfig               | 12 ++++----
 lib/Kconfig.debug                    |  2 +-
 7 files changed, 64 insertions(+), 11 deletions(-)
Signature · 1 line
2.46.0
Tested-by on the v1 series
#8 lore raw
In reply to David Hildenbrand

This series has been successfully tested along with the QEMU's series. Virtio-mem devices could be resized, plugged and unplugged seamlessly. The memory information displayed is correct and reboot doesn't cause any issue.

Quoted 77 lines · David Hildenbrand

Let's finally add s390x support for virtio-mem; my last RFC was sent 4 years ago, and a lot changed in the meantime.

This is based on mm/stable.

I sent out the QEMU part earlier today [1], that contains some more details and a usage example on s390x (last patch).

There is not too much in here: The biggest part is querying a new diag(500) STORAGE_LIMIT hypercall to obtain the proper "max_physmem_end". Once this and the QEMU part will go upstream, it will get documented in [2]

The last two patches are not strictly required but certainly nice-to-have.

Note that -- in contrast to standby memory -- virtio-mem memory must be configured to be automatically onlined as soon as hotplugged. The easiest approach is using the "memhp_default_state=" kernel parameter or by using proper udev rules. More details can be found at [3].

I have reviving+upstreaming a systemd service to handle configuring that on my todo list, but for some reason I keep getting distracted ...

I tested various things, including:
* Various memory hotplug/hotunplug combinations
* Device hotplug/hotunplug
* /proc/iomem output
* reboot
* kexec
* kdump: make sure we don't hotplug memory

One remaining work item is kdump support for virtio-mem memory. I am working on a prototype that will be fairly straight forward, because the virtio-mem driver already supports a special kdump mode and dracut will already include it in the initrd as default. With holiday and conferences coming up I rather sent this out now.

[1] https://lkml.kernel.org/r/[email protected]
[2] https://gitlab.com/davidhildenbrand/s390x-os-virt-spec
[3] https://virtio-mem.gitlab.io/user-guide/user-guide-linux.html

Cc Heiko Carstens <[email protected]>
Cc Vasily Gorbik <[email protected]>
Cc Alexander Gordeev <[email protected]>
Cc Christian Borntraeger <[email protected]>
Cc Sven Schnelle <[email protected]>
Cc Thomas Huth <[email protected]>
Cc Cornelia Huck <[email protected]>
Cc Janosch Frank <[email protected]>
Cc Claudio Imbrenda <[email protected]>
Cc "Michael S. Tsirkin" <[email protected]>
Cc Jason Wang <[email protected]>
Cc Xuan Zhuo <[email protected]>
Cc "Eugenio Pérez" <[email protected]>
Cc Andrew Morton <[email protected]>

David Hildenbrand (5):
s390/kdump: implement is_kdump_kernel() s390/physmem_info: query diag500(STORAGE_LIMIT) to support QEMU/KVM
memory devices
virtio-mem: s390x support
lib/Kconfig.debug: default STRICT_DEVMEM to "y" on s390x s390/sparsemem: reduce section size to 128 MiB

 arch/s390/boot/physmem_info.c        | 46 ++++++++++++++++++++++++++--
 arch/s390/include/asm/kexec.h        |  4 +++
 arch/s390/include/asm/physmem_info.h |  3 ++
 arch/s390/include/asm/sparsemem.h    |  2 +-
 arch/s390/kernel/crash_dump.c        |  6 ++++
 drivers/virtio/Kconfig               | 12 ++++----
 lib/Kconfig.debug                    |  2 +-
 7 files changed, 64 insertions(+), 11 deletions(-)

--
2.46.0

#9 lore raw
Quoted 6 lines · Mario Casquero

This series has been successfully tested along with the QEMU's series. Virtio-mem devices could be resized, plugged and unplugged seamlessly. The memory information displayed is correct and reboot doesn't cause any issue.

Thanks a bunch for testing!

If there are no more comments, I'll add the in-tree kernel update for the new diag500 subcall and resend.

Signature · 3 lines
Cheers,

David / dhildenb
maintainer
#10 lore raw
Quoted 6 lines · David Hildenbrand
Quoted 5 lines · Mario Casquero

This series has been successfully tested along with the QEMU's series. Virtio-mem devices could be resized, plugged and unplugged seamlessly. The memory information displayed is correct and reboot doesn't cause any issue.

Quoted 6 lines
Quoted 1 line

Thanks a bunch for testing!

If there are no more comments, I'll add the in-tree kernel update for the new diag500 subcall and resend.

Sorry that you haven't seen any review from here yet, but... :)

Please also change all usages of "s390x" to "s390" before you resend. Within the kernel usage of s390x is not common and there shouldn't be anything like this added.

#11 lore raw
Quoted 11 lines · Heiko Carstens
Quoted 10 lines · David Hildenbrand
Quoted 6 lines · Mario Casquero

This series has been successfully tested along with the QEMU's series. Virtio-mem devices could be resized, plugged and unplugged seamlessly. The memory information displayed is correct and reboot doesn't cause any issue.

Thanks a bunch for testing!

Quoted 8 lines
Quoted 2 lines

If there are no more comments, I'll add the in-tree kernel update for the new diag500 subcall and resend.

Sorry that you haven't seen any review from here yet, but... :)

Please also change all usages of "s390x" to "s390" before you resend. Within the kernel usage of s390x is not common and there shouldn't be anything like this added.

Makes sense, thanks!

Signature · 3 lines
Cheers,

David / dhildenb