From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.3 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1734C43603 for ; Thu, 12 Dec 2019 17:43:24 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B7894214AF for ; Thu, 12 Dec 2019 17:43:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GF+0KBFk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B7894214AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:34864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifSUl-0005lO-FX for qemu-devel@archiver.kernel.org; Thu, 12 Dec 2019 12:43:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57730) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifRWM-0006sr-PB for qemu-devel@nongnu.org; Thu, 12 Dec 2019 11:41:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ifRWL-0003XD-9X for qemu-devel@nongnu.org; Thu, 12 Dec 2019 11:40:58 -0500 Received: from mail-il1-x12a.google.com ([2607:f8b0:4864:20::12a]:45566) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ifRWL-0003VY-2o for qemu-devel@nongnu.org; Thu, 12 Dec 2019 11:40:57 -0500 Received: by mail-il1-x12a.google.com with SMTP id p8so2546679iln.12 for ; Thu, 12 Dec 2019 08:40:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=upLgELSf8R+QsnNRw5FD11DZTxjBQGJ3nZZeCzba1TM=; b=GF+0KBFkLkZ10T96ryuhOhGA48mwVCmnEFLYFFeF2NtCvTSWvUcYOWnyT8yqnqCrRI PjAD/mbTlGyYrQWKwIGkzCkMmAfww3Mirn0+pZ8GkfdV19Vz6NJjIz8AJRWr6NXqtxE/ BkDCfsDh1LY0msnl3yg3wXkfbeWV+b9NxuGh034vCHPd0T7bd0qWcQ+rT7lvDbsfXIQu pvsCLDNpdjHPlMR99LGEQjgq0MMNi3YAWbHsLs1GxeLrgZJW/zQ43FCkCGbXRl6IdRNZ 0E+H+e9IQHL3QsBQmMqSUCRADzkL6k2+NAYg5kXUlWMNPPTcVClo2GOXaWABq60APUEN dung== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=upLgELSf8R+QsnNRw5FD11DZTxjBQGJ3nZZeCzba1TM=; b=gd8NV5CSOk/k2RjgJbQmPPWqkNedMM5aj6u2aZJiZQ5J9pCQFbfisSaCxnu+bhzvU6 hQku0RDwAt7CjLcP1RctBh03Enz++qJFL/UfU5WzSVWR77+tk4v4Qi4qG80C0uYON2eU 4nc7jk62IFosXpYdtfGEvqqLb8PEqkYiScIxkKO4If83j8TzzP/jB4TpdVGUECRMHlfg Qsp2Bkt/rNp/euB0k2fWPU134Xl/hNSk71hzXBiG9S7WrjSYkcW1XjMSarwRq1SLaFVe R7FmpPbX2y1dGh4ntNVkN2oTZCR/TOIPJMj0/8+hc+B1m5WJgs/wyQCEEr6p7XLQpEMx ZzNQ== X-Gm-Message-State: APjAAAUpr70ijD0G2TmWLl2Jqjp7DLgFUbHPajHTaMjnTVTrVps9m9nD CZfUAFAxmBejxiUa6y1ovo/hRugdUSZ3BbWREwo= X-Google-Smtp-Source: APXvYqyfWEsqFudLcd0xX2ZJCiW+oAbGSynHEkd9ywLdtmn1sc7zuwpQOS2LL/70kDpHY5Qz33VcpCesX9yECV1sI8s= X-Received: by 2002:a92:b749:: with SMTP id c9mr8854127ilm.143.1576168856071; Thu, 12 Dec 2019 08:40:56 -0800 (PST) MIME-Version: 1.0 References: <76b207cd-09ce-b3df-e288-a515df40677e@redhat.com> In-Reply-To: From: Wayne Li Date: Thu, 12 Dec 2019 10:40:44 -0600 Message-ID: Subject: Re: QEMU VM crashes when enabling KVM To: Paolo Bonzini Content-Type: multipart/alternative; boundary="000000000000c5b38b0599846864" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::12a X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Gibson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --000000000000c5b38b0599846864 Content-Type: text/plain; charset="UTF-8" Dear David Gibson, I know you are under no obligation to respond, but if it's possible for you to find the time to respond to my question, I would be extremely grateful. My team at Boeing has been stuck trying to get KVM working for our project for the last few months. A good explanation of why this isn't possible would be absolutely critical. -Thanks, Wayne Li On Thu, Dec 12, 2019 at 1:17 AM Paolo Bonzini wrote: > On 12/12/19 02:59, Wayne Li wrote: > > We wrote a project that is created on top of the QEMU source code; it > > calls functions from the QEMU code. I run the executable created by > > compiling that project/QEMU code. Anyway, looking at the following > > documentation: > > > > https://www.kernel.org/doc/Documentation/powerpc/cpu_families.txt > > > > It looks like the PowerPC 7457 is Book3S and the PowerPC e6500 is > > BookE. Is that why you think I require a Book3S KVM? Exactly why do > > you feel this way? Also would that mean my team would need to go and > > buy a board with a Book3S processor? > > CCing the PPC maintainer. There are aspects of BookE and Book3S that > are different and not really interchangeable in the privileged interface. > > Paolo > > > -Thanks!, Wayne Li > > > > From my understanding > > > > On Wed, Dec 11, 2019 at 7:16 PM Paolo Bonzini > > wrote: > > > > On 11/12/19 22:23, Wayne Li wrote: > > > > > > Now I am fairly sure KVM is actually enabled on the system. > Finding > > > that out was another story that spanned a couple of months. But > long > > > story short, lsmod doesn't show that the KVM kernel module is > > running. > > > But that's because KVM is built-in and it can't actually be built > as a > > > loadable kernel module in this particular system. > > > > > > So I'm not really sure what could be the problem. Though I was > > thinking > > > if I understood the error better that might help? Following the > > code I > > > see that the "Missing PVR setting capability." is called when a > > variable > > > called "cap_segstate" is 0: > > > > > > if (!cap_segstate) { > > > fprintf(stderr, "kvm error: missing PVR setting > > capability\n"); > > > return -ENOSYS; > > > } > > > > > > And the cap_segstate variable is set by the following function: > > > > > > cap_segstate = kvm_check_extension(s, KVM_CAP_PPC_SEGSTATE); > > > > You are not saying how you are running QEMU. I think you are using a > > CPU model that requires a Book3S KVM. > > > > Paolo > > > > --000000000000c5b38b0599846864 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Dear David Gibson,

