Received: from eggs.gnu.org ([2001:4830:134:3::10]:59578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFcbu-0005SP-Ma for qemu-devel@nongnu.org; Fri, 08 Aug 2014 01:21:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XFcbq-0003as-3D for qemu-devel@nongnu.org; Fri, 08 Aug 2014 01:21:02 -0400 Received: from indium.canonical.com ([91.189.90.7]:38960) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFcbp-0003ai-Qt for qemu-devel@nongnu.org; Fri, 08 Aug 2014 01:20:58 -0400 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.76 #1 (Debian)) id 1XFcbp-0004SJ-B8 for ; Fri, 08 Aug 2014 05:20:57 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 40EB32E80BB for ; Fri, 8 Aug 2014 05:20:57 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Fri, 08 Aug 2014 05:14:20 -0000 From: chao zhou Sender: bounces@canonical.com References: <20120504033328.15007.1323.malonedeb@soybean.canonical.com> Message-Id: <20140808051420.5164.77377.malone@gac.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] =?utf-8?q?=5BBug_994378=5D_Re=3A_Nested-virt=29L1_?= =?utf-8?q?=28kvm_on_kvm=29guest_panic_with_parameter_=E2=80=9C-cpu_host?= =?utf-8?q?=E2=80=9D_in_qemu_command_line=2E?= Reply-To: Bug 994378 <994378@bugs.launchpad.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org this patch fixed the bug: commit 338b522ca43cfd32d11a370f4203bcd089c6c877 Author: Kan Liang Date: Mon Jul 14 12:25:56 2014 -0700 perf/x86/intel: Protect LBR and extra_regs against KVM lying With -cpu host, KVM reports LBR and extra_regs support, if the host has support. When the guest perf driver tries to access LBR or extra_regs MSR, it #GPs all MSR accesses,since KVM doesn't handle LBR and extra_regs su= pport. So check the related MSRs access right once at initialization time to a= void the error access at runtime. For reproducing the issue, please build the kernel with CONFIG_KVM_INTE= L =3D y (for host kernel). And CONFIG_PARAVIRT =3D n and CONFIG_KVM_GUEST =3D n (for guest kernel). Start the guest with -cpu host. Run perf record with --branch-any or --branch-filter in guest to trigge= r LBR Run perf stat offcore events (E.g. LLC-loads/LLC-load-misses ...) in gu= est to trigger offcore_rsp #GP Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra Cc: Andi Kleen Cc: Arnaldo Carvalho de Melo Cc: Linus Torvalds Cc: Maria Dimakopoulou Cc: Mark Davies Cc: Paul Mackerras Cc: Stephane Eranian Cc: Yan, Zheng Link: http://lkml.kernel.org/r/1405365957-20202-1-git-send-email-kan.li= ang@intel.com Signed-off-by: Ingo Molnar -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/994378 Title: Nested-virt)L1 (kvm on kvm)guest panic with parameter =E2=80=9C-cpu host= =E2=80=9D in qemu command line. Status in QEMU: New Bug description: Environment: ------------ Host OS (ia32/ia32e/IA64):ia32e Guest OS (ia32/ia32e/IA64):ia32e Guest OS Type (Linux/Windows):Linux kvm.git Commit:19853301ef3289bda2d5264c1093e74efddaeab9 qemu-kvm Commit:69abebf20280152da8fa7c418a819ae51e862231 Host Kernel Version:3.4.0-rc3 Hardware:WSM-EP, Romley-EP = Bug detailed description: -------------------------- (KVM on KVM) L1 guest panic when starting the L1 guest with =E2=80=9C-cpu= host=E2=80=9D parameter in qemu command line. Note: 1. when creating guest with =E2=80=9C-cpu qemu64,+vmx=E2=80=9D, L1 guest = and L2 guest can boot up. = 2. This should be a qemu-kvm bug. using '-cpu host' parameter, the follow= ing is the result. Kvm + qemu-kvm =3Dresult 19853301 + 69abebf2 =3D bad 19853301 + 44755ea3 =3D good 3. when booting up the guest with the good commit of 19853301 + 44755ea3= , you can see some error info, but nested virt works fine. (L1 and L2 guest can boot up.) =E2=80=9Cerror: feature "i64" not available in set error: bad option value [extfeature_edx =3D i64 xd syscall]=E2=80=9D = some logs = [root@vt-snb9 x86_64-softmmu]# ./qemu-system-x86_64 -m 2048 -net nic,mode= l=3Drtl8139 -net tap,script=3D/etc/kvm/qemu-ifup -hda /root/nested-kvm.qcow= -cpu host error: feature "i64" not available in set error: bad option value [extfeature_edx =3D i64 xd syscall] error: feature "i64" not available in set error: bad option value [extfeature_edx =3D i64 xd syscall] error: feature "i64" not available in set error: bad option value [extfeature_edx =3D i64 syscall xd] error: feature "i64" not available in set error: bad option value [extfeature_edx =3D i64 syscall xd] VNC server running on `::1:5900' Reproduce steps: ---------------- 1.start up a host with kvm (commit: 19853301) 2.rmmod kvm_intel 3.modprobe kvm_intel nested=3D1 4.qemu-system-x86_64 -m 2048 -hda L1-kvm.img -cpu host Current result: ---------------- L1 guest panic. Expected result: ---------------- L1 guest and L2 guest boot up correctly. Basic root-causing log: ---------------------- To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/994378/+subscriptions