Skip to content

Commit

Permalink
Merge tag 'for-linus-4.6-rc0-tag' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/kernel/git/xen/tip

Pull xen updates from David Vrabel:
 "Features and fixes for 4.6:

  - Make earlyprintk=xen work for HVM guests

  - Remove module support for things never built as modules"

* tag 'for-linus-4.6-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
  drivers/xen: make platform-pci.c explicitly non-modular
  drivers/xen: make sys-hypervisor.c explicitly non-modular
  drivers/xen: make xenbus_dev_[front/back]end explicitly non-modular
  drivers/xen: make [xen-]ballon explicitly non-modular
  xen: audit usages of module.h ; remove unnecessary instances
  xen/x86: Drop mode-selecting ifdefs in startup_xen()
  xen/x86: Zero out .bss for PV guests
  hvc_xen: make early_printk work with HVM guests
  hvc_xen: fix xenboot for DomUs
  hvc_xen: add earlycon support
  • Loading branch information
Linus Torvalds committed Mar 22, 2016
2 parents b852495 + e01dc53 commit 55fc733
Show file tree
Hide file tree
Showing 20 changed files with 101 additions and 136 deletions.
2 changes: 2 additions & 0 deletions arch/arm/include/asm/xen/hypercall.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#ifndef _ASM_ARM_XEN_HYPERCALL_H
#define _ASM_ARM_XEN_HYPERCALL_H

#include <linux/bug.h>

#include <xen/interface/xen.h>
#include <xen/interface/sched.h>
#include <xen/interface/platform.h>
Expand Down
19 changes: 12 additions & 7 deletions arch/x86/xen/xen-head.S
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,18 @@
__INIT
ENTRY(startup_xen)
cld
#ifdef CONFIG_X86_32
mov %esi,xen_start_info
mov $init_thread_union+THREAD_SIZE,%esp
#else
mov %rsi,xen_start_info
mov $init_thread_union+THREAD_SIZE,%rsp
#endif

/* Clear .bss */
xor %eax,%eax
mov $__bss_start, %_ASM_DI
mov $__bss_stop, %_ASM_CX
sub %_ASM_DI, %_ASM_CX
shr $__ASM_SEL(2, 3), %_ASM_CX
rep __ASM_SIZE(stos)

mov %_ASM_SI, xen_start_info
mov $init_thread_union+THREAD_SIZE, %_ASM_SP

jmp xen_start_kernel

__FINIT
Expand Down
75 changes: 58 additions & 17 deletions drivers/tty/hvc/hvc_xen.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/init.h>
#include <linux/types.h>
#include <linux/list.h>
#include <linux/serial_core.h>

#include <asm/io.h>
#include <asm/xen/hypervisor.h>
Expand Down Expand Up @@ -245,6 +246,18 @@ static int xen_hvm_console_init(void)
return -ENODEV;
}

static int xencons_info_pv_init(struct xencons_info *info, int vtermno)
{
info->evtchn = xen_start_info->console.domU.evtchn;
/* GFN == MFN for PV guest */
info->intf = gfn_to_virt(xen_start_info->console.domU.mfn);
info->vtermno = vtermno;

list_add_tail(&info->list, &xenconsoles);

return 0;
}

static int xen_pv_console_init(void)
{
struct xencons_info *info;
Expand All @@ -264,13 +277,8 @@ static int xen_pv_console_init(void)
/* already configured */
return 0;
}
info->evtchn = xen_start_info->console.domU.evtchn;
/* GFN == MFN for PV guest */
info->intf = gfn_to_virt(xen_start_info->console.domU.mfn);
info->vtermno = HVC_COOKIE;

spin_lock(&xencons_lock);
list_add_tail(&info->list, &xenconsoles);
xencons_info_pv_init(info, HVC_COOKIE);
spin_unlock(&xencons_lock);

return 0;
Expand Down Expand Up @@ -597,15 +605,39 @@ static int xen_cons_init(void)
}
console_initcall(xen_cons_init);

#ifdef CONFIG_X86
static void xen_hvm_early_write(uint32_t vtermno, const char *str, int len)
{
if (xen_cpuid_base())
outsb(0xe9, str, len);
}
#else
static void xen_hvm_early_write(uint32_t vtermno, const char *str, int len) { }
#endif

#ifdef CONFIG_EARLY_PRINTK
static int __init xenboot_setup_console(struct console *console, char *string)
{
static struct xencons_info xenboot;

if (xen_initial_domain())
return 0;
if (!xen_pv_domain())
return -ENODEV;

return xencons_info_pv_init(&xenboot, 0);
}

