kmemcheck updates for -tip
Hi Ingo,
Please pull the 'for-tip' branch of
git://git.kernel.org/pub/scm/linux/kernel/git/vegard/kmemcheck.git for-tip
to receive the following changes:
Vegard Nossum (3):
kmemcheck: fix sparse warnings
softirq: raise the right softirq
kmemcheck: use the proper comment style
arch/x86/mm/kmemcheck/error.c | 1 + arch/x86/mm/kmemcheck/kmemcheck.c | 26 +++++++++++++++++--------- arch/x86/mm/kmemcheck/opcode.c | 6 ++++-- arch/x86/mm/kmemcheck/shadow.c | 1 + arch/x86/mm/kmemcheck/string.c | 12 ++++++++---- include/linux/kmemcheck.h | 1 + kernel/softirq.c | 2 +- 7 files changed, 33 insertions(+), 16 deletions(-)
Thanks,
Vegard
arch/x86/mm/kmemcheck/error.c +1 -0
@@ -6,6 +6,7 @@#include <linux/stacktrace.h> #include <linux/string.h> +#include "error.h" #include "shadow.h" enum kmemcheck_error_type {
arch/x86/mm/kmemcheck/kmemcheck.c +17 -9
@@ -39,8 +39,10 @@ void __init kmemcheck_init(void)kmemcheck_smp_init ();#if defined(CONFIG_SMP ) && !defined(CONFIG_KMEMCHECK_USE_SMP ) -/* Limit SMP to use a single CPU. We rely on the fact that this code -* runs before SMP is set up. */ +/* +* Limit SMP to use a single CPU. We rely on the fact that this code +* runs before SMP is set up. +*/ if (setup_max_cpus >1 ) {printk (KERN_INFO "kmemcheck: Limiting number of CPUs to 1.\n" );
@@ -144,8 +146,10 @@ void kmemcheck_show(struct pt_regs *regs) n +=kmemcheck_show_addr (data->addr1); n +=kmemcheck_show_addr (data->addr2); -/* None of the addresses actually belonged to kmemcheck. Note that -* this is not an error. */ +/* +* None of the addresses actually belonged to kmemcheck. Note that +* this is not an error. +*/ if (n ==0 ) {kmemcheck_resume ();return ;
@@ -348,7 +352,7 @@ enum kmemcheck_method { KMEMCHECK_WRITE, }; -void kmemcheck_access (struct pt_regs *regs, +static void kmemcheck_access (struct pt_regs *regs,unsigned long fallback_address,enum kmemcheck_method fallback_method) {const uint8_t *insn;
@@ -414,8 +418,10 @@ void kmemcheck_access(struct pt_regs *regs,/* MOVS, MOVSB, MOVSW, MOVSD */ case 0xa4 :case 0xa5 : -/* These instructions are special because they take two -* addresses, but we only get one page fault. */ +/* +* These instructions are special because they take two +* addresses, but we only get one page fault. +*/ kmemcheck_read (regs, regs->si, size);kmemcheck_write (regs, regs->di, size); data->addr1 = regs->si;
@@ -434,9 +440,11 @@ void kmemcheck_access(struct pt_regs *regs,return ; } -/* If the opcode isn't special in any way, we use the data from the +/* +* If the opcode isn't special in any way, we use the data from the * page fault handler to determine the address and type of memory -* access. */ +* access. +*/ switch (fallback_method) {case KMEMCHECK_READ :kmemcheck_read (regs, fallback_address, size);
arch/x86/mm/kmemcheck/opcode.c +4 -2
@@ -21,10 +21,12 @@ static bool opcode_is_rex_prefix(uint8_t b)return (b &0xf0 ) ==0x40 ; } -/* This is a VERY crude opcode decoder. We only need to find the size of the +/* +* This is a VERY crude opcode decoder. We only need to find the size of the * load/store that caused our #PF and this should work for all the opcodes * that we care about. Moreover, the ones who invented this instruction set -* should be shot. */ +* should be shot. +*/ unsigned int kmemcheck_opcode_get_size (const uint8_t *op) {/* Default operand size */
arch/x86/mm/kmemcheck/shadow.c +1 -0
@@ -1,3 +1,4 @@ +#include <linux/kmemcheck.h> #include <linux/mm.h> #include <asm/page.h>
arch/x86/mm/kmemcheck/string.c +8 -4
@@ -27,8 +27,10 @@ static void memset_one_page(void *s, int c, size_t n)return ; } -/* While we are not guarding the page in question, nobody else -* should be able to change them. */ +/* +* While we are not guarding the page in question, nobody else +* should be able to change them. +*/ local_irq_save (flags);kmemcheck_pause_allbutself ();
@@ -68,8 +70,10 @@ void *kmemcheck_memset(void *s, int c, size_t n) end_page = (addr + n) &PAGE_MASK ;if (start_page == end_page) { -/* The entire area is within the same page. Good, we only -* need one memset(). */ +/* +* The entire area is within the same page. Good, we only +* need one memset(). +*/ memset_one_page (s, c, n);return s; }
include/linux/kmemcheck.h +1 -0
@@ -1,6 +1,7 @@#ifndef LINUX_KMEMCHECK_H #define LINUX_KMEMCHECK_H +#include <linux/mm_types.h> #include <linux/types.h> #ifdef CONFIG_KMEMCHECK
kernel/softirq.c +1 -1
@@ -399,7 +399,7 @@ void __tasklet_hi_schedule_first(struct tasklet_struct *t) t->next =__get_cpu_var (tasklet_hi_vec).head;__get_cpu_var (tasklet_hi_vec).head = t; -__raise_softirq_irqoff (TASKLET_SOFTIRQ ); +__raise_softirq_irqoff (HI_SOFTIRQ ); }EXPORT_SYMBOL (__tasklet_hi_schedule_first);
Quoted 4 lines · Vegard Nossum
Hi Ingo,
Please pull the 'for-tip' branch of
Quoted 8 lines
git://git.kernel.org/pub/scm/linux/kernel/git/vegard/kmemcheck.gitfor-tipto receive the following changes:
Vegard Nossum (3):
kmemcheck: fix sparse warnings
softirq: raise the right softirq
kmemcheck: use the proper comment style
pulled into tip/kmemcheck, thanks Vegard!
btw:
kernel/softirq.c void __tasklet_hi_schedule_first(struct tasklet_struct *t) · line 403
Quoted 9 lines
kernel/softirq.c +1
-1@@ -399,7 +399,7 @@ void __tasklet_hi_schedule_first(struct tasklet_struct *t) t->next =__get_cpu_var (tasklet_hi_vec).head;__get_cpu_var (tasklet_hi_vec).head = t; -__raise_softirq_irqoff (TASKLET_SOFTIRQ ); +__raise_softirq_irqoff (HI_SOFTIRQ ); }
i think i'll put this one into core/softirqs as well.
Ingo