I know yo= u are under no obligation to respond, but if it's possible for you to f= ind the time to respond to my question, I would be extremely grateful.=C2= =A0 My team at Boeing has been stuck trying to get KVM working for our proj= ect for the last few months.=C2=A0 A good explanation of why this isn't= possible would be absolutely critical.

-Thanks, W= ayne Li

On Thu, Dec 12, 2019 at 1:17 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
On 12/12/19 02:59, Wayne= Li wrote:
> We wrote a project that is created on top of the QEMU source code; it<= br> > calls functions from the QEMU code.=C2=A0 I run the executable created= by
> compiling that project/QEMU code.=C2=A0 Anyway, looking at the followi= ng
> documentation:
>
> https://www.kernel.org/doc/Doc= umentation/powerpc/cpu_families.txt
>
> It looks like the PowerPC 7457 is Book3S and the PowerPC e6500 is
> BookE.=C2=A0 Is that why you think I require a Book3S KVM?=C2=A0 Exact= ly why do
> you feel this way?=C2=A0 Also would that mean my team would need to go= and
> buy a board with a Book3S processor?

CCing the PPC maintainer.=C2=A0 There are aspects of BookE and Book3S that<= br> are different and not really interchangeable in the privileged interface.
Paolo

> -Thanks!, Wayne Li
>
> From my understanding
>
> On Wed, Dec 11, 2019 at 7:16 PM Paolo Bonzini <pbonzini@redhat.com
> <mailto:pb= onzini@redhat.com>> wrote:
>
>=C2=A0 =C2=A0 =C2=A0On 11/12/19 22:23, Wayne Li wrote:
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> Now I am fairly sure KVM is actually enabled o= n the system.=C2=A0 Finding
>=C2=A0 =C2=A0 =C2=A0> that out was another story that spanned a coup= le of months.=C2=A0 But long
>=C2=A0 =C2=A0 =C2=A0> story short, lsmod doesn't show that the K= VM kernel module is
>=C2=A0 =C2=A0 =C2=A0running.=C2=A0
>=C2=A0 =C2=A0 =C2=A0> But that's because KVM is built-in and it = can't actually be built as a
>=C2=A0 =C2=A0 =C2=A0> loadable kernel module in this particular syst= em.
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> So I'm not really sure what could be the p= roblem.=C2=A0 Though I was
>=C2=A0 =C2=A0 =C2=A0thinking
>=C2=A0 =C2=A0 =C2=A0> if I understood the error better that might he= lp?=C2=A0 Following the
>=C2=A0 =C2=A0 =C2=A0code I
>=C2=A0 =C2=A0 =C2=A0> see that the "Missing PVR setting capabil= ity." is called when a
>=C2=A0 =C2=A0 =C2=A0variable
>=C2=A0 =C2=A0 =C2=A0> called "cap_segstate" is 0:
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> if (!cap_segstate) {
>=C2=A0 =C2=A0 =C2=A0> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fpri= ntf(stderr, "kvm error: missing PVR setting
>=C2=A0 =C2=A0 =C2=A0capability\n");
>=C2=A0 =C2=A0 =C2=A0> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 retu= rn -ENOSYS;
>=C2=A0 =C2=A0 =C2=A0> }
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> And the cap_segstate variable is set by the fo= llowing function:
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> cap_segstate =3D kvm_check_extension(s, KVM_CA= P_PPC_SEGSTATE);
>
>=C2=A0 =C2=A0 =C2=A0You are not saying how you are running QEMU.=C2=A0 = I think you are using a
>=C2=A0 =C2=A0 =C2=A0CPU model that requires a Book3S KVM.
>
>=C2=A0 =C2=A0 =C2=A0Paolo
>

--000000000000c5b38b0599846864--