Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp295952rdb; Thu, 18 Jan 2024 04:02:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IHnT1paEJRCBUQt5qAIb4F4RAuOPjbSRYrQ6dXV6TjPerMYkmXjV+tHuEaQUk/j7S8Zf3/x X-Received: by 2002:a05:620a:3946:b0:783:77ab:b370 with SMTP id qs6-20020a05620a394600b0078377abb370mr3155009qkn.71.1705579372716; Thu, 18 Jan 2024 04:02:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705579372; cv=pass; d=google.com; s=arc-20160816; b=rmBIR0YMUw+jhWUV0b1S70TwVJWDWoxLkpD4ZyOu/8k/McmF70K8rOrE+38kN3y/L2 11DxLaK//TKOWnMHX7xFu55R7xZvcIfPyaTvBt+avn53PUd6oAj2OUJiOZMVRmhm8atq B+hSqva8AXQ3O5giWsvLWB2DynRYmJiSTBtkr3ediktxMrJooMu1NQtgFFoNSzqbgz+v MNxNiMaCp4WptGaP+vbmDUkWM8gsC8sWcV/kiFzFTIoS1zej3NgHY0VQubGTwEB3vhkc lQGoHR5gQvboxZ5FJ61Kt17H2uClCGteB7ZgacUr/W+VNN/skqOd6C4MqtN1eAq4kS2r n/yQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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=P0tLb7zh/J9xc6obD1uMWOtg2U5tqExT6rHEuH7NLic=; fh=tPgLdxBWohMW892g3IEQV4u24o1PT73J5Zkz1u/tNs8=; b=FndzQJKXFBgomfKae9fHEoaSBunxb40pNUqDfmuNI27RgvSHV8hw6Z7biN4gVfLbkb 7QQo63T3W5a3riiyHHZBFuaelwN0OKeJd/Ts11V6fHk5DqNLgktLkJfT14EUcnNeN7+d GOJAsUeoZWeNzNbMuWQj+QbWRR3sl2RmmZo9YqxBAhEGcJdxPWZkNm+jdY2Se/hPY+vS BNt7RyVu/bBHzGs56ZL42jGWve0VOvjA/IxoSCvj1I1pza6YQ0P7rYlAra5qpanZt/CO b5qnt8bp8qyarn3YrtmypHvR36ucc3EiHjAjPoWOIbZx9U1OoD6asAPZgag4PnOY6sUO YGjw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oRmSCPG4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-30074-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30074-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id z26-20020a05620a08da00b007835b33c34csi7904136qkz.470.2024.01.18.04.02.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 04:02:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-30074-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oRmSCPG4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-30074-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30074-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 791AD1C2205A for ; Thu, 18 Jan 2024 12:02:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3A8BA24B40; Thu, 18 Jan 2024 12:02:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oRmSCPG4" 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 690D824A18 for ; Thu, 18 Jan 2024 12:02:35 +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=1705579355; cv=none; b=qSzvlVurYzmq0RFXj/6ywSGnlo1u048UKO6xIm1Gs98gVE4ZVa+dUXLysu4wWXPLFPR7Tr33d+oyTpRi8vPN2Msbhin3FcD5ovgCcpEyk+JSE4DjyG76Y8MMFENcHgJkOGTtVP0m9oT0Uk0dVizqF4J9kPjkzP1WWnmvgAIKjzY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705579355; c=relaxed/simple; bh=HkvjrkwPoNggfGuAt0QTtfV2Uq15mf6eeytkNTiLxjg=; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-Id: X-Mailer:In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; b=cPZ1979MBNnv4EJtSE7LlEUylhrX5JnmnA4kKrXDDgWITMJEhuM3+qGHKU+900/sVKH1RzR6OX3tnV6lofCfmvsE/yOmOsSpSY8STlKDeX7ZSGYB1u/QkqDyiUE9JHQzqp1cWYeKiSZackifwmKZ26YMqX3cv4relWPdFULBi8U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oRmSCPG4; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3ADEEC43399; Thu, 18 Jan 2024 12:02:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705579354; bh=HkvjrkwPoNggfGuAt0QTtfV2Uq15mf6eeytkNTiLxjg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oRmSCPG4c8zk/m88wFTLxVBuKiu1pY263ShdpOdSkrEq8baJkg/WmhQF9fZhtNFsY aoENJugJl/Ihb6UdQSugaD+YoLBxn/bfY/qN6MIOjrZFNe8oWP9cHbsXHOswcqGds3 CsTucGDnKdBegk16/NtXEJ5GR/n79AauQaFEgVkfJApmRBqwJYa0kSSI2bsHFRIoVB /sUnN0qHpcvXj4y0lOXflxmxN84B6Hjzabfxw0KxPh3sm70dcVVpWYq3evxlMveE65 UqQ7sW6NGByJhR/zpCOGPl/pV2ild7D9GBoHRvkvfXFzGcykAOgw9Q/JVv4225+ksg q8GemRcNz98+Q== From: Will Deacon To: Oleg Nesterov , Mark Brown , Catalin Marinas Cc: kernel-team@android.com, Will Deacon , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Dave Martin Subject: Re: [PATCH] arm64/ptrace: Don't flush ZA/ZT storage when writing ZA via ptrace Date: Thu, 18 Jan 2024 12:02:24 +0000 Message-Id: <170557585754.3201244.6685336349493300608.b4-ty@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20240115-arm64-fix-ptrace-za-zt-v1-1-48617517028a@kernel.org> References: <20240115-arm64-fix-ptrace-za-zt-v1-1-48617517028a@kernel.org> 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="utf-8" Content-Transfer-Encoding: 8bit On Mon, 15 Jan 2024 18:42:38 +0000, Mark Brown wrote: > When writing ZA we currently unconditionally flush the buffer used to store > it as part of ensuring that it is allocated. Since this buffer is shared > with ZT0 this means that a write to ZA when PSTATE.ZA is already set will > corrupt the value of ZT0 on a SME2 system. Fix this by only flushing the > backing storage if PSTATE.ZA was not previously set. > > This will mean that short or failed writes may leave stale data in the > buffer, this seems as correct as our current behaviour and unlikely to be > something that userspace will rely on. > > [...] Applied to arm64 (for-next/core), thanks! [1/1] arm64/ptrace: Don't flush ZA/ZT storage when writing ZA via ptrace https://git.kernel.org/arm64/c/b7c510d04904 Cheers, -- Will https://fixes.arm64.dev https://next.arm64.dev https://will.arm64.dev