From nobody Mon Feb 9 17:24:50 2026 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1549306623495106.4216609218081; Mon, 4 Feb 2019 10:57:03 -0800 (PST) Received: from localhost ([127.0.0.1]:47556 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqjQL-0004RA-Lc for importer@patchew.org; Mon, 04 Feb 2019 13:56:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59367) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqj6u-00055L-6a for qemu-devel@nongnu.org; Mon, 04 Feb 2019 13:36:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gqj6r-0003Vt-6f for qemu-devel@nongnu.org; Mon, 04 Feb 2019 13:36:48 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:51430) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gqj6q-0003Tx-UJ for qemu-devel@nongnu.org; Mon, 04 Feb 2019 13:36:45 -0500 Received: by mail-wm1-x336.google.com with SMTP id b11so978632wmj.1 for ; Mon, 04 Feb 2019 10:36:44 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s132sm8836236wmf.28.2019.02.04.10.36.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Feb 2019 10:36:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=HVJ3B/UNAH8XhQBccB+E089Vd2e5nd2LhE6G1KGfwpM=; b=g6to10U4ec286GLPzcwSWIq365e1cQW/W/y+UlChAZnGSTk6rLQlDCWt5W/hNBiMKQ /Jou7VhDhPOI4bjVEwmTutVDSyshinmYV6r4uHtO41JxIbIlNchSrEJIfKpQNf3jOikL 0NPf7qO3yhpVI/o/gnIKMr33Q/CngvRdiaQ7PGJuokaWYgpSZYH3nGeXA5wWoY7ARGhX CRIavhXYHLnFg8FNyllHkfFqRvs9IsyyujcChBzge+0dNKNEaY3BUKU48cuUtfzqF21+ hZZiEwPbqNifnxklBfLdcK7qG/E8oXHVJFDj+SP0QSKQlGwWRP69/by8rgFqgA4AHtWp DHZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=HVJ3B/UNAH8XhQBccB+E089Vd2e5nd2LhE6G1KGfwpM=; b=K5xrl+CVHKqGFwfdh2jnOKSfJnZ4Qs5O50/z6Wudt6LV1u11oiHxmoCVhTwyunLKiZ pOPZDxlCldEkEkTiFPg2WqA0lH+El75ptC5Tczwdk/sx86Za4svHjAFpVvwIlw8h4b+Z 5QM90P4eWOZ0A6Ofe1An3KDnh2vnX5EplnVvZUuZlIoYgy6gy6EA9RT5VZFhFXpWZUwU 5lVdD1cScSXpbOvcBC68J6yYrhTjPyWL/0eBGmKt8ZdzPzKtU3GovVIdQMYmznuzkZn8 rz7Ipa63JYgIUEc8kslMntCf00c+h6ji8puhDOmPfT0hYhb45Q3K9hB8stkTvawNkr13 /u1Q== X-Gm-Message-State: AHQUAuZLdFg2kLqYhl79JxBREViAP/M6grNRj7ROA9TYOuMCk9PSk6+o KUTdBDTci8cpe/IpoNVIGzSgcL4l X-Google-Smtp-Source: AHgI3IbUhebLiZq7ohplDUfA+wKdZLZh0oOm3VIlw+Zs8PzlLJ/vgCYCKBR2XcdMx96kUa5aY3bQ5A== X-Received: by 2002:a1c:4c9:: with SMTP id 192mr571471wme.135.1549305403577; Mon, 04 Feb 2019 10:36:43 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 4 Feb 2019 19:35:24 +0100 Message-Id: <1549305379-51117-23-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1549305379-51117-1-git-send-email-pbonzini@redhat.com> References: <1549305379-51117-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::336 Subject: [Qemu-devel] [PULL 22/77] hw/i386/pc: enable PVH only for machine type >= 4.0 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Stefano Garzarella In order to avoid migration issues, we enable PVH only for machine type >=3D 4.0 Suggested-by: Michael S. Tsirkin Signed-off-by: Stefano Garzarella Signed-off-by: Paolo Bonzini --- hw/i386/pc.c | 4 +++- hw/i386/pc_piix.c | 3 +++ hw/i386/pc_q35.c | 3 +++ include/hw/i386/pc.h | 3 +++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 9efbd16..00166d1 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1220,7 +1220,8 @@ static void load_linux(PCMachineState *pcms, * saving the PVH entry point used by the x86/HVM direct boot ABI. * If load_elfboot() is successful, populate the fw_cfg info. */ - if (load_elfboot(kernel_filename, kernel_size, + if (pcmc->pvh_enabled && + load_elfboot(kernel_filename, kernel_size, header, pvh_start_addr, fw_cfg)) { fclose(f); =20 @@ -2783,6 +2784,7 @@ static void pc_machine_class_init(ObjectClass *oc, vo= id *data) pcmc->acpi_data_size =3D 0x20000 + 0x8000; pcmc->save_tsc_khz =3D true; pcmc->linuxboot_dma_enabled =3D true; + pcmc->pvh_enabled =3D true; assert(!mc->get_hotplug_handler); mc->get_hotplug_handler =3D pc_get_hotplug_handler; mc->cpu_index_to_instance_props =3D pc_cpu_index_to_props; diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 63c84e3..fd0f2c2 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -440,9 +440,12 @@ DEFINE_I440FX_MACHINE(v4_0, "pc-i440fx-4.0", NULL, =20 static void pc_i440fx_3_1_machine_options(MachineClass *m) { + PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); + pc_i440fx_4_0_machine_options(m); m->is_default =3D 0; m->alias =3D NULL; + pcmc->pvh_enabled =3D false; compat_props_add(m->compat_props, hw_compat_3_1, hw_compat_3_1_len); compat_props_add(m->compat_props, pc_compat_3_1, pc_compat_3_1_len); } diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index b7b7959..4a175ea 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -376,9 +376,12 @@ DEFINE_Q35_MACHINE(v4_0, "pc-q35-4.0", NULL, =20 static void pc_q35_3_1_machine_options(MachineClass *m) { + PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); + pc_q35_4_0_machine_options(m); m->default_kernel_irqchip_split =3D false; m->alias =3D NULL; + pcmc->pvh_enabled =3D false; compat_props_add(m->compat_props, hw_compat_3_1, hw_compat_3_1_len); compat_props_add(m->compat_props, pc_compat_3_1, pc_compat_3_1_len); } diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 882fd8d..3ff127e 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -133,6 +133,9 @@ typedef struct PCMachineClass { =20 /* use DMA capable linuxboot option rom */ bool linuxboot_dma_enabled; + + /* use PVH to load kernels that support this feature */ + bool pvh_enabled; } PCMachineClass; =20 #define TYPE_PC_MACHINE "generic-pc-machine" --=20 1.8.3.1