xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH v5 2/3] xen: add the RTC io space to the blocked access list
Date: Thu, 7 May 2015 16:54:18 +0200	[thread overview]
Message-ID: <1431010459-20920-3-git-send-email-roger.pau@citrix.com> (raw)
In-Reply-To: <1431010459-20920-1-git-send-email-roger.pau@citrix.com>

Previously this was done ad-hoc in admin_io_okay.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain_build.c | 3 +++
 xen/arch/x86/traps.c        | 4 ----
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 03e4bfe..2a23746 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -37,6 +37,7 @@
 #include <asm/io_apic.h>
 #include <asm/hap.h>
 #include <asm/hpet.h>
+#include <asm/mc146818rtc.h>
 
 #include <public/version.h>
 
@@ -1548,6 +1549,8 @@ int __init construct_dom0(
         rc |= ioports_deny_access(d, pmtmr_ioport, pmtmr_ioport + 3);
     /* PCI configuration space (NB. 0xcf8 has special treatment). */
     rc |= ioports_deny_access(d, 0xcfc, 0xcff);
+    /* Never permit direct access to the RTC/CMOS registers. */
+    rc |= ioports_deny_access(d, RTC_PORT(0), RTC_PORT(1));
     /* Command-line I/O ranges. */
     process_dom0_ioports_disable(d);
 
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 22cdfc4..0b0c5e9 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1765,10 +1765,6 @@ static int admin_io_okay(
     if ( (port == 0xcf8) && (bytes == 4) )
         return 0;
 
-    /* We also never permit direct access to the RTC/CMOS registers. */
-    if ( ((port & ~1) == RTC_PORT(0)) )
-        return 0;
-
     return ioports_access_permitted(v->domain, port, port + bytes - 1);
 }
 
-- 
1.9.5 (Apple Git-50.3)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  parent reply	other threads:[~2015-05-07 14:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-07 14:54 [PATCH v5 0/3] xen/pvh: use a custom IO bitmap for PVH hardware domains Roger Pau Monne
2015-05-07 14:54 ` [PATCH v5 1/3] " Roger Pau Monne
2015-05-07 15:10   ` Jan Beulich
2015-05-07 15:21     ` Roger Pau Monné
2015-05-18  6:05   ` Tian, Kevin
2015-05-07 14:54 ` Roger Pau Monne [this message]
2015-05-07 15:15   ` [PATCH v5 2/3] xen: add the RTC io space to the blocked access list Jan Beulich
2015-05-08 11:50   ` Jan Beulich
2015-05-08 11:55     ` Roger Pau Monné
2015-05-08 12:09       ` Jan Beulich
2015-05-07 14:54 ` [PATCH v5 3/3] xen: block access to IO port 0xcf9 Roger Pau Monne
2015-05-07 15:22   ` Jan Beulich
2015-05-07 15:57     ` Roger Pau Monné
2015-05-07 16:08       ` Jan Beulich

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=1431010459-20920-3-git-send-email-roger.pau@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=xen-devel@lists.xenproject.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).