Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp151756rwb; Tue, 25 Jul 2023 13:29:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlFEXwljlq9jlpBbqOTMStLgFu3+GoVTV1mtuMt9OeP/VjlKfsS8zHr15hCJRN3OtRCJtHJH X-Received: by 2002:ac2:446b:0:b0:4fe:a2c:24b0 with SMTP id y11-20020ac2446b000000b004fe0a2c24b0mr1469053lfl.26.1690316952957; Tue, 25 Jul 2023 13:29:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690316952; cv=none; d=google.com; s=arc-20160816; b=xOwTmIhSUIkjdkzrJoDCFvZ1Ctuw920PnQTO70QCDFl3Bv3w1j7kTDFOCWsYkbgaEK Mp/bycWSOAlccteo3r6EjyzHP5I+h5ulEaRw0Tk+jMyD22w6mu6IN6aiVUT+M+dy/hXJ shIYcD0Q1RRjsFgFZxeet9RQNK1TWDW2p6fs6xxjIYJXmD/ZQqJW6U9PjxDAzxcC4oi1 5aeG2Tj15b76NdocxgyNZsV7SE7lNPlqspsa3BVdktZbp4/XPWeUz1Hqi1NswmuccQCe DjEbmiDUnFwiuKMveARy3SYHQ57WTl2H/HMAwsgTI4RexgWRbc/yOUwbTnJWWHynmrJU d2Bg== 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:message-id:subject:cc:to:from:date:dkim-signature; bh=v4YHaqFTnygyQkblJpx43RygwEhtDteZIlR91AuBaX0=; fh=+irGckGNh5SKmyq6EK62+m/6DGkQLGUzvIQy3yOY+7Q=; b=JTrHSBfhXysG6JTxA5hCZ/nvDG7Rr2LPMsj7ol2PmCtVxMlFjXA+QxKWQd/Lwn5DH/ SjpYBm6VFSDwd5wPyeDdC/H2LUaUoKfFV11fMvGBOp5FtjYy+5hbiaWaeCJL7RE+kgS8 9+n/2WYH78b71VtuY/qWYSSOMMX/JAZpy6L8CuALitlbaqA/Psf7qznvEEQLw7uIG87q Ry8hbryA8q1QejZS3d6APTwkbVAzswL8zQkCRX0H+I9zLZIImg7l8ZYoh29lJQ/0B+Fq B/f+rpWcxVGGok0fvGyJi609rkMVlf7Ux6RoQFVHNVfgR41qFE7GNHzqMoOI0ZbDPX7Y pOqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gnuweeb.org header.s=default header.b=eoDm3Ym4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnuweeb.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c3-20020a170906d18300b00998f7d25ea7si8410525ejz.815.2023.07.25.13.28.48; Tue, 25 Jul 2023 13:29:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gnuweeb.org header.s=default header.b=eoDm3Ym4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnuweeb.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230520AbjGYSXs (ORCPT + 99 others); Tue, 25 Jul 2023 14:23:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbjGYSXq (ORCPT ); Tue, 25 Jul 2023 14:23:46 -0400 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C9722125; Tue, 25 Jul 2023 11:23:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1690309424; bh=zFYIq3Co+qyjUFECaDvYffNEVwgRI5mFYW9PtEP+uK0=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=eoDm3Ym4Qx5pjUZWAFgCt4ofah1FYk3awUDh+ekYujvpyTGZf52VD+YfR8KyFpVP5 pz6ZEvUN2uLluU9axncC8/Lf7LbFgzXTSJDf30fnPZyD17cRSCpu4pm/BNEByz1CKQ 3Cg3pGCC0GMqrxycvOldTcIg9SNM1VK74SKpvqeZTZB/WckOz1Z4LINyPcCxxKTlwb zJoyVODPj1+WOfjsJbbSkVTGXNqipDa+TbgC2wfZ+BUvHI0+HnySjqhTcgmOSFgVHz 8pWxSGZNisokbnTaoLQhZSMsomiQOs7IATZHe/chNRhD54BEJ8ACyAdvwuTNOQCCNN 65+FXtaNkODkQ== Received: from biznet-home.integral.gnuweeb.org (unknown [182.253.126.67]) by gnuweeb.org (Postfix) with ESMTPSA id C982E24AF9F; Wed, 26 Jul 2023 01:23:41 +0700 (WIB) Date: Wed, 26 Jul 2023 01:23:37 +0700 From: Ammar Faizi To: Zhangjin Wu Cc: Arnd Bergmann , Sven Schnelle , Thomas =?iso-8859-1?Q?Wei=DFschuh?= , Willy Tarreau , Linux Kernel Mailing List , Linux Kselftest Mailing List Subject: Re: [PATCH v1 1/8] tools/nolibc: add support for powerpc Message-ID: References: <20230725170426.58050-1-falcon@tinylab.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230725170426.58050-1-falcon@tinylab.org> X-Bpl: hUx9VaHkTWcLO7S8CQCslj6OzqBx2hfLChRz45nPESx5VSB/xuJQVOKOB1zSXE3yc9ntP27bV1M1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 26, 2023 at 01:04:26AM +0800, Zhangjin Wu wrote: > My old 'reply' is not rigorous, since the syscall6() uses stack to pass > the 6th argument, so, our new syscall.h didn't support it currently, > the syscalls I have tested about "=r" instead of "=a" were only syscall1-5(). Yeah, it won't fit with the new design. i386 runs out of GPRs very quickly. Given that, it had a hard time implementing syscall6() properly in nolibc. The calling convention itself actually doesn't require stack for executing 'int $0x80'. The reason of why it uses stack is because the %ebp register cannot be listed in the clobber list nor in the constraint if -fomit-frame-pointer is not activated. Thus, we have to carefully preserve the value on the stack before using %ebp as the 6-th argument to the syscall. It's a hack to make it work on i386. > Ok, so, with the new syscalls.h proposed, we'd better keep i386 > syscall6() as-is. > > For the left syscall1-5(), is there any risk when use '=r' instead of 'r'? Using "=r" instead of "r" doesn't make sense. Did you mean "=r" instead of "=a"? If that's what you mean: So far I don't see the risk of using "=r" instead of "=a" as long as the variable is properly marked as 'register' + asm("eax"). -- Ammar Faizi