From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 21667 invoked from network); 28 Oct 2020 01:48:28 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 28 Oct 2020 01:48:28 -0000 Received: (qmail 28099 invoked by uid 550); 28 Oct 2020 01:48:26 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 28075 invoked from network); 28 Oct 2020 01:48:25 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hhKhvwDgRdFL4cOIV3FTPj1PxlzzYSX3yb/2jEAEasQ=; b=e1IHR9tDlGQ9YrZh0tPrff3/QgY7sKQptpAmoNgEuwoEzSI2SDsERXRymZig5OB0Ho QNlB4+kCsGEvZ3fVcyq9WYdmlGQQI8/0wouuYP13IldqrMvDe+vP9RSLyS0fmNFqxkpc bpcY4MsCvUG77Y2ut+W4pyw+XeDDAeyL3dvok6BrzyUFw3qVCng+lXROpDVb9H0oSF6k z+rTs3BHomTxVjSHwX4PYNo/Dr5TFiY3xNwvKJJdrjP6q6WLTv55gncavFbfPQb/MNc5 PlCohHt/VHNh2XT25UlB0+5yKt/MX3b5KOiYsa74lob7AXs54GK+eKY6//fSNGp3ExTv 4lFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hhKhvwDgRdFL4cOIV3FTPj1PxlzzYSX3yb/2jEAEasQ=; b=uV+1dvvsikv5+IoQ1BqYxRJoXPTMVN2rICuDDN2YPJBuvaolFXZ14Gd3pD+5j+tt03 0B8l1h23STLqokUmN1LbONhXCvrRxhNXeKFd/SLvT/zrOjYGCtfjTLXxC3at0IDPQj9W lygHafE/qGIQ3sfAQICidmSIerl6c34XVXziWK37teMRNgiSRCfCOrMfUeDBt5ikLhH5 rm+R7p8gcBgzdXn8icvymSBWTkWO0KIy1BL0LeQJXw0NQp/nf6B2LVbjWjoCfp+Q6BbR u3jhZpVxSg3VtIOLkPrfe+6GT4sgnJwcTjGUwALbdvKJY2qpH4DnNByxw5/YXpz6J8el bIYQ== X-Gm-Message-State: AOAM532W1bK0rWsjwknmzHUHSfnjUVGLY+HEL/9jswNSnoUBOHhlZPfm SbR13x7AAhn+NuhSbdmnzLSM/R5kFPxjaa2UD9Z/QtIO X-Google-Smtp-Source: ABdhPJzy5SKpSGgcnXLdyrrPPSlj3/QitE0kzD8JDGwb8j8L3U5/mEhDZBOsIZIrdOXP+OHe7vZRfQA3JMKkqUcSyDU= X-Received: by 2002:a17:906:7a46:: with SMTP id i6mr1861927ejo.65.1603849694007; Tue, 27 Oct 2020 18:48:14 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Patrick Oppenlander Date: Wed, 28 Oct 2020 12:48:02 +1100 Message-ID: To: musl@lists.openwall.com Cc: unicorn_wang Content-Type: text/plain; charset="UTF-8" Subject: Re: [musl] [Question] about arch/riscv64/crt_arch.h On Wed, Oct 28, 2020 at 12:40 PM Chen Wang wrote: > > hi, > I'm reading musl (1.2.1) code for riscv. In arch/riscv64/crt_arch.h, > > __asm__( > ...... > "andi sp, sp, -16\n\t" // <--- why do we need this? > "tail " START "_c" > ); > I'm not familiar with RISC-V, but it's there to guarantee that the stack is 16-byte aligned which must be either an architectural or ABI requirement. Perhaps the kernel can start the process with a more relaxed stack alignment. Otherwise it's there for safety (paranoia). Patrick