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 'for-linus-6.0-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull xen updates from Juergen Gross:

- a series fine tuning virtio support for Xen guests, including removal
the now again unused "platform_has()" feature.

- a fix for host admin triggered reboot of Xen guests

- a simple spelling fix

* tag 'for-linus-6.0-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
xen: don't require virtio with grants for non-PV guests
kernel: remove platform_has() infrastructure
virtio: replace restricted mem access flag with callback
xen: Fix spelling mistake
xen/manage: Use orderly_reboot() to reboot

+90 -84
-8
MAINTAINERS
··· 16121 16121 F: Documentation/devicetree/bindings/iio/chemical/plantower,pms7003.yaml 16122 16122 F: drivers/iio/chemical/pms7003.c 16123 16123 16124 - PLATFORM FEATURE INFRASTRUCTURE 16125 - M: Juergen Gross <jgross@suse.com> 16126 - S: Maintained 16127 - F: arch/*/include/asm/platform-feature.h 16128 - F: include/asm-generic/platform-feature.h 16129 - F: include/linux/platform-feature.h 16130 - F: kernel/platform-feature.c 16131 - 16132 16124 PLDMFW LIBRARY 16133 16125 M: Jacob Keller <jacob.e.keller@intel.com> 16134 16126 S: Maintained
+3 -1
arch/arm/xen/enlighten.c
··· 34 34 #include <linux/timekeeping.h> 35 35 #include <linux/timekeeper_internal.h> 36 36 #include <linux/acpi.h> 37 + #include <linux/virtio_anchor.h> 37 38 38 39 #include <linux/mm.h> 39 40 ··· 444 443 if (!xen_domain()) 445 444 return 0; 446 445 447 - xen_set_restricted_virtio_memory_access(); 446 + if (IS_ENABLED(CONFIG_XEN_VIRTIO)) 447 + virtio_set_mem_acc_cb(xen_virtio_mem_acc); 448 448 449 449 if (!acpi_disabled) 450 450 xen_acpi_guest_init();
+2 -2
arch/s390/mm/init.c
··· 31 31 #include <linux/cma.h> 32 32 #include <linux/gfp.h> 33 33 #include <linux/dma-direct.h> 34 - #include <linux/platform-feature.h> 35 34 #include <asm/processor.h> 36 35 #include <linux/uaccess.h> 37 36 #include <asm/pgalloc.h> ··· 47 48 #include <asm/kasan.h> 48 49 #include <asm/dma-mapping.h> 49 50 #include <asm/uv.h> 51 + #include <linux/virtio_anchor.h> 50 52 #include <linux/virtio_config.h> 51 53 52 54 pgd_t swapper_pg_dir[PTRS_PER_PGD] __section(".bss..swapper_pg_dir"); ··· 175 175 if (!is_prot_virt_guest()) 176 176 return; 177 177 178 - platform_set(PLATFORM_VIRTIO_RESTRICTED_MEM_ACCESS); 178 + virtio_set_mem_acc_cb(virtio_require_restricted_mem_acc); 179 179 180 180 /* make sure bounce buffers are shared */ 181 181 swiotlb_init(true, SWIOTLB_FORCE | SWIOTLB_VERBOSE);
+2 -2
arch/x86/mm/mem_encrypt_amd.c
··· 20 20 #include <linux/bitops.h> 21 21 #include <linux/dma-mapping.h> 22 22 #include <linux/virtio_config.h> 23 + #include <linux/virtio_anchor.h> 23 24 #include <linux/cc_platform.h> 24 - #include <linux/platform-feature.h> 25 25 26 26 #include <asm/tlbflush.h> 27 27 #include <asm/fixmap.h> ··· 245 245 swiotlb_adjust_size(size); 246 246 247 247 /* Set restricted memory access for virtio. */ 248 - platform_set(PLATFORM_VIRTIO_RESTRICTED_MEM_ACCESS); 248 + virtio_set_mem_acc_cb(virtio_require_restricted_mem_acc); 249 249 } 250 250 251 251 static unsigned long pg_level_to_pfn(int level, pte_t *kpte, pgprot_t *ret_prot)
+3 -1
arch/x86/xen/enlighten_hvm.c
··· 4 4 #include <linux/cpu.h> 5 5 #include <linux/kexec.h> 6 6 #include <linux/memblock.h> 7 + #include <linux/virtio_anchor.h> 7 8 8 9 #include <xen/features.h> 9 10 #include <xen/events.h> ··· 196 195 if (xen_pv_domain()) 197 196 return; 198 197 199 - xen_set_restricted_virtio_memory_access(); 198 + if (IS_ENABLED(CONFIG_XEN_VIRTIO_FORCE_GRANT)) 199 + virtio_set_mem_acc_cb(virtio_require_restricted_mem_acc); 200 200 201 201 init_hvm_pv_info(); 202 202
+4 -1
arch/x86/xen/enlighten_pv.c
··· 31 31 #include <linux/gfp.h> 32 32 #include <linux/edd.h> 33 33 #include <linux/reboot.h> 34 + #include <linux/virtio_anchor.h> 34 35 35 36 #include <xen/xen.h> 36 37 #include <xen/events.h> ··· 110 109 111 110 static void __init xen_pv_init_platform(void) 112 111 { 113 - xen_set_restricted_virtio_memory_access(); 112 + /* PV guests can't operate virtio devices without grants. */ 113 + if (IS_ENABLED(CONFIG_XEN_VIRTIO)) 114 + virtio_set_mem_acc_cb(virtio_require_restricted_mem_acc); 114 115 115 116 populate_extra_pte(fix_to_virt(FIX_PARAVIRT_BOOTMAP)); 116 117
+4
drivers/virtio/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 + config VIRTIO_ANCHOR 3 + bool 4 + 2 5 config VIRTIO 3 6 tristate 7 + select VIRTIO_ANCHOR 4 8 help 5 9 This option is selected by any driver which implements the virtio 6 10 bus, such as CONFIG_VIRTIO_PCI, CONFIG_VIRTIO_MMIO, CONFIG_RPMSG
+1
drivers/virtio/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 obj-$(CONFIG_VIRTIO) += virtio.o virtio_ring.o 3 + obj-$(CONFIG_VIRTIO_ANCHOR) += virtio_anchor.o 3 4 obj-$(CONFIG_VIRTIO_PCI_LIB) += virtio_pci_modern_dev.o 4 5 obj-$(CONFIG_VIRTIO_PCI_LIB_LEGACY) += virtio_pci_legacy_dev.o 5 6 obj-$(CONFIG_VIRTIO_MMIO) += virtio_mmio.o
+2 -2
drivers/virtio/virtio.c
··· 2 2 #include <linux/virtio.h> 3 3 #include <linux/spinlock.h> 4 4 #include <linux/virtio_config.h> 5 + #include <linux/virtio_anchor.h> 5 6 #include <linux/module.h> 6 7 #include <linux/idr.h> 7 8 #include <linux/of.h> 8 - #include <linux/platform-feature.h> 9 9 #include <uapi/linux/virtio_ids.h> 10 10 11 11 /* Unique numbering for virtio devices. */ ··· 174 174 175 175 might_sleep(); 176 176 177 - if (platform_has(PLATFORM_VIRTIO_RESTRICTED_MEM_ACCESS)) { 177 + if (virtio_check_mem_acc_cb(dev)) { 178 178 if (!virtio_has_feature(dev, VIRTIO_F_VERSION_1)) { 179 179 dev_warn(&dev->dev, 180 180 "device must provide VIRTIO_F_VERSION_1\n");
+18
drivers/virtio/virtio_anchor.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + #include <linux/virtio.h> 3 + #include <linux/virtio_anchor.h> 4 + 5 + bool virtio_require_restricted_mem_acc(struct virtio_device *dev) 6 + { 7 + return true; 8 + } 9 + EXPORT_SYMBOL_GPL(virtio_require_restricted_mem_acc); 10 + 11 + static bool virtio_no_restricted_mem_acc(struct virtio_device *dev) 12 + { 13 + return false; 14 + } 15 + 16 + bool (*virtio_check_mem_acc_cb)(struct virtio_device *dev) = 17 + virtio_no_restricted_mem_acc; 18 + EXPORT_SYMBOL_GPL(virtio_check_mem_acc_cb);
+9
drivers/xen/Kconfig
··· 355 355 356 356 If in doubt, say n. 357 357 358 + config XEN_VIRTIO_FORCE_GRANT 359 + bool "Require Xen virtio support to use grants" 360 + depends on XEN_VIRTIO 361 + help 362 + Require virtio for Xen guests to use grant mappings. 363 + This will avoid the need to give the backend the right to map all 364 + of the guest memory. This will need support on the backend side 365 + (e.g. qemu or kernel, depending on the virtio device types used). 366 + 358 367 endmenu
+10
drivers/xen/grant-dma-ops.c
··· 12 12 #include <linux/of.h> 13 13 #include <linux/pfn.h> 14 14 #include <linux/xarray.h> 15 + #include <linux/virtio_anchor.h> 16 + #include <linux/virtio.h> 15 17 #include <xen/xen.h> 16 18 #include <xen/xen-ops.h> 17 19 #include <xen/grant_table.h> ··· 287 285 of_node_put(iommu_np); 288 286 289 287 return has_iommu; 288 + } 289 + 290 + bool xen_virtio_mem_acc(struct virtio_device *dev) 291 + { 292 + if (IS_ENABLED(CONFIG_XEN_VIRTIO_FORCE_GRANT)) 293 + return true; 294 + 295 + return xen_is_grant_dma_device(dev->dev.parent); 290 296 } 291 297 292 298 void xen_grant_setup_dma_ops(struct device *dev)
+1 -1
drivers/xen/manage.c
··· 205 205 static void do_reboot(void) 206 206 { 207 207 shutting_down = SHUTDOWN_POWEROFF; /* ? */ 208 - ctrl_alt_del(); 208 + orderly_reboot(); 209 209 } 210 210 211 211 static struct shutdown_handler shutdown_handlers[] = {
+2 -2
drivers/xen/xen-front-pgdir-shbuf.c
··· 89 89 * shared by the frontend itself) or map the provided granted 90 90 * references onto the backing storage (buf->pages). 91 91 * 92 - * \param buf shared buffer which grants to be maped. 92 + * \param buf shared buffer which grants to be mapped. 93 93 * \return zero on success or a negative number on failure. 94 94 */ 95 95 int xen_front_pgdir_shbuf_map(struct xen_front_pgdir_shbuf *buf) ··· 110 110 * shared by the frontend itself) or unmap the provided granted 111 111 * references. 112 112 * 113 - * \param buf shared buffer which grants to be unmaped. 113 + * \param buf shared buffer which grants to be unmapped. 114 114 * \return zero on success or a negative number on failure. 115 115 */ 116 116 int xen_front_pgdir_shbuf_unmap(struct xen_front_pgdir_shbuf *buf)
-1
include/asm-generic/Kbuild
··· 45 45 mandatory-y += pci.h 46 46 mandatory-y += percpu.h 47 47 mandatory-y += pgalloc.h 48 - mandatory-y += platform-feature.h 49 48 mandatory-y += preempt.h 50 49 mandatory-y += rwonce.h 51 50 mandatory-y += sections.h
-8
include/asm-generic/platform-feature.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - #ifndef _ASM_GENERIC_PLATFORM_FEATURE_H 3 - #define _ASM_GENERIC_PLATFORM_FEATURE_H 4 - 5 - /* Number of arch specific feature flags. */ 6 - #define PLATFORM_ARCH_FEAT_N 0 7 - 8 - #endif /* _ASM_GENERIC_PLATFORM_FEATURE_H */
-19
include/linux/platform-feature.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - #ifndef _PLATFORM_FEATURE_H 3 - #define _PLATFORM_FEATURE_H 4 - 5 - #include <linux/bitops.h> 6 - #include <asm/platform-feature.h> 7 - 8 - /* The platform features are starting with the architecture specific ones. */ 9 - 10 - /* Used to enable platform specific DMA handling for virtio devices. */ 11 - #define PLATFORM_VIRTIO_RESTRICTED_MEM_ACCESS (0 + PLATFORM_ARCH_FEAT_N) 12 - 13 - #define PLATFORM_FEAT_N (1 + PLATFORM_ARCH_FEAT_N) 14 - 15 - void platform_set(unsigned int feature); 16 - void platform_clear(unsigned int feature); 17 - bool platform_has(unsigned int feature); 18 - 19 - #endif /* _PLATFORM_FEATURE_H */
+19
include/linux/virtio_anchor.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef _LINUX_VIRTIO_ANCHOR_H 3 + #define _LINUX_VIRTIO_ANCHOR_H 4 + 5 + #ifdef CONFIG_VIRTIO_ANCHOR 6 + struct virtio_device; 7 + 8 + bool virtio_require_restricted_mem_acc(struct virtio_device *dev); 9 + extern bool (*virtio_check_mem_acc_cb)(struct virtio_device *dev); 10 + 11 + static inline void virtio_set_mem_acc_cb(bool (*func)(struct virtio_device *)) 12 + { 13 + virtio_check_mem_acc_cb = func; 14 + } 15 + #else 16 + #define virtio_set_mem_acc_cb(func) do { } while (0) 17 + #endif 18 + 19 + #endif /* _LINUX_VIRTIO_ANCHOR_H */
+9
include/xen/xen-ops.h
··· 5 5 #include <linux/percpu.h> 6 6 #include <linux/notifier.h> 7 7 #include <linux/efi.h> 8 + #include <linux/virtio_anchor.h> 8 9 #include <xen/features.h> 9 10 #include <asm/xen/interface.h> 10 11 #include <xen/interface/vcpu.h> ··· 218 217 #ifdef CONFIG_XEN_GRANT_DMA_OPS 219 218 void xen_grant_setup_dma_ops(struct device *dev); 220 219 bool xen_is_grant_dma_device(struct device *dev); 220 + bool xen_virtio_mem_acc(struct virtio_device *dev); 221 221 #else 222 222 static inline void xen_grant_setup_dma_ops(struct device *dev) 223 223 { 224 224 } 225 225 static inline bool xen_is_grant_dma_device(struct device *dev) 226 + { 227 + return false; 228 + } 229 + 230 + struct virtio_device; 231 + 232 + static inline bool xen_virtio_mem_acc(struct virtio_device *dev) 226 233 { 227 234 return false; 228 235 }
-8
include/xen/xen.h
··· 52 52 extern u64 xen_saved_max_mem_size; 53 53 #endif 54 54 55 - #include <linux/platform-feature.h> 56 - 57 - static inline void xen_set_restricted_virtio_memory_access(void) 58 - { 59 - if (IS_ENABLED(CONFIG_XEN_VIRTIO) && xen_domain()) 60 - platform_set(PLATFORM_VIRTIO_RESTRICTED_MEM_ACCESS); 61 - } 62 - 63 55 #ifdef CONFIG_XEN_UNPOPULATED_ALLOC 64 56 int xen_alloc_unpopulated_pages(unsigned int nr_pages, struct page **pages); 65 57 void xen_free_unpopulated_pages(unsigned int nr_pages, struct page **pages);
+1 -1
kernel/Makefile
··· 7 7 cpu.o exit.o softirq.o resource.o \ 8 8 sysctl.o capability.o ptrace.o user.o \ 9 9 signal.o sys.o umh.o workqueue.o pid.o task_work.o \ 10 - extable.o params.o platform-feature.o \ 10 + extable.o params.o \ 11 11 kthread.o sys_ni.o nsproxy.o \ 12 12 notifier.o ksysfs.o cred.o reboot.o \ 13 13 async.o range.o smpboot.o ucount.o regset.o
-27
kernel/platform-feature.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - 3 - #include <linux/bitops.h> 4 - #include <linux/cache.h> 5 - #include <linux/export.h> 6 - #include <linux/platform-feature.h> 7 - 8 - #define PLATFORM_FEAT_ARRAY_SZ BITS_TO_LONGS(PLATFORM_FEAT_N) 9 - static unsigned long __read_mostly platform_features[PLATFORM_FEAT_ARRAY_SZ]; 10 - 11 - void platform_set(unsigned int feature) 12 - { 13 - set_bit(feature, platform_features); 14 - } 15 - EXPORT_SYMBOL_GPL(platform_set); 16 - 17 - void platform_clear(unsigned int feature) 18 - { 19 - clear_bit(feature, platform_features); 20 - } 21 - EXPORT_SYMBOL_GPL(platform_clear); 22 - 23 - bool platform_has(unsigned int feature) 24 - { 25 - return test_bit(feature, platform_features); 26 - } 27 - EXPORT_SYMBOL_GPL(platform_has);