Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2339671pxb; Tue, 23 Feb 2021 04:53:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJx/pZ+lZaiosMshxjfkRNywJXrW7s/UpmxQZ/hFMnpGHjkvKpHurGq8rSIbx6qlq1vSK58S X-Received: by 2002:a17:906:38a:: with SMTP id b10mr26015580eja.438.1614084784818; Tue, 23 Feb 2021 04:53:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614084784; cv=none; d=google.com; s=arc-20160816; b=l9+MB4/NmtGl/pFIUdHRTA5B3fUOFP1dc2l+fVb+DqafuY1wpMmuBnVu7ChcZ2Jxgd 1jJFWoCv1Z2jbsoany7Nsp+lG7yxBK24g+DwlsgCxrh619RAnnb3qFym5ncEUHnCyp5h 5Z1xchJ0t2DjRowgBET+Hw/jQj7U+bZWq15njp+75V/c2E37mAtCFVJbTEeNcpThnBTw EW0jLk2sTaJvV5z/AEY1KwpXQgqw6KTWxJ5mJYjXsDQL5Ctej1vAWYbRhmSD/TigVGJh eJkRTllkxBfWYwdbKRUfzRInAuXmV64C1nuAPJkFXXNn3VOku8mIyKzvqO8pdNv9FIR4 Q3Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=EffLcHzEI3sgFri9iUU2fxbo+cmR2oDgq3oKRnWTsI8=; b=VL7Mv1hHLDlC3E7zhijL3yOAmzumHcKTFbYfOYX23+uqVRZ4lXOSYWfcCeMM+Azni2 822CKIwUQLZrfH8Z1XT2EWw6e0B+BrphYny+KC2WzcmXAuJoYDl6FJQyuK7kbbkgY3Qa U8OmJ/j10I67+8RfCZH6lyIva0oOtoWH8eXcLR+OicWHc4TAgduBU2FI4MopMHaL7A3X 87shsUAUr1E2U/UhGSKpfKSNLRg4AhgenWgh2gnimB7tC6PUcevcfdnmaj2fCKcJisiK VsrJ+WOPeKaTvNbR94OfoH2MFqM4EMI8+IJfh4454i94V20+zEMC0kMBhx2oQNV7ykVD D26w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="cjBbeVP/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y25si13924998edm.396.2021.02.23.04.52.39; Tue, 23 Feb 2021 04:53:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="cjBbeVP/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232520AbhBWMuj (ORCPT + 99 others); Tue, 23 Feb 2021 07:50:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:46364 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232489AbhBWMui (ORCPT ); Tue, 23 Feb 2021 07:50:38 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 69BA464E57; Tue, 23 Feb 2021 12:49:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614084597; bh=ZwLSEkv9ULwVhvjLMFYiYYF1IZnzRSzjqD14ce8PBu0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cjBbeVP/7uB6me5AXmcpsFdhWLGEFEo4pRVzATN5IXf9LyWku5JdSrcNo+aj6d33+ eSVn+VKrSuWhhqTCNo+VfouWMRuDrYhCXbPuiZHHtP2iWwemkbp1BB67YNFK4FM2YK tS2kT+bPAWxEnC+WRM5JPBJGEl/pKk1EhU0djMXC75OpsizpQAjF4oDTArQfWz0L8r 0c0kf1vMPiJ/Zul/attffbAUPVk2Na6Rllv2n28XpQczHbGY8Im5DvAjC7dwHBH/wA Z3jGzr0ixaVG4CXuBujEJk4h3TpsF2bue1eO4Q1tK3Fyu2WHFllv6hqi3AW+pLKub+ KHFfdm6mNslNQ== Date: Tue, 23 Feb 2021 12:49:52 +0000 From: Will Deacon To: Catalin Marinas Cc: Vincenzo Frascino , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, Andrew Morton , Dmitry Vyukov , Andrey Ryabinin , Alexander Potapenko , Marco Elver , Evgenii Stepanov , Branislav Rankov , Andrey Konovalov , Lorenzo Pieralisi Subject: Re: [PATCH v13 4/7] arm64: mte: Enable TCO in functions that can read beyond buffer limits Message-ID: <20210223124951.GA10563@willie-the-truck> References: <20210211153353.29094-1-vincenzo.frascino@arm.com> <20210211153353.29094-5-vincenzo.frascino@arm.com> <20210212172128.GE7718@arm.com> <20210222175825.GE19604@arm.com> <6111633c-3bbd-edfa-86a0-be580a9ebcc8@arm.com> <20210223120530.GA20769@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210223120530.GA20769@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 23, 2021 at 12:05:32PM +0000, Catalin Marinas wrote: > On Tue, Feb 23, 2021 at 10:56:46AM +0000, Vincenzo Frascino wrote: > > On 2/22/21 5:58 PM, Catalin Marinas wrote: > > > We'll still have an issue with dynamically switching the async/sync mode > > > at run-time. Luckily kasan doesn't do this now. The problem is that > > > until the last CPU have been switched from async to sync, we can't > > > toggle the static label. When switching from sync to async, we need > > > to do it on the first CPU being switched. > > > > I totally agree on this point. In the case of runtime switching we might need > > the rethink completely the strategy and depends a lot on what we want to allow > > and what not. For the kernel I imagine we will need to expose something in sysfs > > that affects all the cores and then maybe stop_machine() to propagate it to all > > the cores. Do you think having some of the cores running in sync mode and some > > in async is a viable solution? > > stop_machine() is an option indeed. I think it's still possible to run > some cores in async while others in sync but the static key here would > only be toggled when no async CPUs are left. Just as a general point, but if we expose stop_machine() via sysfs we probably want to limit that to privileged users so you can't DoS the system by spamming into the file. Will