Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4699404imu; Tue, 15 Jan 2019 04:37:35 -0800 (PST) X-Google-Smtp-Source: ALg8bN4qTqVhKWNAvXAukea0+Jz4vyTgs/2WSM9M0JJTzQEafjLu1cMUrlGI+xMGCwr+X5bD4M/z X-Received: by 2002:a17:902:7e0d:: with SMTP id b13mr3962134plm.154.1547555855335; Tue, 15 Jan 2019 04:37:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547555855; cv=none; d=google.com; s=arc-20160816; b=OvuGyQJIFwSljIr8QNZuxEKTpHLB0QZ5lxX1xc6e2NaxuVwcuzrBN2hRBxxWwR+rtG FQ+K8QcdC2dE/P6mbEyIIJmXa6dvFdrMSgmE1bYNF0PRkQQLXDF6jm+SK4b54Vsz7o5Y kVYm2/QXbywwq61swsD5mdR36byjL8cE2kpPgim0K8NMex4Yb9AyTPWkjcuyfcXcy04h EomH7Ur600mQ6vWx07gkuRyBk3EoSqaQoBaW/VaUURzLlWqmTFA7APBkZijV+xK/C/wp E+w//vzn0cIyXHORPNNTnDBFXhozwKIjaj++sZsL3FURpcbaxIyRGHNl7W7yJA7RvEEG +pbg== 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:mime-version:user-agent:date:message-id:cc:to :subject:from; bh=Qw82qAjWJwl1LRn500Jrbn4uYKuRt2ERgi+cyxGnpWs=; b=xkljF0Mxnu6PfDmi7M4nri8noIVz6G74VfYoixG4wA5gLVvqzUgrSB6/LEoKlGa3gh idcIgPRLt5AHnOiafY5TLLNA4/1mLCFKSmF3/hAwfj83rrBBnUg2tcFkqPZi5CxOypuD kh9CPnsgWTV6ZFbWQ7Bf8BZhnB3ftT+P5XNTRB2OyEMdhn9041xvszYxXWejMEb/a1/m bkq3AoYlbzj34hEl6WOKB3O6O+SOfvb11wJ/HUkupjVKen3Jghuc5smL+7gbjJnHHdn7 Rk3TlRm8oxQg9k7tOzZqQ3Cv07Dq+O8eOXe5tVWsYYyGkYtiqrYioyRUWLlj9Zk6ncXL n2jg== 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 h3si3199037pgi.391.2019.01.15.04.37.16; Tue, 15 Jan 2019 04:37:35 -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 S1729285AbfAOLor (ORCPT + 99 others); Tue, 15 Jan 2019 06:44:47 -0500 Received: from mail.cn.fujitsu.com ([183.91.158.132]:25872 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727976AbfAOLor (ORCPT ); Tue, 15 Jan 2019 06:44:47 -0500 X-IronPort-AV: E=Sophos;i="5.56,481,1539619200"; d="scan'208";a="52060888" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 15 Jan 2019 19:44:44 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id DF3BB4BAD9B7; Tue, 15 Jan 2019 19:44:41 +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; Tue, 15 Jan 2019 19:44:40 +0800 From: Cao jin Subject: question about head_64.S To: Thomas Gleixner , Ingo Molnar , , "H. Peter Anvin" CC: , LKML Message-ID: <6aebbf86-2ba1-c517-dc47-054279daec49@cn.fujitsu.com> Date: Tue, 15 Jan 2019 19:45:10 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 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: DF3BB4BAD9B7.ABC03 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 Hi, I have been digging into this file for a while, and I still have 2 questions unclear, hope to get your help. 1. At the entry of startup_64, we set all the data segment registers to 0, according to commit 08da5a2ca("x86_64: Early segment setup for VT"), it is said to accelerate the decompression under VT. I don't know Intel VT, but I did test under physical machine and virtual machine(with KVM, and intel VT enabled in BIOS) with following patch: diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S index 58f6a467f1fa..595f3c300173 100644 --- a/arch/x86/boot/compressed/head_64.S +++ b/arch/x86/boot/compressed/head_64.S @@ -260,12 +260,12 @@ ENTRY(startup_64) */ /* Setup data segments. */ - xorl %eax, %eax - movl %eax, %ds - movl %eax, %es - movl %eax, %ss - movl %eax, %fs - movl %eax, %gs +// xorl %eax, %eax +// movl %eax, %ds +// movl %eax, %es +// movl %eax, %ss +// movl %eax, %fs +// movl %eax, %gs I don't see any obvious booting time difference, is there anything I missed? Also, I don't find explicit document saying we should zero these registers under VT. 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. -- Sincerely, Cao jin