From patchwork Wed May 22 16:22:46 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: 164851 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1068379ili; Wed, 22 May 2019 09:28:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxVpJtYQrqOOzYlwhOOkqvTqZKLzWXqslmU+iO24vYJBmlK6gIYVkisKSdmLS6b2Uye9wVV X-Received: by 2002:a17:906:fc0d:: with SMTP id ov13mr51006702ejb.25.1558542500428; Wed, 22 May 2019 09:28:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558542500; cv=none; d=google.com; s=arc-20160816; b=y19v3dripinzCzV7ThvT9I/LA6wsAf/VA0mpFG9k84ctTDXYdbeQZ56VxLPWZ5dsJe x4duPJ3/Wpv0pf3vvkgk7z1SwWktWypGeO5OvYawJliZeaZHNEqZ6bcXHrs2psnCVJht 4OOBeRQxR2Yk3cRrAXZ9cCQByVzZr9SUpNzTkMj8eOizW/jpW3K/rjGPKi9jfriZKzWJ T7cKgbKpin2HofECUkEnlocjej4IjajTEApJTeOw1kmmTj3g0fToAZWeWpP+tISQ4S15 2mr/N/XNZkzBelrq8AqIyMkuaYdArpjJD+2WIXsbCItEDOOvC+VqkgXv5C+xcIfcTdcO UV2w== 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=tH6RMAJrmzrPb+/L7KoeTD30P3yxyJiMKEugfjArIKM=; b=wucP+lTT0hGJrDrrZJWMqsQeJE8je5bXLJC7Gg0GF00AXvb9CCC5OOXj/eKaqbhsQo MlnyfNz2qLpN+eoy4/ZmMOUjUbZ35sdSFv6e8JMVwZS7l5+TjLMAvS5hGDrl/nC6PWhl iCNLryOq2H8M/mxgFcP7id+fGiLVj2AzgadjzzFyKZkf/W5RzNqagICYiu28vwZ6Oc7t 2x5fDRHhVvbDoPeSpDqogK3XAboqZjdUQXotn/erQaICPlbvjfXB0XC3ZoGqTKq34vSS KDPdrccVKIZaiBFmNXxFxiHu0wULC7ZGOehWADkIgszle4coLr22lEzytmWtBEW6CX50 FiTQ== 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 q2si17656419edg.63.2019.05.22.09.28.20 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 22 May 2019 09:28:20 -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]:47568 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTU6F-0001EJ-Ay for patch@linaro.org; Wed, 22 May 2019 12:28:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTU3A-0006eW-QW for qemu-devel@nongnu.org; Wed, 22 May 2019 12:25:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTU39-0002Aq-To for qemu-devel@nongnu.org; Wed, 22 May 2019 12:25:08 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:2218 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hTU37-00020t-Ci; Wed, 22 May 2019 12:25:05 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id D491ED543854AA74BCF7; Thu, 23 May 2019 00:25:02 +0800 (CST) Received: from S00345302A-PC.china.huawei.com (10.202.227.237) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.439.0; Thu, 23 May 2019 00:24:03 +0800 From: Shameer Kolothum To: , , , Date: Wed, 22 May 2019 17:22:46 +0100 Message-ID: <20190522162252.28568-3-shameerali.kolothum.thodi@huawei.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20190522162252.28568-1-shameerali.kolothum.thodi@huawei.com> References: <20190522162252.28568-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 v5 2/8] 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: 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 --- hw/acpi/memory_hotplug.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- 2.17.1 Reviewed-by: Igor Mammedov 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); }