Message ID | 20240220054513.2832-2-W_Armin@gmx.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-72359-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp209092dyc; Mon, 19 Feb 2024 21:46:09 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV6JXFuZU+f/pS0efi2qGWSr+v6etBxJv0zEdUf+ZI53mvzq+uvz1AN230Y6bcgkrOsCx8jhofGssCitp3pEVs5StemZw== X-Google-Smtp-Source: AGHT+IHfIbKgvGlGxHTycsOydUEE3BXRct9M+91f45swscQ/P2DHF3IvfFLROx8KWxg2K2nuVBmo X-Received: by 2002:a05:6512:3b93:b0:512:8de5:2170 with SMTP id g19-20020a0565123b9300b005128de52170mr10002554lfv.38.1708407969109; Mon, 19 Feb 2024 21:46:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708407969; cv=pass; d=google.com; s=arc-20160816; b=RHjfRP4nn/LTrGLGMvmq9dTKxpZQKUKUb0FNniGzUPSB4ijMKQgCjxvtl4ILCHmdGN iSuo3x1bxkgl4kBvRL/S4rucmmwfYIRKuExabFP4CbKig/gLT0v7yOLJ99E37JdZ7MhB bAMG1+KV/lydSkenmVf1+RwHL7Ox+wTKMAOxHx5axB0oR/cN7x7a53ZHVwgUoqkd3GA8 Mm1IoUGYZad/zQF1hjuqJq/Gztmaa8iJB6VZ/IiHI6g0IzTGCerJEFQdLkzH8glaVvyF +46CP7ClzMYS/tJ6DssqqSYmfDR9OKlX05Ns3JDBC3LbIZoh35m5lo6a4apkZAHOzhkx pC4Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=LtQM/3AaqLKs073FGuPfyUwoandzlH35Lk1qD/bAiek=; fh=xt+np4dF0xGbpP4oQizzbfrKzEKFlIEn9yOJU2r58TM=; b=QdM6VUMn5mbZh02fNcO2qu8XOIMS4WtX6R/ylB0TqfFkDXnqxE1isQP3KCLBiQ5vwm Qzb4rGxkucjq6KAJeH83Hz2hdBUTYb2EfZuXc0+5ubZeTCycyWwwGttoWwEl5nr8v6rh +Cw8uNwrL0bMfwQdm4ap7IxU9EMSUqzcv9NtaBAGX2hpJY8k6TBFmLwTMJ4MicEwTVct vPvXRglrI2oLqGQghTrZzJa0FEFxgBgIiNwuyDzGB6bANpMLlfomLichlFXRodFUA6FF vMe5OFWJmQWzeV0aV/yHk+m8ypwb8KrxUo2AfXW5rDiPR67lvB+x6mVspTsTi8T0ZLHV pruw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=TrwHiWqO; arc=pass (i=1 spf=pass spfdomain=gmx.de dkim=pass dkdomain=gmx.de dmarc=pass fromdomain=gmx.de); spf=pass (google.com: domain of linux-kernel+bounces-72359-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72359-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id hg8-20020a170906f34800b00a3ed01674f5si950766ejb.732.2024.02.19.21.46.08 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 21:46:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72359-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=TrwHiWqO; arc=pass (i=1 spf=pass spfdomain=gmx.de dkim=pass dkdomain=gmx.de dmarc=pass fromdomain=gmx.de); spf=pass (google.com: domain of linux-kernel+bounces-72359-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72359-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 931251F228F1 for <ouuuleilei@gmail.com>; Tue, 20 Feb 2024 05:46:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2CADA58ACF; Tue, 20 Feb 2024 05:45:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b="TrwHiWqO" Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (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 E2FE456B9C; Tue, 20 Feb 2024 05:45:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708407935; cv=none; b=lXop87aWgSfs4LDCCFwi76BUN/F27/CUv9z/ev9dGGq2/yE6cR4JKUuXczyPSnyFpRN5dw7Jm1y2VwFoR6h4NjSbEUdNWKy5w/nzapW7f29wFvo6Mr4XQUR44ndGOLnjAOrNeebWg1FA0NmjpVheDiPAFAP5yUCutdYQWzJb5Xk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708407935; c=relaxed/simple; bh=EOUDer5qk9/zoxzi1igP61wAaiJrJ+Ygu/OKnKKEOVI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WDL446HPRX3NHbwAOvphh8SvlnEr56WKJwcDvyqMtI2WprlZsAcbR/KEsRXPuDkgR/FgoegQbl2Vd3QEIVN/kBT8UMI45eGztNGwcxcH4Z1qmKWsdyG3T4JAAEf3Y7yQeFP5GkPRHFUk4N86rHfjpWCUOJn2i35BM6I7f0KuQQ0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b=TrwHiWqO; arc=none smtp.client-ip=212.227.15.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1708407920; x=1709012720; i=w_armin@gmx.de; bh=EOUDer5qk9/zoxzi1igP61wAaiJrJ+Ygu/OKnKKEOVI=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=TrwHiWqOqX2cpbBaE+ZAsxJrN/YGkjBLqcGVYKuAn+x13lFKmt/E7v74QpyGFX++ x+4iASOJnblW/nWYXSrLKrLHEGuXGlEq3f/r8tRikhUCTndXE4ufWO05Mtj9pHd/5 v5dlHWfCDK1aZyNiCf9NICFi8E2cOng0nLI7cZvqnnB5Cp8grLDfAS2oKhGcJiyv5 VhEFxxwIdJTKRgyqyJcxXWjsJcsPuXicf4nFGgbbIheleOvcMLUJpEVYU0TblJRWy N9wyLTzxVUzvj0JxsUtvKcbtky2CFy473MuqZL0dKC79+S2XYBngPFoziD9i5Eqlx dNjnoVohUcI/c9cPFQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from mx-amd-b650.users.agdsn.de ([141.30.226.129]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MOREi-1rHzpu2uMw-00Putm; Tue, 20 Feb 2024 06:45:20 +0100 From: Armin Wolf <W_Armin@gmx.de> To: Shyam-sundar.S-k@amd.com, mika.westerberg@linux.intel.com Cc: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] platform/x86/amd/pmf: Do not use readl() for policy buffer access Date: Tue, 20 Feb 2024 06:45:12 +0100 Message-Id: <20240220054513.2832-2-W_Armin@gmx.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240220054513.2832-1-W_Armin@gmx.de> References: <20240220054513.2832-1-W_Armin@gmx.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:SyimU/oU4LVCuHbt58JTQgUNmqeE86uN4FHY9gZeuyC1388IYJf F42AV8S3/ztnTnQ3LUomiqNKoGgY30JN4zSZTvq3yvUmKmPARltjba8fJ4s2FDwLjneDnqW IkVb/J51EOBlsKE1Jv3BUpQghL08Zrj93S8bb32yrNWQwoo5QGF9OCQzN4yD+u/y2W0iJ50 6zZtNfUwIg++lWY9RYQjw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:9mDdGKpSQWw=;FZUCS8i+sySI+qn939HZXC7F9jt XQZ/HXICIrSQYIQpfT4EounJf+Sa/W3Ql0bp4L+s7vUiuSAgmT0Lpt2dHFsulOul3bohA6uln t+WPZOLoSTFR8Lu/cJgikCh+OWF2G7K2HFy71sRhYJ/Fb9dC/tBV7DZp7iVGykkqfyPRDHxvK 2/YWQ/GAMOB1Sx/K9VwGklT+3qyMDJtsxbH3uNX3O+KyxWrnClh7rhymditKgnnIsGYQBxNER +LuibJqnhiJQy9z4pgR2/ODmSEZYkJYNXEaccIe3Q7yN0Daz3YxdyUuCZWLNh9ZBwSQ+wACf4 OSCK9RvJiVmOuDgZdCHd2+gu/1z4kPxP4j1O5+GxUheS4vi1U1kPsB9LE5WgvNypCpE/9QB7S K4zvYBwB+LKNNjGaVBHsqNFblgv3OFSBRnRrh3RT8kuK2RXbJbSoGH9xztnws/t3s5r4mut7P OrdZQ8jRqCYAH39i6BlT4/5Z+D/MvuBSJkw1V3SiS08SweyEchMbvtubPSM34Cu+uozYE5Apq fi9ivaW1ewcueyJ9zv7t/YZnlLnQYjpGY3lisfSYXDfjfJcGT3EQUuZp6ljbYrQqceGIz42BF NxUZEVD6pyBjgAQfDdLz/VUzDEH4RBUXSqPTsiwAJUs+IuDFSI9f6r6AyugZLJuNLfsTnJwEO Hv36fnd8Ahkt80VPylRCgMue67f16SKLaDfDOyW3DYmX8SfB59731gqBilvNoYA4LuweHxi46 usNrzRDrTCIva8wSsMk0V/sQ7f+UUl4pNA5jYalmDAc4hHuQAQ4DNN8aUMc7X7I4s4Op48FHg 1WFAd+ip1tVR2m4fD/xcnqx9Y4xk7/U0sglXU7+k9F0SY= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791395594289881157 X-GMAIL-MSGID: 1791395594289881157 |
Series |
[1/3] platform/x86/amd/pmf: Add missing __iomem attribute to policy_base
|
|
Commit Message
Armin Wolf
Feb. 20, 2024, 5:45 a.m. UTC
The policy buffer is allocated using normal memory allocation
functions, so readl() should not be used on it.
Use get_unaligned_le32() instead.
Compile-tested only.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
drivers/platform/x86/amd/pmf/tee-if.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--
2.39.2
diff --git a/drivers/platform/x86/amd/pmf/tee-if.c b/drivers/platform/x86/amd/pmf/tee-if.c index 16973bebf55f..3220b6580270 100644 --- a/drivers/platform/x86/amd/pmf/tee-if.c +++ b/drivers/platform/x86/amd/pmf/tee-if.c @@ -11,6 +11,7 @@ #include <linux/debugfs.h> #include <linux/tee_drv.h> #include <linux/uuid.h> +#include <asm/unaligned.h> #include "pmf.h" #define MAX_TEE_PARAM 4 @@ -249,8 +250,8 @@ static int amd_pmf_start_policy_engine(struct amd_pmf_dev *dev) u32 cookie, length; int res; - cookie = readl(dev->policy_buf + POLICY_COOKIE_OFFSET); - length = readl(dev->policy_buf + POLICY_COOKIE_LEN); + cookie = get_unaligned_le32(dev->policy_buf + POLICY_COOKIE_OFFSET); + length = get_unaligned_le32(dev->policy_buf + POLICY_COOKIE_LEN); if (cookie != POLICY_SIGN_COOKIE || !length) return -EINVAL;