From: lists-xen@pimb.org
To: xen-devel@lists.xensource.com
Subject: [PATCH 1/4] ioports: disable ioports in dom0 at boot-time
Date: Sun, 6 Nov 2005 02:43:25 +0100 [thread overview]
Message-ID: <20051106014325.GA12698@pimb.org> (raw)
In-Reply-To: <20051106014026.GN5268@pimb.org>
[-- Attachment #1: Type: text/plain, Size: 46 bytes --]
1/3
--
Jody Belka
knew (at) pimb (dot) org
[-- Attachment #2: ioport-1.patch --]
[-- Type: text/plain, Size: 2707 bytes --]
# HG changeset patch
# User jmb@artemis.home.pimb.org
# Node ID 9e1a127dc366ec3359471feffb7e12a46bd16687
# Parent 0cae0c6436f5fa49ab42f72ea90373cc5884d93a
Add boot-time support for disabling ioport ranges in dom0
This patch adds a new boot parameter, dom0_ioports_disable, which
accepts a comma seperated list of hex ioports and/or ioport ranges
(eg. dom0_ioports_disable=02f8-02ff,03f8-03ff), and applies them to dom0.
Signed-off-by: Jody Belka <knew (at) pimb (dot) org>
diff -r 0cae0c6436f5 -r 9e1a127dc366 xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c Sat Nov 5 10:30:01 2005
+++ b/xen/arch/x86/domain_build.c Sun Nov 6 01:13:42 2005
@@ -56,6 +56,9 @@
static unsigned int opt_dom0_translate = 0;
boolean_param("dom0_translate", opt_dom0_translate);
+static char opt_dom0_ioports_disable[200] = "";
+string_param("dom0_ioports_disable", opt_dom0_ioports_disable);
+
#if defined(__i386__)
/* No ring-3 access in initial leaf page tables. */
#define L1_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED)
@@ -89,6 +92,51 @@
if ( order-- == 0 )
break;
return page;
+}
+
+static void process_dom0_ioports_disable()
+{
+ unsigned long io_from, io_to, io_nr;
+ char *t, *u, *s = opt_dom0_ioports_disable;
+
+ if (*s == '\0') return;
+ for (; (t = strsep(&s, ",")) != NULL;)
+ {
+ if ( *t == '\n' ) continue;
+
+ io_from = simple_strtoul(t, &u, 16);
+ if ( u == t || *u != '-' )
+ {
+ printk("Invalid ioport range <%s> "
+ "in dom0_ioports_disable, skipping\n", t);
+ continue;
+ }
+
+ if ( u == s - 1 )
+ io_to = io_from;
+ else
+ io_to = simple_strtoul(u + 1, &u, 16);
+
+ if ( *u != '\0' || io_to < io_from )
+ {
+ printk("Invalid ioport range <%s> "
+ "in dom0_ioports_disable, skipping\n", t);
+ continue;
+ }
+
+ if ( (io_from + io_to) >= 65536 )
+ {
+ printk("Invalid ioport range <%s> "
+ "in dom0_ioports_disable, skipping\n", t);
+ continue;
+ }
+
+ printk("Disabling access to ioport range %04lx-%04lx from dom0\n",
+ io_from, io_to);
+
+ io_nr = io_to - io_from + 1;
+ physdev_modify_ioport_access_range(dom0, 0, io_from, io_nr);
+ }
}
int construct_dom0(struct domain *d,
@@ -716,6 +764,8 @@
physdev_modify_ioport_access_range(dom0, 0, 0x40, 4);
/* PIT Channel 2 / PC Speaker Control. */
physdev_modify_ioport_access_range(dom0, 0, 0x61, 1);
+ /* Command-line passed i/o ranges */
+ process_dom0_ioports_disable();
return 0;
}
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2005-11-06 1:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-06 1:40 [PATCH 0/4] fleshing out the ioport support lists-xen
2005-11-06 1:43 ` lists-xen [this message]
2005-11-06 1:44 ` [PATCH 2/4] ioports: libxc support lists-xen
2005-11-06 1:45 ` [PATCH 3/4] ioports: xen.lowlevel.xc support lists-xen
2005-11-06 1:46 ` [PATCH 4/4] ioports: xend/xm support lists-xen
2005-11-06 20:09 ` [PATCH 5/4] ioports: iopif.py missing from last patch Jody Belka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051106014325.GA12698@pimb.org \
--to=lists-xen@pimb.org \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.