Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7376685imu; Tue, 22 Jan 2019 05:09:30 -0800 (PST) X-Google-Smtp-Source: ALg8bN7U0P7NwKH7WqnGOa6sYiKPuE48ksDD9K1uRQDNaMvm58Wvivus+02aHLeO16ZapKwyB68T X-Received: by 2002:a17:902:a50a:: with SMTP id s10mr32711904plq.278.1548162570413; Tue, 22 Jan 2019 05:09:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548162570; cv=none; d=google.com; s=arc-20160816; b=NCp4It+aYLvTLqFwgxFfQR2+kkDh8NxJCIJWkTHAcVVSY0nCxsd0OzEw1I0g5qWmrl +o7U2vFEyv8G5TWrVx8wnh2GmmCwFGZvpHIaTWgPXaIj5XJZpDiOWkKKsr8jPQzFsiiH MeGAn9aqf2lT2FezJlZOkM01BYIUe387Bb/DGp3ed4xCHj01MePtviUMHuY9ij3TVbJd WhskW2t82eA31XbOB4q2PGnQOE0P4TxKJMWEWDdX95BJQQq9o6Z1xPXn1O0ImMCywL5J JJVVN1FRW1H1rGIhLF5Bc9In6slbe232+FDb/6G7D6KGTMgufFn5sZjtP9+145yLAp73 7NuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=4wni7hajAynAQ3IhMurTkKg3VYM8RlUZEkdP4Omy5PU=; b=qgl/KTvk+AnExUAnkAFvyaTBYxlVGcxta/06/HmqW1rMdLLAXv8nR120JXHYk6krpz Jf+ZyOWV2083Z7NbSIom/sdoxs9Kr1xX32Ls88rZBUJFFxgfK5U3jc1bFHbOlTha7FJv jVDWfGr4LD1wSf+1ihc1BYueEManijcmvlwpvm02vmrFHo56+vzqVUhTNtF5ZqvAhiWd qb1lSW1TOExFBZA0TRUnJcLutqtOz0rek5IdsztyPzZHDad/VQ3FO7jzYyPG2vKIX+SD hVoswPeVr4NbTSP8CmCp78M70uN4veK/yXl6FOhCiXKeUT/tSFK9qirMklC/o1l2YvRr oxUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b="a/l+QbVc"; 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 a2si2547406pgm.154.2019.01.22.05.09.13; Tue, 22 Jan 2019 05:09:30 -0800 (PST) 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; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b="a/l+QbVc"; 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 S1728467AbfAVNIG (ORCPT + 99 others); Tue, 22 Jan 2019 08:08:06 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:46692 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728390AbfAVNIG (ORCPT ); Tue, 22 Jan 2019 08:08:06 -0500 Received: by mail-pl1-f195.google.com with SMTP id t13so11449202ply.13 for ; Tue, 22 Jan 2019 05:08:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=4wni7hajAynAQ3IhMurTkKg3VYM8RlUZEkdP4Omy5PU=; b=a/l+QbVclKT3JMyMq2BmvMg/YPvobHaMLHdP5UQMDk3y7BwML7x22ziUZHkU4NR+1m rSd6U0wLYPG3QE7wcXn2Q7/O0tmnMfH9eKQwQq4J3mPEvmncyem9bcA8KsrPR2suE4T6 t+r9ONam+xCnEpHcEKA13ywQTkV9o72xFIydGxqhOqhdyykh3iBDQRu6UMAITDFdXb+x jiTQwfvG167aqpje4UMDx0adCXFAKU01pJpQl28hv0ew43hp6K8V/CRxlopXWYwp/JM1 yR+TD1s0kwAeI1ZTQqvZ1Hh+g6sXkJwq2lxnouBZ5tOhKYxdJIBL1zQHeZHOr4REX14Z 57Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=4wni7hajAynAQ3IhMurTkKg3VYM8RlUZEkdP4Omy5PU=; b=Mh2e05KWlEjGwHA1GmviANhrGS1FoABTBKtzNdVqJA1TiOxSdTOR0yuCeuntPOzSYe QGzZdD2got1aoVcxsvdjmc0UaL6iQDlvW/jgQwpOKc1pKNW4wNT5VQ0DXKgzk8pk9w4U xKg6RtzLlen+fs3xfbEAQqS/tUdn9NWjPKGO8ipeQ56eE2x88OSthlhohSVWQ5klmz7X gozPBcavjSw90nWx5QiAPiwl8C2IEIkCjw7rSob87VP/JcNYKfD/ztINw0BoxP31iFAT WSerdKUyhG+RQ6HKfCp5+brOcp8BpoDm8IpFSdCvG+Ny3WYEuaVnAfQc9bTKbRmvENb6 0/Zg== X-Gm-Message-State: AJcUukcKWoyT1SCtNUoXjHM8YJnont2fEBPBrhWX/qO1abSCsDSvwCLl FKgGZ01aFrXvkFOkkEM9QyS/Nw== X-Received: by 2002:a17:902:ab84:: with SMTP id f4mr33416531plr.207.1548162485428; Tue, 22 Jan 2019 05:08:05 -0800 (PST) Received: from kshutemo-mobl1.localdomain ([192.55.54.40]) by smtp.gmail.com with ESMTPSA id x12sm15370184pgr.55.2019.01.22.05.08.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jan 2019 05:08:04 -0800 (PST) Received: by kshutemo-mobl1.localdomain (Postfix, from userid 1000) id 44869301A3F; Tue, 22 Jan 2019 16:08:00 +0300 (+03) Date: Tue, 22 Jan 2019 16:08:00 +0300 From: "Kirill A. Shutemov" To: Cao jin Cc: kirill.shutemov@linux.intel.com, Thomas Gleixner , Ingo Molnar , bp@alien8.de, "H. Peter Anvin" , LKML Subject: Re: question about head_64.S Message-ID: <20190122130800.cpfor3klov22badb@kshutemo-mobl1> References: <6aebbf86-2ba1-c517-dc47-054279daec49@cn.fujitsu.com> <023da151-bb1d-1b11-ec1d-01eb675d528f@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <023da151-bb1d-1b11-ec1d-01eb675d528f@cn.fujitsu.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 22, 2019 at 03:31:25PM +0800, Cao jin wrote: > Hi, Kirll, > > On 1/15/19 7:45 PM, Cao jin wrote: > > Hi, > > I have been digging into this file for a while, and I still have 2 > > questions unclear, hope to get your help. > > > > > > > 2. > > Why gdt64 has following definition?: > > > > gdt64: > > .word gdt_end - gdt > > .long 0 > > .word 0 > > .quad 0 > > > > obviously, gdt64 stores the GDTR content under x86_64, which is 10 bytes > > long, so why not just: > > > > gdt64: > > .word gdt_end - gdt > > .quad 0 > > > > With above modification, it can boot. > > > > Seems you introduced gdt64 code in commit beebaccd50, could you help > with this question? Looks like you are right. I've got confused at some point. Could you prepare a patch? > And it also remind me of another question about adjust_got which is also > introduced by you. Because I failed to construct a test environment with > ld version less than 2.24 until now, so I wanna do a quick ask here: > does it make sense to adjust GOT from the 4th entry of it? Because as I > know, the first 3 entries are special one, which (I guess) will be not used. No. These 3 entries are reserved for a special symbols (like entry 0 for _DYNAMIC). It means linker should not use these entries for normal symbols, but it doesn't mean that they don't need to be adjusted during the load. -- Kirill A. Shutemov