Skip to contentSkip to conversation

x86: use invd instead of wbinvd in real mode start code

PATCH New Masahiro Yamada 3 participants 4 messages Jan 8, 2020 – Feb 3, 2020 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: use invd instead of wbinvd in real mode start code

I do not know why the boot code immediately after the system reset should write-back the cache content. I think the cache invalidation should be enough.

I tested this commit with qemu-x86_defconfig, and it worked for me.

---

 arch/x86/cpu/start.S   | 2 +-
 arch/x86/cpu/start16.S | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/cpu/start.S +1 -1
index 01524635e9c8..26cf995db2d0 100644
@@ -50,7 +50,7 @@ _x86boot_start:
 	movl	%cr0, %eax
 	orl	$(X86_CR0_NW | X86_CR0_CD), %eax
 	movl	%eax, %cr0
-	wbinvd
+	invd
 
 	/*
 	 * Zero the BIST (Built-In Self Test) value since we don't have it.
arch/x86/cpu/start16.S +1 -1
index 54f4ff6662a8..292e75050814 100644
@@ -28,7 +28,7 @@ start16:
 	movl	%cr0, %eax
 	orl	$(X86_CR0_NW | X86_CR0_CD), %eax
 	movl	%eax, %cr0
-	wbinvd
+	invd
 
 	/* load the temporary Global Descriptor Table */
 data32 cs	lidt	idt_ptr
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 x86: use invd instead of wbinvd in real mode start code

Quoted 5 lines · Masahiro Yamada

I do not know why the boot code immediately after the system reset should write-back the cache content. I think the cache invalidation should be enough.

Quoted 8 lines

I tested this commit with qemu-x86_defconfig, and it worked for me.

---

 arch/x86/cpu/start.S   | 2 +-
 arch/x86/cpu/start16.S | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
#2 lore raw

PATCH 1/1 x86: use invd instead of wbinvd in real mode start code

In reply to Masahiro Yamada
Quoted 5 lines · Masahiro Yamada

I do not know why the boot code immediately after the system reset should write-back the cache content. I think the cache invalidation should be enough.

Quoted 9 lines

I tested this commit with qemu-x86_defconfig, and it worked for me.

---

 arch/x86/cpu/start.S   | 2 +-
 arch/x86/cpu/start16.S | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
#3 lore raw

PATCH 1/1 x86: use invd instead of wbinvd in real mode start code

Quoted 12 lines · Bin Meng
Quoted 10 lines · Masahiro Yamada

I do not know why the boot code immediately after the system reset should write-back the cache content. I think the cache invalidation should be enough.

I tested this commit with qemu-x86_defconfig, and it worked for me.

---

Quoted 7 lines
Quoted 4 lines
 arch/x86/cpu/start.S   | 2 +-
 arch/x86/cpu/start16.S | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

applied to u-boot-x86, thanks!