diff mbox series

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

Message ID 20200108110844.5655-1-masahiroy@kernel.org
State Accepted
Commit 0d67fac29f3187e67f4fd3ef15f73e91be2fad12
Delegated to: Bin Meng
Headers show
Series x86: use invd instead of wbinvd in real mode start code | expand

Commit Message

Masahiro Yamada Jan. 8, 2020, 11:08 a.m. UTC
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.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

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

Comments

Simon Glass Jan. 30, 2020, 2:17 a.m. UTC | #1
On Wed, 8 Jan 2020 at 04:09, Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> 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.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
>
>  arch/x86/cpu/start.S   | 2 +-
>  arch/x86/cpu/start16.S | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Bin Meng Feb. 3, 2020, 4:41 a.m. UTC | #2
On Wed, Jan 8, 2020 at 7:09 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> 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.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
>
>  arch/x86/cpu/start.S   | 2 +-
>  arch/x86/cpu/start16.S | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Bin Meng Feb. 3, 2020, 4:47 a.m. UTC | #3
On Mon, Feb 3, 2020 at 12:41 PM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> On Wed, Jan 8, 2020 at 7:09 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
> >
> > 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.
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> > ---
> >
> >  arch/x86/cpu/start.S   | 2 +-
> >  arch/x86/cpu/start16.S | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> >
>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> Tested-by: Bin Meng <bmeng.cn@gmail.com>

applied to u-boot-x86, thanks!
diff mbox series

Patch

diff --git a/arch/x86/cpu/start.S b/arch/x86/cpu/start.S
index 01524635e9c8..26cf995db2d0 100644
--- a/arch/x86/cpu/start.S
+++ b/arch/x86/cpu/start.S
@@ -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.
diff --git a/arch/x86/cpu/start16.S b/arch/x86/cpu/start16.S
index 54f4ff6662a8..292e75050814 100644
--- a/arch/x86/cpu/start16.S
+++ b/arch/x86/cpu/start16.S
@@ -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