ia64/xen-unstable

view xen/arch/x86/hvm/quirks.c @ 19842:04476e5ef35d

x86 hvm: Make sure port 0x80 in hvm_io_table[] is set correctly
regardless of execution order of hvm_enable() and check_port80().

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 25 13:51:40 2009 +0100 (2009-06-25)
parents cb6f8a34b59a
children
line source
1 /******************************************************************************
2 * x86/hvm/quirks.c
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15 * Place - Suite 330, Boston, MA 02111-1307 USA.
16 */
18 #include <xen/config.h>
19 #include <xen/types.h>
20 #include <xen/init.h>
21 #include <xen/lib.h>
22 #include <xen/dmi.h>
23 #include <xen/bitmap.h>
24 #include <asm/hvm/support.h>
26 int hvm_port80_allowed = -1;
27 boolean_param("hvm_port80", hvm_port80_allowed);
29 static int __init dmi_hvm_deny_port80(/*const*/ struct dmi_system_id *id)
30 {
31 printk(XENLOG_WARNING "%s: port 0x80 access %s allowed for HVM guests\n",
32 id->ident, hvm_port80_allowed > 0 ? "forcibly" : "not");
34 if ( hvm_port80_allowed < 0 )
35 hvm_port80_allowed = 0;
37 return 0;
38 }
40 static int __init check_port80(void)
41 {
42 /*
43 * Quirk table for systems that misbehave (lock up, etc.) if port
44 * 0x80 is used:
45 */
46 static struct dmi_system_id __initdata hvm_no_port80_dmi_table[] =
47 {
48 {
49 .callback = dmi_hvm_deny_port80,
50 .ident = "Compaq Presario V6000",
51 .matches = {
52 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
53 DMI_MATCH(DMI_BOARD_NAME, "30B7")
54 }
55 },
56 {
57 .callback = dmi_hvm_deny_port80,
58 .ident = "HP Pavilion dv9000z",
59 .matches = {
60 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
61 DMI_MATCH(DMI_BOARD_NAME, "30B9")
62 }
63 },
64 {
65 .callback = dmi_hvm_deny_port80,
66 .ident = "HP Pavilion dv6000",
67 .matches = {
68 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
69 DMI_MATCH(DMI_BOARD_NAME, "30B8")
70 }
71 },
72 {
73 .callback = dmi_hvm_deny_port80,
74 .ident = "HP Pavilion tx1000",
75 .matches = {
76 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
77 DMI_MATCH(DMI_BOARD_NAME, "30BF")
78 }
79 },
80 {
81 .callback = dmi_hvm_deny_port80,
82 .ident = "Presario F700",
83 .matches = {
84 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
85 DMI_MATCH(DMI_BOARD_NAME, "30D3")
86 }
87 },
88 { }
89 };
91 dmi_check_system(hvm_no_port80_dmi_table);
93 if ( !hvm_port80_allowed )
94 __set_bit(0x80, hvm_io_bitmap);
96 return 0;
97 }
98 __initcall(check_port80);