Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 352ABC5479D for ; Mon, 9 Jan 2023 16:12:01 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.473830.734629 (Exim 4.92) (envelope-from ) id 1pEukR-0003lx-DR; Mon, 09 Jan 2023 16:11:43 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 473830.734629; Mon, 09 Jan 2023 16:11:43 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pEukR-0003lq-Ab; Mon, 09 Jan 2023 16:11:43 +0000 Received: by outflank-mailman (input) for mailman id 473830; Mon, 09 Jan 2023 16:11:42 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pEukQ-0003li-AJ for xen-devel@lists.xenproject.org; Mon, 09 Jan 2023 16:11:42 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pEukO-0002GF-KN; Mon, 09 Jan 2023 16:11:40 +0000 Received: from 54-240-197-232.amazon.com ([54.240.197.232] helo=[192.168.1.158]) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pEukO-0001C3-Du; Mon, 09 Jan 2023 16:11:40 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID; bh=ZOnG/ZtCnORamGdA/bymsKSaCteFH1kKCRTB4TBz6Fc=; b=2iQODrpyy6jueEd77l8+s2TNcT DPoHF57QnXVobTXb9OQcl5VWpjvL9OGKadgsjrethnUXZOpUn2OjmdfPfTNws3Z3gY4oOcVZidYPN 70k90J5qLSOT3WplbB+6+Buf3CtC1Xpz1yDuzyNmJK3m9IM4dw1T8U4OScRGTGbJUAvw=; Message-ID: Date: Mon, 9 Jan 2023 16:11:38 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v2 3/8] xen/riscv: introduce stack stuff Content-Language: en-US To: Oleksii Kurochko , xen-devel@lists.xenproject.org Cc: Jan Beulich , Andrew Cooper , Stefano Stabellini , Gianluca Guida , Bob Eshleman , Alistair Francis , Connor Davis References: From: Julien Grall In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, On 09/01/2023 15:46, Oleksii Kurochko wrote: > The patch introduces and sets up a stack in order to go to C environment > > Signed-off-by: Oleksii Kurochko It looks like the comments from Andrew were missed. > --- > Changes in V2: > - introduce STACK_SIZE define. > - use consistent padding between instruction mnemonic and operand(s) > --- > xen/arch/riscv/Makefile | 1 + > xen/arch/riscv/include/asm/config.h | 2 ++ > xen/arch/riscv/riscv64/head.S | 8 +++++++- > xen/arch/riscv/setup.c | 6 ++++++ > 4 files changed, 16 insertions(+), 1 deletion(-) > create mode 100644 xen/arch/riscv/setup.c > > diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile > index 248f2cbb3e..5a67a3f493 100644 > --- a/xen/arch/riscv/Makefile > +++ b/xen/arch/riscv/Makefile > @@ -1,4 +1,5 @@ > obj-$(CONFIG_RISCV_64) += riscv64/ > +obj-y += setup.o > > $(TARGET): $(TARGET)-syms > $(OBJCOPY) -O binary -S $< $@ > diff --git a/xen/arch/riscv/include/asm/config.h b/xen/arch/riscv/include/asm/config.h > index 0370f865f3..bdd2237f01 100644 > --- a/xen/arch/riscv/include/asm/config.h > +++ b/xen/arch/riscv/include/asm/config.h > @@ -43,6 +43,8 @@ > > #define SMP_CACHE_BYTES (1 << 6) > > +#define STACK_SIZE (PAGE_SIZE) > + > #endif /* __RISCV_CONFIG_H__ */ > /* > * Local variables: > diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch/riscv/riscv64/head.S > index 990edb70a0..c1f33a1934 100644 > --- a/xen/arch/riscv/riscv64/head.S > +++ b/xen/arch/riscv/riscv64/head.S > @@ -1,4 +1,10 @@ > .section .text.header, "ax", %progbits > > ENTRY(start) > - j start > + la sp, cpu0_boot_stack > + li t0, STACK_SIZE > + add sp, sp, t0 > + > +_start_hang: > + wfi > + j _start_hang > diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c > new file mode 100644 > index 0000000000..41ef4912bd > --- /dev/null > +++ b/xen/arch/riscv/setup.c > @@ -0,0 +1,6 @@ > +#include > +#include Why do you need to include ? In any case, please order the include alphabetically. I haven't look at the rest of the series. But please go through the series and check that generic comments (like this one) are addressed everywhere. Cheers, -- Julien Grall