From patchwork Sat Feb 3 13:00:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 19884 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp1013206dyc; Sat, 3 Feb 2024 05:19:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IHQqXW9zBFMgYUSWTmW3yK/dm3HZtE9bOa8tPuhLiI95u2YDFr3yK4w2OxKweKrf85rdCyZ X-Received: by 2002:a05:6a20:43a0:b0:19a:f0ef:ffc with SMTP id i32-20020a056a2043a000b0019af0ef0ffcmr2249033pzl.3.1706966373264; Sat, 03 Feb 2024 05:19:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706966373; cv=pass; d=google.com; s=arc-20160816; b=b2ofTa2bcwF2LJZ8GpAdwznobMwygc1Ozl2GPJQEWBzBhLob41ygPFNv7C3grsgZZy UnACwxemjjbdqqj4DwtIIGFGYNWVG5Vm05hQovDy5wUC/GmzBi51l/VtuHWI/XIM5J8K dlfeKU6pAxRxiX0u3wQCWFFXPw98NVLYa1vp0wtPyVRpOrtUrkd00+tfICc4QO42p3Gy r6g71fzgR2R5M9nL318plSDwiklBtbv8BbUScK/KcFGSvVjJh+E2AfyQjJurV7aWpgpL 93KhWdpEtlqTebmgq+p2ewMrNQfFWUjKgzTaJRwFnB3RoVlg4fpLyKTwk5Q1raDpugt8 Z9eQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:from :dkim-signature; bh=zLGxnjYpCjLTzfI0sdSBgA/NQfaVd05u4HzcPzyidiM=; fh=xIuPxno/YrbKnXRnOp6b8SCFXSSqAQIUenmDBFrteaI=; b=retb4iKx8XsDEw+UN+9hYDgnwBUlv6c1BoEgjo+otKHlHeUjEmLrzVsRoglXo9kWdp km95nE1tSIwyUQTD7YQYZaeEFvrhJvM40VLrT3940QyCFWToQG6hsh37HO7Sd1hoks+I 9emWgKeTzKEeDnq/dh9BO1whinde7R8FP7hiUS5P8iJkPMMZZ/eCk9eLSznUX9fYQFPy pTiiCPZxjwverOnkaK3flOaY9/GSszWVYpTIFlEoISoDA8KoG5DvPeDFaIOc6y00aUMM TNjtuZjSx/wqv7nb4+RKuUj41GSU4ynI3jstrs+RWd/mJllT2JNJhxhDH0XIeb0IOzrP ydmw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TZQD6GrF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-51096-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51096-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCU2bci1sofKAgWAunaqzoJrwNZLTPbUbWyyZG2dxSmHGMHxqltmsvab5qWj6k2+gcjzvYudgUxBxo3Sduefw5X8AOd90w== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id e2-20020a63aa02000000b005d8c118be4dsi657822pgf.136.2024.02.03.05.19.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Feb 2024 05:19:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51096-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TZQD6GrF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-51096-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51096-ouuuleilei=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 B457FB26ADC for ; Sat, 3 Feb 2024 13:01:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1952E5EE68; Sat, 3 Feb 2024 13:01:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TZQD6GrF" 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 6907D5D755 for ; Sat, 3 Feb 2024 13:01:25 +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=1706965285; cv=none; b=iciDqNzk5ttRFUpX4J1NchdW9NzyCtbFXNK4Sb94l/Hho6fCplTM1bXPrkVu4n03bX8UmR2zcENSgB2EMll6KsCg7wSxuJG2pNh/huaTOkF0mCZObd/Nj3A/NvWgc1NZfbzZp06CcS5wp7BV1eY/WhTx3wWHzbLXfu71HV7dzjY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706965285; c=relaxed/simple; bh=D3W1AsSUTP+B0YKV6vbmTQlyrvjF0RqEOhYOQor2mtE=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=bTDxCiJY9k4ECDYgfSKAOWXT3sh9eWRaFcrsTkz4hIGTLT22LPD5eHfd5qiHi9RsufXrHelrnH0t69xXPfNxUwSR+sn2BLnKdw4SDmJXuB8K4EONGjQKjFSVrP0zKJQnkshyfYcAt7Iq5G+o7LSQBcR2EOv5EoA4SoOKadRUN6U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TZQD6GrF; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08212C433C7; Sat, 3 Feb 2024 13:01:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706965284; bh=D3W1AsSUTP+B0YKV6vbmTQlyrvjF0RqEOhYOQor2mtE=; h=From:Subject:Date:To:Cc:From; b=TZQD6GrFV2G+xwZX71EaBYFfeSfdGB3xv5QSX1iT2w/cWJKQr9TfHhgxXJvK+k0OQ p30tiZXkajbvu0Cotx7TCw/YeahmB1x5wcQKZyx/0fMthMhpkYZAAGum+h0aHc4TQ3 efeuHLwnYYyMZ6smxwdj/TOXLEUoo6GuoTILRtIfT7zpKBTzdI8t87vBCZeUiDrPVt tt1ozXuMT3WnvJlTehESbwjApoAGAzWT3iJv48JIfnjIXpsg6UX0qs/UEEqw9gnTQw OZ1s1slCiNpSIUU/l6uq3I28eZM1RNJ7opk/QZYpo/9wCzaAAMR9vC0R9d+VAfAFS8 P+uvpyoltIIVQ== From: Mark Brown Subject: [PATCH v2 0/2] arm64/sme: Fix handling of traps on resume Date: Sat, 03 Feb 2024 13:00:39 +0000 Message-Id: <20240203-arm64-sme-resume-v2-0-a1fbaddc4425@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAPc4vmUC/2WNwQ6CMBBEf4Xs2Zrtgo148j8Mh1YWaJRCttpoC P9uJd48Td4k82aByOI5wqlYQDj56KeQgXYFXAcbela+zQyEVKGmWlkZTaXiyEo4PnOUZIw+INX kDOTZLNz516a8NJkHHx+TvLeHpL/tT1bivyxphQrZIDtn9bHtzjeWwPf9JD0067p+AMo2zi+xA AAA To: Catalin Marinas , Will Deacon Cc: Dave Martin , Jackson Cooper-Driver , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Brown X-Mailer: b4 0.13-dev-a684c X-Developer-Signature: v=1; a=openpgp-sha256; l=880; i=broonie@kernel.org; h=from:subject:message-id; bh=D3W1AsSUTP+B0YKV6vbmTQlyrvjF0RqEOhYOQor2mtE=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBlvjkSPyDD4qD02bq9cgLjmNpEkXRhypQErmtqaC0z lcggwOGJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZb45EgAKCRAk1otyXVSH0JkLB/ 4/6+XvC4MH7DTqdY/qRrhW2VVyJp/yA8nn1co9LeZGDg9eAn+Jkg5lcOVe/gI/ERmgtEV2SicTZ5sw vy76JP3CP1E4Pt1WXLJPd18j9VIYAY4ixLV8vp1xa+nGDSXfGUoci7mBRQ37rcQ5mLYNKk7BdXGnEE NbPhUXcNaYiNRM627fqtVCAnv58EYkOX2gqSxYP2c1dVwgQ7OplSahpFU0n8xlv38cYTWsuWrCDV3m 1FN8yjGoF4j08KsMd0oSbajyGyy4OUwJIGooTZx2ClH6Tw/ffMcLhKbDkOq32pvPf3zzZ0tBwdQgWu V60Dj5j2mrpBNlu+xnUhRofEYLgDTp X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789883971685414180 X-GMAIL-MSGID: 1789883971685414180 The fast model was recently changed to reset system registers to 0 on resume, exposing the fact that for SME we do not restore the configuration of traps for extensions that add state. Fix this. Signed-off-by: Mark Brown --- Changes in v2: - Also reinitialise SMPRI_EL1. - Link to v1: https://lore.kernel.org/r/20240130-arm64-sme-resume-v1-0-0e60ebba18df@kernel.org --- Mark Brown (2): arm64/sme: Restore SMCR on exit from suspend arm64/sme: Restore SMCR_EL1.EZT0 on exit from suspend arch/arm64/include/asm/fpsimd.h | 2 ++ arch/arm64/kernel/fpsimd.c | 16 ++++++++++++++++ arch/arm64/kernel/suspend.c | 3 +++ 3 files changed, 21 insertions(+) --- base-commit: 41bccc98fb7931d63d03f326a746ac4d429c1dd3 change-id: 20240129-arm64-sme-resume-3266150292b6 Best regards,