linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* question about head_64.S
@ 2019-01-15 11:45 Cao jin
  2019-01-15 15:55 ` Thomas Gleixner
  2019-01-22  7:31 ` Cao jin
  0 siblings, 2 replies; 7+ messages in thread
From: Cao jin @ 2019-01-15 11:45 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, bp, H. Peter Anvin; +Cc: kirill.shutemov, LKML

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



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-01-23 10:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-15 11:45 question about head_64.S Cao jin
2019-01-15 15:55 ` Thomas Gleixner
2019-01-16  9:44   ` Cao jin
2019-01-22  7:31 ` Cao jin
2019-01-22 13:08   ` Kirill A. Shutemov
2019-01-23  4:01     ` Cao jin
2019-01-23 10:03       ` Kirill A. Shutemov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).