From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D6A3C433E7 for ; Thu, 8 Oct 2020 09:04:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E628221D46 for ; Thu, 8 Oct 2020 09:04:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728555AbgJHJEX (ORCPT ); Thu, 8 Oct 2020 05:04:23 -0400 Received: from mx2.suse.de ([195.135.220.15]:34338 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725890AbgJHJEW (ORCPT ); Thu, 8 Oct 2020 05:04:22 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id AADB8AE95; Thu, 8 Oct 2020 09:04:21 +0000 (UTC) Date: Thu, 8 Oct 2020 11:04:20 +0200 From: Joerg Roedel To: Arvind Sankar Cc: x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/5] x86/boot: Initialize boot_params in startup code Message-ID: <20201008090420.GD3209@suse.de> References: <20201007195351.776555-1-nivedita@alum.mit.edu> <20201007195351.776555-2-nivedita@alum.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201007195351.776555-2-nivedita@alum.mit.edu> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 07, 2020 at 03:53:47PM -0400, Arvind Sankar wrote: > Save the boot_params pointer passed in by the bootloader in > startup_32/64. This avoids having to initialize it in two different > places in C code, and having to preserve SI through the early assembly > code. > > Signed-off-by: Arvind Sankar Nice cleanup! > /* > * Jump to the extracted kernel. > */ > - xorl %ebx, %ebx > + movl boot_params@GOTOFF(%ebx), %esi > jmp *%eax > SYM_FUNC_END(.Lrelocated) > > @@ -209,6 +208,8 @@ SYM_DATA_START_LOCAL(gdt) > .quad 0x00cf92000000ffff /* __KERNEL_DS */ > SYM_DATA_END_LABEL(gdt, SYM_L_LOCAL, gdt_end) > > +SYM_DATA(boot_params, .long 0) > + You should add a comment here that boot_params needs to be in the .data section because in .bss it would get zeroed out again later. Same applies to the 64bit version of this. With that changed: Reviewed-by: Joerg Roedel