public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Al Viro <viro@ftp.linux.org.uk>,
	WANG Cong <xiyou.wangcong@gmail.com>,
	Sam Ravnborg <sam@ravnborg.org>, Nix <nix@esperi.org.uk>,
	Jeff Dike <jdike@addtoit.com>,
	Paolo Giarrusso <p.giarrusso@gmail.com>,
	user-mode-linux-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, Rob Landley <rob@landley.net>,
	Adrian Bunk <bunk@stusta.de>
Subject: Re: [uml-devel] User Mode Linux still doesn't build in	2.6.23-final.
Date: Tue, 23 Oct 2007 07:20:51 -0700	[thread overview]
Message-ID: <471E0343.1070902@goop.org> (raw)
In-Reply-To: <20071023084546.GA17007@elte.hu>

Ingo Molnar wrote:
> * Jeremy Fitzhardinge <jeremy@goop.org> wrote:
>
>   
>>>> Should we re-add them for the function pointers in 
>>>> asm-x86/paravirt.h?
>>>>         
>>> yes, yes, yes. :-) It was a nightmare to sort it out in -rt (and 
>>> still is).
>>>       
>> Do you have a patch to do this already?
>>     
>
> yes, attached. Ack?
>
> 	Ingo
>
> ---------------------------->
> Subject: [patch] paravirt: mark assembly dependencies as fastcall
> From: Ingo Molnar <mingo@elte.hu>
>
> the 'fastcall removal' changes to paravirt.c were over-eager: they
> removed fastcall annotations from functions that are (or might be)
> implemented in assembly. So if someone changes the compiler model,
> such as -pg which disables regparm, the kernel breaks in nasty ways.
>
> so this patch adds back fastcall annotations. This serves as
> documentation for assembly calling-convention dependencies as
> well.
>   

It would be really nice if we could get the compiler to warn about
whether mismatches in fastcall use.  Without at least a compiler warning
about mismatches between the function pointer type in paravirt_ops and
the actual function, it will almost certainly rot and fail if you
actually need to depend on the annotations.

What's the issue with regparm and -pg?

> Signed-off-by: Ingo Molnar <mingo@elte.hu>
> ---
>  arch/i386/kernel/paravirt.c       |    6 -
>  arch/i386/kernel/smp.c            |    7 +
>  include/asm-i386/desc.h           |   18 ++--
>  include/asm-i386/io.h             |    2 
>  include/asm-i386/irqflags.h       |   12 +-
>  include/asm-i386/msr.h            |   13 +--
>  include/asm-i386/page.h           |   21 ++---
>  include/asm-i386/paravirt.h       |  156 +++++++++++++++++++-------------------
>  include/asm-i386/pgtable-2level.h |   10 +-
>  include/asm-i386/pgtable-3level.h |   18 ++--
>  include/asm-i386/pgtable.h        |    2 
>  include/asm-i386/processor.h      |    8 -
>  include/asm-i386/system.h         |   22 ++---
>  include/asm-i386/time.h           |    4 
>  include/asm-i386/tlbflush.h       |    4 
>  15 files changed, 154 insertions(+), 149 deletions(-)
>   

Hm,  so it will still need a fair amount of work to update to the
current kernel and add all the lguest/vmi/xen functions (and presumably
the out of tree kvm stuff too).

