From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5115C432BE for ; Tue, 10 Aug 2021 08:02:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 847B061051 for ; Tue, 10 Aug 2021 08:02:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 847B061051 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xNHswH7KZ7VTQcpLBYhWp8tcuqCDw8mp+3br+8RSBE4=; b=SzkSXmDAiuYZ3a m4rWlcRVq/LPx8s1xTI7wZpiCbnws47wbq3oAkVj0pLjozEtM6czYofE1+DWlwTcsBcMjySeUut+o Ffc2HUqxP0rgQNFHJKMf2POCEu+NkaffgK0eRYvpVAkSO7HOGOlwT1quiL4CPssDZmkPIg5LwvAh5 x7u6IJYO8zmvz3p2Oj6ZQJd9C6153sEsW2gfhJYTeBzD6aeHYn656qs+Z+d4QQFb+xIeyjIBH8Jw3 1rRp7U8LP9hctyBmOmymRMqWz6z7gZlQVYhlmCZa1cYdRQB6Vt+Znu4YC+YO0ji6Wb+9+ShQPTOBx jpj0uTzCwVxcATYKd89w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDMfv-002qza-JH; Tue, 10 Aug 2021 07:59:51 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDMfB-002qdl-Tp for linux-arm-kernel@lists.infradead.org; Tue, 10 Aug 2021 07:59:07 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5492060F11; Tue, 10 Aug 2021 07:59:05 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mDMf9-003zxb-HC; Tue, 10 Aug 2021 08:59:03 +0100 Date: Tue, 10 Aug 2021 08:59:03 +0100 Message-ID: <87h7fxbuig.wl-maz@kernel.org> From: Marc Zyngier To: Oliver Upton Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Rutland , Daniel Lezcano , Thomas Gleixner , Peter Shier , Raghavendra Rao Ananta , Ricardo Koller , Will Deacon , Catalin Marinas , Linus Walleij , kernel-team@android.com Subject: Re: [PATCH 13/13] arm64: Add CNT{P, V}CTSS_EL0 alternatives to cnt{p, v}ct_el0 In-Reply-To: References: <20210809152651.2297337-1-maz@kernel.org> <20210809152651.2297337-14-maz@kernel.org> <87im0ebi9m.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: oupton@google.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, mark.rutland@arm.com, daniel.lezcano@linaro.org, tglx@linutronix.de, pshier@google.com, rananta@google.com, ricarkol@google.com, will@kernel.org, catalin.marinas@arm.com, linus.walleij@linaro.org, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210810_005906_043804_74147FA0 X-CRM114-Status: GOOD ( 28.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 09 Aug 2021 19:17:38 +0100, Oliver Upton wrote: > > On Mon, Aug 9, 2021 at 11:11 AM Marc Zyngier wrote: > > > > On Mon, 09 Aug 2021 17:42:00 +0100, > > Oliver Upton wrote: > > > > > > On Mon, Aug 9, 2021 at 8:48 AM Marc Zyngier wrote: > > > > > > > > CNTPCTSS_EL0 and CNTVCTSS_EL0 are alternatives to the usual > > > > CNTPCT_EL0 and CNTVCT_EL0 that do not require a previous ISB > > > > to be synchronised (SS stands for Self-Synchronising). > > > > > > > > Use the ARM64_HAS_ECV capability to control alternative sequences > > > > that switch to these low(er)-cost primitives. Note that the > > > > counter access in the VDSO is for now left alone until we decide > > > > whether we want to allow this. > > > > > > What remains to be figured out before we add this to the vDSO (and > > > presumably advertise to userspace through some standard convention)? > > > > We need to understand what breaks if we runtime-patch the VDSO just > > like we do with the rest of the kernel. To start with, the debug > > version of the shared object is not the same as the object presented > > to the process. Maybe that's not a problem, but I would tend to err on > > the side of caution. > > I would too, but there sadly are instances of Linux patching *user* > memory already (go look at how KVM/x86 handles the VMCALL/VMMCALL > instruction). But yes, I would much prefer the debug vDSO correspond > to the actual instructions. Urghhh... This reminds me of https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/commit/?h=arm/netwinder&id=72797818a31d37a7ec28db659afcab0a56d47968 which I never tried to get merged for this exact reason. I'd rather not replicate this sort of braindamage^Wthing if I can avoid it. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD3F7C4338F for ; Tue, 10 Aug 2021 07:59:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BEE5C60F13 for ; Tue, 10 Aug 2021 07:59:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237983AbhHJH7n (ORCPT ); Tue, 10 Aug 2021 03:59:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:46954 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237965AbhHJH71 (ORCPT ); Tue, 10 Aug 2021 03:59:27 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5492060F11; Tue, 10 Aug 2021 07:59:05 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mDMf9-003zxb-HC; Tue, 10 Aug 2021 08:59:03 +0100 Date: Tue, 10 Aug 2021 08:59:03 +0100 Message-ID: <87h7fxbuig.wl-maz@kernel.org> From: Marc Zyngier To: Oliver Upton Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Rutland , Daniel Lezcano , Thomas Gleixner , Peter Shier , Raghavendra Rao Ananta , Ricardo Koller , Will Deacon , Catalin Marinas , Linus Walleij , kernel-team@android.com Subject: Re: [PATCH 13/13] arm64: Add CNT{P,V}CTSS_EL0 alternatives to cnt{p,v}ct_el0 In-Reply-To: References: <20210809152651.2297337-1-maz@kernel.org> <20210809152651.2297337-14-maz@kernel.org> <87im0ebi9m.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: oupton@google.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, mark.rutland@arm.com, daniel.lezcano@linaro.org, tglx@linutronix.de, pshier@google.com, rananta@google.com, ricarkol@google.com, will@kernel.org, catalin.marinas@arm.com, linus.walleij@linaro.org, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 09 Aug 2021 19:17:38 +0100, Oliver Upton wrote: > > On Mon, Aug 9, 2021 at 11:11 AM Marc Zyngier wrote: > > > > On Mon, 09 Aug 2021 17:42:00 +0100, > > Oliver Upton wrote: > > > > > > On Mon, Aug 9, 2021 at 8:48 AM Marc Zyngier wrote: > > > > > > > > CNTPCTSS_EL0 and CNTVCTSS_EL0 are alternatives to the usual > > > > CNTPCT_EL0 and CNTVCT_EL0 that do not require a previous ISB > > > > to be synchronised (SS stands for Self-Synchronising). > > > > > > > > Use the ARM64_HAS_ECV capability to control alternative sequences > > > > that switch to these low(er)-cost primitives. Note that the > > > > counter access in the VDSO is for now left alone until we decide > > > > whether we want to allow this. > > > > > > What remains to be figured out before we add this to the vDSO (and > > > presumably advertise to userspace through some standard convention)? > > > > We need to understand what breaks if we runtime-patch the VDSO just > > like we do with the rest of the kernel. To start with, the debug > > version of the shared object is not the same as the object presented > > to the process. Maybe that's not a problem, but I would tend to err on > > the side of caution. > > I would too, but there sadly are instances of Linux patching *user* > memory already (go look at how KVM/x86 handles the VMCALL/VMMCALL > instruction). But yes, I would much prefer the debug vDSO correspond > to the actual instructions. Urghhh... This reminds me of https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/commit/?h=arm/netwinder&id=72797818a31d37a7ec28db659afcab0a56d47968 which I never tried to get merged for this exact reason. I'd rather not replicate this sort of braindamage^Wthing if I can avoid it. Thanks, M. -- Without deviation from the norm, progress is not possible.