|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH 21 of 38] xen dom0: Initialize xenbus for dom0
From: Juan Quintela <quintela@xxxxxxxxxx>
Do initial xenbus/xenstore setup in dom0. In dom0 we need to actually
allocate the xenstore resources, rather than being given them from
outside.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
Signed-off-by: Juan Quintela <quintela@xxxxxxxxxx>
---
drivers/xen/xenbus/xenbus_probe.c | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/drivers/xen/xenbus/xenbus_probe.c
b/drivers/xen/xenbus/xenbus_probe.c
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -810,6 +810,7 @@
static int __init xenbus_probe_init(void)
{
int err = 0;
+ unsigned long page = 0;
DPRINTK("");
@@ -830,7 +831,31 @@
* Domain0 doesn't have a store_evtchn or store_mfn yet.
*/
if (xen_initial_domain()) {
- /* dom0 not yet supported */
+ struct evtchn_alloc_unbound alloc_unbound;
+
+ /* Allocate Xenstore page */
+ page = get_zeroed_page(GFP_KERNEL);
+ if (!page)
+ return -ENOMEM;
+
+ xen_store_mfn = xen_start_info->store_mfn =
+ pfn_to_mfn(virt_to_phys((void *)page) >>
+ PAGE_SHIFT);
+
+ /* Next allocate a local port which xenstored can bind to */
+ alloc_unbound.dom = DOMID_SELF;
+ alloc_unbound.remote_dom = 0;
+
+ err = HYPERVISOR_event_channel_op(EVTCHNOP_alloc_unbound,
+ &alloc_unbound);
+ if (err == -ENOSYS)
+ goto out_unreg_front;
+
+ BUG_ON(err);
+ xen_store_evtchn = xen_start_info->store_evtchn =
+ alloc_unbound.port;
+
+ xen_store_interface = mfn_to_virt(xen_store_mfn);
} else {
xenstored_ready = 1;
xen_store_evtchn = xen_start_info->store_evtchn;
@@ -858,6 +883,9 @@
bus_unregister(&xenbus_frontend.bus);
out_error:
+ if (page != 0)
+ free_page(page);
+
return err;
}
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-devel] [PATCH 07 of 38] x86: add io_apic_ops, (continued)
- [Xen-devel] [PATCH 07 of 38] x86: add io_apic_ops, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 10 of 38] x86: add handle_irq() to allow interrupt injection, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 11 of 38] x86: define no-op exit_idle() on 32-bit, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 12 of 38] xen/dom0: handle acpi lapic parsing in Xen dom0, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 13 of 38] x86: unstatic mp_find_ioapic so it can be used elsewhere, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 14 of 38] x86: add mp_find_ioapic_pin, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 15 of 38] x86: unstatic ioapic entry funcs, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 16 of 38] x86: include linux/init.h in asm/numa_64.h, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 17 of 38] x86: add swiotlb allocation functions, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 19 of 38] x86: add arch specific version of the swiotlb virt<->bus<->virt functions, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 21 of 38] xen dom0: Initialize xenbus for dom0,
Jeremy Fitzhardinge <=
- [Xen-devel] [PATCH 18 of 38] x86: unify pci iommu setup and allow swiotlb to compile for 32 bit, Jeremy Fitzhardinge
[Xen-devel] [PATCH 20 of 38] xen dom0: Make hvc_xen console work for dom0, Jeremy Fitzhardinge
[Xen-devel] [PATCH 23 of 38] xen-dom0: only selectively disable cpu features, Jeremy Fitzhardinge
[Xen-devel] [PATCH 22 of 38] xen dom0: Set up basic IO permissions for dom0, Jeremy Fitzhardinge
|
|
|
|
|