> Index: linux-2.6.23-rt1/arch/i386/kernel/paravirt.c
> ===================================================================
> --- linux-2.6.23-rt1.orig/arch/i386/kernel/paravirt.c	2007-10-11 15:58:08.000000000 -0400
> +++ linux-2.6.23-rt1/arch/i386/kernel/paravirt.c	2007-10-11 16:00:03.000000000 -0400
> @@ -208,7 +208,7 @@ void init_IRQ(void)
>  	paravirt_ops.init_IRQ();
>  }
>  
> -static void native_flush_tlb(void)
> +static fastcall void native_flush_tlb(void)
>  {
>  	__native_flush_tlb();
>  }
> @@ -217,12 +217,12 @@ static void native_flush_tlb(void)
>   * Global pages have to be flushed a bit differently. Not a real
>   * performance problem because this does not happen often.
>   */
> -static void native_flush_tlb_global(void)
> +static fastcall void native_flush_tlb_global(void)
>  {
>  	__native_flush_tlb_global();
>  }
>  
> -static void native_flush_tlb_single(unsigned long addr)
> +static fastcall void native_flush_tlb_single(unsigned long addr)
>  {
>  	__native_flush_tlb_single(addr);
>  }
> Index: linux-2.6.23-rt1/arch/i386/kernel/smp.c
> ===================================================================
> --- linux-2.6.23-rt1.orig/arch/i386/kernel/smp.c	2007-10-11 15:58:08.000000000 -0400
> +++ linux-2.6.23-rt1/arch/i386/kernel/smp.c	2007-10-11 16:00:03.000000000 -0400
> @@ -344,8 +344,9 @@ out:
>  	put_cpu_no_resched();
>  }
>  
> -void native_flush_tlb_others(const cpumask_t *cpumaskp, struct mm_struct *mm,
> -			     unsigned long va)
> +void fastcall
> +native_flush_tlb_others(const cpumask_t *cpumaskp, struct mm_struct *mm,
> +			unsigned long va)
>  {
>  	cpumask_t cpumask = *cpumaskp;
>  
> @@ -470,6 +471,7 @@ void flush_tlb_all(void)
>   */
>  static void native_smp_send_reschedule(int cpu)
>  {
> +	trace_special(cpu, 0, 0);
>  	WARN_ON(cpu_is_offline(cpu));
>  	send_IPI_mask(cpumask_of_cpu(cpu), RESCHEDULE_VECTOR);
>  }
> @@ -639,6 +641,7 @@ static void native_smp_send_stop(void)
>   */
>  fastcall void smp_reschedule_interrupt(struct pt_regs *regs)
>  {
> +	trace_special(regs->eip, 0, 0);
>  	ack_APIC_irq();
>  }
>   

What's trace_special()?  Has this escaped from another patch?

    J

  parent reply	other threads:[~2007-10-23 14:21 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-11 22:54 User Mode Linux still doesn't build in 2.6.23-final Rob Landley
2007-10-20  0:52 ` [uml-devel] " Paolo Giarrusso
2007-10-20 11:41   ` Nix
2007-10-21 11:48     ` WANG Cong
2007-10-21 13:08       ` Jeff Dike
2007-10-21 13:20         ` WANG Cong
2007-10-21 15:43           ` Al Viro
2007-10-22  4:37             ` WANG Cong
2007-10-22  5:22               ` Al Viro
2007-10-22  6:12                 ` WANG Cong
2007-10-22  6:42                   ` Nix
2007-10-22  6:52                     ` WANG Cong
2007-10-22  6:59                       ` Sam Ravnborg
2007-10-22  7:48                         ` WANG Cong
2007-10-22  7:58                           ` Robert P. J. Day
2007-10-22 11:36                           ` Al Viro
2007-10-22 12:25                             ` WANG Cong
2007-10-22 12:30                               ` Ingo Molnar
2007-10-22 12:39                                 ` WANG Cong
2007-10-22 12:43                               ` Al Viro
2007-10-22 12:45                                 ` Ingo Molnar
2007-10-22 23:14                                   ` Jeremy Fitzhardinge
2007-10-22 23:19                                     ` Ingo Molnar
2007-10-22 23:26                                       ` Jeremy Fitzhardinge
2007-10-22 23:56                                       ` Jeremy Fitzhardinge
2007-10-23  8:45                                         ` Ingo Molnar
2007-10-23 12:55                                           ` Andi Kleen
2007-10-23 13:10                                             ` Ingo Molnar
2007-10-23 14:01                                               ` Andi Kleen
2007-10-23 14:20                                                 ` Ingo Molnar
2007-10-23 14:31                                                   ` Jeremy Fitzhardinge
2007-10-23 14:47                                                     ` Ingo Molnar
2007-10-23 15:11                                                       ` Adrian Bunk
2007-10-23 14:48                                                   ` Andi Kleen
2007-10-23 15:13                                                     ` Ingo Molnar
2007-10-23 15:44                                                       ` Ingo Molnar
2007-10-23 16:57                                                         ` Andi Kleen
2007-10-23 13:25                                           ` Adrian Bunk
2007-10-23 14:20                                           ` Jeremy Fitzhardinge [this message]
2007-10-22 15:33                                 ` Jeff Dike
2007-10-22  7:01                       ` Robert P. J. Day
2007-10-22  7:27                   ` Al Viro
2007-10-22 20:24             ` Jeff Dike
2007-10-24 15:22 ` Jeff Dike
2007-10-24 16:14   ` Sam Ravnborg
2007-10-24 21:46   ` Rob Landley
2007-10-25  0:43     ` Jeff Dike

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=471E0343.1070902@goop.org \
    --to=jeremy@goop.org \
    --cc=bunk@stusta.de \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nix@esperi.org.uk \
    --cc=p.giarrusso@gmail.com \
    --cc=rob@landley.net \
    --cc=sam@ravnborg.org \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    --cc=viro@ftp.linux.org.uk \
    --cc=xiyou.wangcong@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox