From: David Gibson <david@gibson.dropbear.id.au>
To: Daniel Henrique Barboza <danielhb413@gmail.com>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, clg@kaod.org
Subject: Re: [PATCH v2 1/2] ppc/pnv.c: add a friendly warning when accel=kvm is used
Date: Wed, 1 Dec 2021 10:43:55 +1100 [thread overview]
Message-ID: <Yaa3OyEl1KGFVx66@yekko> (raw)
In-Reply-To: <20211130133153.444601-2-danielhb413@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1904 bytes --]
On Tue, Nov 30, 2021 at 10:31:52AM -0300, Daniel Henrique Barboza wrote:
> If one tries to use -machine powernv9,accel=kvm in a Power9 host, a
> cryptic error will be shown:
>
> qemu-system-ppc64: Register sync failed... If you're using kvm-hv.ko, only "-cpu host" is possible
> qemu-system-ppc64: kvm_init_vcpu: kvm_arch_init_vcpu failed (0): Invalid argument
>
> Appending '-cpu host' will throw another error:
>
> qemu-system-ppc64: invalid chip model 'host' for powernv9 machine
>
> The root cause is that in IBM PowerPC we have different specs for the bare-metal
> and the guests. The bare-metal follows OPAL, the guests follow PAPR. The kernel
> KVM modules presented in the ppc kernels implements PAPR. This means that we
> can't use KVM accel when using the powernv machine, which is the emulation of
> the bare-metal host.
>
> All that said, let's give a more informative error in this case.
>
> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> hw/ppc/pnv.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
> index 71e45515f1..e5b87e8730 100644
> --- a/hw/ppc/pnv.c
> +++ b/hw/ppc/pnv.c
> @@ -742,6 +742,11 @@ static void pnv_init(MachineState *machine)
> DriveInfo *pnor = drive_get(IF_MTD, 0, 0);
> DeviceState *dev;
>
> + if (kvm_enabled()) {
> + error_report("The powernv machine does not work with KVM acceleration");
> + exit(EXIT_FAILURE);
> + }
> +
> /* allocate RAM */
> if (machine->ram_size < mc->default_ram_size) {
> char *sz = size_to_str(mc->default_ram_size);
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2021-12-01 2:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-30 13:31 [PATCH v2 0/2] ppc/pnv.c: add a friendly warning when accel=kvm is used Daniel Henrique Barboza
2021-11-30 13:31 ` [PATCH v2 1/2] " Daniel Henrique Barboza
2021-11-30 23:43 ` David Gibson [this message]
2021-11-30 13:31 ` [PATCH v2 2/2] docs/system/ppc/powernv.rst: document KVM support status Daniel Henrique Barboza
2021-12-15 16:38 ` [PATCH v2 0/2] ppc/pnv.c: add a friendly warning when accel=kvm is used Cédric Le Goater
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yaa3OyEl1KGFVx66@yekko \
--to=david@gibson.dropbear.id.au \
--cc=clg@kaod.org \
--cc=danielhb413@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.