All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Andi Kleen <andi@firstfloor.org>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org, mmarek@suse.cz,
	linux-kbuild@vger.kernel.org, JBeulich@suse.com,
	akpm@linux-foundation.org, Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH 53/74] x86, lto, paravirt: Make paravirt thunks global
Date: Sun, 19 Aug 2012 01:27:00 -0700	[thread overview]
Message-ID: <5030A354.7000109@goop.org> (raw)
In-Reply-To: <1345345030-22211-54-git-send-email-andi@firstfloor.org>

On 08/18/2012 07:56 PM, Andi Kleen wrote:
> From: Andi Kleen <ak@linux.intel.com>
>
> The paravirt thunks use a hack of using a static reference to a static
> function to reference that function from the top level statement.
>
> This assumes that gcc always generates static function names in a specific
> format, which is not necessarily true.
>
> Simply make these functions global and asmlinkage. This way the
> static __used variables are not needed and everything works.

I'm not a huge fan of unstaticing all this stuff, but it doesn't
surprise me that the current code is brittle in the face of gcc changes.

    J

>
> Changed in paravirt and in all users (Xen and vsmp)
>
> Cc: jeremy@goop.org
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> ---
>  arch/x86/include/asm/paravirt.h |    2 +-
>  arch/x86/kernel/vsmp_64.c       |    8 ++++----
>  arch/x86/xen/irq.c              |    8 ++++----
>  arch/x86/xen/mmu.c              |   16 ++++++++--------
>  4 files changed, 17 insertions(+), 17 deletions(-)
>
> diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
> index a0facf3..cc733a6 100644
> --- a/arch/x86/include/asm/paravirt.h
> +++ b/arch/x86/include/asm/paravirt.h
> @@ -804,9 +804,9 @@ static __always_inline void arch_spin_unlock(struct arch_spinlock *lock)
>   */
>  #define PV_CALLEE_SAVE_REGS_THUNK(func)					\
>  	extern typeof(func) __raw_callee_save_##func;			\
> -	static void *__##func##__ __used = func;			\
>  									\
>  	asm(".pushsection .text;"					\
> +	    ".globl __raw_callee_save_" #func " ; "			\
>  	    "__raw_callee_save_" #func ": "				\
>  	    PV_SAVE_ALL_CALLER_REGS					\
>  	    "call " #func ";"						\
> diff --git a/arch/x86/kernel/vsmp_64.c b/arch/x86/kernel/vsmp_64.c
> index 992f890..f393d6d 100644
> --- a/arch/x86/kernel/vsmp_64.c
> +++ b/arch/x86/kernel/vsmp_64.c
> @@ -33,7 +33,7 @@
>   * and vice versa.
>   */
>  
> -static unsigned long vsmp_save_fl(void)
> +asmlinkage unsigned long vsmp_save_fl(void)
>  {
>  	unsigned long flags = native_save_fl();
>  
> @@ -43,7 +43,7 @@ static unsigned long vsmp_save_fl(void)
>  }
>  PV_CALLEE_SAVE_REGS_THUNK(vsmp_save_fl);
>  
> -static void vsmp_restore_fl(unsigned long flags)
> +asmlinkage void vsmp_restore_fl(unsigned long flags)
>  {
>  	if (flags & X86_EFLAGS_IF)
>  		flags &= ~X86_EFLAGS_AC;
> @@ -53,7 +53,7 @@ static void vsmp_restore_fl(unsigned long flags)
>  }
>  PV_CALLEE_SAVE_REGS_THUNK(vsmp_restore_fl);
>  
> -static void vsmp_irq_disable(void)
> +asmlinkage void vsmp_irq_disable(void)
>  {
>  	unsigned long flags = native_save_fl();
>  
> @@ -61,7 +61,7 @@ static void vsmp_irq_disable(void)
>  }
>  PV_CALLEE_SAVE_REGS_THUNK(vsmp_irq_disable);
>  
> -static void vsmp_irq_enable(void)
> +asmlinkage void vsmp_irq_enable(void)
>  {
>  	unsigned long flags = native_save_fl();
>  
> diff --git a/arch/x86/xen/irq.c b/arch/x86/xen/irq.c
> index 1573376..3dd8831 100644
> --- a/arch/x86/xen/irq.c
> +++ b/arch/x86/xen/irq.c
> @@ -21,7 +21,7 @@ void xen_force_evtchn_callback(void)
>  	(void)HYPERVISOR_xen_version(0, NULL);
>  }
>  
> -static unsigned long xen_save_fl(void)
> +asmlinkage unsigned long xen_save_fl(void)
>  {
>  	struct vcpu_info *vcpu;
>  	unsigned long flags;
> @@ -39,7 +39,7 @@ static unsigned long xen_save_fl(void)
>  }
>  PV_CALLEE_SAVE_REGS_THUNK(xen_save_fl);
>  
> -static void xen_restore_fl(unsigned long flags)
> +asmlinkage void xen_restore_fl(unsigned long flags)
>  {
>  	struct vcpu_info *vcpu;
>  
> @@ -66,7 +66,7 @@ static void xen_restore_fl(unsigned long flags)
>  }
>  PV_CALLEE_SAVE_REGS_THUNK(xen_restore_fl);
>  
> -static void xen_irq_disable(void)
> +asmlinkage void xen_irq_disable(void)
>  {
>  	/* There's a one instruction preempt window here.  We need to
>  	   make sure we're don't switch CPUs between getting the vcpu
> @@ -77,7 +77,7 @@ static void xen_irq_disable(void)
>  }
>  PV_CALLEE_SAVE_REGS_THUNK(xen_irq_disable);
>  
> -static void xen_irq_enable(void)
> +asmlinkage void xen_irq_enable(void)
>  {
>  	struct vcpu_info *vcpu;
>  
> diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
> index b65a761..9f82443 100644
> --- a/arch/x86/xen/mmu.c
> +++ b/arch/x86/xen/mmu.c
> @@ -429,7 +429,7 @@ static pteval_t iomap_pte(pteval_t val)
>  	return val;
>  }
>  
> -static pteval_t xen_pte_val(pte_t pte)
> +asmlinkage pteval_t xen_pte_val(pte_t pte)
>  {
>  	pteval_t pteval = pte.pte;
>  #if 0
> @@ -446,7 +446,7 @@ static pteval_t xen_pte_val(pte_t pte)
>  }
>  PV_CALLEE_SAVE_REGS_THUNK(xen_pte_val);
>  
> -static pgdval_t xen_pgd_val(pgd_t pgd)
> +asmlinkage pgdval_t xen_pgd_val(pgd_t pgd)
>  {
>  	return pte_mfn_to_pfn(pgd.pgd);
>  }
> @@ -477,7 +477,7 @@ void xen_set_pat(u64 pat)
>  	WARN_ON(pat != 0x0007010600070106ull);
>  }
>  
> -static pte_t xen_make_pte(pteval_t pte)
> +asmlinkage pte_t xen_make_pte(pteval_t pte)
>  {
>  	phys_addr_t addr = (pte & PTE_PFN_MASK);
>  #if 0
> @@ -512,14 +512,14 @@ static pte_t xen_make_pte(pteval_t pte)
>  }
>  PV_CALLEE_SAVE_REGS_THUNK(xen_make_pte);
>  
> -static pgd_t xen_make_pgd(pgdval_t pgd)
> +asmlinkage pgd_t xen_make_pgd(pgdval_t pgd)
>  {
>  	pgd = pte_pfn_to_mfn(pgd);
>  	return native_make_pgd(pgd);
>  }
>  PV_CALLEE_SAVE_REGS_THUNK(xen_make_pgd);
>  
> -static pmdval_t xen_pmd_val(pmd_t pmd)
> +asmlinkage pmdval_t xen_pmd_val(pmd_t pmd)
>  {
>  	return pte_mfn_to_pfn(pmd.pmd);
>  }
> @@ -578,7 +578,7 @@ static void xen_pmd_clear(pmd_t *pmdp)
>  }
>  #endif	/* CONFIG_X86_PAE */
>  
> -static pmd_t xen_make_pmd(pmdval_t pmd)
> +asmlinkage pmd_t xen_make_pmd(pmdval_t pmd)
>  {
>  	pmd = pte_pfn_to_mfn(pmd);
>  	return native_make_pmd(pmd);
> @@ -586,13 +586,13 @@ static pmd_t xen_make_pmd(pmdval_t pmd)
>  PV_CALLEE_SAVE_REGS_THUNK(xen_make_pmd);
>  
>  #if PAGETABLE_LEVELS == 4
> -static pudval_t xen_pud_val(pud_t pud)
> +asmlinkage pudval_t xen_pud_val(pud_t pud)
>  {
>  	return pte_mfn_to_pfn(pud.pud);
>  }
>  PV_CALLEE_SAVE_REGS_THUNK(xen_pud_val);
>  
> -static pud_t xen_make_pud(pudval_t pud)
> +asmlinkage pud_t xen_make_pud(pudval_t pud)
>  {
>  	pud = pte_pfn_to_mfn(pud);
>  


  reply	other threads:[~2012-08-19  8:35 UTC|newest]

Thread overview: 140+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-19  2:55 RFC: Link Time Optimization support for the kernel Andi Kleen
2012-08-19  2:55 ` [PATCH 01/74] Add __visible Andi Kleen
2012-08-19  2:55 ` [PATCH 02/74] sections: Make all standard section identifiers __visible Andi Kleen
2012-08-19  2:55 ` [PATCH 03/74] sections: Make external kallsyms tables __visible Andi Kleen
2012-08-19  7:53   ` Jan Beulich
2012-08-19  7:53     ` Jan Beulich
2012-08-19 15:29     ` Andi Kleen
2012-08-19  2:56 ` [PATCH 04/74] sections: Add __visible to ia64 sections Andi Kleen
2012-08-19  2:56 ` [PATCH 05/74] sections: Add __visible to m68k sections Andi Kleen
2012-08-19  2:56 ` [PATCH 06/74] sections: Add __visible to powerpc sections Andi Kleen
2012-08-19  2:56 ` [PATCH 07/74] sections: Add __visible to sh sections Andi Kleen
2012-08-19  2:56 ` [PATCH 08/74] sections: Add __visible to tile sections Andi Kleen
2012-08-19  2:56 ` [PATCH 09/74] sections: Add __visible to x86 sections Andi Kleen
2012-08-19  2:56 ` [PATCH 10/74] sections: Add __visible to drivers/{base,pci} sections Andi Kleen
2012-08-19  2:56 ` [PATCH 11/74] sections: Add __visible to rapidio sections Andi Kleen
2012-08-19  2:56 ` [PATCH 12/74] sections: Add __visible to jump_label sections Andi Kleen
2012-08-19  2:56 ` [PATCH 13/74] sections: Add __visible to init/* sections Andi Kleen
2012-08-19  2:56 ` [PATCH 14/74] sections: Add __visible to kernel/* sections Andi Kleen
2012-08-19  2:56 ` [PATCH 15/74] sections: Add __visible to kernel/trace/* sections Andi Kleen
2012-08-19  2:56 ` [PATCH 16/74] sections: Add __visible to lib/* sections Andi Kleen
2012-08-19  2:56 ` [PATCH 17/74] lto: Make asmlinkage __visible Andi Kleen
2012-08-19  2:56 ` [PATCH 18/74] lto, wan/sbni: Make inline assembler symbols visible and assembler global Andi Kleen
2012-08-19  2:56 ` [PATCH 19/74] x86, lto: Add missing asmlinkages and __visible Andi Kleen
2012-08-19  2:56 ` [PATCH 20/74] x86, lto: Change dotraplinkage into __visible on 32bit Andi Kleen
2012-09-01 14:44   ` Michal Marek
2012-08-19  2:56 ` [PATCH 21/74] lto: Make lockdep_sys_exit asmlinkage Andi Kleen
2012-08-19  2:56 ` [PATCH 22/74] lto: Change kernel_execve to asmlinkage for all architectures Andi Kleen
2012-08-19  2:56 ` [PATCH 23/74] lto, mutex: Mark __visible Andi Kleen
2012-08-19  2:56 ` [PATCH 24/74] lto: Mark do_exit asmlinkage Andi Kleen
2012-08-19  2:56 ` [PATCH 25/74] x86, lto: Fix sys_call_table type in asm/syscall.h v2 Andi Kleen
2012-08-19  2:56 ` [PATCH 26/74] lto, sound: Fix export symbols for !CONFIG_MODULES Andi Kleen
2012-08-20  8:30   ` Takashi Iwai
2012-08-20  9:45     ` Andi Kleen
2012-08-20  9:53       ` Takashi Iwai
2012-08-19  2:56 ` [PATCH 27/74] lto: Mark EXPORT_SYMBOL symbols __visible Andi Kleen
2012-08-20  6:54   ` Rusty Russell
2012-08-20  9:49     ` Andi Kleen
2012-08-19  2:56 ` [PATCH 28/74] lto: Make ksymtab and kcrctab symbols and __this_module __visible Andi Kleen
2012-08-19  2:56 ` [PATCH 29/74] x86, lto: Make amd.c vide visible Andi Kleen
2012-08-19  2:56 ` [PATCH 30/74] x86, lto: Fix AMD K6 indirect call check Andi Kleen
2012-08-19  2:56 ` [PATCH 31/74] x86, lto: Make various variables used by assembler code __visible Andi Kleen
2012-08-19  2:56 ` [PATCH 32/74] lto, PNP: Fix the inline assembler to use asmlinkage symbols Andi Kleen
2012-08-19  2:56 ` [PATCH 33/74] x86, lto, apm: Make APM data structure used from assembler visible Andi Kleen
2012-08-19  2:56 ` [PATCH 34/74] x86, lto, lguest: Fix C functions used by inline assembler Andi Kleen
2012-08-19  2:56 ` [PATCH 35/74] lto, crypto, aes: mark AES tables __visible Andi Kleen
2012-08-19  2:56   ` Andi Kleen
2012-08-20  8:21   ` Herbert Xu
2012-08-20  8:21     ` Herbert Xu
2012-08-19  2:56 ` [PATCH 36/74] lto, crypto, camelia: Make camelia tables used by assembler __visible Andi Kleen
2012-08-19  2:56   ` Andi Kleen
2012-08-20  8:21   ` Herbert Xu
2012-08-20  8:21     ` Herbert Xu
2012-08-19  2:56 ` [PATCH 37/74] lto, KVM: Don't assume asm statements end up in the same assembler file Andi Kleen
2012-08-19  8:59   ` Avi Kivity
2012-08-19 15:09     ` Andi Kleen
2012-08-19 15:12       ` Avi Kivity
2012-08-19 15:20         ` Andi Kleen
2012-08-19  2:56 ` [PATCH 38/74] lto, watchdog/hpwdt.c: Make assembler label global Andi Kleen
2012-08-22 19:25   ` Wim Van Sebroeck
2012-08-22 20:11     ` Mingarelli, Thomas
2012-08-19  2:56 ` [PATCH 39/74] x86, lto: Mark vdso variables __visible Andi Kleen
2012-08-19  2:56 ` [PATCH 40/74] lto, powerpc: Disable LTO for the powerpc VDSO Andi Kleen
2012-08-19  2:56 ` [PATCH 41/74] x86, lto: Disable LTO for the x86 VDSO Andi Kleen
2012-08-19  2:56 ` [PATCH 42/74] lto, raid: disable LTO for the Altivec RAID code Andi Kleen
2012-08-19  2:56 ` [PATCH 43/74] lto, workaround: Disable LTO for sys_ni to work around alias bugs Andi Kleen
2012-08-19  2:56 ` [PATCH 44/74] lto: Mark functions used by the vsyscall init code visible Andi Kleen
2012-09-01 15:26   ` Michal Marek
2012-09-01 17:16     ` Andi Kleen
2012-09-01 17:26       ` Andi Kleen
2012-08-19  2:56 ` [PATCH 45/74] lto: Mark rwsem functions that can be called from assembler asmlinkage Andi Kleen
2012-08-19  2:56 ` [PATCH 46/74] x86, lto: Disable fancy hweight optimizations for LTO Andi Kleen
2012-08-19  8:28   ` Jan Beulich
2012-08-19  8:28     ` Jan Beulich
2012-08-19 15:15     ` Andi Kleen
2012-08-20 10:57       ` Jan Beulich
2012-08-20 10:57         ` Jan Beulich
2012-08-20 11:18         ` Andi Kleen
2012-08-20 12:38           ` Jan Beulich
2012-08-20 12:38             ` Jan Beulich
2012-08-20  9:15   ` Avi Kivity
2012-08-20  9:42     ` Andi Kleen
2012-08-19  2:56 ` [PATCH 47/74] x86, lto: Fix kprobes " Andi Kleen
2012-08-19  2:56 ` [PATCH 48/74] x86, lto: Use inline assembler instead of global register variable to get sp Andi Kleen
2012-08-19  8:37   ` Jan Beulich
2012-08-19  8:37     ` Jan Beulich
2012-08-19 15:18     ` Andi Kleen
2012-08-19  2:56 ` [PATCH 49/74] x86, lto, paravirt: Add __visible/asmlinkage to xen paravirt ops Andi Kleen
2012-08-19  2:56 ` [PATCH 50/74] x86, lto: Make empty_zero_page __visible for LTO Andi Kleen
2012-08-19  2:56 ` [PATCH 51/74] x86, lto, efi: Mark the efi variable used from assembler __visible Andi Kleen
2012-08-19  2:56 ` [PATCH 52/74] x86, lto, paravirt: Don't rely on local assembler labels Andi Kleen
2012-08-19  8:26   ` Jeremy Fitzhardinge
2012-08-19  2:56 ` [PATCH 53/74] x86, lto, paravirt: Make paravirt thunks global Andi Kleen
2012-08-19  8:27   ` Jeremy Fitzhardinge [this message]
2012-08-19 15:25     ` Andi Kleen
2012-08-19  2:56 ` [PATCH 54/74] x86, lto, vdso: Don't duplicate vvar address variables Andi Kleen
2012-08-20 17:47   ` Andrew Lutomirski
2012-08-19  2:56 ` [PATCH 55/74] lto, workaround: Add workaround for initcall reordering Andi Kleen
2012-08-19  8:46   ` Jan Beulich
2012-08-19  8:46     ` Jan Beulich
2012-08-19 15:01     ` Andi Kleen
2012-08-20 11:00       ` Jan Beulich
2012-08-20 11:00         ` Jan Beulich
2012-08-19  2:56 ` [PATCH 56/74] lto, workaround: Add workaround for missing LTO symbols in igb Andi Kleen
2012-08-22  8:43   ` Arnd Bergmann
2012-08-22 12:36     ` Andi Kleen
2012-08-19  2:56 ` [PATCH 57/74] lto, workaround: Add workaround for LTO build problem in pvrusb2-audio Andi Kleen
2012-08-19  2:56 ` [PATCH 58/74] lto, workaround: Work around LTO compiler problem in atheros driver Andi Kleen
2012-08-19  2:56 ` [PATCH 59/74] lto: Handle LTO common symbols in module loader Andi Kleen
2012-08-19  8:53   ` Jan Beulich
2012-08-19  8:53     ` Jan Beulich
2012-08-19 15:23     ` Andi Kleen
2012-08-19  2:56 ` [PATCH 60/74] lto, Kbuild, bloat-o-meter: fix static detection Andi Kleen
2012-08-19  2:56 ` [PATCH 61/74] Kbuild, lto: Drop .number postfixes in modpost Andi Kleen
2012-08-19  2:56 ` [PATCH 62/74] Kbuild, lto: add ld-version and ld-ifversion macros Andi Kleen
2012-08-19  2:56 ` [PATCH 63/74] Kbuild, lto: Print correct info messages for vmlinux link Andi Kleen
2012-08-19  2:57 ` [PATCH 64/74] Kbuild, lto: Add a gcc-ld script to let run gcc as ld Andi Kleen
2012-08-19  2:57 ` [PATCH 65/74] Kbuild, lto: Disable LTO for asm-offsets.c Andi Kleen
2012-08-19  2:57 ` [PATCH 66/74] Kbuild, lto: Handle basic LTO in modpost Andi Kleen
2012-08-19  2:57 ` [PATCH 67/74] Kbuild, lto: Add Link Time Optimization support Andi Kleen
2012-08-19  2:57 ` [PATCH 68/74] Kbuild, lto: Add LTO build Documentation Andi Kleen
2012-08-19  2:57 ` [PATCH 69/74] lto: Increase kallsyms max symbol length Andi Kleen
2012-08-19  2:57 ` [PATCH 70/74] Kbuild, lto: Handle longer symbols in kallsyms.c Andi Kleen
2012-08-19  2:57 ` [PATCH 71/74] lto, kprobes: Use KSYM_NAME_LEN to size identifier buffers Andi Kleen
2012-08-21  4:44   ` Ananth N Mavinakayanahalli
2012-08-19  2:57 ` [PATCH 72/74] lto: Mark spinlocks noinline when inline spinlocks are disabled Andi Kleen
2012-08-19  2:57 ` [PATCH 73/74] lto, module: Warn about modules that are not fully LTOed Andi Kleen
2012-08-19  2:57 ` [PATCH 74/74] lto, workaround: Mark do_futex noinline to prevent clobbering ebp Andi Kleen
2012-08-23  0:17   ` H. Peter Anvin
2012-08-23  2:14     ` H. Peter Anvin
2012-08-23  2:29     ` Andi Kleen
2012-08-23  3:14       ` H. Peter Anvin
2012-08-20  7:48 ` RFC: Link Time Optimization support for the kernel Ingo Molnar
2012-08-20 10:10   ` Andi Kleen
2012-08-21  7:49     ` Ingo Molnar
2012-08-21 14:05       ` Don Zickus
2012-08-21 14:26       ` Avi Kivity
2012-08-21 17:02       ` Andi Kleen
2012-08-23 15:02         ` Jan Hubicka
2012-08-22  8:58 ` Arnd Bergmann
2012-08-22 12:35   ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5030A354.7000109@goop.org \
    --to=jeremy@goop.org \
    --cc=JBeulich@suse.com \
    --cc=ak@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.