Received: by 10.213.65.68 with SMTP id h4csp1111975imn; Wed, 21 Mar 2018 02:59:26 -0700 (PDT) X-Google-Smtp-Source: AG47ELvGOxoHjXb9dxx0ioZxoM9v2F2LbGq4+8GsVCbDLGVCpjHQic+nFrLBef7qcAUt5cGCCLqI X-Received: by 2002:a17:902:bd8e:: with SMTP id q14-v6mr20130360pls.19.1521626366030; Wed, 21 Mar 2018 02:59:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521626365; cv=none; d=google.com; s=arc-20160816; b=etHkTOK1wyKBdR6l7hJ1DJGi9yreyCR3E1LLKEJtV7azV4w5rWPv8YkzAd0PR/R1Mq 9DfjvE7SpNJs5raBsuvU1ZIIdhxLDgRme7qKTuTT9nSxcNUnFlqllWOEKmp4tvJwvWgj YeBLLGrZbt5wCnKXJmCKb1NysKBVJWRrFwjIsIW4E+/IegI+gpWE2XKwCuGJs7WMqHBu a93xo+V1BXEsCee210JhjAdrs1Pl6U8H8CaduAgx/+QxKJNBKNZbugIqeCAGlKj0Kq/H v+JON6T9yBjHDjeMlc63nVnfigjR23eETZpciMakxlfJD+EXKMa5+HWFkz+fimpWDpvO LSqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=69vvej3V0q0HtYMtz0juYukSrHn8k7FBRA4XO3e+AYU=; b=K/tRe2d41WkPQ3SjLsvwwnXQhjJ3hdTYBUB6zGoG2Rf2EUYOPUc3rrZI1V0tETSnPj JDmnhp+AmlygOVesgSFhb3peJqtuwk5o5uIn6r0FD5a4f8GWjDBOKMeszswmH8waxZJD +JaugRHfUeK0G2PfpZsFaGZj63Czmtud7gGwXhw9z4DM/atd8ARcbn6/uKCHi5JXbssE A91kNaKviK5rh2f6XF5A4gLRv6Fu/LzfZ1nCS1i9yf0pWHarOzCPJOhsWlGOAENn0Mc+ 6QbKPdqtWMZ+TjH2PWRmcINBKPJXg6GALrDN0jsuhxI0/V10klORg6ES/Xrb9GwgW5kh U7zQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1si2540709pgq.219.2018.03.21.02.59.12; Wed, 21 Mar 2018 02:59:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751732AbeCUJ6G (ORCPT + 99 others); Wed, 21 Mar 2018 05:58:06 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:36624 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751671AbeCUJ6E (ORCPT ); Wed, 21 Mar 2018 05:58:04 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1eyaVK-0003eQ-DO; Wed, 21 Mar 2018 10:57:58 +0100 Date: Wed, 21 Mar 2018 10:57:58 +0100 (CET) From: Thomas Gleixner To: Cao jin cc: Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: questions about header.S In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-2081520870-1521626278=:3754" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-2081520870-1521626278=:3754 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT On Wed, 21 Mar 2018, Cao jin wrote: > On 03/17/2018 06:01 PM, Cao jin wrote: > >   I find two small questions which confuse me a little. > > > > 1. > > # Check signature at end of setup > > cmpl $0x5a5aaa55, setup_sig > > jne setup_bad > > > > setup_sig is defined in setup.ld, which points to the constant also > > defined in setup.ld, so I don't figure out in which case they don't > > equal and jump to setup_bad? That's a lame sanity check to make sure that nothing overwrote the loader. > > In my test, drop these 2 lines seems fine, system can boot without any > > obvious error. Sure it does as long as you have no corruption. > > 2. > > # Zero the bss > > movw $__bss_start, %di > > movw $_end+3, %cx > > xorl %eax, %eax > > subw %di, %cx > > shrw $2, %cx > > rep; stosl > > > > It is not a big deal, but I think replace "_end" with "__bss_end" make > > more sense, and "_end" is already aligned to word length. And, there is > > no other code use symbol "__bss_end". So I don't know is there any > > reason to use "_end" here? It doesn't matter at all. But its also pointless to change it. Thanks, tglx --8323329-2081520870-1521626278=:3754--