WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [XEN] Allow direct reads of port 0x61 by

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEN] Allow direct reads of port 0x61 by any guest.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 13 Sep 2006 16:30:13 +0000
Delivery-date: Wed, 13 Sep 2006 09:30:50 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 8c0cf4d3c4120b0b91a9a76a67f4005822cb7a7f
# Parent  3bff5c5b9206eec951e649aff006379009dc5a2a
[XEN] Allow direct reads of port 0x61 by any guest.
Often used by BIOS code which may be executed e.g., when starting
an X server.
From: Jan Beulich <jbeulich@xxxxxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/traps.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletion(-)

diff -r 3bff5c5b9206 -r 8c0cf4d3c412 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c      Wed Sep 13 14:34:34 2006 +0100
+++ b/xen/arch/x86/traps.c      Wed Sep 13 14:46:54 2006 +0100
@@ -1003,7 +1003,21 @@ static inline int admin_io_okay(
 }
 
 /* Check admin limits. Silently fail the access if it is disallowed. */
-#define inb_user(_p, _d, _r) (admin_io_okay(_p, 1, _d, _r) ? inb(_p) : ~0)
+static inline unsigned char inb_user(
+    unsigned int port, struct vcpu *v, struct cpu_user_regs *regs)
+{
+    /*
+     * Allow read access to port 0x61. Bit 4 oscillates with period 30us, and
+     * so it is often used for timing loops in BIOS code. This hack can go
+     * away when we have separate read/write permission rangesets.
+     * Note that we could emulate bit 4 instead of directly reading port 0x61,
+     * but there's not really a good reason to do so.
+     */
+    if ( admin_io_okay(port, 1, v, regs) || (port == 0x61) )
+        return inb(port);
+    return ~0;
+}
+//#define inb_user(_p, _d, _r) (admin_io_okay(_p, 1, _d, _r) ? inb(_p) : ~0)
 #define inw_user(_p, _d, _r) (admin_io_okay(_p, 2, _d, _r) ? inw(_p) : ~0)
 #define inl_user(_p, _d, _r) (admin_io_okay(_p, 4, _d, _r) ? inl(_p) : ~0)
 #define outb_user(_v, _p, _d, _r) \

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [XEN] Allow direct reads of port 0x61 by any guest., Xen patchbot-unstable <=