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.

xen: introduce xen_console_io option

Xen can support console_io hypercalls for any domains, not just dom0,
depending on DEBUG and XSM policies. These hypercalls can be very useful
for development and debugging.

Introduce a kernel command line option xen_console_io to enable the
usage of console_io hypercalls for any domain upon request. When
xen_console_io is not specified, the current behavior is retained.

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Message-ID: <alpine.DEB.2.22.394.2601131522540.992863@ubuntu-linux-20-04-desktop>

authored by

Stefano Stabellini and committed by
Juergen Gross
763baca7 dc8ea871

+29 -5
+5
Documentation/admin-guide/kernel-parameters.txt
··· 8414 8414 save/restore/migration must be enabled to handle larger 8415 8415 domains. 8416 8416 8417 + xen_console_io [XEN,EARLY] 8418 + Boolean option to enable/disable the usage of the Xen 8419 + console_io hypercalls to read and write to the console. 8420 + Mostly useful for debugging and development. 8421 + 8417 8422 xen_emul_unplug= [HW,X86,XEN,EARLY] 8418 8423 Unplug Xen emulated devices 8419 8424 Format: [unplug0,][unplug1]
+24 -5
drivers/tty/hvc/hvc_xen.c
··· 51 51 52 52 /* ------------------------------------------------------------------ */ 53 53 54 + static bool xen_console_io = false; 55 + static int __initdata opt_console_io = -1; 56 + 57 + static int __init parse_xen_console_io(char *arg) 58 + { 59 + bool val; 60 + int ret; 61 + 62 + ret = kstrtobool(arg, &val); 63 + if (ret == 0) 64 + opt_console_io = (int)val; 65 + 66 + return ret; 67 + } 68 + early_param("xen_console_io", parse_xen_console_io); 69 + 54 70 static struct xencons_info *vtermno_to_xencons(int vtermno) 55 71 { 56 72 struct xencons_info *entry, *ret = NULL; ··· 347 331 struct xencons_info *info; 348 332 unsigned long flags; 349 333 350 - if (!xen_initial_domain()) 334 + if (!xen_console_io) 351 335 return -ENODEV; 352 336 353 337 info = vtermno_to_xencons(HVC_COOKIE); ··· 385 369 { 386 370 struct xencons_info *info = vtermno_to_xencons(HVC_COOKIE); 387 371 if (info != NULL && info->irq) { 388 - if (!xen_initial_domain()) 372 + if (!xen_console_io) 389 373 xen_console_update_evtchn(info); 390 374 rebind_evtchn_irq(info->evtchn, info->irq); 391 375 } ··· 617 601 if (!xen_domain()) 618 602 return -ENODEV; 619 603 620 - if (xen_initial_domain()) { 604 + if (xen_console_io) { 621 605 ops = &dom0_hvc_ops; 622 606 r = xen_initial_domain_console_init(); 623 607 if (r < 0) ··· 663 647 } 664 648 device_initcall(xen_hvc_init); 665 649 666 - static int xen_cons_init(void) 650 + static int __init xen_cons_init(void) 667 651 { 668 652 const struct hv_ops *ops; 653 + 654 + xen_console_io = opt_console_io >= 0 ? opt_console_io : 655 + xen_initial_domain(); 669 656 670 657 if (!xen_domain()) 671 658 return 0; 672 659 673 - if (xen_initial_domain()) 660 + if (xen_console_io) 674 661 ops = &dom0_hvc_ops; 675 662 else { 676 663 int r;