Release 4.7 drivers/tty/hvc/hvc_xen.c
/*
* xen console driver interface to hvc_console.c
*
* (c) 2007 Gerd Hoffmann <kraxel@suse.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <linux/console.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/irq.h>
#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>
#include <xen/xen.h>
#include <xen/interface/xen.h>
#include <xen/hvm.h>
#include <xen/grant_table.h>
#include <xen/page.h>
#include <xen/events.h>
#include <xen/interface/io/console.h>
#include <xen/interface/sched.h>
#include <xen/hvc-console.h>
#include <xen/xenbus.h>
#include "hvc_console.h"
#define HVC_COOKIE 0x58656e
/* "Xen" in hex */
struct xencons_info {
struct list_head list;
struct xenbus_device *xbdev;
struct xencons_interface *intf;
unsigned int evtchn;
struct hvc_struct *hvc;
int irq;
int vtermno;
grant_ref_t gntref;
};
static LIST_HEAD(xenconsoles);
static DEFINE_SPINLOCK(xencons_lock);
/* ------------------------------------------------------------------ */
static struct xencons_info *vtermno_to_xencons(int vtermno)
{
struct xencons_info *entry, *n, *ret = NULL;
if (list_empty(&xenconsoles))
return NULL;
list_for_each_entry_safe(entry, n, &xenconsoles, list) {
if (entry->vtermno == vtermno) {
ret = entry;
break;
}
}
return ret;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
stefano stabellini | stefano stabellini | 53 | 81.54% | 2 | 50.00% |
jeremy fitzhardinge | jeremy fitzhardinge | 12 | 18.46% | 2 | 50.00% |
| Total | 65 | 100.00% | 4 | 100.00% |
static inline int xenbus_devid_to_vtermno(int devid)
{
return devid + HVC_COOKIE;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
stefano stabellini | stefano stabellini | 12 | 80.00% | 1 | 33.33% |
jeremy fitzhardinge | jeremy fitzhardinge | 3 | 20.00% | 2 | 66.67% |
| Total | 15 | 100.00% | 3 | 100.00% |
static inline void notify_daemon(struct xencons_info *cons)
{
/* Use evtchn: this is called early, before irq is set up. */
notify_remote_via_evtchn(cons->evtchn);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jeremy fitzhardinge | jeremy fitzhardinge | 15 | 75.00% | 1 | 50.00% |
stefano stabellini | stefano stabellini | 5 | 25.00% | 1 | 50.00% |
| Total | 20 | 100.00% | 2 | 100.00% |
static int __write_console(struct xencons_info *xencons,
const char *data, int len)
{
XENCONS_RING_IDX cons, prod;
struct xencons_interface *intf = xencons->intf;
int sent = 0;
cons = intf->out_cons;
prod = intf->out_prod;
mb(); /* update queue values before going on */
BUG_ON((prod - cons) > sizeof(intf->out));
while ((sent < len) && ((prod - cons) < sizeof(intf->out)))
intf->out[MASK_XENCONS_IDX(prod++, intf->out)] = data[sent++];
wmb(); /* write ring before updating pointer */
intf->out_prod = prod;
if (sent)
notify_daemon(xencons);
return sent;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jeremy fitzhardinge | jeremy fitzhardinge | 120 | 88.24% | 3 | 75.00% |
stefano stabellini | stefano stabellini | 16 | 11.76% | 1 | 25.00% |
| Total | 136 | 100.00% | 4 | 100.00% |
static int domU_write_console(uint32_t vtermno, const char *data, int len)
{
int ret = len;
struct xencons_info *cons = vtermno_to_xencons(vtermno);
if (cons == NULL)
return -EINVAL;
/*
* Make sure the whole buffer is emitted, polling if
* necessary. We don't ever want to rely on the hvc daemon
* because the most interesting console output is when the
* kernel is crippled.
*/
while (len) {
int sent = __write_console(cons, data, len);
data += sent;
len -= sent;
if (unlikely(len))
HYPERVISOR_sched_op(SCHEDOP_yield, NULL);
}
return ret;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jeremy fitzhardinge | jeremy fitzhardinge | 64 | 74.42% | 2 | 66.67% |
stefano stabellini | stefano stabellini | 22 | 25.58% | 1 | 33.33% |
| Total | 86 | 100.00% | 3 | 100.00% |
static int domU_read_console(uint32_t vtermno, char *buf, int len)
{
struct xencons_interface *intf;
XENCONS_RING_IDX cons, prod;
int recv = 0;
struct xencons_info *xencons = vtermno_to_xencons(vtermno);
if (xencons == NULL)
return -EINVAL;
intf = xencons->intf;
cons = intf->in_cons;
prod = intf->in_prod;
mb(); /* get pointers before reading ring */
BUG_ON((prod - cons) > sizeof(intf->in));
while (cons != prod && recv < len)
buf[recv++] = intf->in[MASK_XENCONS_IDX(cons++, intf->in)];
mb(); /* read ring before consuming */
intf->in_cons = cons;
notify_daemon(xencons);
return recv;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jeremy fitzhardinge | jeremy fitzhardinge | 109 | 78.99% | 2 | 66.67% |
stefano stabellini | stefano stabellini | 29 | 21.01% | 1 | 33.33% |
| Total | 138 | 100.00% | 3 | 100.00% |
static const struct hv_ops domU_hvc_ops = {
.get_chars = domU_read_console,
.put_chars = domU_write_console,
.notifier_add = notifier_add_irq,
.notifier_del = notifier_del_irq,
.notifier_hangup = notifier_hangup_irq,
};
static int dom0_read_console(uint32_t vtermno, char *buf, int len)
{
return HYPERVISOR_console_io(CONSOLEIO_read, len, buf);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jeremy fitzhardinge | jeremy fitzhardinge | 26 | 100.00% | 1 | 100.00% |
| Total | 26 | 100.00% | 1 | 100.00% |
/*
* Either for a dom0 to write to the system console, or a domU with a
* debug version of Xen
*/
static int dom0_write_console(uint32_t vtermno, const char *str, int len)
{
int rc = HYPERVISOR_console_io(CONSOLEIO_write, len, (char *)str);
if (rc < 0)
return rc;
return len;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jeremy fitzhardinge | jeremy fitzhardinge | 43 | 95.56% | 1 | 33.33% |
konrad rzeszutek wilk | konrad rzeszutek wilk | 1 | 2.22% | 1 | 33.33% |
rusty russell | rusty russell | 1 | 2.22% | 1 | 33.33% |
| Total | 45 | 100.00% | 3 | 100.00% |
static const struct hv_ops dom0_hvc_ops = {
.get_chars = dom0_read_console,
.put_chars = dom0_write_console,
.notifier_add = notifier_add_irq,
.notifier_del = notifier_del_irq,
.notifier_hangup = notifier_hangup_irq,
};
static int xen_hvm_console_init(void)
{
int r;
uint64_t v = 0;
unsigned long gfn;
struct xencons_info *info;
if (!xen_hvm_domain())
return -ENODEV;
info = vtermno_to_xencons(HVC_COOKIE);
if (!info) {
info = kzalloc(sizeof(struct xencons_info), GFP_KERNEL);
if (!info)
return -ENOMEM;
} else if (info->intf != NULL) {
/* already configured */
return 0;
}
/*
* If the toolstack (or the hypervisor) hasn't set these values, the
* default value is 0. Even though gfn = 0 and evtchn = 0 are
* theoretically correct values, in practice they never are and they
* mean that a legacy toolstack hasn't initialized the pv console correctly.
*/
r = hvm_get_parameter(HVM_PARAM_CONSOLE_EVTCHN, &v);
if (r < 0 || v == 0)
goto err;
info->evtchn = v;
v = 0;
r = hvm_get_parameter(HVM_PARAM_CONSOLE_PFN, &v);
if (r < 0 || v == 0)
goto err;
gfn = v;
info->intf = xen_remap(gfn << XEN_PAGE_SHIFT, XEN_PAGE_SIZE);
if (info->intf == NULL)
goto err;
info->vtermno = HVC_COOKIE;
spin_lock(&xencons_lock);
list_add_tail(&info->list, &xenconsoles);
spin_unlock(&xencons_lock);
return 0;
err:
kfree(info);
return -ENODEV;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
stefano stabellini | stefano stabellini | 170 | 79.44% | 3 | 33.33% |
konrad rzeszutek wilk | konrad rzeszutek wilk | 38 | 17.76% | 4 | 44.44% |
julien grall | julien grall | 6 | 2.80% | 2 | 22.22% |
| Total | 214 | 100.00% | 9 | 100.00% |
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;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
stefano stabellini | stefano stabellini | 62 | 100.00% | 1 | 100.00% |
| Total | 62 | 100.00% | 1 | 100.00% |
static int xen_pv_console_init(void)
{
struct xencons_info *info;
if (!xen_pv_domain())
return -ENODEV;
if (!xen_start_info->console.domU.evtchn)
return -ENODEV;
info = vtermno_to_xencons(HVC_COOKIE);
if (!info) {
info = kzalloc(sizeof(struct xencons_info), GFP_KERNEL);
if (!info)
return -ENOMEM;
} else if (info->intf != NULL) {
/* already configured */
return 0;
}
spin_lock(&xencons_lock);
xencons_info_pv_init(info, HVC_COOKIE);
spin_unlock(&xencons_lock);
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
stefano stabellini | stefano stabellini | 107 | 96.40% | 2 | 66.67% |
konrad rzeszutek wilk | konrad rzeszutek wilk | 4 | 3.60% | 1 | 33.33% |
| Total | 111 | 100.00% | 3 | 100.00% |
static int xen_initial_domain_console_init(void)
{
struct xencons_info *info;
if (!xen_initial_domain())
return -ENODEV;
info = vtermno_to_xencons(HVC_COOKIE);
if (!info) {
info = kzalloc(sizeof(struct xencons_info), GFP_KERNEL);
if (!info)
return -ENOMEM;
}
info->irq = bind_virq_to_irq(VIRQ_CONSOLE, 0, false);
info->vtermno = HVC_COOKIE;
spin_lock(&xencons_lock);
list_add_tail(&info->list, &xenconsoles);
spin_unlock(&xencons_lock);
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
stefano stabellini | stefano stabellini | 102 | 98.08% | 2 | 66.67% |
david vrabel | david vrabel | 2 | 1.92% | 1 | 33.33% |
| Total | 104 | 100.00% | 3 | 100.00% |
static void xen_console_update_evtchn(struct xencons_info *info)
{
if (xen_hvm_domain()) {
uint64_t v = 0;
int err;
err = hvm_get_parameter(HVM_PARAM_CONSOLE_EVTCHN, &v);
if (!err && v)
info->evtchn = v;
} else
info->evtchn = xen_start_info->console.domU.evtchn;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
boris ostrovsky | boris ostrovsky | 60 | 96.77% | 1 | 50.00% |
jan beulich | jan beulich | 2 | 3.23% | 1 | 50.00% |
| Total | 62 | 100.00% | 2 | 100.00% |
void xen_console_resume(void)
{
struct xencons_info *info = vtermno_to_xencons(HVC_COOKIE);
if (info != NULL && info->irq) {
if (!xen_initial_domain())
xen_console_update_evtchn(info);
rebind_evtchn_irq(info->evtchn, info->irq);
}
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
stefano stabellini | stefano stabellini | 38 | 74.51% | 1 | 50.00% |
boris ostrovsky | boris ostrovsky | 13 | 25.49% | 1 | 50.00% |
| Total | 51 | 100.00% | 2 | 100.00% |
#ifdef CONFIG_HVC_XEN_FRONTEND
static void xencons_disconnect_backend(struct xencons_info *info)
{
if (info->irq > 0)
unbind_from_irqhandler(info->irq, NULL);
info->irq = 0;
if (info->evtchn > 0)
xenbus_free_evtchn(info->xbdev, info->evtchn);
info->evtchn = 0;
if (info->gntref > 0)
gnttab_free_grant_references(info->gntref);
info->gntref = 0;
if (info->hvc != NULL)
hvc_remove(info->hvc);
info->hvc = NULL;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
stefano stabellini | stefano stabellini | 101 | 100.00% | 1 | 100.00% |
| Total | 101 | 100.00% | 1 | 100.00% |
static void xencons_free(struct xencons_info *info)
{
free_page((unsigned long)info->intf);
info->intf = NULL;
info->vtermno = 0;
kfree(info);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
stefano stabellini | stefano stabellini | 39 | 100.00% | 1 | 100.00% |
| Total | 39 | 100.00% | 1 | 100.00% |
static int xen_console_remove(struct xencons_info *info)
{
xencons_disconnect_backend(info);
spin_lock(&xencons_lock);
list_del(&info->list);
spin_unlock(&xencons_lock);
if (info->xbdev != NULL)
xencons_free(info);
else {
if (xen_hvm_domain())
iounmap(info->intf);
kfree(info);
}
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
stefano stabellini | stefano stabellini | 72 | 100.00% | 1 | 100.00% |
| Total | 72 | 100.00% | 1 | 100.00% |
static int xencons_remove(struct xenbus_device *dev)
{
return xen_console_remove(dev_get_drvdata(&dev->dev));
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
stefano stabellini | stefano stabellini | 23 | 100.00% | 1 | 100.00% |
| Total | 23 | 100.00% | 1 | 100.00% |
static int xencons_connect_backend(struct xenbus_device *dev,
struct xencons_info *info)
{
int ret, evtchn, devid, ref, irq;
struct xenbus_transaction xbt;
grant_ref_t gref_head;
ret = xenbus_alloc_evtchn(dev, &evtchn);
if (ret)
return ret;
info->evtchn = evtchn;
irq = bind_evtchn_to_irq(evtchn);
if (irq < 0)
return irq;
info->irq = irq;
devid = dev->nodename[strlen(dev->nodename) - 1] - '0';
info->hvc = hvc_alloc(xenbus_devid_to_vtermno(devid),
irq, &domU_hvc_ops, 256);
if (IS_ERR(info->hvc))
return PTR_ERR(info->hvc);
ret = gnttab_alloc_grant_references(1, &gref_head);
if (ret < 0)
return ret;
info->gntref = gref_head;
ref = gnttab_claim_grant_reference(&gref_head);
if (ref < 0)
return ref;
gnttab_grant_foreign_access_ref(ref, info->xbdev->otherend_id,
virt_to_gfn(info->intf), 0);
again:
ret = xenbus_transaction_start(&xbt);
if (ret) {
xenbus_dev_fatal(dev, ret, "starting transaction");
return ret;
}
ret = xenbus_printf(xbt, dev->nodename, "ring-ref", "%d", ref);
if (ret)
goto error_xenbus;
ret = xenbus_printf(xbt, dev->nodename, "port", "%u",
evtchn);
if (ret)
goto error_xenbus;
ret = xenbus_transaction_end(xbt, 0);
if (ret) {
if (ret == -EAGAIN)
goto again;
xenbus_dev_fatal(dev, ret, "completing transaction");
return ret;
}
xenbus_switch_state(dev, XenbusStateInitialised);
return 0;
error_xenbus:
xenbus_transaction_end(xbt, 1);
xenbus_dev_fatal(dev, ret, "writing xenstore");
return ret;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
stefano stabellini | stefano stabellini | 333 | 98.23% | 1 | 50.00% |
julien grall | julien grall | 6 | 1.77% | 1 | 50.00% |
| Total | 339 | 100.00% | 2 | 100.00% |
static int xencons_probe(struct xenbus_device *dev,
const struct xenbus_device_id *id)
{
int ret, devid;
struct xencons_info *info;
devid = dev->nodename[strlen(dev->nodename) - 1] - '0';
if (devid == 0)
return -ENODEV;
info = kzalloc(sizeof(struct xencons_info), GFP_KERNEL);
if (!info)
return -ENOMEM;
dev_set_drvdata(&dev->dev, info);
info->xbdev = dev;
info->vtermno = xenbus_devid_to_vtermno(devid);
info->intf = (void *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
if (!info->intf)
goto error_nomem;
ret = xencons_connect_backend(dev, info);
if (ret < 0)
goto error;
spin_lock(&xencons_lock);
list_add_tail(&info->list, &xenconsoles);
spin_unlock(&xencons_lock);
return 0;
error_nomem:
ret = -ENOMEM;
xenbus_dev_fatal(dev, ret, "allocating device memory");
error:
xencons_disconnect_backend(info);
xencons_free(info);
return ret;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
stefano stabellini | stefano stabellini | 164 | 81.19% | 2 | 28.57% |
jeremy fitzhardinge | jeremy fitzhardinge | 31 | 15.35% | 3 | 42.86% |
dan carpenter | dan carpenter | 4 | 1.98% | 1 | 14.29% |
konrad rzeszutek wilk | konrad rzeszutek wilk | 3 | 1.49% | 1 | 14.29% |
| Total | 202 | 100.00% | 7 | 100.00% |
static int xencons_resume(struct xenbus_device *dev)
{
struct xencons_info *info = dev_get_drvdata(&dev->dev);
xencons_disconnect_backend(info);
memset(info->intf, 0, XEN_PAGE_SIZE);
return xencons_connect_backend(dev, info);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
stefano stabellini | stefano stabellini | 44 | 91.67% | 1 | 33.33% |
jeremy fitzhardinge | jeremy fitzhardinge | 3 | 6.25% | 1 | 33.33% |
julien grall | julien grall | 1 | 2.08% | 1 | 33.33% |
| Total | 48 | 100.00% | 3 | 100.00% |
static void xencons_backend_changed(struct xenbus_device *dev,
enum xenbus_state backend_state)
{
switch (backend_state) {
case XenbusStateReconfiguring:
case XenbusStateReconfigured:
case XenbusStateInitialising:
case XenbusStateInitialised:
case XenbusStateUnknown:
break;
case XenbusStateInitWait:
break;
case XenbusStateConnected:
xenbus_switch_state(dev, XenbusStateConnected);
break;
case XenbusStateClosed:
if (dev->state == XenbusStateClosed)
break;
/* Missed the backend's CLOSING state -- fallthrough */
case XenbusStateClosing:
xenbus_frontend_closed(dev);
break;
}
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
stefano stabellini | stefano stabellini | 50 | 67.57% | 1 | 33.33% |
david vrabel | david vrabel | 13 | 17.57% | 1 | 33.33% |
jeremy fitzhardinge | jeremy fitzhardinge | 11 | 14.86% | 1 | 33.33% |
| Total | 74 | 100.00% | 3 | 100.00% |
static const struct xenbus_device_id xencons_ids[] = {
{ "console" },
{ "" }
};
static struct xenbus_driver xencons_driver = {
.name = "xenconsole",
.ids = xencons_ids,
.probe = xencons_probe,
.remove = xencons_remove,
.resume = xencons_resume,
.otherend_changed = xencons_backend_changed,
};
#endif /* CONFIG_HVC_XEN_FRONTEND */
static int __init xen_hvc_init(void)
{
int r;
struct xencons_info *info;
const struct hv_ops *ops;
if (!xen_domain())
return -ENODEV;
if (xen_initial_domain()) {
ops = &dom0_hvc_ops;
r = xen_initial_domain_console_init();
if (r < 0)
return r;
info = vtermno_to_xencons(HVC_COOKIE);
} else {
ops = &domU_hvc_ops;
if (xen_hvm_domain())
r = xen_hvm_console_init();
else
r = xen_pv_console_init();
if (r < 0)
return r;
info = vtermno_to_xencons(HVC_COOKIE);
info->irq = bind_evtchn_to_irq(info->evtchn);
}
if (info->irq < 0)
info->irq = 0; /* NO_IRQ */
else
irq_set_noprobe(info->irq);
info->hvc = hvc_alloc(HVC_COOKIE, info->irq, ops, 256);
if (IS_ERR(info->hvc)) {
r = PTR_ERR(info->hvc);
spin_lock(&xencons_lock);
list_del(&info->list);
spin_unlock(&xencons_lock);
if (info->irq)
unbind_from_irqhandler(info->irq, NULL);
kfree(info);
return r;
}
r = 0;
#ifdef CONFIG_HVC_XEN_FRONTEND
r = xenbus_register_frontend(&xencons_driver);
#endif
return r;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
stefano stabellini | stefano stabellini | 240 | 100.00% | 1 | 100.00% |
| Total | 240 | 100.00% | 1 | 100.00% |
device_initcall(xen_hvc_init);
static int xen_cons_init(void)
{
const struct hv_ops *ops;
if (!xen_domain())
return 0;
if (xen_initial_domain())
ops = &dom0_hvc_ops;
else {
int r;
ops = &domU_hvc_ops;
if (xen_hvm_domain())
r = xen_hvm_console_init();
else
r = xen_pv_console_init();
if (r < 0)
return r;
}
hvc_instantiate(HVC_COOKIE, 0, ops);
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jeremy fitzhardinge | jeremy fitzhardinge | 49 | 60.49% | 2 | 50.00% |
stefano stabellini | stefano stabellini | 32 | 39.51% | 2 | 50.00% |
| Total | 81 | 100.00% | 4 | 100.00% |
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);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
stefano stabellini | stefano stabellini | 31 | 100.00% | 1 | 100.00% |
| Total | 31 | 100.00% | 1 | 100.00% |
#else
static void xen_hvm_early_write(uint32_t vtermno, const char *str, int len) { }
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
stefano stabellini | stefano stabellini | 16 | 100.00% | 1 | 100.00% |
| Total | 16 | 100.00% | 1 | 100.00% |
#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);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
stefano stabellini | stefano stabellini | 48 | 100.00% | 1 | 100.00% |
| Total | 48 | 100.00% | 1 | 100.00% |
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()) {
xen_hvm_early_write(0, string, len);
return;
}
dom0_write_console(0, string, len);
if (xen_initial_domain())
return;
domU_write_console(0, "(early) ", 8);
while (off < len && NULL != (pos = strchr(string+off, '\n'))) {
linelen = pos-string+off;
if (off + linelen > len)
break;
domU_write_console(0, string+off, linelen);
domU_write_console(0, "\r\n", 2);
off += linelen + 1;
}
if (off < len)
domU_write_console(0, string+off, len-off);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jeremy fitzhardinge | jeremy fitzhardinge | 141 | 88.68% | 4 | 66.67% |
stefano stabellini | stefano stabellini | 18 | 11.32% | 2 | 33.33% |
| Total | 159 | 100.00% | 6 | 100.00% |
struct console xenboot_console = {
.name = "xenboot",
.write = xenboot_write_console,
.setup = xenboot_setup_console,
.flags = CON_PRINTBUFFER | CON_BOOT | CON_ANYTIME,
.index = -1,
};
#endif /* CONFIG_EARLY_PRINTK */
void xen_raw_console_write(const char *str)
{
ssize_t len = strlen(str);
int rc = 0;
if (xen_domain()) {
rc = dom0_write_console(0, str, len);
if (rc != -ENOSYS || !xen_hvm_domain())
return;
}
xen_hvm_early_write(0, str, len);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
konrad rzeszutek wilk | konrad rzeszutek wilk | 34 | 54.84% | 1 | 20.00% |
jeremy fitzhardinge | jeremy fitzhardinge | 20 | 32.26% | 3 | 60.00% |
stefano stabellini | stefano stabellini | 8 | 12.90% | 1 | 20.00% |
| Total | 62 | 100.00% | 5 | 100.00% |
void xen_raw_printk(const char *fmt, ...)
{
static char buf[512];
va_list ap;
va_start(ap, fmt);
vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
xen_raw_console_write(buf);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jeremy fitzhardinge | jeremy fitzhardinge | 53 | 100.00% | 1 | 100.00% |
| Total | 53 | 100.00% | 1 | 100.00% |
static void xenboot_earlycon_write(struct console *console,
const char *string,
unsigned len)
{
dom0_write_console(0, string, len);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
stefano stabellini | stefano stabellini | 28 | 100.00% | 1 | 100.00% |
| Total | 28 | 100.00% | 1 | 100.00% |
static int __init xenboot_earlycon_setup(struct earlycon_device *device,
const char *opt)
{
device->con->write = xenboot_earlycon_write;
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
stefano stabellini | stefano stabellini | 28 | 100.00% | 1 | 100.00% |
| Total | 28 | 100.00% | 1 | 100.00% |
EARLYCON_DECLARE(xenboot, xenboot_earlycon_setup);
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
stefano stabellini | stefano stabellini | 2018 | 65.29% | 8 | 21.05% |
jeremy fitzhardinge | jeremy fitzhardinge | 838 | 27.11% | 9 | 23.68% |
konrad rzeszutek wilk | konrad rzeszutek wilk | 80 | 2.59% | 6 | 15.79% |
boris ostrovsky | boris ostrovsky | 73 | 2.36% | 1 | 2.63% |
david vrabel | david vrabel | 40 | 1.29% | 4 | 10.53% |
julien grall | julien grall | 13 | 0.42% | 2 | 5.26% |
christian borntraeger | christian borntraeger | 10 | 0.32% | 1 | 2.63% |
hendrik brueckner | hendrik brueckner | 5 | 0.16% | 1 | 2.63% |
dan carpenter | dan carpenter | 4 | 0.13% | 1 | 2.63% |
arnd bergmann | arnd bergmann | 3 | 0.10% | 1 | 2.63% |
julia lawall | julia lawall | 2 | 0.06% | 1 | 2.63% |
paul gortmaker | paul gortmaker | 2 | 0.06% | 1 | 2.63% |
jan beulich | jan beulich | 2 | 0.06% | 1 | 2.63% |
rusty russell | rusty russell | 1 | 0.03% | 1 | 2.63% |
| Total | 3091 | 100.00% | 38 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.