From nobody Thu Dec 18 08:06:53 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1665427968; cv=none; d=zohomail.com; s=zohoarc; b=OqNaeAhkrP2R/vTz9e7oK8/mSb2/XBC577Zb4ctg4cOchaegAC+2svnc11qdAykoYAuVN3W6F0D8SdM4RlF10ssSA3fhjHq3Q3B+bC371R/X96JgRmVYwvmBlKFARg5OuFGjeSLIIc+7/LPbmHWgDYZfM0Ojaulsl/RCvR07ehk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1665427968; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=usPkxvTH7QvAvChQcJRZywVhPddBwQYaDj8J2SS1D1c=; b=OMqIR3WNP6mHJk4OZfOxt4tLdrvQHu6aMJzYflxfuNyXjCV9RbuvUDoRFuoU74Eqf2dwaJeD5llzl28u7QAOgzpUjm3pUvkiAmI+HEAcIs8WN6NcR7LhkRGkU6BZiB/Tg8OvhBnhsAsK0viGKl+yU0qfrzYQ3Ek4TF2BQdLw0og= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1665427968024126.6475677047722; Mon, 10 Oct 2022 11:52:48 -0700 (PDT) Received: from localhost ([::1]:32922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohxtL-00052r-TI for importer@patchew.org; Mon, 10 Oct 2022 14:52:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohwdL-00049K-1W for qemu-devel@nongnu.org; Mon, 10 Oct 2022 13:32:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:29323) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohwdJ-0007XF-En for qemu-devel@nongnu.org; Mon, 10 Oct 2022 13:32:06 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-518-Ygj5TACZOcOzeQa6EQ9XFw-1; Mon, 10 Oct 2022 13:32:03 -0400 Received: by mail-wm1-f69.google.com with SMTP id v125-20020a1cac83000000b003bd44dc5242so9284680wme.7 for ; Mon, 10 Oct 2022 10:32:03 -0700 (PDT) Received: from redhat.com ([2.55.183.131]) by smtp.gmail.com with ESMTPSA id iv19-20020a05600c549300b003b47b913901sm38953308wmb.1.2022.10.10.10.31.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 10:32:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665423124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=usPkxvTH7QvAvChQcJRZywVhPddBwQYaDj8J2SS1D1c=; b=ifENLsqW3nS+kfbmZWjWTsSvIULyToJHU9AkBk2EBFiY9Co+2a7MEKtQ/Yup/3dWZG5m8b XZcFh4X9PTzZ/A2/XJNcBvjCISuR/J+9KvutjStEC5Fragx1C8tyBgJgab5BC82hGaWT5u psAXVC0VgPhM4pyB1qD/LiGG2iOqnhQ= X-MC-Unique: Ygj5TACZOcOzeQa6EQ9XFw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=usPkxvTH7QvAvChQcJRZywVhPddBwQYaDj8J2SS1D1c=; b=rbFz8FkKVA0vzir9yTC10JuT2ujLO8F6iOKCPbUPgMd4KNvlvFZ1GyObtpAgwYnPeW y7hsHniX8bPHEwM1zdWD+Hj+gukz0dKJzoGMdqhBpXTbORs0A3jDTOhFKZGkKD0/pqlP xi/qI70UgXMPZy/TIOnC8s9LR79GaDKh8hmlK6eas47AQiFm04MoAOcfyXiG7+3r5Y9G qR1T/eHc9ts8xcAqAQsM0wmLGDqwcQUER8Cc75ogZHlHdlKQmRDNl4hbyHLx15RYCNEK 9lmw7EXI67IDmLwsCO+TUpTKN9aQ5+k4hraBsyn0lgolA80BwJfBT1RleEo05NGx3v2R omaQ== X-Gm-Message-State: ACrzQf1apOkxy+kLk3vl9yiKpoj9k7rGwiltKU8DRJp8NizheA6aU2RB sIgKrLa8bcVnMpJ96bquHSvWuyh5MsWu70nTMdy12qAc9FDHTHbd91rhUQ2yz8zWgwYZu+62T4n m8Rfm39V7hT+BDBvEA4vFFTEu1osm1EjsptpnS5b2uvuui+VikrpkVtuW1AJY X-Received: by 2002:a5d:5109:0:b0:22f:ed4:65da with SMTP id s9-20020a5d5109000000b0022f0ed465damr9081657wrt.688.1665423121382; Mon, 10 Oct 2022 10:32:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5+5V1yYoi02UPda3TFFWY4+Zo1T2XfYLrMFbZPhG22dg1G1gAdyDBK7yM3rWS1wJdjcIkGqA== X-Received: by 2002:a5d:5109:0:b0:22f:ed4:65da with SMTP id s9-20020a5d5109000000b0022f0ed465damr9081640wrt.688.1665423121114; Mon, 10 Oct 2022 10:32:01 -0700 (PDT) Date: Mon, 10 Oct 2022 13:31:56 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Ani Sinha , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 44/55] x86: acpi: _DSM: use Package to pass parameters Message-ID: <20221010172813.204597-45-mst@redhat.com> References: <20221010172813.204597-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221010172813.204597-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1665427968606100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Igor Mammedov Numer of possible arguments to pass to a method is limited in ACPI. The following patches will need to pass over more parameters to PDSM method, will hit that limit. Prepare for this by passing structure (Package) to method, which let us workaround arguments limitation. Pass to PDSM all standard arguments of _DSM as is, and pack custom parameters into Package that is passed as the last argument to PDSM. Signed-off-by: Igor Mammedov Message-Id: <20220701133515.137890-7-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/acpi-build.c | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 6d02eed12c..a19900c4e4 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -431,11 +431,17 @@ static void build_append_pci_bus_devices(Aml *parent_= scope, PCIBus *bus, ); aml_append(dev, method); method =3D aml_method("_DSM", 4, AML_SERIALIZED); - aml_append(method, - aml_return(aml_call6("PDSM", aml_arg(0), aml_arg(1), - aml_arg(2), aml_arg(3), - aml_name("BSEL"), aml_name("_SUN"= ))) - ); + { + Aml *params =3D aml_local(0); + Aml *pkg =3D aml_package(2); + aml_append(pkg, aml_name("BSEL")); + aml_append(pkg, aml_name("_SUN")); + aml_append(method, aml_store(pkg, params)); + aml_append(method, + aml_return(aml_call5("PDSM", aml_arg(0), aml_arg(1= ), + aml_arg(2), aml_arg(3), param= s)) + ); + } aml_append(dev, method); aml_append(parent_scope, dev); =20 @@ -480,10 +486,17 @@ static void build_append_pci_bus_devices(Aml *parent_= scope, PCIBus *bus, */ aml_append(dev, aml_name_decl("ASUN", aml_int(slot))); method =3D aml_method("_DSM", 4, AML_SERIALIZED); - aml_append(method, aml_return( - aml_call6("PDSM", aml_arg(0), aml_arg(1), aml_arg(2), - aml_arg(3), aml_name("BSEL"), aml_name("ASUN")) - )); + { + Aml *params =3D aml_local(0); + Aml *pkg =3D aml_package(2); + aml_append(pkg, aml_name("BSEL")); + aml_append(pkg, aml_name("ASUN")); + aml_append(method, aml_store(pkg, params)); + aml_append(method, aml_return( + aml_call5("PDSM", aml_arg(0), aml_arg(1), aml_arg(2), + aml_arg(3), params) + )); + } aml_append(dev, method); } =20 @@ -580,12 +593,13 @@ Aml *aml_pci_device_dsm(void) Aml *acpi_index =3D aml_local(2); Aml *zero =3D aml_int(0); Aml *one =3D aml_int(1); - Aml *bnum =3D aml_arg(4); Aml *func =3D aml_arg(2); Aml *rev =3D aml_arg(1); - Aml *sunum =3D aml_arg(5); + Aml *params =3D aml_arg(4); + Aml *bnum =3D aml_derefof(aml_index(params, aml_int(0))); + Aml *sunum =3D aml_derefof(aml_index(params, aml_int(1))); =20 - method =3D aml_method("PDSM", 6, AML_SERIALIZED); + method =3D aml_method("PDSM", 5, AML_SERIALIZED); =20 /* get supported functions */ ifctx =3D aml_if(aml_equal(func, zero)); @@ -662,10 +676,10 @@ Aml *aml_pci_device_dsm(void) * update acpi-index to actual value */ aml_append(ifctx, aml_store(acpi_index, aml_index(ret, zero))); + aml_append(ifctx, aml_return(ret)); } =20 aml_append(method, ifctx); - aml_append(method, aml_return(ret)); return method; } =20 --=20 MST