From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 1E11A3858D33 for ; Wed, 19 Apr 2023 15:21:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1E11A3858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681917716; h=from:from:reply-to:subject:subject: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=53fCKRuv6TKu3Vr44nqBwWY5Kzvb0cEaf3Ps375jF/c=; b=IBfsf8NIH/yUUlpkgXd+Y/QdpNYfQmS0dj8L0oi9VI/s6ajhfm3vXjP6zCsaobrnH/jqHG jjxLk0kNSSHfHvnY2yG+7CsgiJSH3V9aFnpZvBtclEcosEEuOQjUbWX5f87G+UFEsbZdVq aYVsCei9exDrIQ9KCMjUKXMZncS5Vbs= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-383-yyNd5gm3M6WolFASNJMkCQ-1; Wed, 19 Apr 2023 11:21:53 -0400 X-MC-Unique: yyNd5gm3M6WolFASNJMkCQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0F2823C10152; Wed, 19 Apr 2023 15:21:53 +0000 (UTC) Received: from oak (unknown [10.22.34.175]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E74914020BF0; Wed, 19 Apr 2023 15:21:52 +0000 (UTC) Date: Wed, 19 Apr 2023 11:21:51 -0400 From: Joe Simmons-Talbott To: Szabolcs Nagy Cc: libc-alpha@sourceware.org Subject: Re: [PATCH v5 2/3] aarch64: Set the syscall register right before doing the syscall. Message-ID: <20230419152151.GG2106608@oak> References: <20230411133004.2268170-1-josimmon@redhat.com> <20230419135821.4113156-1-josimmon@redhat.com> <20230419135821.4113156-3-josimmon@redhat.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, Apr 19, 2023 at 03:56:05PM +0100, Szabolcs Nagy wrote: > The 04/19/2023 09:58, Joe Simmons-Talbott via Libc-alpha wrote: > > --- a/sysdeps/unix/sysv/linux/aarch64/sysdep.h > > +++ b/sysdeps/unix/sysv/linux/aarch64/sysdep.h > > @@ -168,15 +168,26 @@ > > # define HAVE_CLONE3_WRAPPER 1 > > > > # undef INTERNAL_SYSCALL_RAW > > -# define INTERNAL_SYSCALL_RAW(name, nr, args...) \ > > - ({ long _sys_result; \ > > - { \ > > - LOAD_ARGS_##nr (args) \ > > - register long _x8 asm ("x8") = (name); \ > > - asm volatile ("svc 0 // syscall " # name \ > > - : "=r" (_x0) : "r"(_x8) ASM_ARGS_##nr : "memory"); \ > > - _sys_result = _x0; \ > > - } \ > > +# define INTERNAL_SYSCALL_RAW(name, nr, args...) \ > > + ({ long _sys_result; \ > > + { \ > > + LOAD_ARGS_##nr (args) \ > > + if (__builtin_constant_p(name)) \ > > + asm volatile ("mov x8, %1 // syscall " # name "\n" \ > > + "svc 0" \ > > + : "=r" (_x0) \ > > + : "i" (name) ASM_ARGS_##nr \ > > + : "x8", "memory"); \ > > + else \ > > + { \ > > + register long _x8 asm ("x8") = (name); \ > > + asm volatile ("svc 0\n\t" \ > > why \n\t ? > > i don't think that's needed. I'll remove it in v6. Thanks, Joe