From nobody Thu May 16 15:44:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) 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=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1586776247; cv=none; d=zohomail.com; s=zohoarc; b=PF1jyF6mk6hpu5IUS5WSVkF3jOI7u/hLKbpiKkkIl4gvUqpQ5/r68xJUyP50Y4JJQs2WqZDxgT8a+I/sN9ACxYjwgn618nJuM4JbCvFk77pxfNMLhRQD6jWDWISfgpCF7WkXNNOLIptp6tYuKH8Tn27xo5UUxmNgAlQgZKt91wk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586776247; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=b70fwI1uKzBY3zR8ExZ5/UCKMs6OQTY0f1zHtfOQbi4=; b=ahupBdL1NXO7wnFo4vb6DKGe/LvWdfMFsLOeioTOcqciP+2D/lMQKI4VZq3GxZ7NfG7KqoLEOwhCe8eL3N+ExzIJKCvKtBO586qi6bNWaHO86evSxwYlXsZntaZMwIe1mQxCSRHABrkfLWAFISe38sFzAx5jzy5o0I/C12PBXTk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 158677624792122.33228034424053; Mon, 13 Apr 2020 04:10:47 -0700 (PDT) Received: from localhost ([::1]:43026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNwzG-0000Q0-82 for importer@patchew.org; Mon, 13 Apr 2020 07:10:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58541) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNwxk-0007PC-29 for qemu-devel@nongnu.org; Mon, 13 Apr 2020 07:09:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jNwxi-0006Rz-P5 for qemu-devel@nongnu.org; Mon, 13 Apr 2020 07:09:11 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:48803 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jNwxi-0006OW-IY for qemu-devel@nongnu.org; Mon, 13 Apr 2020 07:09:10 -0400 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-356-fiA5O-MKOzCRz6p7VN3Pyw-1; Mon, 13 Apr 2020 07:09:08 -0400 Received: by mail-wr1-f69.google.com with SMTP id d17so5533353wrr.17 for ; Mon, 13 Apr 2020 04:09:07 -0700 (PDT) Received: from redhat.com ([185.107.45.41]) by smtp.gmail.com with ESMTPSA id b15sm14391055wru.70.2020.04.13.04.09.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Apr 2020 04:09:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586776150; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=b70fwI1uKzBY3zR8ExZ5/UCKMs6OQTY0f1zHtfOQbi4=; b=gRlWLVGLA6x+jRofgi+PrkWPC4go+Bo1kv+EHjq4ysWSuaQSebFtqYy4ObQGpQadyj029w QdV/NQ5hgaoDjnCWdwwhL6FSaQ3H5eEJ4cyY3S6zJZaWbq9lyNkc9efVUUmsDpJXBb5xT5 vGDczlve1QKNnXaDDq1mOd14Akndc9Q= X-MC-Unique: fiA5O-MKOzCRz6p7VN3Pyw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=NEOsAd9JMpraVqoahrs8JKUiJrezriTLGts03bpTjhg=; b=hu9YFYi3wDBuRk0eUGNijTHqPUvEdBYhEcY34nUBGgKRlOQK9Dju52CApPLRayOcwf KDiy2BRtFM9zABJZi5H679slDspkRjTLdIwsyvvkivWQpjLepVRlgT0nZIwdh31SFNUC 33CV0ReQoOukSOiLK+Rll2lTzFhFe2uWkWIQYXOkCcjK31mGBiB1hY7u9ktJ1JqLYpu1 8/goeWgMEgb0jVe3WDv/YP0YsatNmGJeHLuzXktNBi0ItVhhEjyr9CPZqAdstJb8PAQ/ OqdaYB37YoOaV+ZWmuuX6Qg0JSEQrfXhbtsk+yn2eFiQTwUKEkJT5RoZy9+vFEtJcWhR hf1g== X-Gm-Message-State: AGi0PuYGDuwHXSvNdCvo5hW2CYdRUP9S7fY5LHuhVWeCloPpW1d70S3V V8e/Irr27g22CZJNcKZuc4wPSCll9npznvwx9OMJrXFvxm4rIPaRxA0h0YlZti2uUmHg4eaNZeX HJdPnBlIY4tNfnLc= X-Received: by 2002:adf:eec8:: with SMTP id a8mr12900186wrp.28.1586776146620; Mon, 13 Apr 2020 04:09:06 -0700 (PDT) X-Google-Smtp-Source: APiQypLuwxTUq3jXZYVam/92ozqHCuJMCk8NvUiaDQ0muWPvyrQxkCj4skmIGrQUVncrMiWhpoqw4g== X-Received: by 2002:adf:eec8:: with SMTP id a8mr12900171wrp.28.1586776146469; Mon, 13 Apr 2020 04:09:06 -0700 (PDT) Date: Mon, 13 Apr 2020 07:09:04 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 1/4] MAINTAINERS: Add myself as vhost-user-blk maintainer Message-ID: <20200413110838.151374-2-mst@redhat.com> References: <20200413110838.151374-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200413110838.151374-1-mst@redhat.com> X-Mailer: git-send-email 2.24.1.751.gd10ce2899c X-Mutt-Fcc: =sent X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 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: Peter Maydell , Laurent Vivier , Markus Armbruster , Aleksandar Markovic , Raphael Norwitz , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Raphael Norwitz As suggested by Michael, let's add me as a maintainer of vhost-user-blk and vhost-user-scsi. CC: Michael S. Tsirkin CC Peter Maydell Signed-off-by: Raphael Norwitz Message-Id: <1585213047-20089-1-git-send-email-raphael.norwitz@nutanix.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- MAINTAINERS | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 642c8e0b6b..5f93e8c01d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1853,6 +1853,18 @@ F: hw/display/virtio-gpu* F: hw/display/virtio-vga.* F: include/hw/virtio/virtio-gpu.h =20 +vhost-user-blk +M: Raphael Norwitz +S: Maintained +F: contrib/vhost-user-blk/ +F: contrib/vhost-user-scsi/ +F: hw/block/vhost-user-blk.c +F: hw/scsi/vhost-user-scsi.c +F: hw/virtio/vhost-user-blk-pci.c +F: hw/virtio/vhost-user-scsi-pci.c +F: include/hw/virtio/vhost-user-blk.h +F: include/hw/virtio/vhost-user-scsi.h + vhost-user-gpu M: Marc-Andr=C3=A9 Lureau M: Gerd Hoffmann --=20 MST From nobody Thu May 16 15:44:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) 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=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1586776252; cv=none; d=zohomail.com; s=zohoarc; b=XTPevkzj+osdHxHDq/N3nu65QmpfvCvxJ8RAPjKgETsxlTa7MeCqIiZ+20povjlrziCWHg6+l3W9G/svpglBBJ1xurwhIwibSc7tI6YnRSLstVw10MbfINkZByAI3ka+Y9PWmk5kmRIxC6bIT6tqvNPGPvJ1YACm0uL94inMzWY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586776252; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CJQx85+FirRBKcuYybxlgWpS5zFo+gnEtyDRFkVHinY=; b=TwF3V9bztgHJrQ4i1k+0alLbXfZNQwjeOrqgs4M5mMqXnuXCmSzMF62HGY5wV7hQ5hQzq3IXIC8rK0lhGPGOfwqjDhAWN+D/u1x5bB3qJ0qLhRUW/cU7xnovIO99nanPT0r860/pF9xUMylZkwiPBhBo2FVmNpg/JQK+o+2abK4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1586776252881475.9962471489622; Mon, 13 Apr 2020 04:10:52 -0700 (PDT) Received: from localhost ([::1]:43024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNwzL-0000Pn-Kt for importer@patchew.org; Mon, 13 Apr 2020 07:10:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58569) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNwxl-0007Qx-TW for qemu-devel@nongnu.org; Mon, 13 Apr 2020 07:09:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jNwxk-0006hG-PH for qemu-devel@nongnu.org; Mon, 13 Apr 2020 07:09:13 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:51763 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jNwxk-0006cs-Kf for qemu-devel@nongnu.org; Mon, 13 Apr 2020 07:09:12 -0400 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-41-PDjKSwyHNhC5evrBn1bIRg-1; Mon, 13 Apr 2020 07:09:10 -0400 Received: by mail-wr1-f71.google.com with SMTP id f15so6572258wrj.2 for ; Mon, 13 Apr 2020 04:09:10 -0700 (PDT) Received: from redhat.com ([185.107.45.41]) by smtp.gmail.com with ESMTPSA id u15sm13218433wrn.46.2020.04.13.04.09.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Apr 2020 04:09:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586776152; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CJQx85+FirRBKcuYybxlgWpS5zFo+gnEtyDRFkVHinY=; b=VFPo+lwSfwadsO6fRbG52hZedlpgfXd9fDkHqRnq9QO31lFViOWqiSV1OrSeB44S9QJKYN V1btN4N22EDsBQHRZDM8N8BTV8448cyZ09OZdtb2bkA960Fa0Hhui45OO2sQoK9BQi+hLQ Nt5FKyM9mPygKFKrp/ZJJ62rUCBBoIw= X-MC-Unique: PDjKSwyHNhC5evrBn1bIRg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=wu2DMb7EM7lw3R1vo6KDqbpnls1BmYoUZ7qyMICe52c=; b=aWbMTjSP9nFFwnSsMEaRteOVtpMKP5xiVb/BCg2f/sjVM9aOsTVRvGbl5MAZESQf2n yBg5GTCy8HKgMFXaX/gshBortZEXnWgbNdcZ747R35kKTREI/AFTJeauuQG1mnTnjR+z 7RdcXshA/H7zMOP7zE1u8D+p4sbJnuG6VRmdcHOBLhisQoPnDUNgox3CGgjbkQCMQ+J/ Oe17JuOlr5R0IHhwilusH2er61aOC7TM0xbk6Jl8yg2ceN2ZMGFXAJQCIQ12cEwnpAnH ib6AzG+dXIST2hr4lIldG5URrHLC+DkLJm+kt044/43zwQ+q163ou1sStMnwGNwBFsVW KSTA== X-Gm-Message-State: AGi0PuaOBBweGz5XOaUEW38X2P802wVNlf7iH89pGo3XVJEBdUZNiUBQ TZ5U4p24XW0muyuyPrtLy4Jh0RbgQ+t2/5OmH2RhnXMKEDS9VSZXo+dfTml2kHB4aqM8sLhVTFw HIZPkHE5VzAJT10M= X-Received: by 2002:adf:b78b:: with SMTP id s11mr17520440wre.235.1586776149431; Mon, 13 Apr 2020 04:09:09 -0700 (PDT) X-Google-Smtp-Source: APiQypIkBDz8xoZFmy7yZVH+DXIihD15Qf6+N16rR/WHCbvKyReKLbNHuWYdQzZS1RqiUZRj0GmGhg== X-Received: by 2002:adf:b78b:: with SMTP id s11mr17520428wre.235.1586776149216; Mon, 13 Apr 2020 04:09:09 -0700 (PDT) Date: Mon, 13 Apr 2020 07:09:06 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 2/4] acpi: Use macro for table-loader file name Message-ID: <20200413110838.151374-3-mst@redhat.com> References: <20200413110838.151374-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200413110838.151374-1-mst@redhat.com> X-Mailer: git-send-email 2.24.1.751.gd10ce2899c X-Mutt-Fcc: =sent X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 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: Peter Maydell , Eduardo Habkost , Shameer Kolothum , Shannon Zhao , qemu-arm@nongnu.org, Igor Mammedov , Paolo Bonzini , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Shameer Kolothum Use macro for "etc/table-loader" and move it to the header file similar to ACPI_BUILD_TABLE_FILE/ACPI_BUILD_RSDP_FILE etc. Signed-off-by: Shameer Kolothum Reviewed-by: Igor Mammedov Message-Id: <20200403101827.30664-2-shameerali.kolothum.thodi@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/acpi/aml-build.h | 1 + hw/arm/virt-acpi-build.c | 2 +- hw/i386/acpi-build.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index de4a406568..0f4ed53d7f 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -13,6 +13,7 @@ #define ACPI_BUILD_TABLE_FILE "etc/acpi/tables" #define ACPI_BUILD_RSDP_FILE "etc/acpi/rsdp" #define ACPI_BUILD_TPMLOG_FILE "etc/tpm/log" +#define ACPI_BUILD_LOADER_FILE "etc/table-loader" =20 #define AML_NOTIFY_METHOD "NTFY" =20 diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 7ef0733d71..81d41a3990 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -929,7 +929,7 @@ void virt_acpi_setup(VirtMachineState *vms) =20 build_state->linker_mr =3D acpi_add_rom_blob(virt_acpi_build_update, build_state, - tables.linker->cmd_blob, "etc/table-loader", 0); + tables.linker->cmd_blob, ACPI_BUILD_LOADER_FILE,= 0); =20 fw_cfg_add_file(vms->fw_cfg, ACPI_BUILD_TPMLOG_FILE, tables.tcpalog->d= ata, acpi_data_len(tables.tcpalog)); diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 2a7e55bae7..23c77eeb95 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -3043,7 +3043,7 @@ void acpi_setup(void) =20 build_state->linker_mr =3D acpi_add_rom_blob(acpi_build_update, build_state, - tables.linker->cmd_blob, "etc/table-loader", 0); + tables.linker->cmd_blob, ACPI_BUILD_LOADER_FILE,= 0); =20 fw_cfg_add_file(x86ms->fw_cfg, ACPI_BUILD_TPMLOG_FILE, tables.tcpalog->data, acpi_data_len(tables.tcpalog)); --=20 MST From nobody Thu May 16 15:44:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) 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=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1586776330; cv=none; d=zohomail.com; s=zohoarc; b=BykZofM5a2uEmo93fhtglRTnANpqKvdf3YEvjdD/HP0dRlmKsDX2ocui/3PN/6wRh6tBdyYvvptEbNmrEevWsFKwedPIbKKncTIwx7x8Uk9uqS66pcsZRu9QmQu5MnNIELCwXNPqUegcFPH2y28h2pk4hIjhSIGJ+hI+AZjDFYA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586776330; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kJUSLyyd/FhSQI7dImJ761r6OxD1h8L7ChQu+2/D99Y=; b=lIWg9fNH/W99NklWlZGhWWfr/8p5v2PDYAo78xAsco7dyDT77IT6GVcXDh4JQTQEwEBmmYAzdi3UK+ZCCG8AeAzK+by5eSw+DEjiYzX1PzjEXxf6RcbON69/YmNzzWvE0yoy8tOnNq3CpuNwvG3IF4gT/njEik4wB7G38FUb7uQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1586776330061147.63370120338868; Mon, 13 Apr 2020 04:12:10 -0700 (PDT) Received: from localhost ([::1]:43038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNx0a-0002Fp-Pz for importer@patchew.org; Mon, 13 Apr 2020 07:12:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58606) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNwxr-0007WC-5A for qemu-devel@nongnu.org; Mon, 13 Apr 2020 07:09:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jNwxp-00076d-Ht for qemu-devel@nongnu.org; Mon, 13 Apr 2020 07:09:19 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:32967 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jNwxp-0006y2-D1 for qemu-devel@nongnu.org; Mon, 13 Apr 2020 07:09:17 -0400 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-127-5YghlXlEOYeFe8JqD7iX6w-1; Mon, 13 Apr 2020 07:09:13 -0400 Received: by mail-wr1-f70.google.com with SMTP id f15so6572298wrj.2 for ; Mon, 13 Apr 2020 04:09:13 -0700 (PDT) Received: from redhat.com ([185.107.45.41]) by smtp.gmail.com with ESMTPSA id d6sm14517700wrw.10.2020.04.13.04.09.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Apr 2020 04:09:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586776155; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kJUSLyyd/FhSQI7dImJ761r6OxD1h8L7ChQu+2/D99Y=; b=FTpMe59FdTTJP12dKXtBHk+36tRwcc04wzfOuQul6u6FvE7yG6GwaY6aMuPy8v0nirXZ+X pbZWjITFqfhTg47hefhyI13kWjLsNO1jta27ZaTcz4NJa+YYGtclpWkq07caM4cVrunKc4 LT9Y7BJ2jf2xsQjA/MfLEC5mEBrxV+I= X-MC-Unique: 5YghlXlEOYeFe8JqD7iX6w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=MLA7kiIbbP9cwbAxVDUuKyWpMwD53/uRqCg6C22vu3w=; b=VcoblX0WK5vKN5UzUqWNv9KFMc5IQn+X+qZj9lR05vWQjxGgPxwOaQewiIaPv2rrzJ U1O93igHu5Of03McV8aKUocu12/bJpNdebukCF4aIfu4GY87tU679iF5ijv93bUH3x84 A0CTyeWCPoIZgqEPIBB4zU+iIORiP4JvDF/JFONX79YB1NQFUWrRPjUVjjtmUGw90KKP lk7ObG1nJzyJrTwnP8YXNbiTQSURrsUUFx/3TFioP+o/vbZrJ1ITi/uc0gUCbWn+VhXN zk/Km/3mqYSKI0qbcRBCtLbBTHtUkB3hJLukBjbLNs0SIBIEMLpzkLmuQeW0qQek5Lq4 +j0Q== X-Gm-Message-State: AGi0PuY+bm0f/r4QpadGSNRxkOwfWv7QwZKn/UpgmzBbPik0CGM4UXVW 2OSGo2eNwc5DzFLFp/a5dzqXysP8tH6VCfCrfwsObfacbnt+z9gAgbuyJehsWwrM7sXUA+e5PZ4 XCeAzbCAOhiiRLRM= X-Received: by 2002:adf:df8a:: with SMTP id z10mr17338394wrl.278.1586776152440; Mon, 13 Apr 2020 04:09:12 -0700 (PDT) X-Google-Smtp-Source: APiQypJlAjvS+rDeBWVWu0GMIkW3uI8l0jviwc9suK0IQOg09mMakKqRxpIT0L3foU1aN/II0BAgzA== X-Received: by 2002:adf:df8a:: with SMTP id z10mr17338358wrl.278.1586776152128; Mon, 13 Apr 2020 04:09:12 -0700 (PDT) Date: Mon, 13 Apr 2020 07:09:09 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 3/4] fw_cfg: Migrate ACPI table mr sizes separately Message-ID: <20200413110838.151374-4-mst@redhat.com> References: <20200413110838.151374-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200413110838.151374-1-mst@redhat.com> X-Mailer: git-send-email 2.24.1.751.gd10ce2899c X-Mutt-Fcc: =sent X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 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: Peter Maydell , Eduardo Habkost , David Hildenbrand , Laszlo Ersek , Shameer Kolothum , Gerd Hoffmann , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Shameer Kolothum Any sub-page size update to ACPI MRs will be lost during migration, as we use aligned size in ram_load_precopy() -> qemu_ram_resize() path. This will result in inconsistency in FWCfgEntry sizes between source and destination. In order to avoid this, save and restore them separately during migration. Up until now, this problem may not be that relevant for x86 as both ACPI table and Linker MRs gets padded and aligned. Also at present, qemu_ram_resize() doesn't invoke callback to update FWCfgEntry for unaligned size changes. But since we are going to fix the qemu_ram_resize() in the subsequent patch, the issue may become more serious especially for RSDP MR case. Moreover, the issue will soon become prominent in arm/virt as well where the MRs are not padded or aligned at all and eventually have acpi table changes as part of future additions like NVDIMM hot-add feature. Suggested-by: David Hildenbrand Signed-off-by: Shameer Kolothum Acked-by: David Hildenbrand Message-Id: <20200403101827.30664-3-shameerali.kolothum.thodi@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/nvram/fw_cfg.h | 6 +++ hw/core/machine.c | 1 + hw/nvram/fw_cfg.c | 91 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 97 insertions(+), 1 deletion(-) diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h index b5291eefad..25d9307018 100644 --- a/include/hw/nvram/fw_cfg.h +++ b/include/hw/nvram/fw_cfg.h @@ -53,6 +53,12 @@ struct FWCfgState { dma_addr_t dma_addr; AddressSpace *dma_as; MemoryRegion dma_iomem; + + /* restore during migration */ + bool acpi_mr_restore; + uint64_t table_mr_size; + uint64_t linker_mr_size; + uint64_t rsdp_mr_size; }; =20 struct FWCfgIoState { diff --git a/hw/core/machine.c b/hw/core/machine.c index de0c425605..c1a444cb75 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -39,6 +39,7 @@ GlobalProperty hw_compat_4_2[] =3D { { "usb-redir", "suppress-remote-wake", "off" }, { "qxl", "revision", "4" }, { "qxl-vga", "revision", "4" }, + { "fw_cfg", "acpi-mr-restore", "false" }, }; const size_t hw_compat_4_2_len =3D G_N_ELEMENTS(hw_compat_4_2); =20 diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 179b302f01..4be6c9d9fd 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -39,6 +39,7 @@ #include "qemu/config-file.h" #include "qemu/cutils.h" #include "qapi/error.h" +#include "hw/acpi/aml-build.h" =20 #define FW_CFG_FILE_SLOTS_DFLT 0x20 =20 @@ -610,6 +611,55 @@ bool fw_cfg_dma_enabled(void *opaque) return s->dma_enabled; } =20 +static bool fw_cfg_acpi_mr_restore(void *opaque) +{ + FWCfgState *s =3D opaque; + bool mr_aligned; + + mr_aligned =3D QEMU_IS_ALIGNED(s->table_mr_size, qemu_real_host_page_s= ize) && + QEMU_IS_ALIGNED(s->linker_mr_size, qemu_real_host_page_si= ze) && + QEMU_IS_ALIGNED(s->rsdp_mr_size, qemu_real_host_page_size= ); + return s->acpi_mr_restore && !mr_aligned; +} + +static void fw_cfg_update_mr(FWCfgState *s, uint16_t key, size_t size) +{ + MemoryRegion *mr; + ram_addr_t offset; + int arch =3D !!(key & FW_CFG_ARCH_LOCAL); + void *ptr; + + key &=3D FW_CFG_ENTRY_MASK; + assert(key < fw_cfg_max_entry(s)); + + ptr =3D s->entries[arch][key].data; + mr =3D memory_region_from_host(ptr, &offset); + + memory_region_ram_resize(mr, size, &error_abort); +} + +static int fw_cfg_acpi_mr_restore_post_load(void *opaque, int version_id) +{ + FWCfgState *s =3D opaque; + int i, index; + + assert(s->files); + + index =3D be32_to_cpu(s->files->count); + + for (i =3D 0; i < index; i++) { + if (!strcmp(s->files->f[i].name, ACPI_BUILD_TABLE_FILE)) { + fw_cfg_update_mr(s, FW_CFG_FILE_FIRST + i, s->table_mr_size); + } else if (!strcmp(s->files->f[i].name, ACPI_BUILD_LOADER_FILE)) { + fw_cfg_update_mr(s, FW_CFG_FILE_FIRST + i, s->linker_mr_size); + } else if (!strcmp(s->files->f[i].name, ACPI_BUILD_RSDP_FILE)) { + fw_cfg_update_mr(s, FW_CFG_FILE_FIRST + i, s->rsdp_mr_size); + } + } + + return 0; +} + static const VMStateDescription vmstate_fw_cfg_dma =3D { .name =3D "fw_cfg/dma", .needed =3D fw_cfg_dma_enabled, @@ -619,6 +669,20 @@ static const VMStateDescription vmstate_fw_cfg_dma =3D= { }, }; =20 +static const VMStateDescription vmstate_fw_cfg_acpi_mr =3D { + .name =3D "fw_cfg/acpi_mr", + .version_id =3D 1, + .minimum_version_id =3D 1, + .needed =3D fw_cfg_acpi_mr_restore, + .post_load =3D fw_cfg_acpi_mr_restore_post_load, + .fields =3D (VMStateField[]) { + VMSTATE_UINT64(table_mr_size, FWCfgState), + VMSTATE_UINT64(linker_mr_size, FWCfgState), + VMSTATE_UINT64(rsdp_mr_size, FWCfgState), + VMSTATE_END_OF_LIST() + }, +}; + static const VMStateDescription vmstate_fw_cfg =3D { .name =3D "fw_cfg", .version_id =3D 2, @@ -631,6 +695,7 @@ static const VMStateDescription vmstate_fw_cfg =3D { }, .subsections =3D (const VMStateDescription*[]) { &vmstate_fw_cfg_dma, + &vmstate_fw_cfg_acpi_mr, NULL, } }; @@ -815,6 +880,23 @@ static struct { #define FW_CFG_ORDER_OVERRIDE_LAST 200 }; =20 +/* + * Any sub-page size update to these table MRs will be lost during migrati= on, + * as we use aligned size in ram_load_precopy() -> qemu_ram_resize() path. + * In order to avoid the inconsistency in sizes save them seperately and + * migrate over in vmstate post_load(). + */ +static void fw_cfg_acpi_mr_save(FWCfgState *s, const char *filename, size_= t len) +{ + if (!strcmp(filename, ACPI_BUILD_TABLE_FILE)) { + s->table_mr_size =3D len; + } else if (!strcmp(filename, ACPI_BUILD_LOADER_FILE)) { + s->linker_mr_size =3D len; + } else if (!strcmp(filename, ACPI_BUILD_RSDP_FILE)) { + s->rsdp_mr_size =3D len; + } +} + static int get_fw_cfg_order(FWCfgState *s, const char *name) { int i; @@ -914,6 +996,7 @@ void fw_cfg_add_file_callback(FWCfgState *s, const cha= r *filename, trace_fw_cfg_add_file(s, index, s->files->f[index].name, len); =20 s->files->count =3D cpu_to_be32(count+1); + fw_cfg_acpi_mr_save(s, filename, len); } =20 void fw_cfg_add_file(FWCfgState *s, const char *filename, @@ -937,6 +1020,7 @@ void *fw_cfg_modify_file(FWCfgState *s, const char *fi= lename, ptr =3D fw_cfg_modify_bytes_read(s, FW_CFG_FILE_FIRST + i, data, len); s->files->f[i].size =3D cpu_to_be32(len); + fw_cfg_acpi_mr_save(s, filename, len); return ptr; } } @@ -973,7 +1057,10 @@ static void fw_cfg_machine_ready(struct Notifier *n, = void *data) qemu_register_reset(fw_cfg_machine_reset, s); } =20 - +static Property fw_cfg_properties[] =3D { + DEFINE_PROP_BOOL("acpi-mr-restore", FWCfgState, acpi_mr_restore, true), + DEFINE_PROP_END_OF_LIST(), +}; =20 static void fw_cfg_common_realize(DeviceState *dev, Error **errp) { @@ -1097,6 +1184,8 @@ static void fw_cfg_class_init(ObjectClass *klass, voi= d *data) =20 dc->reset =3D fw_cfg_reset; dc->vmsd =3D &vmstate_fw_cfg; + + device_class_set_props(dc, fw_cfg_properties); } =20 static const TypeInfo fw_cfg_info =3D { --=20 MST From nobody Thu May 16 15:44:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) 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=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1586776401; cv=none; d=zohomail.com; s=zohoarc; b=ed9KYomPe6NgNLoERSt+C2V06XehVrXcYcj+dYWe81rvMSI5V76Pdqb4Jj/r/IOSh2AfAe5Lf85N3k5sc+aCoJ5tD18tbxXXKCUgSya0K+FdVsxOBgHFjnCntqPfrDeRoJ0vfi+nuzjXgxKLfhU3h4xtwVYwgCM8A59PRHGJQJA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586776401; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hngf1T4xIdGtDUWQBKvLGu7Vp96xshofitGMfLmzyhs=; b=e8E6QK0FUdeP06Xhf9Zx9VIFRMsDoAi8XshGuqEtL7OaTBBLWkKDFkYG1FUdZO/j58TPNPU1vrTHFc6baWqhHXnQT+/IO4QEaukbo2ojm7rSfxtCZ/FnEl8809PWVSLXJzEZfasC6HljG5Dn1Q8Bvg2AKZdsEfe0ZaPmL3vLoCY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1586776401448800.6423800438733; Mon, 13 Apr 2020 04:13:21 -0700 (PDT) Received: from localhost ([::1]:43060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNx1k-0004Dd-3r for importer@patchew.org; Mon, 13 Apr 2020 07:13:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58801) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNx0W-0002P5-GU for qemu-devel@nongnu.org; Mon, 13 Apr 2020 07:12:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jNx0V-0000SJ-3F for qemu-devel@nongnu.org; Mon, 13 Apr 2020 07:12:04 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:50586 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jNx0U-0000S1-VJ for qemu-devel@nongnu.org; Mon, 13 Apr 2020 07:12:03 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-215--UlO8VCTN_uc5tA7jtAbkw-1; Mon, 13 Apr 2020 07:09:16 -0400 Received: by mail-wm1-f70.google.com with SMTP id o5so2542005wmo.6 for ; Mon, 13 Apr 2020 04:09:16 -0700 (PDT) Received: from redhat.com ([185.107.45.41]) by smtp.gmail.com with ESMTPSA id h2sm14512643wmf.34.2020.04.13.04.09.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Apr 2020 04:09:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586776322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hngf1T4xIdGtDUWQBKvLGu7Vp96xshofitGMfLmzyhs=; b=ecSuo+Npn26+hVjgPWj9BwlxsFNKoi4ifRp639Avrw916ml5fJdtVn4KImX727/1Gj83P6 kKXizmkW+2wAGd66k+cVasW8tjuPO2j94r2V1fmIOTngUMsky+zMXDL4kVt9fAUkyruIA7 8+dlt3hcv1yGEQSJqD1Dl+542LNirPQ= X-MC-Unique: -UlO8VCTN_uc5tA7jtAbkw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=b47iFwMVN9QYq3a/PDcTMzVV7TwuVWttbtbEsjdpn3s=; b=jPeWiVDigDliFfpLj4EBsyn+ciD9s1NnDQR2ezfwNK7WZUNHodl9ENPexdpsmNVprd 35qpdMzumLKdIavVANPJcM6YolZYkJ7Aps847jcH+ykNRMryvEcoAE7PnpB0vvoWovrE Jwwywpo18i4wNiUWez8Yq2sxQWVMSmwukPN5M9J/pRJaKv13CYD0aK8EXLmZRtqU9vO4 RLpgU5RAk1vSed5f10mtK72aZa/UzzFDDAnCvITpKF3uwDLCF1PNWjGF9hN5+wSuFogq U3zt2Fgfbb9/154lU6E7Bnqg5TuxQMys7rWe/NZ607lbG4UZvf510mFiiK/kSp6oDuUh nihA== X-Gm-Message-State: AGi0PuZ/xTa3FmviKZMxv88zfpgNjGS6JxV7fhMtvS8abYcbetdAW3f2 4n1CT0gHpprX2KGKd71MZyCWP1JV4msnG5aHnpJHamJ/w2M0XkSuvoknVSesQMrA3X561BOQq/I GbvHKs8YmOk1jtT4= X-Received: by 2002:a7b:c401:: with SMTP id k1mr17855158wmi.152.1586776155097; Mon, 13 Apr 2020 04:09:15 -0700 (PDT) X-Google-Smtp-Source: APiQypJNKQcsJndV9iBW/kyN6EB4g11EndmI5RNXV9yF8WAcQkkjAjqLwmWbDO8eLpjLV+XckcJXwQ== X-Received: by 2002:a7b:c401:: with SMTP id k1mr17855132wmi.152.1586776154800; Mon, 13 Apr 2020 04:09:14 -0700 (PDT) Date: Mon, 13 Apr 2020 07:09:12 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 4/4] exec: Fix for qemu_ram_resize() callback Message-ID: <20200413110838.151374-5-mst@redhat.com> References: <20200413110838.151374-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200413110838.151374-1-mst@redhat.com> X-Mailer: git-send-email 2.24.1.751.gd10ce2899c X-Mutt-Fcc: =sent X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 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: Peter Maydell , David Hildenbrand , Shameer Kolothum , Paolo Bonzini , Igor Mammedov , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: David Hildenbrand Summarizing the issue: 1. Memory regions contain ram blocks with a different size, if the size is not properly aligned. While memory regions can have an unaligned size, ram blocks can't. This is true when creating resizable memory region with an unaligned size. 2. When resizing a ram block/memory region, the size of the memory region is set to the aligned size. The callback is called with the aligned size. The unaligned piece is lost. Because of the above, if ACPI blob length modifications happens after the initial virt_acpi_build() call, and the changed blob length is within the PAGE size boundary, then the revised size is not seen by the firmware on Guest reboot. Hence make sure callback is called if memory region size is changed, irrespective of aligned or not. Signed-off-by: David Hildenbrand [Shameer: added commit log] Signed-off-by: Shameer Kolothum Reviewed-by: Igor Mammedov Message-Id: <20200403101827.30664-4-shameerali.kolothum.thodi@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- exec.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/exec.c b/exec.c index de9d949902..2874bb5088 100644 --- a/exec.c +++ b/exec.c @@ -2074,11 +2074,23 @@ static int memory_try_enable_merging(void *addr, si= ze_t len) */ int qemu_ram_resize(RAMBlock *block, ram_addr_t newsize, Error **errp) { + const ram_addr_t unaligned_size =3D newsize; + assert(block); =20 newsize =3D HOST_PAGE_ALIGN(newsize); =20 if (block->used_length =3D=3D newsize) { + /* + * We don't have to resize the ram block (which only knows aligned + * sizes), however, we have to notify if the unaligned size change= d. + */ + if (unaligned_size !=3D memory_region_size(block->mr)) { + memory_region_set_size(block->mr, unaligned_size); + if (block->resized) { + block->resized(block->idstr, unaligned_size, block->host); + } + } return 0; } =20 @@ -2102,9 +2114,9 @@ int qemu_ram_resize(RAMBlock *block, ram_addr_t newsi= ze, Error **errp) block->used_length =3D newsize; cpu_physical_memory_set_dirty_range(block->offset, block->used_length, DIRTY_CLIENTS_ALL); - memory_region_set_size(block->mr, newsize); + memory_region_set_size(block->mr, unaligned_size); if (block->resized) { - block->resized(block->idstr, newsize, block->host); + block->resized(block->idstr, unaligned_size, block->host); } return 0; } --=20 MST