From patchwork Tue Aug 13 21:05:29 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: 171212 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp1396985ily; Tue, 13 Aug 2019 14:08:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZSClV9CjHui2NwZHmiDOHgpi48pucjtBZXjqKpk4Fd2RBc26B3qYoAdtI+I672qU1B5GR X-Received: by 2002:a17:906:158c:: with SMTP id k12mr38048645ejd.83.1565730535823; Tue, 13 Aug 2019 14:08:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565730535; cv=none; d=google.com; s=arc-20160816; b=DX0pOjSaDrtITjadPNxxRWheenmV8lMeHpCzk5rwu7zl/SZ8BUQtJQp2Ut/8HqYjWt VGxCmhO43eLiSaAnsl3D+5IPth0IfQjWU/2X9qQUD5vinP9EySJuUruWPSzvSbowdoJl 9WtTYXgiFiVHuoU729/VgZXkcxqQzOfdU05tv+qY4NXpvwbMDCn21FKNtNW7IxogdqKC OIy5FbxMGoVVYLA6dqkf6bnSA59XzB1PciNY7W3NiF+npltbHGCbY1UXmzcxYmMLjv0V 6+Mbh+ygpzxnxlen7SlcMvzQ8m3vYr78TaofVEa20jw9DrYZTnz/P23oXUe2Z6/+U1zI u+0Q== 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=Mr1ezuKYoxi9xD3uOq/jX8oVxNnNpcd1PW9SAOmoapY=; b=oxsdnB12sK3Yh4EIQZAKpU6dq/KaAL3Ouqz1rdlrsKCHMNl2WpOAg4OYHyuZnqQrgL fttVycuXH0DeJG6Qx8RLTcWEXR9Y/Fs3o84wmwICkXjM2XwjMvQLOMi6idXzEPr6XvFu OZfRr9F2p9iqhdrxPOQT1uWAs6Qu5rTCIcVgAUPwOwgF6/Y0Z2lc1ZhP1xZjt2VElAbT bf0iwxUYZL479vav1XYMJjh8M2pDZJiuOsgkfInSHmCsAzDSepzQ58wioRSEb+lcjm1j tthvuNxRoPOPgmTLDZDZ3GsDKZC01l+KrTfKTfzDwZx5Vg+V3OgEjfl/kVuLV3A9sFWw oNzQ== 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 c30si4526742ejj.214.2019.08.13.14.08.55 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Aug 2019 14:08:55 -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]:55468 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hxe2I-0005PS-R9 for patch@linaro.org; Tue, 13 Aug 2019 17:08:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41602) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hxe0o-0004Zd-P8 for qemu-devel@nongnu.org; Tue, 13 Aug 2019 17:07:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hxe0n-00010e-TY for qemu-devel@nongnu.org; Tue, 13 Aug 2019 17:07:22 -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 1hxe0l-0000tZ-Fm; Tue, 13 Aug 2019 17:07:19 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id D986516219B64C76B000; Wed, 14 Aug 2019 05:07:16 +0800 (CST) Received: from S00345302A-PC.china.huawei.com (10.47.94.0) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.439.0; Wed, 14 Aug 2019 05:07:10 +0800 From: Shameer Kolothum To: , , , Date: Tue, 13 Aug 2019 22:05:29 +0100 Message-ID: <20190813210539.31164-3-shameerali.kolothum.thodi@huawei.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20190813210539.31164-1-shameerali.kolothum.thodi@huawei.com> References: <20190813210539.31164-1-shameerali.kolothum.thodi@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.47.94.0] 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 v9 02/12] 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 1734d4b44f..552f60a716 100644 --- a/hw/acpi/memory_hotplug.c +++ b/hw/acpi/memory_hotplug.c @@ -715,10 +715,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); }