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

Pull xen updates from Juergen Gross:

- fix an error path in drivers/xen/manage.c

- fix the Xen console driver solving a boot hangup when the console
backend isn't yet running

- comment fix in the Xen swiotlb driver

- hardening for Xen on Arm adding a more thorough validation

- cleanup of the Xen grant table code hiding suspend/resume code for
the case if CONFIG_HIBERNATE_CALLBACKS isn't defined

* tag 'for-linus-7.1-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
xen/grant-table: guard gnttab_suspend/resume with CONFIG_HIBERNATE_CALLBACKS
hvc/xen: Check console connection flag
xen/swiotlb: fix stale reference to swiotlb_unmap_page()
xen/manage: unwind partial shutdown watcher setup on error
ARM: xen: validate hypervisor compatible before parsing its version

+54 -9
+6 -4
arch/arm/xen/enlighten.c
··· 218 218 static int __init fdt_find_hyper_node(unsigned long node, const char *uname, 219 219 int depth, void *data) 220 220 { 221 - const void *s = NULL; 221 + const char *s = NULL; 222 222 int len; 223 + size_t prefix_len = strlen(hyper_node.prefix); 223 224 224 225 if (depth != 1 || strcmp(uname, "hypervisor") != 0) 225 226 return 0; ··· 229 228 hyper_node.found = true; 230 229 231 230 s = of_get_flat_dt_prop(node, "compatible", &len); 232 - if (strlen(hyper_node.prefix) + 3 < len && 233 - !strncmp(hyper_node.prefix, s, strlen(hyper_node.prefix))) 234 - hyper_node.version = s + strlen(hyper_node.prefix); 231 + if (s && len > 0 && strnlen(s, len) < len && 232 + len > prefix_len + 3 && 233 + !strncmp(hyper_node.prefix, s, prefix_len)) 234 + hyper_node.version = s + prefix_len; 235 235 236 236 /* 237 237 * Check if Xen supports EFI by checking whether there is the
+3
drivers/tty/hvc/hvc_xen.c
··· 139 139 if (cons == NULL) 140 140 return -EINVAL; 141 141 142 + if (cons->intf->connection == XENCONSOLE_DISCONNECTED) 143 + return -ENOTCONN; 144 + 142 145 /* 143 146 * Make sure the whole buffer is emitted, polling if 144 147 * necessary. We don't ever want to rely on the hvc daemon
+2 -1
drivers/xen/grant-table.c
··· 1579 1579 } 1580 1580 return gnttab_map(0, nr_grant_frames - 1); 1581 1581 } 1582 - 1582 + #ifdef CONFIG_HIBERNATE_CALLBACKS 1583 1583 int gnttab_resume(void) 1584 1584 { 1585 1585 gnttab_request_version(); ··· 1592 1592 gnttab_interface->unmap_frames(); 1593 1593 return 0; 1594 1594 } 1595 + #endif 1595 1596 1596 1597 static int gnttab_expand(unsigned int req_entries) 1597 1598 {
+17 -3
drivers/xen/manage.c
··· 343 343 return err; 344 344 } 345 345 346 - 347 346 #ifdef CONFIG_MAGIC_SYSRQ 348 347 err = register_xenbus_watch(&sysrq_watch); 349 348 if (err) { 350 349 pr_err("Failed to set sysrq watcher\n"); 351 - return err; 350 + goto err_unregister_shutdown; 352 351 } 353 352 #endif 354 353 ··· 360 361 if (err) { 361 362 pr_err("%s: Error %d writing %s\n", __func__, 362 363 err, node); 363 - return err; 364 + goto err_remove_features; 364 365 } 365 366 } 366 367 367 368 return 0; 369 + 370 + err_remove_features: 371 + while (--idx >= 0) { 372 + if (!shutdown_handlers[idx].flag) 373 + continue; 374 + snprintf(node, FEATURE_PATH_SIZE, "feature-%s", 375 + shutdown_handlers[idx].command); 376 + xenbus_rm(XBT_NIL, "control", node); 377 + } 378 + #ifdef CONFIG_MAGIC_SYSRQ 379 + unregister_xenbus_watch(&sysrq_watch); 380 + err_unregister_shutdown: 381 + #endif 382 + unregister_xenbus_watch(&shutdown_watch); 383 + return err; 368 384 } 369 385 370 386 static int shutdown_event(struct notifier_block *notifier,
+1 -1
drivers/xen/swiotlb-xen.c
··· 340 340 341 341 /* 342 342 * Unmap a set of streaming mode DMA translations. Again, cpu read rules 343 - * concerning calls here are the same as for swiotlb_unmap_phys() above. 343 + * concerning calls here are the same as for xen_swiotlb_unmap_phys() above. 344 344 */ 345 345 static void 346 346 xen_swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sgl, int nelems,
+12
include/xen/grant_table.h
··· 84 84 }; 85 85 86 86 int gnttab_init(void); 87 + #ifdef CONFIG_HIBERNATE_CALLBACKS 87 88 int gnttab_suspend(void); 88 89 int gnttab_resume(void); 90 + #else 91 + static inline int gnttab_suspend(void) 92 + { 93 + return 0; 94 + } 95 + 96 + static inline int gnttab_resume(void) 97 + { 98 + return 0; 99 + } 100 + #endif 89 101 90 102 int gnttab_grant_foreign_access(domid_t domid, unsigned long frame, 91 103 int readonly);
+13
include/xen/interface/io/console.h
··· 19 19 char out[2048]; 20 20 XENCONS_RING_IDX in_cons, in_prod; 21 21 XENCONS_RING_IDX out_cons, out_prod; 22 + /* 23 + * Flag values signaling from backend to frontend whether the console is 24 + * connected. i.e. Whether it will be serviced and emptied. 25 + * 26 + * The flag starts as disconnected. 27 + */ 28 + #define XENCONSOLE_DISCONNECTED 1 29 + /* 30 + * The flag is set to connected when the backend connects and the console 31 + * will be serviced. 32 + */ 33 + #define XENCONSOLE_CONNECTED 0 34 + uint8_t connection; 22 35 }; 23 36 24 37 #endif /* __XEN_PUBLIC_IO_CONSOLE_H__ */