From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932754AbZLEB0S (ORCPT ); Fri, 4 Dec 2009 20:26:18 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932713AbZLEB0O (ORCPT ); Fri, 4 Dec 2009 20:26:14 -0500 Received: from terminus.zytor.com ([198.137.202.10]:45755 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932703AbZLEB0N (ORCPT ); Fri, 4 Dec 2009 20:26:13 -0500 Message-ID: <4B19B680.9050700@zytor.com> Date: Fri, 04 Dec 2009 17:25:20 -0800 From: "H. Peter Anvin" User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20090922 Fedora/3.0-3.9.b4.fc12 Thunderbird/3.0b4 MIME-Version: 1.0 To: Rakib Mullick , "Cihula, Joseph" , Shane Wang CC: Ingo Molnar , Thomas Gleixner , LKML , x86@kernel.org Subject: Re: [PATCH] x86: Call __va() to get trampoline_base. References: In-Reply-To: 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 12/04/2009 08:26 AM, Rakib Mullick wrote: > x86, tboot: Call __va() to get trampoline_base. > > Do not pass trampoline_base as parameter of virt_to_phys. > Because trampoline_base is in .cpuinit.data section, but its > called from non-cpuinit function. So use __va(TRAMPOLINE_BASE) > instead of trampoline_base, which helps to fix section mismatch. > > We were warned by the following warning: > > LD arch/x86/kernel/built-in.o > WARNING: arch/x86/kernel/built-in.o(.text+0x13c5f): Section mismatch > in reference from the function tboot_setup_sleep() to the variable > .cpuinit.data:trampoline_base > The function tboot_setup_sleep() references > the variable __cpuinitdata trampoline_base. > This is often because tboot_setup_sleep lacks a __cpuinitdata > annotation or the annotation of trampoline_base is wrong. > > Signed-off-by: Rakib Mullick This is a bug, but this isn't the right fix. trampoline.c has: #if defined(CONFIG_X86_64) && defined(CONFIG_ACPI_SLEEP) #define __trampinit #define __trampinitdata #else #define __trampinit __cpuinit #define __trampinitdata __cpuinitdata #endif ... because on i386 we don't use the trampoline for ACPI return. This means one of these is true: - Either we need the AP trampoline for tboot on i386, and the above definition in trampoline.c needs to be fixed; or - The CONFIG_X86_TRAMPOLINE in tboot.c is too generous, and in fact it needs to be set to defined(CONFIG_X86_64) && defined(CONFIG_ACPI_SLEEP) just like the above code. Sending to Joseph and Shane to figure out... -hpa