[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Xen MCE test: all test cases



# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1293186188 0
# Node ID a69ceb6ded9257c10c673bfc246ceaff9d77d4c5
# Parent  ca0b26180f32d4ba56afef2483dcdd5da841e434
Xen MCE test: all test cases

Implement the test cases. Each of cases will call the common function,
then call mce inject tool. README for Xen MCE test suite, include the
framwork and test instruction.

Signed-off-by: Yunhong Jiang <yunhong.jiang@xxxxxxxxx>
Signed-off-by: Haicheng Li<haicheng.li@xxxxxxxxx>
Signed-off-by: Xudong Hao <xudong.hao@xxxxxxxxx>
---
 tools/tests/mce-test/Makefile                      |    7 +
 tools/tests/mce-test/README                        |   75 ++++++++++++++++
 tools/tests/mce-test/cases/srao_llc/dom0/cases.sh  |   74 ++++++++++++++++
 tools/tests/mce-test/cases/srao_llc/guest/cases.sh |   95 +++++++++++++++++++++
 tools/tests/mce-test/cases/srao_llc/xen/cases.sh   |   70 +++++++++++++++
 tools/tests/mce-test/cases/srao_mem/dom0/cases.sh  |   74 ++++++++++++++++
 tools/tests/mce-test/cases/srao_mem/guest/cases.sh |   95 +++++++++++++++++++++
 tools/tests/mce-test/cases/srao_mem/xen/cases.sh   |   70 +++++++++++++++
 tools/tests/mce-test/cases/ucna_llc/dom0/cases.sh  |   73 ++++++++++++++++
 tools/tests/mce-test/cases/ucna_llc/guest/cases.sh |   93 ++++++++++++++++++++
 tools/tests/mce-test/cases/ucna_llc/xen/cases.sh   |   69 +++++++++++++++
 11 files changed, 795 insertions(+)

diff -r ca0b26180f32 -r a69ceb6ded92 tools/tests/mce-test/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/tests/mce-test/Makefile     Fri Dec 24 10:23:08 2010 +0000
@@ -0,0 +1,7 @@
+.PHONY: all clean
+
+all: 
+       $(MAKE) -C tools
+
+clean:
+       $(MAKE) -C tools clean
diff -r ca0b26180f32 -r a69ceb6ded92 tools/tests/mce-test/README
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/tests/mce-test/README       Fri Dec 24 10:23:08 2010 +0000
@@ -0,0 +1,75 @@
+Xen MCE test suite
+---------------
+
+The Xen MCE test suite is a collection of tools and test scripts for
+testing the Xen MCE processing features. The goal is to cover
+most Xen MCE processing code paths and features with automation tests.
+
+
+In the Package
+--------------
+
+Here is a short description of what is included in the package
+
+README
+       This is document
+
+Makefile
+       For compile
+
+cases/*
+       Contains all test cases, which may be organized in sub-directories, 
+       the interface of test case is a shell script under cases/, such as:
+          -- cases/srao_mem/dom0/cases.sh
+
+config/*
+       Contains test configuration files, which specifies the parameters 
+       for test cases, etc.
+
+lib/*
+       Contains some shell scripts, in which some common shell
+       functions and variable definitions are defined to be used by
+       test cases.
+
+tools/*
+       Tools used by MCE test suites, now only xen-mceinj tool.
+
+results/
+       When test is done, the test result will be placed in this
+       directory, test results of various cases may be in corresponding 
+       directory. 
+       For example, files in
+           results/srao_mem_dom0/result
+       is the result for test case cases/srao_mem/dom0/cases.sh, there will
+       be 3 result conditions: PASSED/FAILED/NORESULT.
+               results/<test_case>/testlog   #the test log during testing
+               results/<test_case>/mcelog    #mcelog output during testing
+               results/<test_case>/xenlog    #Xen log during testing
+               results/<test_case>/gklog     #VM guest kernel log during 
testing
+               results/<test_case>/guest_config   #config file used to create 
guest
+
+
+Test Instruction
+----------------
+
+1.     make sure you have a dom0 with mce support
+       CONFIG_X86_MCE=y
+       CONFIG_X86_MCE_INTEL=y
+       CONFIG_X86_MCE_AMD=y
+       CONFIG_X86_MCE_THRESHOLD=y
+       CONFIG_X86_MCE_INJECT=y
+
+2.     run system at xen and start xend. A installed guest image is
+       necessary when do guest MCE error injection.
+3.     compile tools that used to test. in mce-test, $make.
+       Note: make sure compile xen/tools before do this step
+4.     run test cases that you want.
+       e.g. $sh cases/srao_mem/dom0/cases.sh -d 0 -p 0x0200 -c 2 -t 1
+5.     get test result in results directory
+
+
+Notes
+----------------
+All test cases fake a error and inject this error in 0x180020, For Xen
+test cases(e.g. cases/srao_mem/xen/cases.sh), error happen on every page 
+may cause a Xen panic. 
diff -r ca0b26180f32 -r a69ceb6ded92 
tools/tests/mce-test/cases/srao_llc/dom0/cases.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/tests/mce-test/cases/srao_llc/dom0/cases.sh Fri Dec 24 10:23:08 
2010 +0000
@@ -0,0 +1,74 @@
+#!/bin/bash
+#
+# Copyright (c) 2010, Intel Corporation
+# 
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version
+# 2 as published by the Free Software Foundation.
+# 
+# This program is distributed in the hope that 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., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Author: Xudong Hao <xudong.hao@xxxxxxxxx>
+#
+
+sd=$(dirname $0)
+export ROOT=`(cd $sd/../../../; pwd)`
+export this_case=srao_llc_dom0
+
+. $ROOT/lib/xen-mceinj-tool.sh
+
+usage()
+{
+    echo "Usage: ./cases.sh [-options] [arguments]"
+    echo "================Below are the optional options================"
+    echo -e "\t-d domainID\t: 0"
+    echo -e "\t-c injcpu\t: which cpu to inject error"
+    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
+    echo -e "\t\t\tBy default, the GPA is 0x180020"
+    echo -e "\t-h help"
+    exit 0
+}
+
+while getopts ":c:d:p:h" option
+do
+    case "$option" in
+    c) injcpu=$OPTARG;;
+    d) domid=$OPTARG;;
+    p) pageaddr=$OPTARG;;
+    h) usage;;
+    *) echo "invalid option!"; usage;;
+    esac
+done
+
+[ -z $domid ] && domid=0
+
+inject()
+{
+    mce_inject_trigger $MCE_SRAO_LLC -d $domid -u $injcpu -p $pageaddr 
+    if [ $? -eq 0 ]; then
+        show "  Passed: Successfully to fake and inject a MCE error"
+    else
+        show "  Failed: Fake error and inject fail !!"
+        return 1
+    fi
+    return 0
+}
+
+do_main()
+{
+    ret_val=0
+    clean_env
+    inject || ret_val=1
+    xen_verify || ret_val=1
+    mcelog_verify $MCE_SRAO_LLC || ret_val=1
+    gen_result $ret_val
+}
+
+do_main "$@"
diff -r ca0b26180f32 -r a69ceb6ded92 
tools/tests/mce-test/cases/srao_llc/guest/cases.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/tests/mce-test/cases/srao_llc/guest/cases.sh        Fri Dec 24 
10:23:08 2010 +0000
@@ -0,0 +1,95 @@
+#!/bin/bash
+#
+# Copyright (c) 2010, Intel Corporation
+# 
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version
+# 2 as published by the Free Software Foundation.
+# 
+# This program is distributed in the hope that 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., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Author: Xudong Hao <xudong.hao@xxxxxxxxx>
+#
+
+sd=$(dirname $0)
+export ROOT=`(cd $sd/../../../; pwd)`
+export this_case=srao_llc_guest
+
+. $ROOT/lib/xen-mceinj-tool.sh
+
+usage()
+{
+    echo "Usage: ./cases.sh [-options] [arguments]"
+    echo "================Below are the must have options==============="
+    echo -e "\t-i image\t: guest image"
+    echo -e "\t-m memory\t: set guest virtual memory"
+    echo "========                                              ========"
+    echo "================Below are the optional options================"
+    echo -e "\t-u vcpus\t: set guest virtual cpus number"
+    echo -e "\t-c injcpu\t: which cpu to inject error"
+    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
+    echo -e "\t\t\tBy default, the GPA is 0x180020"
+    echo -e "\t-h help"
+    exit 0
+}
+
+[ $# -lt 1 ] && usage
+
+while getopts ":i:u:m:c:p:hl:" option
+do
+    case "$option" in
+    i) image=$OPTARG; offset=`kpartx -l $image | awk '{print $NF*512}'`;;
+    u) vcpus=$OPTARG;;
+    m) memory=$OPTARG;;
+    c) injcpu=$OPTARG;;
+    p) pageaddr=$OPTARG;;
+    l) early_kill="0";;
+    h) usage;;
+    *) echo "invalid option!"; usage;;
+    esac
+done
+
+
+start_guest()
+{
+    create_hvm_guest $image -u $vcpus -m $memory
+    if [ $? -ne 0 ]; then
+        echo "  Create guest fail!"
+        return 1
+    fi
+    return 0
+}
+
+inject()
+{
+    mce_inject_trigger $MCE_SRAO_LLC -u $injcpu -p $pageaddr 
+    if [ $? -eq 0 ]; then
+        show "  Passed: Successfully to fake and inject a MCE error"
+    else
+        show "  Failed: Fake error and inject fail !!"
+        return 1
+    fi
+    return 0
+}
+
+do_main()
+{
+    ret_val=0
+    clean_env
+    start_guest || ret_val=1
+    inject || ret_val=1
+    xen_verify || ret_val=1
+    guest_verify || ret_val=1
+    mcelog_verify $MCE_SRAO_LLC || ret_val=1
+    des_guest
+    gen_result $ret_val
+}
+
+do_main "$@"
diff -r ca0b26180f32 -r a69ceb6ded92 
tools/tests/mce-test/cases/srao_llc/xen/cases.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/tests/mce-test/cases/srao_llc/xen/cases.sh  Fri Dec 24 10:23:08 
2010 +0000
@@ -0,0 +1,70 @@
+#!/bin/bash
+#
+# Copyright (c) 2010, Intel Corporation
+# 
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version
+# 2 as published by the Free Software Foundation.
+# 
+# This program is distributed in the hope that 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., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Author: Xudong Hao <xudong.hao@xxxxxxxxx>
+#
+
+sd=$(dirname $0)
+export ROOT=`(cd $sd/../../../; pwd)`
+export this_case=srao_llc_xen
+
+. $ROOT/lib/xen-mceinj-tool.sh
+
+usage()
+{
+    echo "Usage: ./cases.sh [-options] [arguments]"
+    echo "================Below are the optional options================"
+    echo -e "\t-c injcpu\t: which cpu to inject error"
+    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
+    echo -e "\t\t\tBy default, the GPA is 0x180020"
+    echo -e "\t-h help"
+    exit 0
+}
+
+while getopts ":c:p:h" option
+do
+    case "$option" in
+    c) injcpu=$OPTARG;;
+    p) pageaddr=$OPTARG;;
+    h) usage;;
+    *) echo "invalid option!"; usage;;
+    esac
+done
+
+inject()
+{
+    mce_inject_trigger $MCE_SRAO_LLC -u $injcpu -p $pageaddr 
+    if [ $? -eq 0 ]; then
+        show "  Passed: Successfully to fake and inject a MCE error"
+    else
+        show "  Failed: Fake error and inject fail !!"
+        return 1
+    fi
+    return 0
+}
+
+do_main()
+{
+    ret_val=0
+    clean_env
+    inject || ret_val=1
+    xen_verify || ret_val=1
+    mcelog_verify $MCE_SRAO_LLC || ret_val=1
+    gen_result $ret_val
+}
+
+do_main "$@"
diff -r ca0b26180f32 -r a69ceb6ded92 
tools/tests/mce-test/cases/srao_mem/dom0/cases.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/tests/mce-test/cases/srao_mem/dom0/cases.sh Fri Dec 24 10:23:08 
2010 +0000
@@ -0,0 +1,74 @@
+#!/bin/bash
+#
+# Copyright (c) 2010, Intel Corporation
+# 
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version
+# 2 as published by the Free Software Foundation.
+# 
+# This program is distributed in the hope that 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., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Author: Xudong Hao <xudong.hao@xxxxxxxxx>
+#
+
+sd=$(dirname $0)
+export ROOT=`(cd $sd/../../../; pwd)`
+export this_case=srao_mem_dom0
+
+. $ROOT/lib/xen-mceinj-tool.sh
+
+usage()
+{
+    echo "Usage: ./cases.sh [-options] [arguments]"
+    echo "================Below are the optional options================"
+    echo -e "\t-d domainID\t: 0"
+    echo -e "\t-c injcpu\t: which cpu to inject error"
+    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
+    echo -e "\t\t\tBy default, the GPA is 0x180020"
+    echo -e "\t-h help"
+    exit 0
+}
+
+while getopts ":c:d:p:h" option
+do
+    case "$option" in
+    c) injcpu=$OPTARG;;
+    d) domid=$OPTARG;;
+    p) pageaddr=$OPTARG;;
+    h) usage;;
+    *) echo "invalid option!"; usage;;
+    esac
+done
+
+[ -z $domid ] && domid=0
+
+inject()
+{
+    mce_inject_trigger $MCE_SRAO_MEM -d $domid -u $injcpu -p $pageaddr 
+    if [ $? -eq 0 ]; then
+        show "  Passed: Successfully to fake and inject a MCE error"
+    else
+        show "  Failed: Fake error and inject fail !!"
+        return 1
+    fi
+    return 0
+}
+
+do_main()
+{
+    ret_val=0
+    clean_env
+    inject || ret_val=1
+    xen_verify || ret_val=1
+    mcelog_verify $MCE_SRAO_MEM || ret_val=1
+    gen_result $ret_val
+}
+
+do_main "$@"
diff -r ca0b26180f32 -r a69ceb6ded92 
tools/tests/mce-test/cases/srao_mem/guest/cases.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/tests/mce-test/cases/srao_mem/guest/cases.sh        Fri Dec 24 
10:23:08 2010 +0000
@@ -0,0 +1,95 @@
+#!/bin/bash
+#
+# Copyright (c) 2010, Intel Corporation
+# 
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version
+# 2 as published by the Free Software Foundation.
+# 
+# This program is distributed in the hope that 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., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Author: Xudong Hao <xudong.hao@xxxxxxxxx>
+#
+
+sd=$(dirname $0)
+export ROOT=`(cd $sd/../../../; pwd)`
+export this_case=srao_mem_guest
+
+. $ROOT/lib/xen-mceinj-tool.sh
+
+usage()
+{
+    echo "Usage: ./cases.sh [-options] [arguments]"
+    echo "================Below are the must have options==============="
+    echo -e "\t-i image\t: guest image"
+    echo -e "\t-m memory\t: set guest virtual memory"
+    echo "========                                              ========"
+    echo "================Below are the optional options================"
+    echo -e "\t-u vcpus\t: set guest virtual cpus number"
+    echo -e "\t-c injcpu\t: which cpu to inject error"
+    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
+    echo -e "\t\t\tBy default, the GPA is 0x180020"
+    echo -e "\t-h help"
+    exit 0
+}
+
+[ $# -lt 1 ] && usage
+
+while getopts ":i:u:m:c:p:hl:" option
+do
+    case "$option" in
+    i) image=$OPTARG; offset=`kpartx -l $image | awk '{print $NF*512}'`;;
+    u) vcpus=$OPTARG;;
+    m) memory=$OPTARG;;
+    c) injcpu=$OPTARG;;
+    p) pageaddr=$OPTARG;;
+    l) early_kill="0";;
+    h) usage;;
+    *) echo "invalid option!"; usage;;
+    esac
+done
+
+
+start_guest()
+{
+    create_hvm_guest $image -u $vcpus -m $memory
+    if [ $? -ne 0 ]; then
+        echo "  Create guest fail!"
+        return 1
+    fi
+    return 0
+}
+
+inject()
+{
+    mce_inject_trigger $MCE_SRAO_MEM -u $injcpu -p $pageaddr 
+    if [ $? -eq 0 ]; then
+        show "  Passed: Successfully to fake and inject a MCE error"
+    else
+        show "  Failed: Fake error and inject fail !!"
+        return 1
+    fi
+    return 0
+}
+
+do_main()
+{
+    ret_val=0
+    clean_env
+    start_guest || ret_val=1
+    inject || ret_val=1
+    xen_verify || ret_val=1
+    guest_verify || ret_val=1
+    mcelog_verify $MCE_SRAO_MEM || ret_val=1
+    des_guest
+    gen_result $ret_val
+}
+
+do_main "$@"
diff -r ca0b26180f32 -r a69ceb6ded92 
tools/tests/mce-test/cases/srao_mem/xen/cases.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/tests/mce-test/cases/srao_mem/xen/cases.sh  Fri Dec 24 10:23:08 
2010 +0000
@@ -0,0 +1,70 @@
+#!/bin/bash
+#
+# Copyright (c) 2010, Intel Corporation
+# 
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version
+# 2 as published by the Free Software Foundation.
+# 
+# This program is distributed in the hope that 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., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Author: Xudong Hao <xudong.hao@xxxxxxxxx>
+#
+
+sd=$(dirname $0)
+export ROOT=`(cd $sd/../../../; pwd)`
+export this_case=srao_mem_xen
+
+. $ROOT/lib/xen-mceinj-tool.sh
+
+usage()
+{
+    echo "Usage: ./cases.sh [-options] [arguments]"
+    echo "================Below are the optional options================"
+    echo -e "\t-c injcpu\t: which cpu to inject error"
+    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
+    echo -e "\t\t\tBy default, the GPA is 0x180020"
+    echo -e "\t-h help"
+    exit 0
+}
+
+while getopts ":c:p:h" option
+do
+    case "$option" in
+    c) injcpu=$OPTARG;;
+    p) pageaddr=$OPTARG;;
+    h) usage;;
+    *) echo "invalid option!"; usage;;
+    esac
+done
+
+inject()
+{
+    mce_inject_trigger $MCE_SRAO_MEM -u $injcpu -p $pageaddr 
+    if [ $? -eq 0 ]; then
+        show "  Passed: Successfully to fake and inject a MCE error"
+    else
+        show "  Failed: Fake error and inject fail !!"
+        return 1
+    fi
+    return 0
+}
+
+do_main()
+{
+    ret_val=0
+    clean_env
+    inject || ret_val=1
+    xen_verify || ret_val=1
+    mcelog_verify $MCE_SRAO_MEM || ret_val=1
+    gen_result $ret_val
+}
+
+do_main "$@"
diff -r ca0b26180f32 -r a69ceb6ded92 
tools/tests/mce-test/cases/ucna_llc/dom0/cases.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/tests/mce-test/cases/ucna_llc/dom0/cases.sh Fri Dec 24 10:23:08 
2010 +0000
@@ -0,0 +1,73 @@
+#!/bin/bash
+#
+# Copyright (c) 2010, Intel Corporation
+# 
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version
+# 2 as published by the Free Software Foundation.
+# 
+# This program is distributed in the hope that 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., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Author: Xudong Hao <xudong.hao@xxxxxxxxx>
+#
+
+sd=$(dirname $0)
+export ROOT=`(cd $sd/../../../; pwd)`
+export this_case=ucna_llc_dom0
+
+. $ROOT/lib/xen-mceinj-tool.sh
+
+usage()
+{
+    echo "Usage: ./cases.sh [-options] [arguments]"
+    echo "================Below are the optional options================"
+    echo -e "\t-d domainID\t: 0"
+    echo -e "\t-c injcpu\t: which cpu to inject error"
+    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
+    echo -e "\t\t\tBy default, the GPA is 0x180020"
+    echo -e "\t-h help"
+    exit 0
+}
+
+while getopts ":c:d:p:h" option
+do
+    case "$option" in
+    c) injcpu=$OPTARG;;
+    d) domid=$OPTARG;;
+    p) pageaddr=$OPTARG;;
+    h) usage;;
+    *) echo "invalid option!"; usage;;
+    esac
+done
+
+[ -z $domid ] && domid=0
+
+inject()
+{
+    mce_inject_trigger $CMCI_UCNA_LLC -d $domid -u $injcpu -p $pageaddr 
+    if [ $? -eq 0 ]; then
+        show "  Passed: Successfully to fake and inject a MCE error"
+    else
+        show "  Failed: Fake error and inject fail !!"
+        return 1
+    fi
+    return 0
+}
+
+do_main()
+{
+    ret_val=0
+    clean_env
+    inject || ret_val=1
+    mcelog_verify $CMCI_UCNA_LLC || ret_val=1
+    gen_result $ret_val
+}
+
+do_main "$@"
diff -r ca0b26180f32 -r a69ceb6ded92 
tools/tests/mce-test/cases/ucna_llc/guest/cases.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/tests/mce-test/cases/ucna_llc/guest/cases.sh        Fri Dec 24 
10:23:08 2010 +0000
@@ -0,0 +1,93 @@
+#!/bin/bash
+#
+# Copyright (c) 2010, Intel Corporation
+# 
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version
+# 2 as published by the Free Software Foundation.
+# 
+# This program is distributed in the hope that 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., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Author: Xudong Hao <xudong.hao@xxxxxxxxx>
+#
+
+sd=$(dirname $0)
+export ROOT=`(cd $sd/../../../; pwd)`
+export this_case=ucna_llc_guest
+
+. $ROOT/lib/xen-mceinj-tool.sh
+
+usage()
+{
+    echo "Usage: ./cases.sh [-options] [arguments]"
+    echo "================Below are the must have options==============="
+    echo -e "\t-i image\t: guest image"
+    echo -e "\t-m memory\t: set guest virtual memory"
+    echo "========                                              ========"
+    echo "================Below are the optional options================"
+    echo -e "\t-u vcpus\t: set guest virtual cpus number"
+    echo -e "\t-c injcpu\t: which cpu to inject error"
+    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
+    echo -e "\t\t\tBy default, the GPA is 0x180020"
+    echo -e "\t-h help"
+    exit 0
+}
+
+[ $# -lt 1 ] && usage
+
+while getopts ":i:u:m:c:p:hl:" option
+do
+    case "$option" in
+    i) image=$OPTARG; offset=`kpartx -l $image | awk '{print $NF*512}'`;;
+    u) vcpus=$OPTARG;;
+    m) memory=$OPTARG;;
+    c) injcpu=$OPTARG;;
+    p) pageaddr=$OPTARG;;
+    l) early_kill="0";;
+    h) usage;;
+    *) echo "invalid option!"; usage;;
+    esac
+done
+
+
+start_guest()
+{
+    create_hvm_guest $image -u $vcpus -m $memory
+    if [ $? -ne 0 ]; then
+        echo "  Create guest fail!"
+        return 1
+    fi
+    return 0
+}
+
+inject()
+{
+    mce_inject_trigger $CMCI_UCNA_LLC -u $injcpu -p $pageaddr 
+    if [ $? -eq 0 ]; then
+        show "  Passed: Successfully to fake and inject a MCE error"
+    else
+        show "  Failed: Fake error and inject fail !!"
+        return 1
+    fi
+    return 0
+}
+
+do_main()
+{
+    ret_val=0
+    clean_env
+    start_guest || ret_val=1
+    inject || ret_val=1
+    mcelog_verify $CMCI_UCNA_LLC || ret_val=1
+    des_guest
+    gen_result $ret_val
+}
+
+do_main "$@"
diff -r ca0b26180f32 -r a69ceb6ded92 
tools/tests/mce-test/cases/ucna_llc/xen/cases.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/tests/mce-test/cases/ucna_llc/xen/cases.sh  Fri Dec 24 10:23:08 
2010 +0000
@@ -0,0 +1,69 @@
+#!/bin/bash
+#
+# Copyright (c) 2010, Intel Corporation
+# 
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version
+# 2 as published by the Free Software Foundation.
+# 
+# This program is distributed in the hope that 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., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Author: Xudong Hao <xudong.hao@xxxxxxxxx>
+#
+
+sd=$(dirname $0)
+export ROOT=`(cd $sd/../../../; pwd)`
+export this_case=ucna_llc_xen
+
+. $ROOT/lib/xen-mceinj-tool.sh
+
+usage()
+{
+    echo "Usage: ./cases.sh [-options] [arguments]"
+    echo "================Below are the optional options================"
+    echo -e "\t-c injcpu\t: which cpu to inject error"
+    echo -e "\t-p pageaddr\t: Guest Physical Address to inject error"
+    echo -e "\t\t\tBy default, the GPA is 0x180020"
+    echo -e "\t-h help"
+    exit 0
+}
+
+while getopts ":c:p:h" option
+do
+    case "$option" in
+    c) injcpu=$OPTARG;;
+    p) pageaddr=$OPTARG;;
+    h) usage;;
+    *) echo "invalid option!"; usage;;
+    esac
+done
+
+inject()
+{
+    mce_inject_trigger $CMCI_UCNA_LLC -u $injcpu -p $pageaddr 
+    if [ $? -eq 0 ]; then
+        show "  Passed: Successfully to fake and inject a MCE error"
+    else
+        show "  Failed: Fake error and inject fail !!"
+        return 1
+    fi
+    return 0
+}
+
+do_main()
+{
+    ret_val=0
+    clean_env
+    inject || ret_val=1
+    mcelog_verify $CMCI_UCNA_LLC || ret_val=1
+    gen_result $ret_val
+}
+
+do_main "$@"

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.