lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1242057588.29990.105.camel@zakaz.uk.xensource.com>
Date:	Mon, 11 May 2009 16:59:48 +0100
From:	Ian Campbell <Ian.Campbell@...citrix.com>
To:	Ingo Molnar <mingo@...e.hu>
CC:	"mingo@...hat.com" <mingo@...hat.com>,
	"hpa@...or.com" <hpa@...or.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Jeremy Fitzhardinge <Jeremy.Fitzhardinge@...rix.com>,
	"tglx@...utronix.de" <tglx@...utronix.de>,
	"xen-devel@...ts.xensource.com" <xen-devel@...ts.xensource.com>,
	"linux-tip-commits@...r.kernel.org" 
	<linux-tip-commits@...r.kernel.org>
Subject: Re: [tip:x86/xen] x86: use flush_tlb_others to implement
	flush_tlb_all, fix

On Mon, 2009-05-11 at 11:42 -0400, Ingo Molnar wrote:
> * Ian Campbell <Ian.Campbell@...citrix.com> wrote:
> 
> > in any case I would guess that the fix is:
> > 
> > --- a/arch/x86/kernel/setup.c
> > +++ b/arch/x86/kernel/setup.c
> > @@ -87,6 +87,7 @@
> >  #include <asm/cacheflush.h>
> >  #include <asm/processor.h>
> >  #include <asm/bugs.h>
> > +#include <asm/tlbflush.h>
> >  
> >  #include <asm/system.h>
> >  #include <asm/vsyscall.h>
> 
> Guessing is not enough - please review the prototype position. Is it 
> available on all configs? It is not ...

Damn, you are (of course) right. There is nothing for it to do on !SMP
so patch below. I also observe that since it's no longer an initcall
there is no need for a return value so included that change too.

> But even the proper fix runs into that smp_processor_id() bug i just 
> posted.

That's back to an issue in the original patch from Jeremy I think, I'll
leave that one to him and/or tomorrow -- I've botched enough patches for
one day!

Ian.

diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h
index a3f42bf..e1e3e6a 100644
--- a/arch/x86/include/asm/tlbflush.h
+++ b/arch/x86/include/asm/tlbflush.h
@@ -89,6 +89,8 @@ static inline void __flush_tlb_one(unsigned long addr)
 
 #ifndef CONFIG_SMP
 
+static inline void init_smp_flush(void) {}
+
 #define flush_tlb() __flush_tlb()
 #define flush_tlb_all() __flush_tlb_all()
 #define local_flush_tlb() __flush_tlb()
@@ -129,7 +131,7 @@ static inline void reset_lazy_tlbstate(void)
 
 #define local_flush_tlb() __flush_tlb()
 
-extern int init_smp_flush(void);
+extern void init_smp_flush(void);
 
 extern void flush_tlb_all(void);
 extern void flush_tlb_current_task(void);
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 03f52f5..db28919 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -217,14 +217,12 @@ void native_flush_tlb_others(const struct cpumask *cpumask,
 	flush_tlb_others_ipi(cpumask, mm, va);
 }
 
-int __init init_smp_flush(void)
+void __init init_smp_flush(void)
 {
 	int i;
 
 	for (i = 0; i < ARRAY_SIZE(flush_state); i++)
 		spin_lock_init(&flush_state[i].tlbstate_lock);
-
-	return 0;
 }
 
 void flush_tlb_current_task(void)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