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

Merge tag 'for-linus-5.16c-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull xen fixes from Juergen Gross:

- Kconfig fix to make it possible to control building of the privcmd
driver

- three fixes for issues identified by the kernel test robot

- a five-patch series to simplify timeout handling for Xen PV driver
initialization

- two patches to fix error paths in xenstore/xenbus driver
initialization

* tag 'for-linus-5.16c-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
xen: make HYPERVISOR_set_debugreg() always_inline
xen: make HYPERVISOR_get_debugreg() always_inline
xen: detect uninitialized xenbus in xenbus_init
xen: flag xen_snd_front to be not essential for system boot
xen: flag pvcalls-front to be not essential for system boot
xen: flag hvc_xen to be not essential for system boot
xen: flag xen_drm_front to be not essential for system boot
xen: add "not_essential" flag to struct xenbus_driver
xen/pvh: add missing prototype to header
xen: don't continue xenstore initialization in case of errors
xen/privcmd: make option visible in Kconfig

+47 -16
+2 -2
arch/x86/include/asm/xen/hypercall.h
··· 281 281 return _hypercall2(int, callback_op, cmd, arg); 282 282 } 283 283 284 - static inline int 284 + static __always_inline int 285 285 HYPERVISOR_set_debugreg(int reg, unsigned long value) 286 286 { 287 287 return _hypercall2(int, set_debugreg, reg, value); 288 288 } 289 289 290 - static inline unsigned long 290 + static __always_inline unsigned long 291 291 HYPERVISOR_get_debugreg(int reg) 292 292 { 293 293 return _hypercall1(unsigned long, get_debugreg, reg);
+1
arch/x86/include/asm/xen/hypervisor.h
··· 64 64 65 65 #ifdef CONFIG_PVH 66 66 void __init xen_pvh_init(struct boot_params *boot_params); 67 + void __init mem_map_via_hcall(struct boot_params *boot_params_p); 67 68 #endif 68 69 69 70 #endif /* _ASM_X86_XEN_HYPERVISOR_H */
+1
drivers/gpu/drm/xen/xen_drm_front.c
··· 773 773 .probe = xen_drv_probe, 774 774 .remove = xen_drv_remove, 775 775 .otherend_changed = displback_changed, 776 + .not_essential = true, 776 777 }; 777 778 778 779 static int __init xen_drv_init(void)
+1
drivers/input/misc/xen-kbdfront.c
··· 542 542 .remove = xenkbd_remove, 543 543 .resume = xenkbd_resume, 544 544 .otherend_changed = xenkbd_backend_changed, 545 + .not_essential = true, 545 546 }; 546 547 547 548 static int __init xenkbd_init(void)
+1
drivers/tty/hvc/hvc_xen.c
··· 522 522 .remove = xencons_remove, 523 523 .resume = xencons_resume, 524 524 .otherend_changed = xencons_backend_changed, 525 + .not_essential = true, 525 526 }; 526 527 #endif /* CONFIG_HVC_XEN_FRONTEND */ 527 528
+1
drivers/video/fbdev/xen-fbfront.c
··· 695 695 .remove = xenfb_remove, 696 696 .resume = xenfb_resume, 697 697 .otherend_changed = xenfb_backend_changed, 698 + .not_essential = true, 698 699 }; 699 700 700 701 static int __init xenfb_init(void)
+7 -1
drivers/xen/Kconfig
··· 259 259 if guests need generic access to SCSI devices. 260 260 261 261 config XEN_PRIVCMD 262 - tristate 262 + tristate "Xen hypercall passthrough driver" 263 263 depends on XEN 264 264 default m 265 + help 266 + The hypercall passthrough driver allows privileged user programs to 267 + perform Xen hypercalls. This driver is normally required for systems 268 + running as Dom0 to perform privileged operations, but in some 269 + disaggregated Xen setups this driver might be needed for other 270 + domains, too. 265 271 266 272 config XEN_ACPI_PROCESSOR 267 273 tristate "Xen ACPI processor"
+1
drivers/xen/pvcalls-front.c
··· 1275 1275 .probe = pvcalls_front_probe, 1276 1276 .remove = pvcalls_front_remove, 1277 1277 .otherend_changed = pvcalls_front_changed, 1278 + .not_essential = true, 1278 1279 }; 1279 1280 1280 1281 static int __init pvcalls_frontend_init(void)
+26 -1
drivers/xen/xenbus/xenbus_probe.c
··· 909 909 910 910 static int __init xenbus_init(void) 911 911 { 912 - int err = 0; 912 + int err; 913 913 uint64_t v = 0; 914 914 xen_store_domain_type = XS_UNKNOWN; 915 915 ··· 949 949 err = hvm_get_parameter(HVM_PARAM_STORE_PFN, &v); 950 950 if (err) 951 951 goto out_error; 952 + /* 953 + * Uninitialized hvm_params are zero and return no error. 954 + * Although it is theoretically possible to have 955 + * HVM_PARAM_STORE_PFN set to zero on purpose, in reality it is 956 + * not zero when valid. If zero, it means that Xenstore hasn't 957 + * been properly initialized. Instead of attempting to map a 958 + * wrong guest physical address return error. 959 + * 960 + * Also recognize all bits set as an invalid value. 961 + */ 962 + if (!v || !~v) { 963 + err = -ENOENT; 964 + goto out_error; 965 + } 966 + /* Avoid truncation on 32-bit. */ 967 + #if BITS_PER_LONG == 32 968 + if (v > ULONG_MAX) { 969 + pr_err("%s: cannot handle HVM_PARAM_STORE_PFN=%llx > ULONG_MAX\n", 970 + __func__, v); 971 + err = -EINVAL; 972 + goto out_error; 973 + } 974 + #endif 952 975 xen_store_gfn = (unsigned long)v; 953 976 xen_store_interface = 954 977 xen_remap(xen_store_gfn << XEN_PAGE_SHIFT, ··· 1006 983 */ 1007 984 proc_create_mount_point("xen"); 1008 985 #endif 986 + return 0; 1009 987 1010 988 out_error: 989 + xen_store_domain_type = XS_UNKNOWN; 1011 990 return err; 1012 991 } 1013 992
+4 -12
drivers/xen/xenbus/xenbus_probe_frontend.c
··· 211 211 if (drv && (dev->driver != drv)) 212 212 return 0; 213 213 214 - if (ignore_nonessential) { 215 - /* With older QEMU, for PVonHVM guests the guest config files 216 - * could contain: vfb = [ 'vnc=1, vnclisten=0.0.0.0'] 217 - * which is nonsensical as there is no PV FB (there can be 218 - * a PVKB) running as HVM guest. */ 219 - 220 - if ((strncmp(xendev->nodename, "device/vkbd", 11) == 0)) 221 - return 0; 222 - 223 - if ((strncmp(xendev->nodename, "device/vfb", 10) == 0)) 224 - return 0; 225 - } 226 214 xendrv = to_xenbus_driver(dev->driver); 215 + 216 + if (ignore_nonessential && xendrv->not_essential) 217 + return 0; 218 + 227 219 return (xendev->state < XenbusStateConnected || 228 220 (xendev->state == XenbusStateConnected && 229 221 xendrv->is_ready && !xendrv->is_ready(xendev)));
+1
include/xen/xenbus.h
··· 112 112 const char *name; /* defaults to ids[0].devicetype */ 113 113 const struct xenbus_device_id *ids; 114 114 bool allow_rebind; /* avoid setting xenstore closed during remove */ 115 + bool not_essential; /* is not mandatory for boot progress */ 115 116 int (*probe)(struct xenbus_device *dev, 116 117 const struct xenbus_device_id *id); 117 118 void (*otherend_changed)(struct xenbus_device *dev,
+1
sound/xen/xen_snd_front.c
··· 358 358 .probe = xen_drv_probe, 359 359 .remove = xen_drv_remove, 360 360 .otherend_changed = sndback_changed, 361 + .not_essential = true, 361 362 }; 362 363 363 364 static int __init xen_drv_init(void)