From patchwork Tue Jul 16 15:38:08 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: 169067 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1025132ilk; Tue, 16 Jul 2019 08:41:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwabm0PJ9k7w3/0kcHiX8UdQr3LXpx8rMPk0a4cIUMzTa5EZiPLIE0GOJCbjSbGleVY+5z X-Received: by 2002:a17:906:85d7:: with SMTP id i23mr26288546ejy.119.1563291710079; Tue, 16 Jul 2019 08:41:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563291710; cv=none; d=google.com; s=arc-20160816; b=tFx8h2KJa4CJP1xHTDHvSx6lSyBBWgg9IrSzVkuVnOHy0Yuxm31NbxfxF0DhiGMlPB sVdpl4282qQedvPhSuU1UxSLUCQn4oA2MRBJx9NHjNwoUBCQyL6rJd8AoM+Na+CtWZFe wGKrMd60wIYFodJAETaG8ISGmGQ3wEXN/KNBfN1wajNwr5GTFC8AJL5DTO5XzEI2eUf2 qugZ+teW8SfEIpAPdrGrXFO/YnPrUI6OIEa7Kg6e3BIj0KdD77kWBg3o3rzncfB1vNED Y7g1sUaT/VnR3WKDtZLEsX8lkmtx2lQSkU//YKxjgvWK+hhkIlwa6xYfetn2gt1EP2Ec A9iw== 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=rCWHrMBZftcnydBxe20riTAsROaY/Psm0j7VxlBy/YM=; b=gBJIrLPXBqCIBmu/ugdxe0UuXTrBF1rWIjXZ3b/CGrBhjm+zks6uot+al0rJnpKSd/ ejaKEkg5C0HeyM43zUaFluFO6/ku25ywXXd+77Xi7l+vJQI/jUXRpS+a+CS+U0hPS4HD sIef6A+ED30X++w2Otti5TMq9eg2UvC4l3S0UUnxsHiZ6v5Kjh3pQGYb5LUZvwwfTavm I6tktvdBl6l3UOOEUSnUy4ROf0xGMR6VWGPS6xs6ZNbIOqYo8YR43uQFg6ql6dwGHupV g9TMNl3h40CDDBQQgBmdS/U+0cLqcOiAqgqbMmRNQNoMKhXwB3oUSRIklHxcRxaKAAL6 HKNQ== 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 39si13095814edq.151.2019.07.16.08.41.49 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jul 2019 08:41:50 -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 ([::1]:50210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hnPaO-0008Nu-NX for patch@linaro.org; Tue, 16 Jul 2019 11:41:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36602) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hnPZq-0007Sr-AQ for qemu-devel@nongnu.org; Tue, 16 Jul 2019 11:41:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hnPZp-0004Oo-7M for qemu-devel@nongnu.org; Tue, 16 Jul 2019 11:41:14 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:2235 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hnPZl-0004B7-PU; Tue, 16 Jul 2019 11:41:11 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 3D8A3E59FF59AFEC0BBD; Tue, 16 Jul 2019 23:40:49 +0800 (CST) Received: from S00345302A-PC.china.huawei.com (10.202.227.237) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.439.0; Tue, 16 Jul 2019 23:40:43 +0800 From: Shameer Kolothum To: , , , Date: Tue, 16 Jul 2019 16:38:08 +0100 Message-ID: <20190716153816.17676-3-shameerali.kolothum.thodi@huawei.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20190716153816.17676-1-shameerali.kolothum.thodi@huawei.com> References: <20190716153816.17676-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-for-4.2 v7 02/10] hw/acpi: Do not create memory hotplug method when handler is not defined 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@linaro.org, sameo@linux.intel.com, ard.biesheuvel@linaro.org, linuxarm@huawei.com, xuwei5@hisilicon.com, shannon.zhaosl@gmail.com, sebastien.boeuf@intel.com, lersek@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Samuel Ortiz With Hardware-reduced ACPI, the GED device will manage ACPI hotplug entirely. As a consequence, make the memory specific events AML generation optional. The code will only be added when the method name is not NULL. Signed-off-by: Samuel Ortiz Signed-off-by: Shameer Kolothum Reviewed-by: Eric Auger Reviewed-by: Igor Mammedov --- hw/acpi/memory_hotplug.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c index c724f5f1e4..7e30e6f886 100644 --- a/hw/acpi/memory_hotplug.c +++ b/hw/acpi/memory_hotplug.c @@ -719,10 +719,12 @@ void build_memory_hotplug_aml(Aml *table, uint32_t nr_mem, } aml_append(table, dev_container); - method = aml_method(event_handler_method, 0, AML_NOTSERIALIZED); - aml_append(method, - aml_call0(MEMORY_DEVICES_CONTAINER "." MEMORY_SLOT_SCAN_METHOD)); - aml_append(table, method); + if (event_handler_method) { + method = aml_method(event_handler_method, 0, AML_NOTSERIALIZED); + aml_append(method, aml_call0(MEMORY_DEVICES_CONTAINER "." + MEMORY_SLOT_SCAN_METHOD)); + aml_append(table, method); + } g_free(mhp_res_path); }