Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp333160imu; Tue, 22 Jan 2019 20:06:08 -0800 (PST) X-Google-Smtp-Source: ALg8bN6Y8isv3DcEV1/02gpo9e5LibZIavuTvwhDMB6AAYg4QMAm7VID1bLUest583PwRHkHQESB X-Received: by 2002:a63:fd0a:: with SMTP id d10mr643272pgh.164.1548216368067; Tue, 22 Jan 2019 20:06:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548216368; cv=none; d=google.com; s=arc-20160816; b=Lgv43zaYwuBtG6oi8Jyl4Ljr3uzhg2UfYmm+wbgPuSaeoT3Pyoi21UvcWsYyEhOG8C bv3TKq3cNxBcO6upp64mvnSLiAlW2By2BR9nQYATZfg1MhHUw5Ro0pOLj1CCT/9kWlfC BCdXLkMvltXmWzrPvK0c296V7Y9srCWDFt9eDCrev3mHLMZvlWZCsactRA+4QfLrM5Ek DCnAx9u2ydAqrkArhzWG/Q3hqXWujLa/JSrcb3t+xDc5CCKiyX/+oxusTJv2+Si+c3cM xWh2cBGbGKiYHU2jGATgso5eJQeKzoNWXnvNvsEzQEQaR+JT3rMXL5qgMVYmAQ+aGHQE ZEIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=FlcAyYjA3JCtpXLLsxq/D3xoHfDtdsocCtcw6T/mocI=; b=SaFYvr2X2DZZbuZP7m5fo5r6wdto1fv8NMAKauIzU8riVbDzy1zwVAFV8sYXik4bSN 9vlAa9/4LdGkmokAO1lC094DYIpqkpJAc7Cvn93Mpgtl3cc5mBuHfQxngNXPm8hegq1e p01xqswlIRN//DZSxpGP4UZeohCCCobXZZP1LpvAzeX7b4uFtyD0JnzE/LzG02xRAu8m XnFNJT6dNT7RUgd7+a84T7ZlMpVkK6unAaTmgqzS1zQfaIW3mJ2RK4hC4A/GKIhqi6kC 6y+aA/2oVN2kqSIuw0O8IRfcGQLpIa+/2gVpWQzXnlPM37rXs85BvyhmHvCw6lRY57gc gZyw== 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 e11si18338964pgf.450.2019.01.22.20.05.36; Tue, 22 Jan 2019 20:06:08 -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; 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 S1727010AbfAWEEI (ORCPT + 99 others); Tue, 22 Jan 2019 23:04:08 -0500 Received: from mail.cn.fujitsu.com ([183.91.158.132]:35002 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726964AbfAWEEI (ORCPT ); Tue, 22 Jan 2019 23:04:08 -0500 X-IronPort-AV: E=Sophos;i="5.56,509,1539619200"; d="scan'208";a="52623961" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 23 Jan 2019 12:04:04 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id D963B4C47E9C; Wed, 23 Jan 2019 12:04:02 +0800 (CST) Received: from [10.167.226.60] (10.167.226.60) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 23 Jan 2019 12:04:01 +0800 Subject: Re: question about head_64.S To: "Kirill A. Shutemov" CC: , Thomas Gleixner , Ingo Molnar , , "H. Peter Anvin" , LKML References: <6aebbf86-2ba1-c517-dc47-054279daec49@cn.fujitsu.com> <023da151-bb1d-1b11-ec1d-01eb675d528f@cn.fujitsu.com> <20190122130800.cpfor3klov22badb@kshutemo-mobl1> From: Cao jin Message-ID: <4d4efba6-9b15-4730-b4c4-b70e79a5e6e2@cn.fujitsu.com> Date: Wed, 23 Jan 2019 12:01:23 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20190122130800.cpfor3klov22badb@kshutemo-mobl1> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.167.226.60] X-yoursite-MailScanner-ID: D963B4C47E9C.AA8D5 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: caoj.fnst@cn.fujitsu.com X-Spam-Status: No Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/22/19 9:08 PM, Kirill A. Shutemov wrote: > On Tue, Jan 22, 2019 at 03:31:25PM +0800, Cao jin wrote: >> Hi, Kirll, >> >>> 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? Sure. > >> 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. > Thanks for your info! BTW, could I know how you construct the test environment? I tried centos6, the GCC version is too old to compile; then tried fedora28 with binutils-2.20.51.0.2-5.48.el6.x86_64.rpm from centos6, ld reported errors; and then tried compiling binutils source with tag 2.23, stopped at configure phase:( -- Sincerely, Cao jin