Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'virtio-mem-for-5.16' of git://github.com/davidhildenbrand/linux

Pull virtio-mem update from David Hildenbrand:
"Support the VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE feature in virtio-mem,
now that "accidential" access to logically unplugged memory inside
added Linux memory blocks is no longer possible, because we:

- Removed /dev/kmem in commit bbcd53c96071 ("drivers/char: remove
/dev/kmem for good")

- Disallowed access to virtio-mem device memory via /dev/mem in
commit 2128f4e21aa ("virtio-mem: disallow mapping virtio-mem memory
via /dev/mem")

- Sanitized access to virtio-mem device memory via /proc/kcore in
commit 0daa322b8ff9 ("fs/proc/kcore: don't read offline sections,
logically offline pages and hwpoisoned pages")

- Sanitized access to virtio-mem device memory via /proc/vmcore in
commit ce2814622e84 ("virtio-mem: kdump mode to sanitize
/proc/vmcore access")

The new VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE feature that will be
required by some hypervisors implementing virtio-mem in the near
future, so let's support it now that we safely can"

* tag 'virtio-mem-for-5.16' of git://github.com/davidhildenbrand/linux:
virtio-mem: support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE

+7 -3
+1
drivers/virtio/virtio_mem.c
··· 2889 2889 #if defined(CONFIG_NUMA) && defined(CONFIG_ACPI_NUMA) 2890 2890 VIRTIO_MEM_F_ACPI_PXM, 2891 2891 #endif 2892 + VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE, 2892 2893 }; 2893 2894 2894 2895 static const struct virtio_device_id virtio_mem_id_table[] = {
+6 -3
include/uapi/linux/virtio_mem.h
··· 68 68 * explicitly triggered (VIRTIO_MEM_REQ_UNPLUG). 69 69 * 70 70 * There are no guarantees what will happen if unplugged memory is 71 - * read/written. Such memory should, in general, not be touched. E.g., 72 - * even writing might succeed, but the values will simply be discarded at 73 - * random points in time. 71 + * read/written. In general, unplugged memory should not be touched, because 72 + * the resulting action is undefined. There is one exception: without 73 + * VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE, unplugged memory inside the usable 74 + * region can be read, to simplify creation of memory dumps. 74 75 * 75 76 * It can happen that the device cannot process a request, because it is 76 77 * busy. The device driver has to retry later. ··· 88 87 89 88 /* node_id is an ACPI PXM and is valid */ 90 89 #define VIRTIO_MEM_F_ACPI_PXM 0 90 + /* unplugged memory must not be accessed */ 91 + #define VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE 1 91 92 92 93 93 94 /* --- virtio-mem: guest -> host requests --- */