From patchwork Tue Jun 25 12:14:15 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: 167721 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp5500125ilk; Tue, 25 Jun 2019 05:38:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxlcAFVsDI95UjcyF413ST86pB17ZY9pBZ7SvncQiKuPgwf0FhbTNm7mhsdMjdjUxoCZxIh X-Received: by 2002:a17:906:b203:: with SMTP id p3mr5898870ejz.145.1561466315365; Tue, 25 Jun 2019 05:38:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561466315; cv=none; d=google.com; s=arc-20160816; b=KYon6Ba5PpJqBuv6on98cCw9Ur+yNUvpeYYIScsoQmEcuNC0aCT1BaSqaWW1MEdCNX lrYoPc2307kaGq4OosYqd9baw65Ug8chrMA9DYPT6jiyeODb0WOY7dzTXOx3b3hIdlV1 Gd3oLaJHW/9BYI0ZhmQZJNNiPNXLow/YRPKtJKNsLQ9yqwDAAME/MMeVXJx4dwi53qVK /+27pe+/zFymRn/gFl44I7SQGCjwEOQV7LJr+fpFEr8j2tIIXOQHP5Fdc2W4VyoWsLIQ cj52Q/tm7cg+XOxdBNlxHNgElpPDSqg20KKUUni3Jo3dQ4Fywtanpu0EU4ZIHy/wg2M/ ocWA== 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=WHESVJlvr51j3zgRoRgC/7LTP5irpTY09pRQMoFOUah4v5Gi9lX/rEYteCvJCMT3W6 LZAowdObPxXNm3xoj4QXAC//oFlP8UH0qxWifkSt0CJdMpjj0/7g9DhUJuhNC18xDce8 ckZ64fdHD4V/MftxYRcOo8daq+AgPRdV8A9IDcZf8r9YKIwquLOLaqSuAPCJGwrA4D3D snKN4dHdATTyq6aukZpr5PDPVVS6xY1UNnEUZKoq8AlUK7fx2XETZvQNGSCLkbMcjdOd 47SmvCm02L20kmkIeEaI+L4FfVeKLoNvOA+1oG5hbp3ZfJZLVmM4JD4pYuAdelejx9QI a2yw== 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 pv1si265566ejb.259.2019.06.25.05.38.35 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Jun 2019 05:38:35 -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]:59732 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfkiY-0005bI-Ai for patch@linaro.org; Tue, 25 Jun 2019 08:38:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36274) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfkMh-0007Bw-C7 for qemu-devel@nongnu.org; Tue, 25 Jun 2019 08:16:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfkMY-00048L-Nr for qemu-devel@nongnu.org; Tue, 25 Jun 2019 08:15:54 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:2179 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hfkMT-00040C-1W; Tue, 25 Jun 2019 08:15:46 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 64560D0D11A5D8470602; Tue, 25 Jun 2019 20:15:39 +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; Tue, 25 Jun 2019 20:15:32 +0800 From: Shameer Kolothum To: , , , Date: Tue, 25 Jun 2019 13:14:15 +0100 Message-ID: <20190625121421.22280-3-shameerali.kolothum.thodi@huawei.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20190625121421.22280-1-shameerali.kolothum.thodi@huawei.com> References: <20190625121421.22280-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 v6 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.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); }