[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen/riscv: init bss section


  • To: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 24 Feb 2023 15:56:16 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IHEEUfUF20HxZ5D3lpWO3zDJYtU2QA0Xdgfe/VrBu3Q=; b=SZRCO6KBkFB6xDBPBDpk2SwaazRBnRUflNDrqorK98mkmpHexLHPFex+4fMtH+Vexa6HgJPlo7rzxxM1nHeyQZ5lGSsw28gJjYG9Mi60/Vh2E7Sc/cV2p5TilAiFmLB+m0fkCoVzgHE8o46W8n2nHB2BdTxQfOfFla4+ShU6Sph7qImZWHUVu3Okw6O7yoiWYb8o01Igg1oX2RS7NC0hnpe20DsrKl998p4OnAsQ78A0UgXV1dfJZ3Q7RlcEcRSd4fFBo4JzkW1M1d7qk2p5oJts0UNxqra29+Rfdq9NBRp46mHziSoiaDDUYaKbDtBW9uRYU6w9dqUHmOmK4HswLg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GX35uCpbvwZ5h0EpVlmgTOfcDcXWcv9gfnGclLStyTzqT5f8CYjVR5iwrKLhOpyGPwc/rz9LQd5Yrv5NttKRACj7MomZpcd9g/OBw903iAmgKpjebkvhFJwGGuqbwcYPihL7g0k+J2nSlTCAvzaiTQmcOEEGq1LCFSkwhpzW4vX+m6lohIuTVtXCdYNGkcv2WELoKFa7JxFLB3PvyulHt7Kv6lIeFiueUTDLQQ5jpqa/vsho5JHWhiMc5yTY4GciMEO1zZmKCyAEPFKaszXj9cFKjvC0wx/y7a7Xlylmqi98nDdOsFYy3u/IlOVgsMsVO5yzvZdp0foF8v2583IIdg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Gianluca Guida <gianluca@xxxxxxxxxxxx>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 24 Feb 2023 14:56:29 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 24.02.2023 15:48, Oleksii Kurochko wrote:
> --- a/xen/arch/riscv/setup.c
> +++ b/xen/arch/riscv/setup.c
> @@ -24,6 +24,18 @@ static void test_macros_from_bug_h(void)
>      early_printk("WARN is most likely working\n");
>  }
>  
> +static void __init init_bss(void)
> +{
> +    extern char __bss_start;
> +    extern char __bss_end;

Better use [] and then perhaps omit the & operators further down.
However, I thought we have a compiler warning option in use which
precludes extern declarations which aren't at file scope. Even if
I'm misremembering, perhaps better to move them.

> +    char *bss = &__bss_start;
> +
> +    while ( bss < &__bss_end ) {
> +        *bss = 0;
> +        bss++;
> +    }
> +}

If you're sure you can defer this until being in C code, why not use
memset()?

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.