From patchwork Thu Mar 21 10:47:37 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: 160770 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp647048jan; Thu, 21 Mar 2019 03:57:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqxyyKfUXfKO94pd1Z+SyjYY3EzXzP7W31ksC19QWG6SOu8uQoUMp7kEhTTXa6n2qrmm5NXO X-Received: by 2002:a05:6000:1292:: with SMTP id f18mr2137438wrx.115.1553165827627; Thu, 21 Mar 2019 03:57:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553165827; cv=none; d=google.com; s=arc-20160816; b=llqlPY++lSGMeff7XOkIL82x62zAJqWwpdAzNfkyZJzGvaX9nIhtc8DrvZtWsgAUw0 3EbxTyv8S2ZY+5Ryt/zFWL3lo90OeH7myj10aTfiiU+4c2RuF1GdG82brirpqWfHbbFY Pp35lagG4LrFMt34LKH5JDPSWYFATDvPY5cIpUYX19o4EiFdlXMljOaybKxSgZ/aM+lk WLWq1DJyBo1aA6jAiUdUzyjViQJNLyfOC6aR+1cLLvK5SNP1k8WqYO9my2yRIsREudAm g50qqUivgx2eDb+sk2vfIO+YPlK7AeU6mAIrXo8z9tbhGdpo6f3mP+58THGSr+YSGd77 Ymeg== 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=fKctV7GUD3Uo7WpHZwl71IY0iimmutABw+rl8Ebg4u4=; b=nxqh4DfH5IgxYha2C+L9h+oprQqjbsVNY6iLX546imG83vr1LFnkgexmgGg0aNtKUe Qhy72dopLqtSAEznETa2hLqCc6YuypV+pu1hTgtqIShLJEzXK1TMTENw789SKuD0NcHw 3cOlj5Siw4bYObZCsExEJ2Cx/20B2pbJn3Jp/O0yLJskSFwa9iSNuqNDuYfKh+krncPq 6GPYi4ZK4k/IhzGDySyLfh5KIQ6Gt8bZ1STo3DlGiA48PtbQBLEBaeeiAqPKVBoZ4/G6 1D+LBDAsSI1+LpHr+YXDBYZAy0Cb+pmDVGQLv/nD9YZtZ9hI7f78/QWui83oUTbclqpQ 886g== 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 b14si2869431wrj.358.2019.03.21.03.57.07 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 21 Mar 2019 03:57:07 -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]:34800 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6vNi-00018W-9q for patch@linaro.org; Thu, 21 Mar 2019 06:57:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6vHm-0004XC-9l for qemu-devel@nongnu.org; Thu, 21 Mar 2019 06:50:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h6vFq-0001M1-TW for qemu-devel@nongnu.org; Thu, 21 Mar 2019 06:48:59 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:2196 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h6vFp-0000pF-85; Thu, 21 Mar 2019 06:48:57 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 86CEB75FF1BB59E97E57; Thu, 21 Mar 2019 18:48:52 +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:44 +0800 From: Shameer Kolothum To: , , , , , , , Date: Thu, 21 Mar 2019 10:47:37 +0000 Message-ID: <20190321104745.28068-3-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.190 Subject: [Qemu-devel] [PATCH v3 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.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" 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 --- hw/acpi/memory_hotplug.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- 2.7.4 Reviewed-by: Eric Auger diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c index 80e25f0..98407e3 100644 --- a/hw/acpi/memory_hotplug.c +++ b/hw/acpi/memory_hotplug.c @@ -720,10 +720,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); }