x86/hvm: don't pass through port 0x80 in a few special cases
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 1 line
+__initcall(check_port80);
Hi Jan,
Actually this is executed too late:
The global flag 'hvm_port80_allowed' is used in __start_xen() -> identify_cpu() -> init_intel() -> start_vmx() -> hvm_enable().
And later, in __start_xen() -> do_initcalls(0 -> check_port80(), hvm_port80_allowed could be set to 0.
Thanks,
-- Dexuan
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Xen patchbot-unstable
Sent: 2009?6?19? 15:56
To: [email protected]
Subject: [Xen-changelog] [xen-unstable] x86/hvm: don't pass through port 0x80 in a few special cases
# HG changeset patch
# User Keir Fraser <[email protected]>
# Date 1245156733 -3600
# Node ID cb6f8a34b59af59b08c016a64afaba5e71cec79c # Parent 133c889c21a7596be60ab2a79d51b4ce9ded4521 x86/hvm: don't pass through port 0x80 in a few special cases
In a recent commit (99f85a28a78e96d28907fe036e1671a218fee597), KVM disabled the passthrough of this port due to known problems on certain HP laptops (see
http://lkml.indiana.edu/hypermail/linux/kernel/0712.3/0872.html
and http://lkml.indiana.edu/hypermail/linux/kernel/0801.0/2388.html).
For Xen, don't do this globally, but rather based on a DMI black list.
--- xen/arch/x86/hvm/Makefile | 1 xen/arch/x86/hvm/hvm.c | 5 +- xen/arch/x86/hvm/quirks.c | 93 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+), 1 deletion(-)
xen/arch/x86/hvm/Makefile +1 -0
@@ -9,6 +9,7 @@ obj-y += irq.o obj-y += irq.o obj-y += mtrr.o obj-y += pmtimer.o +obj-y += quirks.o obj-y += rtc.o obj-y += hpet.o obj-y += vpt.o
xen/arch/x86/hvm/hvm.c +4 -1
@@ -71,6 +71,8 @@ unsigned long __attribute__ ((__section_void hvm_enable (struct hvm_function_table *fns) { +extern int hvm_port80_allowed; +BUG_ON (hvm_enabled);printk ("HVM: %s enabled\n" , fns->name);
@@ -79,7 +81,8 @@ void hvm_enable(struct hvm_function_tabl* often used for I/O delays, but the vmexits simply slow things down). */ memset (hvm_io_bitmap, ~0 ,sizeof (hvm_io_bitmap)); -__clear_bit (0x80 , hvm_io_bitmap); +if ( hvm_port80_allowed ) +__clear_bit (0x80 , hvm_io_bitmap);__clear_bit (0xed , hvm_io_bitmap); hvm_funcs = *fns;
xen/arch/x86/hvm/quirks.c new file +93 -0
93 lines not on this page · raw message
_______________________________________________
Xen-changelog mailing list
[email protected]
http://lists.xensource.com/xen-changelog
I will fix, thanks.
K.
Quoted 190 lines · Dexuan
Quoted 1 line
+__initcall(check_port80);
Hi Jan,
Actually this is executed too late:The global flag '
hvm_port80_allowed' is used in__start_xen()->identify_cpu()->init_intel()->start_vmx()->hvm_enable().And later, in
__start_xen()-> do_initcalls(0 ->check_port80(),hvm_port80_allowedcould be set to 0.Thanks,
-- Dexuan-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Xen patchbot-unstable
Sent: 2009?6?19? 15:56
To: [email protected]
Subject: [Xen-changelog] [xen-unstable] x86/hvm: don't pass through port0x80in a few special cases# HG changeset patch
# User Keir Fraser <[email protected]>
# Date 1245156733 -3600
# Node IDcb6f8a34b59af59b08c016a64afaba5e71cec79c# Parent133c889c21a7596be60ab2a79d51b4ce9ded4521x86/hvm: don't pass through port0x80in a few special casesIn a recent commit (
99f85a28a78e96d28907fe036e1671a218fee597), KVM disabled the passthrough of this port due to known problems on certain HP laptops (see
http://lkml.indiana.edu/hypermail/linux/kernel/0712.3/0872.html
and http://lkml.indiana.edu/hypermail/linux/kernel/0801.0/2388.html).For Xen, don't do this globally, but rather based on a DMI black list.
Signed-off-by Jan Beulich <[email protected]>--- xen/arch/x86/hvm/Makefile | 1 xen/arch/x86/hvm/hvm.c | 5 +- xen/arch/x86/hvm/quirks.c | 93 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+), 1 deletion(-)diff -r
133c889c21a7-rcb6f8a34b59axen/arch/x86/hvm/Makefilexen/arch/x86/hvm/Makefile Tue Jun 16 13:52:13 2009 +0100 renamed from xen/arch/x86/hvm/Makefile Tue Jun 16 13:41:17 2009 +0100 +1
-0@@ -9,6 +9,7 @@ obj-y += irq.o obj-y += irq.o obj-y += mtrr.o obj-y += pmtimer.o +obj-y += quirks.o obj-y += rtc.o obj-y += hpet.o obj-y += vpt.odiff -r
133c889c21a7-rcb6f8a34b59axen/arch/x86/hvm/hvm.cxen/arch/x86/hvm/hvm.c Tue Jun 16 13:52:13 2009 +0100 renamed from xen/arch/x86/hvm/hvm.c Tue Jun 16 13:41:17 2009 +0100 +4
-1@@ -71,6 +71,8 @@ unsigned long __attribute__ ((__section_ void hvm_enable(struct hvm_function_table *fns) { + extern int hvm_port80_allowed; + BUG_ON(hvm_enabled); printk("HVM: %s enabled\n", fns->name);@@ -79,7 +81,8 @@ void hvm_enable(struct hvm_function_tabl * often used for I/O delays, but the vmexits simply slow things down). */ memset(hvm_io_bitmap, ~0, sizeof(hvm_io_bitmap)); - __clear_bit(0x80, hvm_io_bitmap); + if ( hvm_port80_allowed ) + __clear_bit(0x80, hvm_io_bitmap); __clear_bit(0xed, hvm_io_bitmap); hvm_funcs = *fns;diff -r
133c889c21a7-rcb6f8a34b59axen/arch/x86/hvm/quirks.cxen/arch/x86/hvm/quirks.c Tue Jun 16 13:52:13 2009 +0100 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +1
-0@@ -0,0 +1,93 @@ +/******************************************************************************
+ *x86/hvm/quirks.c
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ */xen/arch/x86/hvm/quirks.c Tue Jun 16 13:52:13 2009 +0100 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +77
-0+ +#include <xen/config.h> +#include <xen/types.h> +#include <xen/init.h> +#include <xen/lib.h> +#include <xen/dmi.h> + +int hvm_port80_allowed = -1; +boolean_param("hvm_port80", hvm_port80_allowed); + +static int __init dmi_hvm_deny_port80(/*const*/ struct dmi_system_id *id) +{ + printk(XENLOG_WARNING "%s: port 0x80 access %s allowed for HVM guests\n", + id->ident, hvm_port80_allowed > 0 ? "forcibly" : "not"); + + if ( hvm_port80_allowed < 0 ) + hvm_port80_allowed = 0; + + return 0; +} + +static int __init check_port80(void) +{ + /* + * Quirk table for systems that misbehave (lock up, etc.) if port + * 0x80 is used: + */ + static struct dmi_system_id __initdata hvm_no_port80_dmi_table[] = + { + { + .callback = dmi_hvm_deny_port80, + .ident = "Compaq Presario V6000", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), + DMI_MATCH(DMI_BOARD_NAME, "30B7") + } + }, + { + .callback = dmi_hvm_deny_port80, + .ident = "HP Pavilion dv9000z", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), + DMI_MATCH(DMI_BOARD_NAME, "30B9") + } + }, + { + .callback = dmi_hvm_deny_port80, + .ident = "HP Pavilion dv6000", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), + DMI_MATCH(DMI_BOARD_NAME, "30B8") + } + }, + { + .callback = dmi_hvm_deny_port80, + .ident = "HP Pavilion tx1000", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), + DMI_MATCH(DMI_BOARD_NAME, "30BF") + } + }, + { + .callback = dmi_hvm_deny_port80, + .ident = "Presario F700", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), + DMI_MATCH(DMI_BOARD_NAME, "30D3") + } + }, + { } + }; + + dmi_check_system(hvm_no_port80_dmi_table); + + return 0; +} +__initcall(check_port80);_______________________________________________
Xen-changelog mailing list
[email protected]
http://lists.xensource.com/xen-changelog_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Fixed as c/s 19842.
-- Keir
Quoted 86 lines · Keir Fraser
I will fix, thanks.
K.
Quoted 79 lines · Dexuan
Quoted 1 line
+__initcall(check_port80);
Hi Jan,
Actually this is executed too late:The global flag '
hvm_port80_allowed' is used in__start_xen()->identify_cpu()->init_intel()->start_vmx()->hvm_enable().And later, in
__start_xen()-> do_initcalls(0 ->check_port80(),hvm_port80_allowedcould be set to 0.Thanks,
-- Dexuan-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Xen patchbot-unstable
Sent: 2009?6?19? 15:56
To: [email protected]
Subject: [Xen-changelog] [xen-unstable] x86/hvm: don't pass through port0x80in a few special cases# HG changeset patch
# User Keir Fraser <[email protected]>
# Date 1245156733 -3600
# Node IDcb6f8a34b59af59b08c016a64afaba5e71cec79c# Parent133c889c21a7596be60ab2a79d51b4ce9ded4521x86/hvm: don't pass through port0x80in a few special casesIn a recent commit (
99f85a28a78e96d28907fe036e1671a218fee597), KVM disabled the passthrough of this port due to known problems on certain HP laptops (see
http://lkml.indiana.edu/hypermail/linux/kernel/0712.3/0872.html
and http://lkml.indiana.edu/hypermail/linux/kernel/0801.0/2388.html).For Xen, don't do this globally, but rather based on a DMI black list.
Signed-off-by Jan Beulich <[email protected]>--- xen/arch/x86/hvm/Makefile | 1 xen/arch/x86/hvm/hvm.c | 5 +- xen/arch/x86/hvm/quirks.c | 93 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+), 1 deletion(-)diff -r
133c889c21a7-rcb6f8a34b59axen/arch/x86/hvm/Makefilexen/arch/x86/hvm/Makefile Tue Jun 16 13:52:13 2009 +0100 renamed from xen/arch/x86/hvm/Makefile Tue Jun 16 13:41:17 2009 +0100 +1
-0@@ -9,6 +9,7 @@ obj-y += irq.o obj-y += irq.o obj-y += mtrr.o obj-y += pmtimer.o +obj-y += quirks.o obj-y += rtc.o obj-y += hpet.o obj-y += vpt.odiff -r
133c889c21a7-rcb6f8a34b59axen/arch/x86/hvm/hvm.cxen/arch/x86/hvm/hvm.c Tue Jun 16 13:52:13 2009 +0100 renamed from xen/arch/x86/hvm/hvm.c Tue Jun 16 13:41:17 2009 +0100 +4
-1@@ -71,6 +71,8 @@ unsigned long __attribute__ ((__section_ void hvm_enable(struct hvm_function_table *fns) { + extern int hvm_port80_allowed; + BUG_ON(hvm_enabled); printk("HVM: %s enabled\n", fns->name);@@ -79,7 +81,8 @@ void hvm_enable(struct hvm_function_tabl * often used for I/O delays, but the vmexits simply slow things down). */ memset(hvm_io_bitmap, ~0, sizeof(hvm_io_bitmap)); - __clear_bit(0x80, hvm_io_bitmap); + if ( hvm_port80_allowed ) + __clear_bit(0x80, hvm_io_bitmap); __clear_bit(0xed, hvm_io_bitmap);
Quoted 6 lines
xen/arch/x86/hvm/quirks.c Tue Jun 16 13:52:13 2009 +0100
Quoted 6 lines
xen/arch/x86/hvm/hvm.c Tue Jun 16 13:52:13 2009 +0100 renamed from xen/arch/x86/hvm/hvm.c Tue Jun 16 13:41:17 2009 +0100 +0
-0hvm_funcs = *fns;diff -r
133c889c21a7-rcb6f8a34b59axen/arch/x86/hvm/quirks.cxen/arch/x86/hvm/quirks.c Tue Jun 16 13:52:13 2009 +0100 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +0
-0@@ -0,0 +1,93 @@
+/***************************************************************************>> *
Quoted 113 lines
Quoted 102 lines
**
+ *x86/hvm/quirks.c
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ */xen/arch/x86/hvm/quirks.c Tue Jun 16 13:52:13 2009 +0100 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +13
-0+ +#include <xen/config.h> +#include <xen/types.h> +#include <xen/init.h> +#include <xen/lib.h> +#include <xen/dmi.h> + +int hvm_port80_allowed = -1; +boolean_param("hvm_port80", hvm_port80_allowed); + +static int __init dmi_hvm_deny_port80(/*const*/ struct dmi_system_id *id) +{ + printk(XENLOG_WARNING "%s: port 0x80 access %s allowed for HVMguests\n",
xen/arch/x86/hvm/quirks.c Tue Jun 16 13:52:13 2009 +0100 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +64
-0+ id->ident, hvm_port80_allowed > 0 ? "forcibly" : "not"); + + if ( hvm_port80_allowed < 0 ) + hvm_port80_allowed = 0; + + return 0; +} + +static int __init check_port80(void) +{ + /* + * Quirk table for systems that misbehave (lock up, etc.) if port + * 0x80 is used: + */ + static struct dmi_system_id __initdata hvm_no_port80_dmi_table[] = + { + { + .callback = dmi_hvm_deny_port80, + .ident = "Compaq Presario V6000", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), + DMI_MATCH(DMI_BOARD_NAME, "30B7") + } + }, + { + .callback = dmi_hvm_deny_port80, + .ident = "HP Pavilion dv9000z", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), + DMI_MATCH(DMI_BOARD_NAME, "30B9") + } + }, + { + .callback = dmi_hvm_deny_port80, + .ident = "HP Pavilion dv6000", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), + DMI_MATCH(DMI_BOARD_NAME, "30B8") + } + }, + { + .callback = dmi_hvm_deny_port80, + .ident = "HP Pavilion tx1000", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), + DMI_MATCH(DMI_BOARD_NAME, "30BF") + } + }, + { + .callback = dmi_hvm_deny_port80, + .ident = "Presario F700", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), + DMI_MATCH(DMI_BOARD_NAME, "30D3") + } + }, + { } + }; + + dmi_check_system(hvm_no_port80_dmi_table); + + return 0; +} +__initcall(check_port80);_______________________________________________
Xen-changelog mailing list
[email protected]
http://lists.xensource.com/xen-changelogQuoted 4 lines
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel