Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp322325rdb; Thu, 19 Oct 2023 05:48:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF3rXoGt8uORylRaF6/nxYLy0VndZ+wIZWhVX7n309BTXqGyJ/vi8am/1nx6cVDd4t3NQ+3 X-Received: by 2002:a17:902:e843:b0:1c9:b2c1:13a2 with SMTP id t3-20020a170902e84300b001c9b2c113a2mr2634084plg.50.1697719724123; Thu, 19 Oct 2023 05:48:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697719724; cv=none; d=google.com; s=arc-20160816; b=Efo49mR1EFlpAFq35lGF43gHHMmlh0vnBFdU+KZ2FBCuKLs3FHq2sXyyGHspp0KGsR 6Xf4gQZ7u3uVuK0jL7HDi1wACpxjDrmIyJbe8NloVG7s/ixoIm+ganvqDx3YIsoPgBqv YSJ4AmwH0HxvxXuqT+NUEar3IxIF+JQbNUY+F2Ylk+dznbSVtaQKTVEDZsOczcJ2CrPu sGjLTuX/Lr0dGZYxJnvje1VvLUu0QEohx8IL4yv4OSQJIQaVq47OLWbSCqMmT7M6YI1f DwGxFja/kdPboE9LvWb6PMRzzE589Yk9bnkI+ECGISZUCx2q0bpX7Bcb61JT1cwR0r/r tIyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=vZZS7PFDVx3AKmCIBUXkAjn7J/+CmX+2HHETluAokOo=; fh=YElFkqDxIzKQQanb5bRwHpEwnm6kPOq9iTKP1g+/qK8=; b=TecrY/YL4hvUSpUkegUul1T/nV66t1COllqlFzfXAZ07pk0e8dsU89Y5JIl3i9CPmD sas03pFK5XD7aOMZTZR2NdbpEKiRlufz+ZOXMLJIZxxOw7acHATCjwghSBE1Vtsf9GKy UY58G7/bvsOGkpHEdvu8cTSwT1nxFnHqlabJExFoYiYXyrG2F92l/owDvUgUamRKPEsj y7FEPkNWb5kmXVMV4dxtUp14T/a1k1RrF1XuHc5TspXoMmWHBGTJstMZis5Qkg8IPwyc KMfFfKf7oh7MrkCgmeHTwGxLpEoGxG1ExZXTNMVe0QLnZ5TryYJ+LPYlEfpt5OuPdoti 8/TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=E30hlYqF; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id l5-20020a170902f68500b001c9f417f318si2195336plg.585.2023.10.19.05.48.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 05:48:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=E30hlYqF; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 97DFD82B8A7B; Thu, 19 Oct 2023 05:48:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345698AbjJSMse (ORCPT + 99 others); Thu, 19 Oct 2023 08:48:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345635AbjJSMsd (ORCPT ); Thu, 19 Oct 2023 08:48:33 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69543115 for ; Thu, 19 Oct 2023 05:48:31 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 1180A212AE; Thu, 19 Oct 2023 12:48:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1697719710; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vZZS7PFDVx3AKmCIBUXkAjn7J/+CmX+2HHETluAokOo=; b=E30hlYqFmEwX03zGyFnlzrtSfB5ixodN9YhVTeQBT6p3Vz92nGdrXwM8qDFeyFiPtANDaR 4arTSVgVeIsPQ4y4qKNdGzrbRs2X9F17Re2M8Dz1wXm2FiDipl7UfCTLfDaMbt3AvolcA7 vwSHZbjWw13nR++1SQMFgh6qyrwiUDE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1697719710; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vZZS7PFDVx3AKmCIBUXkAjn7J/+CmX+2HHETluAokOo=; b=fdmzPcV42rurEEbMjfguhx7zIiE2J20j4knWOmaAgaCPogMHg2vxri6KOy18xJ9pw3pX7Z vu7FrI61X8yqVJAQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id EEF191357F; Thu, 19 Oct 2023 12:48:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id +ckROZ0lMWXbSQAAMHmgww (envelope-from ); Thu, 19 Oct 2023 12:48:29 +0000 Date: Thu, 19 Oct 2023 14:48:29 +0200 From: Andrea della Porta To: Mark Rutland Cc: Andrea della Porta , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, nik.borisov@suse.com Subject: Re: [PATCH 3/4] arm64/entry-common: Make Aarch32 syscalls' availability depend on aarch32_enabled() Message-ID: Mail-Followup-To: Mark Rutland , Andrea della Porta , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, nik.borisov@suse.com References: <88bdea628a13747bff32c0c3055d6d6ef7264d96.1697614386.git.andrea.porta@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: X-Spam-Score: -10.60 X-Spamd-Result: default: False [-10.60 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-3.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; REPLY(-4.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_SEVEN(0.00)[7]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 19 Oct 2023 05:48:41 -0700 (PDT) On 13:57 Wed 18 Oct , Mark Rutland wrote: > On Wed, Oct 18, 2023 at 01:13:21PM +0200, Andrea della Porta wrote: > > Another major aspect of supporting running of 32bit processes is the > > ability to access 32bit syscalls. Such syscalls can be invoked by > > using the svc instruction. > > > > If Aarch32 emulation is disabled ensure that calling svc results > > in the same behavior as if CONFIG_COMPAT has not been enabled (i.e. > > a kernel panic). > > It's not "emulation" it's directly supported by the hardware. You're right. I also struggled to use this label but I just reused the same name from Nikolai's patchset for x86, in the hope that the option would be more recognizable (something like 'ARCH_emulation' that could be used maybe for other platforms as well), but I agree with you that this is highly misleading. I will change it to something more straightforward. > > > > > Signed-off-by: Andrea della Porta > > --- > > arch/arm64/kernel/entry-common.c | 25 ++++++++++++++++++++++--- > > 1 file changed, 22 insertions(+), 3 deletions(-) > > > > diff --git a/arch/arm64/kernel/entry-common.c b/arch/arm64/kernel/entry-common.c > > index 69ff9b8c0bde..32761760d9dd 100644 > > --- a/arch/arm64/kernel/entry-common.c > > +++ b/arch/arm64/kernel/entry-common.c > > @@ -802,6 +802,11 @@ asmlinkage void noinstr el0t_64_error_handler(struct pt_regs *regs) > > } > > > > #ifdef CONFIG_COMPAT > > +UNHANDLED(el0t, 32, sync_ni) > > +UNHANDLED(el0t, 32, irq_ni) > > +UNHANDLED(el0t, 32, fiq_ni) > > +UNHANDLED(el0t, 32, error_ni) > > IRQ, FIQ, and SError are not syscalls, so the commit title is bad. Agreed. I'll call them exceptions. > > > + > > static void noinstr el0_cp15(struct pt_regs *regs, unsigned long esr) > > { > > enter_from_user_mode(regs); > > @@ -821,6 +826,11 @@ static void noinstr el0_svc_compat(struct pt_regs *regs) > > > > asmlinkage void noinstr el0t_32_sync_handler(struct pt_regs *regs) > > { > > + if (!aarch32_enabled()) { > > + el0t_32_sync_ni_handler(regs); > > + return; > > + } > > Why do we have to do this at all? > > If we don't have AArch32 tasks, these paths are unreachable. Why do we need to > check that they aren't called? > > Mark. Agreed. Please see also my previous comments here: https://lore.kernel.org/lkml/ZTEKabxNdegsbxyv@apocalypse/ https://lore.kernel.org/lkml/ZTD0DAes-J-YQ2eu@apocalypse/ but again, that's only speculative as of now, so we can ignore that part. Andrea