xen-devel
[Xen-devel] [patch 15/44] paravirt: helper to disable all IO space
To: |
Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> |
Subject: |
[Xen-devel] [patch 15/44] paravirt: helper to disable all IO space |
From: |
Jeremy Fitzhardinge <jeremy@xxxxxxxxxxxxx> |
Date: |
Mon, 16 Jul 2007 16:15:51 -0700 |
Cc: |
Jeremy Fitzhardinge <jeremy@xxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Rusty Russell <rusty@xxxxxxxxxxxxxxx>, Andi Kleen <ak@xxxxxxx>, lkml <linux-kernel@xxxxxxxxxxxxxxx>, Chris Wright <chrisw@xxxxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> |
Delivery-date: |
Mon, 16 Jul 2007 17:12:37 -0700 |
Envelope-to: |
www-data@xxxxxxxxxxxxxxxxxx |
List-help: |
<mailto:xen-devel-request@lists.xensource.com?subject=help> |
List-id: |
Xen developer discussion <xen-devel.lists.xensource.com> |
List-post: |
<mailto:xen-devel@lists.xensource.com> |
List-subscribe: |
<http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> |
List-unsubscribe: |
<http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> |
References: |
<20070716231536.937393000@xxxxxxxxxxxxx>> |
Sender: |
xen-devel-bounces@xxxxxxxxxxxxxxxxxxx |
User-agent: |
quilt/0.46-1 |
In a virtual environment, device drivers such as legacy IDE will waste
quite a lot of time probing for their devices which will never appear.
This helper function allows a paravirt implementation to lay claim to
the whole iomem and ioport space, thereby disabling all device drivers
trying to claim IO resources.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xxxxxxxxxxxxx>
Signed-off-by: Chris Wright <chrisw@xxxxxxxxxxxx>
Cc: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
---
arch/i386/kernel/paravirt.c | 35 +++++++++++++++++++++++++++++++++++
include/asm-i386/paravirt.h | 1 +
2 files changed, 36 insertions(+)
===================================================================
--- a/arch/i386/kernel/paravirt.c
+++ b/arch/i386/kernel/paravirt.c
@@ -227,6 +227,41 @@ static int __init print_banner(void)
return 0;
}
core_initcall(print_banner);
+
+static struct resource reserve_ioports = {
+ .start = 0,
+ .end = IO_SPACE_LIMIT,
+ .name = "paravirt-ioport",
+ .flags = IORESOURCE_IO | IORESOURCE_BUSY,
+};
+
+static struct resource reserve_iomem = {
+ .start = 0,
+ .end = -1,
+ .name = "paravirt-iomem",
+ .flags = IORESOURCE_MEM | IORESOURCE_BUSY,
+};
+
+/*
+ * Reserve the whole legacy IO space to prevent any legacy drivers
+ * from wasting time probing for their hardware. This is a fairly
+ * brute-force approach to disabling all non-virtual drivers.
+ *
+ * Note that this must be called very early to have any effect.
+ */
+int paravirt_disable_iospace(void)
+{
+ int ret;
+
+ ret = request_resource(&ioport_resource, &reserve_ioports);
+ if (ret == 0) {
+ ret = request_resource(&iomem_resource, &reserve_iomem);
+ if (ret)
+ release_resource(&reserve_ioports);
+ }
+
+ return ret;
+}
struct paravirt_ops paravirt_ops = {
.name = "bare hardware",
===================================================================
--- a/include/asm-i386/paravirt.h
+++ b/include/asm-i386/paravirt.h
@@ -262,6 +262,7 @@ unsigned paravirt_patch_insns(void *site
unsigned paravirt_patch_insns(void *site, unsigned len,
const char *start, const char *end);
+int paravirt_disable_iospace(void);
/*
* This generates an indirect call based on the operation type number.
--
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-devel] [patch 37/44] xen: add virtual network device driver, (continued)
[Xen-devel] [patch 18/44] xen: Add Xen interface header files, Jeremy Fitzhardinge
[Xen-devel] [patch 16/44] Add a sched_clock paravirt_op, Jeremy Fitzhardinge
[Xen-devel] [patch 32/44] xen: hack to prevent bad segment register reload, Jeremy Fitzhardinge
[Xen-devel] [patch 09/44] paravirt: increase IRQ limit, Jeremy Fitzhardinge
[Xen-devel] [patch 15/44] paravirt: helper to disable all IO space,
Jeremy Fitzhardinge <=
[Xen-devel] [patch 20/44] xen: virtual mmu, Jeremy Fitzhardinge
[Xen-devel] [patch 11/44] paravirt: unstatic smp_store_cpu_info, Jeremy Fitzhardinge
[Xen-devel] [patch 39/44] xen: handle external requests for shutdown, reboot and sysrq, Jeremy Fitzhardinge
[Xen-devel] [patch 19/44] xen: Core Xen implementation, Jeremy Fitzhardinge
[Xen-devel] [patch 28/44] xen: Implement sched_clock, Jeremy Fitzhardinge
[Xen-devel] [patch 27/44] xen: Account for stolen time, Jeremy Fitzhardinge
[Xen-devel] [patch 35/44] xen: add the Xenbus sysfs and virtual device hotplug driver, Jeremy Fitzhardinge
[Xen-devel] [patch 07/44] paravirt: add an "mm" argument to alloc_pt, Jeremy Fitzhardinge
[Xen-devel] [patch 30/44] xen: Add support for preemption, Jeremy Fitzhardinge
|
|
|