From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754496AbbFPMq0 (ORCPT ); Tue, 16 Jun 2015 08:46:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54153 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752422AbbFPMqZ (ORCPT ); Tue, 16 Jun 2015 08:46:25 -0400 Message-ID: <55801A9C.9010207@redhat.com> Date: Tue, 16 Jun 2015 14:46:20 +0200 From: Denys Vlasenko User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Pavel Machek CC: Ingo Molnar , Linus Torvalds , Steven Rostedt , Borislav Petkov , "H. Peter Anvin" , Andy Lutomirski , Oleg Nesterov , Frederic Weisbecker , Alexei Starovoitov , Will Drewry , Kees Cook , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] x86, acpi: Eliminate saved_eip References: <1434288190-24993-1-git-send-email-dvlasenk@redhat.com> <20150616100546.GA22928@amd> In-Reply-To: <20150616100546.GA22928@amd> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/16/2015 12:05 PM, Pavel Machek wrote: > >> diff --git a/arch/x86/kernel/acpi/wakeup_32.S b/arch/x86/kernel/acpi/wakeup_32.S >> index 665c6b7..eef2bd3 100644 >> --- a/arch/x86/kernel/acpi/wakeup_32.S >> +++ b/arch/x86/kernel/acpi/wakeup_32.S >> @@ -31,17 +31,11 @@ wakeup_pmode_return: >> >> movl %cs:saved_magic, %eax >> cmpl $0x12345678, %eax >> - jne bogus_magic >> - >> - # jump to place where we left off >> - movl saved_eip, %eax >> - jmp *%eax >> - >> + je ret_point >> bogus_magic: > > Longjump is supposed to flush the prefetch, but hopefully nothing > depends on that detail... ... > > no. > > https://en.wikibooks.org/wiki/X86_Assembly/Protected_Mode#Entering_Protected_Mode > > longjump is supposed to be there. Sorry about that. I guess indirect > jump is not neccessary, and we should add a comment there. What "long jump"? It's not a far (segment:offset) jump, it's a near jump (one which only changes the offset), indirect one through a register. And we aren't switching to or from protected mode here.