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] [thread-next>] [day] [month] [year] [list]
Message-ID: <5063F9FD.8050002@intel.com>
Date:	Thu, 27 Sep 2012 15:02:21 +0800
From:	Alex Shi <alex.shi@...el.com>
To:	"H. Peter Anvin" <hpa@...or.com>
CC:	Tomoki Sekiyama <tomoki.sekiyama.qu@...achi.com>, x86@...nel.org,
	linux-kernel@...r.kernel.org, yrl.pp-manager.tt@...achi.com,
	Ingo Molnar <mingo@...hat.com>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] x86: Distinguish TLB shootdown interrupts from other
 functions call interrupts

>>

>> the 3.6 kernel will closed soon. it will be great to has this patch in.
>> So, could you like to refresh your patch with popular comments format? :)
> 
> Fixed patch is below.
> Thank you for the review again.
> 



Peter:

Maybe the patch doesn't looks perfect for this issue.
So I am wondering if the following patch is better, if we don't care the irq_tlb
was counted again in irq_call?

===
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 613cd83..2d6d8ed 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -98,6 +98,8 @@ static void flush_tlb_func(void *info)
 {
        struct flush_tlb_info *f = info;
 
+       inc_irq_stat(irq_tlb_count);
+
        if (f->flush_mm != this_cpu_read(cpu_tlbstate.active_mm))
                return;
===

Or another solution is also reducing double counted irq_tlb_count from irq_call_count
What's your comments of this?

===
diff --git a/arch/x86/include/asm/hardirq.h b/arch/x86/include/asm/hardirq.h
index d3895db..aac7886 100644
--- a/arch/x86/include/asm/hardirq.h
+++ b/arch/x86/include/asm/hardirq.h
@@ -36,6 +36,7 @@ DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
 #define __ARCH_IRQ_STAT
 
 #define inc_irq_stat(member)   this_cpu_inc(irq_stat.member)
+#define dec_irq_stat(member)    this_cpu_dec(irq_stat.member)
 
 #define local_softirq_pending()        this_cpu_read(irq_stat.__softirq_pending)
 
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 613cd83..b82bd9f 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -98,6 +98,10 @@ static void flush_tlb_func(void *info)
 {
        struct flush_tlb_info *f = info;
 
+       /* remove double counted irq_tlb_count from irq_call_count */
+       dec_irq_stat(irq_call_count);
+       inc_irq_stat(irq_tlb_count);
+
        if (f->flush_mm != this_cpu_read(cpu_tlbstate.active_mm))
                return;
=== 

 
Thanks
    Alex
--
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