From patchwork Fri Feb 23 16:38:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 205514 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp701259dyb; Fri, 23 Feb 2024 08:39:34 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUT5B8wqYeJQWNRuUEvvx3m8jMVRBu4PjuWzj+EEplQznTqGpFglFv6DY2yXnidqIux8eyxckuUtorWqrglg77/3pJlFg== X-Google-Smtp-Source: AGHT+IHkeTcMk39HG+T2WsoMUxhW0j9eXq/IH1tgD9Sx8w3H1ORAQaSupcMhyu38cXemNDaHT4Ap X-Received: by 2002:a05:620a:4712:b0:787:ab87:192a with SMTP id bs18-20020a05620a471200b00787ab87192amr436098qkb.14.1708706373809; Fri, 23 Feb 2024 08:39:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708706373; cv=pass; d=google.com; s=arc-20160816; b=legnm+/0JqC6o6OK1St/GMojFw9Of+0mJILhFoVcpVZWVxUoTWgwbtgM8T72ctoJY7 JFj7OGxBy/PHH+5Hw5y1W5lXifI3i+xtL4+LyLZvDXlRy9N8V1n6MIEVznfV4nnvpHAW Rkb+hmo51fzhhGCWmEms31W2gvg1JpIhRSsv7VyjeL/xxF/Y+6XyVcpyZvmJdcv6V6Iv EX6HV3X+BZhMlrjJbJzvAu1RYTVBt5xnRWXdiknm/htDfDTk9+/EcdhsRklaHjSvrNyg WyrTEvD4VjlU0Xw0DxIDC2+gCGV3+JMY1OMQJ5V/6QpZVDmOKHh6IZkH5Br9b4gB8Kc8 W6EQ== 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:message-id:date :subject:cc:to:from:dkim-signature; bh=C7IobNk7Jd7a0va7/PO6O+eGY+CDzhpYKADAc2SEFm0=; fh=KXjeTIuRiJ4YZ1OKO3vmTVXctArvGHA3NkBLVK9k/cA=; b=bhnhJzC9mB72b7YIccxUZPDHf8RtfKUOFPidORflR7AU2ExdQu9JnghK2eUlQFvtOb zDZvCbiEBMMNaY/e+qqL29vgsksTOWaSgaChiyflRiLkwW4R1nwU+dMivjUSQxpxq1Os El9cx3FR6tvXdlAbFB22MasM70uW1x9TiWQLTbei3Mx7BZJQmFYX2LIqvwFPHCt4ppMA PDIpuSjSb/pIkVYLcK4kIH4IENZONmX+5jpj1eG/EYM1p3KRFktBbT+chpuKQWQhkzJY CZUjoPzpNSa5ZpRX0nTR8uD3tpxvPrvr5nIEFHedaztw7/L05agVIquwvzLli23rtWLM 5rRA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=LeW1JYd4; 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-78741-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78741-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j9-20020a05620a410900b00787bbe4e146si372181qko.374.2024.02.23.08.39.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 08:39:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78741-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=LeW1JYd4; 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-78741-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78741-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 97BB61C238A1 for ; Fri, 23 Feb 2024 16:39:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E410F12A16B; Fri, 23 Feb 2024 16:39:19 +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="LeW1JYd4" Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (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 E641112838F; Fri, 23 Feb 2024 16:39:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.17.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708706357; cv=none; b=qxfzJ5HBnjcSYAHu91y8hv7aZCiuQNJUWb9L+ppMloEG935GATCuuL6Porc2Y+HXQO1+W5klrIPKI4VhhiT4pxkyL8eP3cNoNy8dG5qYRtninc9ydW2RV1sp4seKq278MEe2UAzngcpQKUObO1u3udosR0VewHzHKX8F1lXsPEg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708706357; c=relaxed/simple; bh=wMCc8J1PCY8KB0C8TU2S2VGitU5uhYxb7pS5TWKpv/4=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=m0ywGQ+wYF/c5YBT3yGn4pJa0knmqxISxLYl3038cqoH/QZV/gKp2Au4RhGMLPzIfzwFA7p8C1GskKMYyFxSNG5ojYB9NeTztX51zhiG1Z7DDMlaHtGGeTslbBYCz4SPbF68TtxAoZZSTx/5tYB0Ny0cCrvGE7hDIiFO1cUQnm0= 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=LeW1JYd4; arc=none smtp.client-ip=212.227.17.21 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=1708706344; x=1709311144; i=w_armin@gmx.de; bh=wMCc8J1PCY8KB0C8TU2S2VGitU5uhYxb7pS5TWKpv/4=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=LeW1JYd4sZeYAiv5q6V+9W1F7OPREwHsyP+1oXuEd2SaiJRuO7myQioMtDGAYi2B 4qdLV9XR3wspI8rAu9tQEzAfnpMFLv/stztJP/npHkrwOt4UXeJJgNDlt8Kw0oe8y dA3PXqYPjb6VFZHCfYCxQ/R/z3YyY+y66Fgv3URpuJ5ChAor8mpbo1xrtx2yjF1go 6jzQCoCq/6HcW5US70Y6GVevMAytStgPoT82jL2fYVHPK/36FTkskUywHslNpUoBF ZoJXfOM8yWSQZklUm2S1rNLRuXR4gJl6516Tw3hrHkqLMVcz3NdgXIz9jzoCOxKRP xxje+Kz/hzUJ9F6v3w== 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 (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mv31c-1qmYRs2gwS-00r2Ea; Fri, 23 Feb 2024 17:39:04 +0100 From: Armin Wolf To: Shyam-sundar.S-k@amd.com, mika.westerberg@linux.intel.com Cc: sathyanarayanan.kuppuswamy@linux.intel.com, hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] platform/x86/amd/pmf: Add missing __iomem attribute to policy_base Date: Fri, 23 Feb 2024 17:38:59 +0100 Message-Id: <20240223163901.13504-1-W_Armin@gmx.de> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:g6CwP8ZbyVS4WMdNo0t7gz5el5M8L0xLzd/hWpAiC8OJ9LRzQM8 Vz3TSxFE5BKM92JTfjUnWEh0RI+1DGljTOVADnhg64X9i44y7l/fGMX5WoO7JXZd+A4Kwqd vTiXn0aXuPscJIHIBEiPY3RtidWsnSZVGe86XvOkEFIR9CWUJRRePTjOCozOO2Zr2KCJovY kLPMmlbkOHQsI6S0WkUKw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:2aICjQ/9zTo=;MM8khOtZJ//pj63x0PsCKT0JlmC QWPXzZ/4ipsD84Q/qJLJ/3v0vvMNQgHjpx4UOWi3IZctxVHTJmhpkUNMvB5gYBYtehgBstN0c rDKa7dOhR1Fh/+c68RoiriFHleKmwx26cp9DAG7xlnyNRlbHz/bkqJ1k1Rvpxs4lq5Z2zpayg tfnfVNw6uOVmfPzb/xn4uVQxoJVJMmRHJrmRO6oIqMhWSKVDm/Zp5JMDqOB+WcccFvrUdtEzj TfMjAUSqO7kCrtL5Ngnv8fINP4UHo2/Viu4bg8XyzGM73wtV5Jv2cJgMJWs6e0uPnH+PcRRqs B0pIndmbs6dUGif2ECLVZ8bgEmpb5HeDoaC+eRdj8lF/+oJwdbrbzRlsbj/LVMZC0/ldeBjex 2fSU4Ywri9rD+cINz68PcRW+6wWqC9kLCD4pDPtGfzu0r6mCQF+KkTbO4t87ZzfHKmvzcRK8R QoGkkZR+2W3wH0UTfKbfNlNOZ2QN71SgZpKzcfL5yC0LLD8yKAS8zPEVwrpfFDAgfIDKyz2Ru P6g/X9QhWSHTUbsHqHpS3rqEMHMLdqTpL6hfiWnUkHFKf4veGRjoBFH3klNwZwGOSo+TQERk5 epCx+5TJIalBA+wBTaW0NgMNFgxp1JdXfwfjz/eWY4htc8INkc214WOUbhEnpL1rVea+GpCOf 2FHL0zKjP/ogVAW2FcKzkaqe+CPmWf65FYIojkwXEAWflprkETDUPIfIUb7a2KObnyGPHPwmn Ga2fd0zYfnolaV7N38gGg5pvxvunFbMKTSs/JMyuF9cTVE0/eEX5P4ZH4OH81RWyuZWwXyaDf z3l4Fmb+PtNS+BiDCPWKE1a+Kos7m1byliKnesrJjn+ww= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791708494923823143 X-GMAIL-MSGID: 1791708494923823143 The value of policy_base is the return value of a devm_ioremap call, which returns a __iomem pointer instead of an regular pointer. Add the missing __iomem attribute. Compile-tested only. Signed-off-by: Armin Wolf Reviewed-by: Kuppuswamy Sathyanarayanan --- drivers/platform/x86/amd/pmf/pmf.h | 2 +- drivers/platform/x86/amd/pmf/tee-if.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.39.2 diff --git a/drivers/platform/x86/amd/pmf/pmf.h b/drivers/platform/x86/amd/pmf/pmf.h index 16999c5b334f..bcf777a5659a 100644 --- a/drivers/platform/x86/amd/pmf/pmf.h +++ b/drivers/platform/x86/amd/pmf/pmf.h @@ -229,7 +229,7 @@ struct amd_pmf_dev { struct delayed_work pb_work; struct pmf_action_table *prev_data; u64 policy_addr; - void *policy_base; + void __iomem *policy_base; bool smart_pc_enabled; }; diff --git a/drivers/platform/x86/amd/pmf/tee-if.c b/drivers/platform/x86/amd/pmf/tee-if.c index f8c0177afb0d..16973bebf55f 100644 --- a/drivers/platform/x86/amd/pmf/tee-if.c +++ b/drivers/platform/x86/amd/pmf/tee-if.c @@ -346,7 +346,7 @@ static int amd_pmf_get_bios_buffer(struct amd_pmf_dev *dev) if (!dev->policy_base) return -ENOMEM; - memcpy(dev->policy_buf, dev->policy_base, dev->policy_sz); + memcpy_fromio(dev->policy_buf, dev->policy_base, dev->policy_sz); amd_pmf_hex_dump_pb(dev); if (pb_side_load) From patchwork Fri Feb 23 16:39:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 205516 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp701473dyb; Fri, 23 Feb 2024 08:40:00 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWgbkafpdp7mzNdcpt7IfLUJt+hKPEoFRVCRiUsaae6oCbkTCoIckOkswo1bHyuWHMU9SBLUv3ShxPNJW92FHYWoIkLCw== X-Google-Smtp-Source: AGHT+IEsJZknIvL6RHApdTY2O46X4FeRoXg0YQvqzPFH3OQuU6vqp65mxTVpjXg2y0rkxt798R8U X-Received: by 2002:a17:902:6806:b0:1db:3a0d:1cf9 with SMTP id h6-20020a170902680600b001db3a0d1cf9mr325344plk.48.1708706400474; Fri, 23 Feb 2024 08:40:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708706400; cv=pass; d=google.com; s=arc-20160816; b=SHq8tSBBPnB53iWVldD0QF5dj+KxG77cJIZkGkqFHA+VeHR4zVeppvoHUOmxyJokKp w3bUGsQhbF7YXH1RssPMTgB/V0yRResjXxboIj/Q0PGsqDIwhCaYxDWj9q3RMznl4oab oncqmjopEmsbBb2BOzLlGH+G/3y2PqgMyl0Jkaou2qJFwFKSQUYb/tVissaLS2NMAAG9 rUB7puazVAEBgNQBfYUEIiwenYHvasD+4v/wWumTZ0FhzZDW3JQuSeIp+8UR3xqw3ltE HYXvYY201PawHQ3AK6J7qI6taFOGJQxJPzcFFfV9S9hAYJSWuXygxtfYKZBQrXZ048nl n6uA== 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=IjI2gq+OHXADlg7vHxXarAr8UqSNAiiGMXzxkKduBkg=; fh=KXjeTIuRiJ4YZ1OKO3vmTVXctArvGHA3NkBLVK9k/cA=; b=T2Yq8yPYnXiYCv0Zv+irfGrW+SFnNK5pnwbpxxHyd06SZtPPfgALAt8W4mIw+KmEzm jDo6FQKPeoQI7Kgfgp01hZak3bJzEhgfiy6nlisawKRlMlFnAAOBgeOKn3yo8ZuqI/3J xIrKNibObLJDJ7179CqdPc9xl7gBVMfzyGYS5fpDldiLs0yIiVKH2fRwTBU64sqxX0VW d0TEieni/tVljJPUmR2Q6pwPlmmeK8PszMFl3u91RvDHKBoG3ROy/HuvREvIyX8JUICS BN4ThxwG5LbiPljY0XmoDlL1wujHMQClDwb3+oU82mC7tIbXxxB1ySLHgWZmkSw/jifm Or6g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=tPjW3FS2; 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-78743-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78743-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id lq6-20020a170903144600b001dc04aa3863si8839344plb.473.2024.02.23.08.40.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 08:40:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78743-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=tPjW3FS2; 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-78743-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78743-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id A3F1728468E for ; Fri, 23 Feb 2024 16:39:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7308412836E; Fri, 23 Feb 2024 16:39:22 +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="tPjW3FS2" Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (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 A738012880E; Fri, 23 Feb 2024 16:39:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.17.22 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708706359; cv=none; b=CZF5h5jSHR4YJC5YDqrICiRXIRww6PKjvfNtvNLODN0NjTfRICUbOS7we148/Fi5iVY3hUauEdjB9LVN7HZ58jrz6LgC0usFLGuG2S/9PcQgvJSgKERMYPC14C+QZwvvO2toDc5BjLI7+jjbyhpsG5idlo81Fg1dvuumLCHMGGg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708706359; c=relaxed/simple; bh=sB+n4etd/gtVhOjMb5MrARpzVq6Ad9vcYeHKS2dl2jE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TN0jIjS/Le1Kn0nGz+iGTclQdMreltVdtP8slh2pbgqyNADryfVgbgD+jaS+ptZohsEtT5aEpBPcnfnTaXdhoEC6INwhsjZnP5Efbhge/xt7XfzfyRun+0CgTA6549bUyjN54QnoWiNVghuPjMfTKohgBnAcfNrWI76ntxkRYao= 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=tPjW3FS2; arc=none smtp.client-ip=212.227.17.22 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=1708706346; x=1709311146; i=w_armin@gmx.de; bh=sB+n4etd/gtVhOjMb5MrARpzVq6Ad9vcYeHKS2dl2jE=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=tPjW3FS2Wcx0FFaNwOzqZaUlciLQ8HKYlR40JUHn7ffwlWRmrqMUnhN+M3rqLRwY LjnDJ/E7pjN073KYIA/QxjKrxmemB2sre9FzMjg8AsnntsAaGeKwDyITtikr5EfzJ tIM2ltHVw+frZ9dRHBR6NjkJEafcCNxJgrrUqOj9A8eqnl+luTRV2Ns2ITmtjJuza 1r0ZgfPzmpeVj3Gcah9+tltPplw2wJlfAMM6m+5IgqASUx1eUv7RRnylNM4U6O+V0 xjkhXMmsLAKTKRCOg4RihBLnSx7s04xP1dOLN0Ng+fqpe64UcKaMOEd71zFcCdJCQ YhEnVV61ZLYXE95Mfg== 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 (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MiJVG-1r1UXU00RC-00fSdt; Fri, 23 Feb 2024 17:39:06 +0100 From: Armin Wolf To: Shyam-sundar.S-k@amd.com, mika.westerberg@linux.intel.com Cc: sathyanarayanan.kuppuswamy@linux.intel.com, hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] platform/x86/amd/pmf: Do not use readl() for policy buffer access Date: Fri, 23 Feb 2024 17:39:00 +0100 Message-Id: <20240223163901.13504-2-W_Armin@gmx.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240223163901.13504-1-W_Armin@gmx.de> References: <20240223163901.13504-1-W_Armin@gmx.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:xJrTW73+XmPgXT0JmOHX3IY9eRW5w4Hf+pwHGtsT1qCACiR8frN gTPS+G+Ay6bbBk3+zTVHcg1MOaS3Ns6RNlUb/ZJV4onO1PXadopumSXTDueKSMNo4Yiun1S Vmzq1jqKjnxjCk+3UrdI4A04HvEpsibH/dJY4GiFdCwwlhxUnb+z2bSlymEbsJQZqMoD4Xd IjulV72aNEjn8Z6RrmqQw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:MzZBuO2b4+E=;mfb/AwrUHrNDFLCyDSqO9D2HeKk OkAkJEtvZjiRdsq86qFYfJIIgjMXG8rx3zuQ5KNISyIngYtgG1m2KPV1jdeMrMxrBmNFHDg99 DhAbXCI7EnW8t4uc3erciDda0hY0J891f7mWFzRODgJUatqC6s0CoMt+/vOlqQLnQxSHoDgKh cgcos0fy4JdS/ysooV7gSONuLTvDJ6rvm4RMTKitKLgzsPINDrHytVsT2K3oy5Is+yGBlchiw lkDQwIMFUbt++Hu4bgyr1eowr6/FI6FUjja8CS6PYjs7Trh3jaTNZ7EV5IfV4mEHlGEGY5hCe AK/thW8PEUIpgdR05hmFejvPhd/mrWy4SkD2evwJvUe5+Uglnjzp+HeKht1B0MjsNB6eaUcz6 Huo91B6WHoQ8OVoez8ldTkusElZ3kNrbH/XSzbRLv4W5AcOpV/7QmGvckKt/5PzX3hyo2FI4t DFcm+xDBI7F1VO10Z2lpe5pRN1/++JubrnYqj6BfN6Tm+JCSogK5ZrmUOmMwwFDLADhcdYQ+F x+najwzwNqQHv9wgKKNA0hsX7oGbPL2tBlnYFsqhW6cgtrZe8pcwbxeJZnJx2oDWX6GCHvGvc YYBmNRoP0qqieuLqz0u1VmJqtC2nFMWY0bJXQn3+setmcI+CN+eJ6r+wyJkAmjBR482suxXG1 k7Vxfus1HiIbMMo8n3qJU3fBhn4JjowcCPVP3zjOas8B/MqDxXtwNEmOU9Pl2Y9D7p5tKeQus uWViZwi+7vQiIo/uOcPIrYwzI/SSBP8KjBaZoxvmmhJzANF7ISNy3947jLAOM1F5qrSltm93G sG30GtBUKZ2z6jVL9/XpNAhyO4rz1eLKsIlVrQq+4EuxU= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791708522403725052 X-GMAIL-MSGID: 1791708522403725052 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 --- 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 #include #include +#include #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; From patchwork Fri Feb 23 16:39:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 205515 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp701402dyb; Fri, 23 Feb 2024 08:39:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWOL9jPLekDXK7F8x33pKzPaL5LOBrR6hoomFiUvsbIUkeJvjQ4lJofXRYNUzS3U4w1EFqayJ7qYMtqExjvkFDSSUXNlw== X-Google-Smtp-Source: AGHT+IG+tvYh7zdye1VyVv5yUYQccjLdXJj+PCAuhuNZdMb8j7cFskSeOWAzdlpSzvt6nlEsU39P X-Received: by 2002:a17:906:3510:b0:a3f:b8e0:96d2 with SMTP id r16-20020a170906351000b00a3fb8e096d2mr321609eja.4.1708706390185; Fri, 23 Feb 2024 08:39:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708706390; cv=pass; d=google.com; s=arc-20160816; b=nvUczaUn2BAWhYvYr+w5ykDBo/VNraMDKWd0VhdADq7POtE+tqGm5eG7qscj2WDas0 tKOHoYweJHy31Z6XTKSgKB/79lwDOtZcebeUfdfDBMzAx1YBBoU6Ef5tsTogXoXMx4ig 1yZY9DctDYL0iLZGHgfahP0ezNv8JiQBedOWk4A4PsMrvAF+V4dHL0sQEQCs5E/c3w4x NuuZQf6MbaV5xQCt26ZDspQmsIW/dMfrkxB5YDmfviig/DMCuQ2HrKEC4bSmTpc+C1YW aF+VAzaUm9h3/PcqyBBEFUNrFN4n0okx5yzye7Q97yKnP996crsVJ2bIXu9cq+n7Dnbn 9XoA== 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=Tp+JT9YYfHOzAPbMml4VpkAxfEnq7R4BcbZtIE6tpTw=; fh=KXjeTIuRiJ4YZ1OKO3vmTVXctArvGHA3NkBLVK9k/cA=; b=KuK+5dIEu4bCV7pnRTjBnFestqC+yDbDghzyApiXk5Y7W8sdLiNc+sea9rEqs7HCce A3VLJdRcjii+FmYagDrMuEfAYhmdooOUYqUBQcmg16QRrTqjjMgNYlx9rTgdFiKhoUu0 nq1OP34JlZNY87VeCnq2TyzyaQKN1Xuub3+SeXdKQ9BY4Njhs/puzKnmnj3sc3R6xvt3 opry1ZGdZVLNaRR/z5Z0Q2zgAwEyNUWNW3HVb2Qhjq3f9Mwri/jlbsLh/pp9PBmngUD3 94+3NdQQGuekgrLS6baRZQx81MoFEJEwVuziJ/esRm8bC0V6M7dF7eXkTy8q9PdixPaW 0W4Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=Fz5UPeMu; 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-78742-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78742-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 lf28-20020a170907175c00b00a3eb7b5818dsi4190404ejc.341.2024.02.23.08.39.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 08:39:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78742-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=Fz5UPeMu; 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-78742-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78742-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 C5CD81F238D3 for ; Fri, 23 Feb 2024 16:39:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9AB1712CD81; Fri, 23 Feb 2024 16:39:21 +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="Fz5UPeMu" Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (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 0715C82D74; Fri, 23 Feb 2024 16:39:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.17.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708706359; cv=none; b=MK72e0ocHaIY4fXKj1xVfxLnS1deeoMYxP2JapMxxP50XS6JuLgxsthyBRa9DCkxEe+W2IzZRkd7EHdkDhBsN57UoEgw6QHzIybmbdSrNg2D4m5NzOQ/NHN+MCtWeNA8z8Eq06lxqsakfgW259IZgREMBcY3CuJCXMB2uCtl5Jc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708706359; c=relaxed/simple; bh=Tp+JT9YYfHOzAPbMml4VpkAxfEnq7R4BcbZtIE6tpTw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZbWF+rFdcq3J1OnGmG+DkrITshtWUDuL5jgB2KXUIQFKWF+SW+oNvLz7pAmUeUQfpm9ZcIaapm99+uSpOSI0Yp4/45z4pQe236lG3qLmy4KZGcq1LYqrKQsbRCgx7QGLDyR5UPfjOplQiminfuLdVVwxtd3exrFJx8OWNl99j0M= 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=Fz5UPeMu; arc=none smtp.client-ip=212.227.17.21 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=1708706347; x=1709311147; i=w_armin@gmx.de; bh=Tp+JT9YYfHOzAPbMml4VpkAxfEnq7R4BcbZtIE6tpTw=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=Fz5UPeMuXNv5QzNDMfJu4x4KNgOMzSN4Vf+BmJ6usglyr2bIVcVKMWjpOWkpCks0 fI1b9G6AayYpueC56lRyIDukxB5s6REyzi5E0aqmsP19xnNeHE+29W+xz0c3D0z9E EwUEsPPYPUEWWzjOZ5tTq5kcTWXALp7qoGNPatudUSaSJg1xvAC6cgTeKEZ2KalZH 7EXm1123v5yDqYBShezn7fuJWeOocNi4vPdmvZkpESInm7bn8Iw3qEK38GZF7Qen4 fBXIkGcv/UB8ljb0SlAookmEeIjV6TKgbn3MwTbLgRsKqjdF9pbIHsF0jC7Um/hga nwja84hPH/dVz2m3FQ== 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 (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MvsEx-1qoTzY1EyF-00sxUm; Fri, 23 Feb 2024 17:39:07 +0100 From: Armin Wolf To: Shyam-sundar.S-k@amd.com, mika.westerberg@linux.intel.com Cc: sathyanarayanan.kuppuswamy@linux.intel.com, hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] platform/x86: intel_scu_ipcutil: Make scu static Date: Fri, 23 Feb 2024 17:39:01 +0100 Message-Id: <20240223163901.13504-3-W_Armin@gmx.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240223163901.13504-1-W_Armin@gmx.de> References: <20240223163901.13504-1-W_Armin@gmx.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:lTG5s8N4IywScvenWJgM5TMMrBm9ZKnIeQN06JuVGNny2sW8kex kWoqwXNAWyFVl+CPrC5FrHxJ16MxancwqIfVx0jcbgO2VZLiQTqxVM2X/25xvsQ+Vh87gJj P+AOc4ZytxvkRl7/eKq6ePewBL7xIZz/1+XqDgl5AjSkcFTk3wK6hT2GGD+Mg3QbKQUaYer DHy+BaoPrSJ+vSCC8he7g== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:kE0PH3YImSY=;+aTDFTGVvwEGGX00nQM22OmknxE MgbFC2VaFcSUlCbkvtz+EIhWQyx8IGfjDyIIB54BuDgEHlk+N6jClQnvbW6JHm398WFztdElm AsQXmC380Mo99lxUpx/vZI+aL/dvMoJRB57TV/72ze3FN05agFr5gfcPAMFMDkh6w7imXMuas E7VqE1JRzFzC6MVreFbFqgFQcYWpPPp/GTiKnYCp0yffecaU3kVQKE/v4J9RbB764ZrULsnEI bJu3CKhZstdz0RG2ezgMkLmeXbpYLAOE8uLiWfyEuxFSVyh1dtN6ygGEU5Ah5iCoBpHy2bZ9T s5CBIr7OFIpjmpAzpJi0WCLvllXmTd1Q8Hf8ICVjTH2Hiuj8NLP1vKu9WP8hNCbqf3zAuijjI 62gmsO9Ro1nywLTSTQMaC39AojvCsy2KNitysm+CrTjqJo+eIWNTq9b38jUFAP5U84yfMoFoF Z6SpgjJf9C3edIctcd3q1a1/8mg5rBo4xKxT92ejzNPCKj9vyA9bhuo2o40mSrT8i/cWWuDbC ieBRVOh8m9n15Ju5r9HLCEoys1rz3vCdo/XtOC6Bi6TDAqhCQysmrCJoHXDf8Bjp11BbBF8Kc nV8B+0uIUD6GogbGFw72ipK6iJNNYXZydnSi/D4gXIDlei0Kln4YboymSV57oSA4MxkaxXoOg J0KNw2YEwfoZ4ZKfeTxur5EALLjd8MMpsJ53jw2z/WaC2dd2ZfIKbc/Np5uwR5CHtuG8CJMa6 5zMhguwQgJV8Nv2rhQ+aj3/wIQVHP1NUa5fjNANk9K7X2Bx8rJgPOyT2fs5F46Ac+bnmx0pkP Uq4xwvJhDKQanZRGwGIOocScA+WSpQy3o3/Aj+hHxaUL0= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791708511922358892 X-GMAIL-MSGID: 1791708511922358892 The variable is only used internally and has no external users, so it should me made static. Compile-tested only. Reviewed-by: Kuppuswamy Sathyanarayanan Signed-off-by: Armin Wolf Reviewed-by: Mika Westerberg --- Changes since v1: - remove Fixes tag - add Reviewed-by tag --- drivers/platform/x86/intel_scu_ipcutil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.39.2 diff --git a/drivers/platform/x86/intel_scu_ipcutil.c b/drivers/platform/x86/intel_scu_ipcutil.c index b7c10c15a3d6..7d87cbd4b9c6 100644 --- a/drivers/platform/x86/intel_scu_ipcutil.c +++ b/drivers/platform/x86/intel_scu_ipcutil.c @@ -22,7 +22,7 @@ static int major; -struct intel_scu_ipc_dev *scu; +static struct intel_scu_ipc_dev *scu; static DEFINE_MUTEX(scu_lock); /* IOCTL commands */