Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp218064lqb; Tue, 4 Jun 2024 09:17:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUihZAIlOBe8Ybl5dzbZjvEQYAJbeqE6Z+rV2YV/+wr3DIpPW4WHUToJzNcczbATCSOOBetM8wlI+9SXEGztMBDMwq+qFfW9dzQJbzNkw== X-Google-Smtp-Source: AGHT+IH76svwrT8hafd9ySRF5xl72d+6NavYkOR8J04aqpcGF/3FlxElYPkKwJLD1VP1Z6xL127G X-Received: by 2002:a05:6a21:8195:b0:1b2:b1a7:483d with SMTP id adf61e73a8af0-1b2b71308b8mr72796637.40.1717517845410; Tue, 04 Jun 2024 09:17:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717517845; cv=pass; d=google.com; s=arc-20160816; b=IIAUkp0IkJ7L+r96G4zI6FIz+IfSCRtRJzUtefMf/j5dfIwRbsXKYWzKqO8Lkq/QDR TKzl5qL88lvyVuIX9G9hGOSHaBP78aBcjNJ6l+JVCNJEIZdtnsrUTUXJu6xQur1T5k5k lmwHsOtaWJJ4X6Ondvtiejgvdy0oXCoWHPt+vzcnNPRGWaOxTIrUaV2BW+AmeFI2TdRP +bcjsWeU5CVVeo0QxfDfLnzc/qSXyum2LSSjwfaRA6KODvVpUavJnHlKhoLbVxW5t0Yt 5pw5Ecrh/BmFB8hFMuWCXd7QwoETP/SoesC6h42m9kE3aoXgSEh+aUi0nYyrUbQF+duC oHRA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=BLsJ57dOorXlE8kBSLbwNQfqDP/v1vokN/Lx42s9DY8=; fh=wg4+WbLH/p8evM/14JmNbNKRrYpY+dpt6oAsx3Lrf3M=; b=zAkvPRKGaR0Jai20w3GojFt1o791X4JQWiFBqDxsX0vb73ioUeAzDPXeffm6te+TfC 2BxxiCN7GeIT7tmPzvqhN/WEE2RvJ13hPzEMX4GusRaNOs/vJX123nVtf/v6KiUNzYDa KAnD97DwA6VX/C9FtNmMXdrNIV1pzHt+PByvrBWkPS9WPG1yxPuEW/m+vdP6KS4K+vfE 1etdM8bv5EymHdpMMWX/N3yHAgP+UnF8D8RE9M78XCAXmGkFPqwvJFKyEQg0B+rWH7tx 4iJHUOZNYFNbnz645JQlpNePag4TOquJoC/C/AZMZo6ABO7Xa5i2O4FZsdCVCz3eBPf2 2rmA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IUpcoIh7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-200959-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200959-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d2e1a72fcca58-70242d594cfsi2528406b3a.340.2024.06.04.09.17.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 09:17:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200959-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IUpcoIh7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-200959-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200959-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 0496FB28E87 for ; Tue, 4 Jun 2024 15:32:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 304BF14831F; Tue, 4 Jun 2024 15:30:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IUpcoIh7" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4013E1482FD; Tue, 4 Jun 2024 15:30:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717515035; cv=none; b=BSvap6pa9ByFpLkO4cAVqU+Hxc/0ch3P/zfgLIDLcg+j3dl7yhKmm4f7P0ANEMnhHW0quABqGIMqLZYXdsjuzgwx0ss/A+vtL5MI9zr0132FhOt6N/WMzDzyr9qcJ8VYDUia8W6kg89nlOwp6/WSpkwBZwVTi+uPK2LdZ9LUHmQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717515035; c=relaxed/simple; bh=u9K203DT7q3+ekRSWvUlR+Y9s6vwYEo9Le/NC4TtiN0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MnQZGLaNnTFtjmiYe9PMtUIjWBgody3QluxUXDmxstIQS+Uc4ixhnDFN2OO1K1WjmB67hngrxV9X1NHUKcKZ15h2l0LQrJSvYeK1oQaNenek+KDo72hglG5UuuLUVN3XLLFxBjS3yBbVIO6WSrOSPn23kcnZGq4cleqw6gYK0HU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IUpcoIh7; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B7CDC4AF08; Tue, 4 Jun 2024 15:30:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717515034; bh=u9K203DT7q3+ekRSWvUlR+Y9s6vwYEo9Le/NC4TtiN0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IUpcoIh7jBNWzNEULN+DknncEDnocOAB3IU8XexYFsZOT4cy9MpmkKlJdCBuhtON3 qE7PkgUmc/Kig6KrFA1ViA0TJpRV+t/ZFgnsl29xGTi0C4H/MIarY61fde15w8dJM1 6L5NeRAfByk+hNF2YM/ThZXNfJlp5rUhoZqSMGZIE2KrZCzkrtYyqWodyaKMFpe1ZQ kwaw8m7JsH/XTIlHHl6IfgdwGFVpei9UeQNUjUicB5iDpoJmgaM8bjsqUtEl9Kn9ld imMMKF2zHSo36ZZ0Tysl369TcgrR3FNVAU97dpguqy3GinrW7bY6k/pLEqsIcXOVIb OLn0PYcCoqcbA== Date: Tue, 4 Jun 2024 16:30:28 +0100 From: Simon Horman To: Wei Huang Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, netdev@vger.kernel.org, bhelgaas@google.com, corbet@lwn.net, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, alex.williamson@redhat.com, gospo@broadcom.com, michael.chan@broadcom.com, ajit.khaparde@broadcom.com, somnath.kotur@broadcom.com, andrew.gospodarek@broadcom.com, manoj.panicker2@amd.com, Eric.VanTassell@amd.com, vadim.fedorenko@linux.dev, bagasdotme@gmail.com Subject: Re: [PATCH V2 6/9] PCI/TPH: Retrieve steering tag from ACPI _DSM Message-ID: <20240604153028.GU491852@kernel.org> References: <20240531213841.3246055-1-wei.huang2@amd.com> <20240531213841.3246055-7-wei.huang2@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240531213841.3246055-7-wei.huang2@amd.com> On Fri, May 31, 2024 at 04:38:38PM -0500, Wei Huang wrote: > According to PCI SIG ECN, calling the _DSM firmware method for a given > CPU_UID returns the steering tags for different types of memory > (volatile, non-volatile). These tags are supposed to be used in ST > table entry for optimal results. > > Co-developed-by: Eric Van Tassell > Signed-off-by: Eric Van Tassell > Signed-off-by: Wei Huang > Reviewed-by: Ajit Khaparde > Reviewed-by: Somnath Kotur > Reviewed-by: Andy Gospodarek ... > diff --git a/drivers/pci/pcie/tph.c b/drivers/pci/pcie/tph.c ... > +static bool invoke_dsm(acpi_handle handle, u32 cpu_uid, u8 ph, > + u8 target_type, bool cache_ref_valid, > + u64 cache_ref, union st_info *st_out) > +{ > + union acpi_object in_obj, in_buf[3], *out_obj; > + > + in_buf[0].integer.type = ACPI_TYPE_INTEGER; > + in_buf[0].integer.value = 0; /* 0 => processor cache steering tags */ > + > + in_buf[1].integer.type = ACPI_TYPE_INTEGER; > + in_buf[1].integer.value = cpu_uid; > + > + in_buf[2].integer.type = ACPI_TYPE_INTEGER; > + in_buf[2].integer.value = ph & 3; > + in_buf[2].integer.value |= (target_type & 1) << 2; > + in_buf[2].integer.value |= (cache_ref_valid & 1) << 3; > + in_buf[2].integer.value |= (cache_ref << 32); > + > + in_obj.type = ACPI_TYPE_PACKAGE; > + in_obj.package.count = ARRAY_SIZE(in_buf); > + in_obj.package.elements = in_buf; > + > + out_obj = acpi_evaluate_dsm(handle, &pci_acpi_dsm_guid, MIN_ST_DSM_REV, > + ST_DSM_FUNC_INDEX, &in_obj); Hi Wei Huang, Eric, all, This seems to break builds on ARM (32bit) with multi_v7_defconfig. .../tph.c:221:39: error: use of undeclared identifier 'pci_acpi_dsm_guid' 221 | out_obj = acpi_evaluate_dsm(handle, &pci_acpi_dsm_guid, MIN_ST_DSM_REV, | I suspect a dependency on ACPI in Kconfig is appropriate. > + > + if (!out_obj) > + return false; > + > + if (out_obj->type != ACPI_TYPE_BUFFER) { > + pr_err("invalid return type %d from TPH _DSM\n", > + out_obj->type); > + ACPI_FREE(out_obj); > + return false; > + } ...