From patchwork Thu Mar 21 10:47:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shameerali Kolothum Thodi X-Patchwork-Id: 160772 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp648022jan; Thu, 21 Mar 2019 03:58:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyiRwSRKJcok7emV2lfHOTz+86VjWxHScvvNIfNOFj13SEVmBbV70g/K6klLdzzZcuIK9k2 X-Received: by 2002:a1c:a186:: with SMTP id k128mr2019281wme.54.1553165905440; Thu, 21 Mar 2019 03:58:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553165905; cv=none; d=google.com; s=arc-20160816; b=KXKR0e6wyqcTIvMr9vdMbL3vKdOrq7VxYZ9JYXjg6v/Dy98agUcMYvUItNQvHeZ0Xy Ph8H7L+OWE4JXUUWKa2gmDZwhFF/tVArpXnoe6LUJRx1SlicPl/Gw+y3pSiHhr26XwYq 2/i7DBYHj5ojc4MiUNksVrM3+RWDVtnL3cMERusXdx4IkE6WRoCKQ1VH04jYQwBM2d/E fVGKll/CY7fYjpTaUV/U2B5u8XiYDQo1z0eYPvaXsxbMB0SlhyFiBuHuSjeBC2BwUqeX uGO5YQS8jhatK+7zh6ZG/hZTdVtFcZctxVcaG5l+Cqdxwp9ukttomKPN1DsN0vbHmWyB Jf8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:mime-version:references :in-reply-to:message-id:date:to:from; bh=qsFGORQU4mJrDD2jEpvrVXk44zuv5QGQVutbHG5usa8=; b=Jv78NCCq9GZ9Ymto9tIKOOdb+Zr25Rw0YuK2mADzGmWGMV1gs67/SDmZAWBnkGAAU1 iVTBRJl+lXtaeao/DaL9PW7Zzi4DeL4EC2+wdAqEw75V61TNRYRj3VHFmTNA/M06RWFp n293xFhH1tNRk16s4upoqCUfWoEZANT2JNpEpF8KUJl0jzVqzK4f7d0jiUsoDDgp9sgg 4VHbz8n9ONFlu99eFA0oUvbWr8jKk7FWhbsvptxN2mJbxz8zb4v8EoYfzTw3RKVzbi4z PrGEis43ef4tNbLAQapNDUQGwedy3P5Bnz8L2fQcCwMRq5zV/zAxsTeGcjp+hgLAQOcV Ywjg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f5si3070501wre.261.2019.03.21.03.58.25 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 21 Mar 2019 03:58:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([127.0.0.1]:34816 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6vOy-0001qk-CN for patch@linaro.org; Thu, 21 Mar 2019 06:58:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46974) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6vHb-0004Og-R3 for qemu-devel@nongnu.org; Thu, 21 Mar 2019 06:50:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h6vG3-0002ov-R4 for qemu-devel@nongnu.org; Thu, 21 Mar 2019 06:49:12 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:2252 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h6vG2-0002Tl-2J; Thu, 21 Mar 2019 06:49:10 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id BC46D422EBD4C3B27C3A; Thu, 21 Mar 2019 18:49:07 +0800 (CST) Received: from S00345302A-PC.china.huawei.com (10.202.227.237) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.408.0; Thu, 21 Mar 2019 18:48:59 +0800 From: Shameer Kolothum To: , , , , , , , Date: Thu, 21 Mar 2019 10:47:42 +0000 Message-ID: <20190321104745.28068-8-shameerali.kolothum.thodi@huawei.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20190321104745.28068-1-shameerali.kolothum.thodi@huawei.com> References: <20190321104745.28068-1-shameerali.kolothum.thodi@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.227.237] X-CFilter-Loop: Reflected X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 45.249.212.191 Subject: [Qemu-devel] [PATCH v3 07/10] hw/arm/virt: Introduce opt-in feature "fdt" 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: linuxarm@huawei.com, xuwei5@hisilicon.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is to disable/enable populating DT nodes in case any conflict with acpi tables. The default is "off". This will be used in subsequent patch where cold plug device-memory support is added for DT boot. If DT memory node support is added for cold-plugged device memory, those memory will be visible to Guest kernel via UEFI GetMemoryMap() and gets treated as early boot memory. Hence memory becomes non hot-un-unpluggable even if Guest is booted in ACPI mode. Signed-off-by: Shameer Kolothum --- hw/arm/virt.c | 23 +++++++++++++++++++++++ include/hw/arm/virt.h | 1 + 2 files changed, 24 insertions(+) -- 2.7.4 diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 13db0e9..b602151 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1717,6 +1717,20 @@ static void virt_set_highmem(Object *obj, bool value, Error **errp) vms->highmem = value; } +static bool virt_get_fdt(Object *obj, Error **errp) +{ + VirtMachineState *vms = VIRT_MACHINE(obj); + + return vms->use_fdt; +} + +static void virt_set_fdt(Object *obj, bool value, Error **errp) +{ + VirtMachineState *vms = VIRT_MACHINE(obj); + + vms->use_fdt = value; +} + static bool virt_get_its(Object *obj, Error **errp) { VirtMachineState *vms = VIRT_MACHINE(obj); @@ -2005,6 +2019,15 @@ static void virt_instance_init(Object *obj) object_property_set_description(obj, "gic-version", "Set GIC version. " "Valid values are 2, 3 and host", NULL); + /* fdt is disabled by default */ + vms->use_fdt = false; + object_property_add_bool(obj, "fdt", virt_get_fdt, + virt_set_fdt, NULL); + object_property_set_description(obj, "fdt", + "Set on/off to enable/disable device tree " + "nodes in case any conflict with ACPI" + "(eg: device memory node)", + NULL); vms->highmem_ecam = !vmc->no_highmem_ecam; diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index c5e4c96..14b2e0a 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -119,6 +119,7 @@ typedef struct { bool highmem_ecam; bool its; bool virt; + bool use_fdt; int32_t gic_version; VirtIOMMUType iommu; struct arm_boot_info bootinfo;