static void xenboot_write_console(struct console *console, const char *string,
unsigned len)
{
unsigned int linelen, off = 0;
const char *pos;

if (!xen_pv_domain())
if (!xen_pv_domain()) {
xen_hvm_early_write(0, string, len);
return;
}

dom0_write_console(0, string, len);

Expand All @@ -628,6 +660,7 @@ static void xenboot_write_console(struct console *console, const char *string,
struct console xenboot_console = {
.name = "xenboot",
.write = xenboot_write_console,
.setup = xenboot_setup_console,
.flags = CON_PRINTBUFFER | CON_BOOT | CON_ANYTIME,
.index = -1,
};
Expand All @@ -640,17 +673,10 @@ void xen_raw_console_write(const char *str)

if (xen_domain()) {
rc = dom0_write_console(0, str, len);
#ifdef CONFIG_X86
if (rc == -ENOSYS && xen_hvm_domain())
goto outb_print;

} else if (xen_cpuid_base()) {
int i;
outb_print:
for (i = 0; i < len; i++)
outb(str[i], 0xe9);
#endif
if (rc != -ENOSYS || !xen_hvm_domain())
return;
}
xen_hvm_early_write(0, str, len);
}

void xen_raw_printk(const char *fmt, ...)
Expand All @@ -664,3 +690,18 @@ void xen_raw_printk(const char *fmt, ...)

xen_raw_console_write(buf);
}

static void xenboot_earlycon_write(struct console *console,
const char *string,
unsigned len)
{
dom0_write_console(0, string, len);
}

static int __init xenboot_earlycon_setup(struct earlycon_device *device,
const char *opt)
{
device->con->write = xenboot_earlycon_write;
return 0;
}
EARLYCON_DECLARE(xenboot, xenboot_earlycon_setup);
4 changes: 0 additions & 4 deletions drivers/xen/balloon.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/bootmem.h>
#include <linux/pagemap.h>
Expand Down Expand Up @@ -760,7 +759,4 @@ static int __init balloon_init(void)

return 0;
}

subsys_initcall(balloon_init);

MODULE_LICENSE("GPL");
1 change: 0 additions & 1 deletion drivers/xen/events/events_2l.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <linux/linkage.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/module.h>

#include <asm/sync_bitops.h>
#include <asm/xen/hypercall.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/xen/events/events_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <linux/linkage.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/string.h>
#include <linux/bootmem.h>
#include <linux/slab.h>
Expand Down
1 change: 0 additions & 1 deletion drivers/xen/events/events_fifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include <linux/linkage.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/smp.h>
#include <linux/percpu.h>
#include <linux/cpu.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/xen/features.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
#include <linux/types.h>
#include <linux/cache.h>
#include <linux/module.h>
#include <linux/export.h>

#include <asm/xen/hypercall.h>

Expand Down
1 change: 0 additions & 1 deletion drivers/xen/grant-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

#define pr_fmt(fmt) "xen:" KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/slab.h>
Expand Down
22 changes: 9 additions & 13 deletions drivers/xen/platform-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
* platform-pci.c
*
* Xen platform PCI device driver
*
* Authors: ssmith@xensource.com and stefano.stabellini@eu.citrix.com
*
* Copyright (c) 2005, Intel Corporation.
* Copyright (c) 2007, XenSource Inc.
* Copyright (c) 2010, Citrix
Expand All @@ -24,7 +27,7 @@

#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/pci.h>

#include <xen/platform_pci.h>
Expand All @@ -36,10 +39,6 @@

#define DRV_NAME "xen-platform-pci"

MODULE_AUTHOR("ssmith@xensource.com and stefano.stabellini@eu.citrix.com");
MODULE_DESCRIPTION("Xen platform PCI device");
MODULE_LICENSE("GPL");

static unsigned long platform_mmio;
static unsigned long platform_mmio_alloc;
static unsigned long platform_mmiolen;
Expand Down Expand Up @@ -101,8 +100,8 @@ static int platform_pci_resume(struct pci_dev *pdev)
return 0;
}

static int platform_pci_init(struct pci_dev *pdev,
const struct pci_device_id *ent)
static int platform_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
int i, ret;
long ioaddr;
Expand Down Expand Up @@ -181,20 +180,17 @@ static struct pci_device_id platform_pci_tbl[] = {
{0,}
};

MODULE_DEVICE_TABLE(pci, platform_pci_tbl);

static struct pci_driver platform_driver = {
.name = DRV_NAME,
.probe = platform_pci_init,
.probe = platform_pci_probe,
.id_table = platform_pci_tbl,
#ifdef CONFIG_PM
.resume_early = platform_pci_resume,
#endif
};

static int __init platform_pci_module_init(void)
static int __init platform_pci_init(void)
{
return pci_register_driver(&platform_driver);
}

module_init(platform_pci_module_init);
device_initcall(platform_pci_init);
Loading

0 comments on commit 55fc733

Please sign in to comment.