Coverage Report

Created: 2017-10-25 09:10

/root/src/xen/xen/arch/x86/hvm/quirks.c
Line
Count
Source (jump to first uncovered line)
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, see <http://www.gnu.org/licenses/>.
15
 */
16
17
#include <xen/types.h>
18
#include <xen/init.h>
19
#include <xen/lib.h>
20
#include <xen/dmi.h>
21
#include <xen/bitmap.h>
22
#include <asm/hvm/support.h>
23
24
s8 __read_mostly hvm_port80_allowed = -1;
25
boolean_param("hvm_port80", hvm_port80_allowed);
26
27
static int __init dmi_hvm_deny_port80(/*const*/ struct dmi_system_id *id)
28
0
{
29
0
    printk(XENLOG_WARNING "%s: port 0x80 access %s allowed for HVM guests\n",
30
0
           id->ident, hvm_port80_allowed > 0 ? "forcibly" : "not");
31
0
32
0
    if ( hvm_port80_allowed < 0 )
33
0
        hvm_port80_allowed = 0;
34
0
35
0
    return 0;
36
0
}
37
38
static int __init check_port80(void)
39
1
{
40
1
    /*
41
1
     * Quirk table for systems that misbehave (lock up, etc.) if port
42
1
     * 0x80 is used:
43
1
     */
44
1
    static struct dmi_system_id __initdata hvm_no_port80_dmi_table[] =
45
1
    {
46
1
        {
47
1
            .callback = dmi_hvm_deny_port80,
48
1
            .ident    = "Compaq Presario V6000",
49
1
            .matches  = {
50
1
                DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
51
1
                DMI_MATCH(DMI_BOARD_NAME,   "30B7")
52
1
            }
53
1
        },
54
1
        {
55
1
            .callback = dmi_hvm_deny_port80,
56
1
            .ident    = "HP Pavilion dv9000z",
57
1
            .matches  = {
58
1
                DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
59
1
                DMI_MATCH(DMI_BOARD_NAME,   "30B9")
60
1
            }
61
1
        },
62
1
        {
63
1
            .callback = dmi_hvm_deny_port80,
64
1
            .ident    = "HP Pavilion dv6000",
65
1
            .matches  = {
66
1
                DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
67
1
                DMI_MATCH(DMI_BOARD_NAME,   "30B8")
68
1
            }
69
1
        },
70
1
        {
71
1
            .callback = dmi_hvm_deny_port80,
72
1
            .ident    = "HP Pavilion tx1000",
73
1
            .matches  = {
74
1
                DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
75
1
                DMI_MATCH(DMI_BOARD_NAME,   "30BF")
76
1
            }
77
1
        },
78
1
        {
79
1
            .callback = dmi_hvm_deny_port80,
80
1
            .ident    = "Presario F700",
81
1
            .matches  = {
82
1
                DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
83
1
                DMI_MATCH(DMI_BOARD_NAME,   "30D3")
84
1
            }
85
1
        },
86
1
        { }
87
1
    };
88
1
89
1
    dmi_check_system(hvm_no_port80_dmi_table);
90
1
91
1
    if ( !hvm_port80_allowed )
92
0
        __set_bit(0x80, hvm_io_bitmap);
93
1
94
1
    return 0;
95
1
}
96
__initcall(check_port80);