diff options
author | Joe Perches <joe@perches.com> | 2009-12-09 13:45:36 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-12-10 02:57:51 -0500 |
commit | 1bd591a5f17f546121fcf0015d72cc3e9c49cc29 (patch) | |
tree | 21c02ad8f34499b4eb9cf21f598543ed2e0315b6 /arch | |
parent | a78d9626f4f6fa7904bfdb071205080743125983 (diff) |
x86: kmmio.c: Add and use pr_fmt(fmt)
- Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- Strip "kmmio: " from pr_<level>s
Signed-off-by: Joe Perches <joe@perches.com>
LKML-Reference: <7aa509f8a23933036d39f54bd51e9acc52068049.1260383912.git.joe@perches.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/mm/kmmio.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c index 88612cdcdc3b..68c3e89af5c2 100644 --- a/arch/x86/mm/kmmio.c +++ b/arch/x86/mm/kmmio.c | |||
@@ -5,6 +5,8 @@ | |||
5 | * 2008 Pekka Paalanen <pq@iki.fi> | 5 | * 2008 Pekka Paalanen <pq@iki.fi> |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
9 | |||
8 | #include <linux/list.h> | 10 | #include <linux/list.h> |
9 | #include <linux/rculist.h> | 11 | #include <linux/rculist.h> |
10 | #include <linux/spinlock.h> | 12 | #include <linux/spinlock.h> |
@@ -136,7 +138,7 @@ static int clear_page_presence(struct kmmio_fault_page *f, bool clear) | |||
136 | pte_t *pte = lookup_address(f->page, &level); | 138 | pte_t *pte = lookup_address(f->page, &level); |
137 | 139 | ||
138 | if (!pte) { | 140 | if (!pte) { |
139 | pr_err("kmmio: no pte for page 0x%08lx\n", f->page); | 141 | pr_err("no pte for page 0x%08lx\n", f->page); |
140 | return -1; | 142 | return -1; |
141 | } | 143 | } |
142 | 144 | ||
@@ -148,7 +150,7 @@ static int clear_page_presence(struct kmmio_fault_page *f, bool clear) | |||
148 | clear_pte_presence(pte, clear, &f->old_presence); | 150 | clear_pte_presence(pte, clear, &f->old_presence); |
149 | break; | 151 | break; |
150 | default: | 152 | default: |
151 | pr_err("kmmio: unexpected page level 0x%x.\n", level); | 153 | pr_err("unexpected page level 0x%x.\n", level); |
152 | return -1; | 154 | return -1; |
153 | } | 155 | } |
154 | 156 | ||
@@ -170,13 +172,14 @@ static int clear_page_presence(struct kmmio_fault_page *f, bool clear) | |||
170 | static int arm_kmmio_fault_page(struct kmmio_fault_page *f) | 172 | static int arm_kmmio_fault_page(struct kmmio_fault_page *f) |
171 | { | 173 | { |
172 | int ret; | 174 | int ret; |
173 | WARN_ONCE(f->armed, KERN_ERR "kmmio page already armed.\n"); | 175 | WARN_ONCE(f->armed, KERN_ERR pr_fmt("kmmio page already armed.\n")); |
174 | if (f->armed) { | 176 | if (f->armed) { |
175 | pr_warning("kmmio double-arm: page 0x%08lx, ref %d, old %d\n", | 177 | pr_warning("double-arm: page 0x%08lx, ref %d, old %d\n", |
176 | f->page, f->count, !!f->old_presence); | 178 | f->page, f->count, !!f->old_presence); |
177 | } | 179 | } |
178 | ret = clear_page_presence(f, true); | 180 | ret = clear_page_presence(f, true); |
179 | WARN_ONCE(ret < 0, KERN_ERR "kmmio arming 0x%08lx failed.\n", f->page); | 181 | WARN_ONCE(ret < 0, KERN_ERR pr_fmt("arming 0x%08lx failed.\n"), |
182 | f->page); | ||
180 | f->armed = true; | 183 | f->armed = true; |
181 | return ret; | 184 | return ret; |
182 | } | 185 | } |
@@ -240,24 +243,21 @@ int kmmio_handler(struct pt_regs *regs, unsigned long addr) | |||
240 | * condition needs handling by do_page_fault(), the | 243 | * condition needs handling by do_page_fault(), the |
241 | * page really not being present is the most common. | 244 | * page really not being present is the most common. |
242 | */ | 245 | */ |
243 | pr_debug("kmmio: secondary hit for 0x%08lx CPU %d.\n", | 246 | pr_debug("secondary hit for 0x%08lx CPU %d.\n", |
244 | addr, smp_processor_id()); | 247 | addr, smp_processor_id()); |
245 | 248 | ||
246 | if (!faultpage->old_presence) | 249 | if (!faultpage->old_presence) |
247 | pr_info("kmmio: unexpected secondary hit for " | 250 | pr_info("unexpected secondary hit for address 0x%08lx on CPU %d.\n", |
248 | "address 0x%08lx on CPU %d.\n", addr, | 251 | addr, smp_processor_id()); |
249 | smp_processor_id()); | ||
250 | } else { | 252 | } else { |
251 | /* | 253 | /* |
252 | * Prevent overwriting already in-flight context. | 254 | * Prevent overwriting already in-flight context. |
253 | * This should not happen, let's hope disarming at | 255 | * This should not happen, let's hope disarming at |
254 | * least prevents a panic. | 256 | * least prevents a panic. |
255 | */ | 257 | */ |
256 | pr_emerg("kmmio: recursive probe hit on CPU %d, " | 258 | pr_emerg("recursive probe hit on CPU %d, for address 0x%08lx. Ignoring.\n", |
257 | "for address 0x%08lx. Ignoring.\n", | 259 | smp_processor_id(), addr); |
258 | smp_processor_id(), addr); | 260 | pr_emerg("previous hit was at 0x%08lx.\n", ctx->addr); |
259 | pr_emerg("kmmio: previous hit was at 0x%08lx.\n", | ||
260 | ctx->addr); | ||
261 | disarm_kmmio_fault_page(faultpage); | 261 | disarm_kmmio_fault_page(faultpage); |
262 | } | 262 | } |
263 | goto no_kmmio_ctx; | 263 | goto no_kmmio_ctx; |
@@ -316,8 +316,8 @@ static int post_kmmio_handler(unsigned long condition, struct pt_regs *regs) | |||
316 | * something external causing them (f.e. using a debugger while | 316 | * something external causing them (f.e. using a debugger while |
317 | * mmio tracing enabled), or erroneous behaviour | 317 | * mmio tracing enabled), or erroneous behaviour |
318 | */ | 318 | */ |
319 | pr_warning("kmmio: unexpected debug trap on CPU %d.\n", | 319 | pr_warning("unexpected debug trap on CPU %d.\n", |
320 | smp_processor_id()); | 320 | smp_processor_id()); |
321 | goto out; | 321 | goto out; |
322 | } | 322 | } |
323 | 323 | ||
@@ -425,7 +425,7 @@ int register_kmmio_probe(struct kmmio_probe *p) | |||
425 | list_add_rcu(&p->list, &kmmio_probes); | 425 | list_add_rcu(&p->list, &kmmio_probes); |
426 | while (size < size_lim) { | 426 | while (size < size_lim) { |
427 | if (add_kmmio_fault_page(p->addr + size)) | 427 | if (add_kmmio_fault_page(p->addr + size)) |
428 | pr_err("kmmio: Unable to set page fault.\n"); | 428 | pr_err("Unable to set page fault.\n"); |
429 | size += PAGE_SIZE; | 429 | size += PAGE_SIZE; |
430 | } | 430 | } |
431 | out: | 431 | out: |
@@ -511,7 +511,7 @@ void unregister_kmmio_probe(struct kmmio_probe *p) | |||
511 | 511 | ||
512 | drelease = kmalloc(sizeof(*drelease), GFP_ATOMIC); | 512 | drelease = kmalloc(sizeof(*drelease), GFP_ATOMIC); |
513 | if (!drelease) { | 513 | if (!drelease) { |
514 | pr_crit("kmmio: leaking kmmio_fault_page objects.\n"); | 514 | pr_crit("leaking kmmio_fault_page objects.\n"); |
515 | return; | 515 | return; |
516 | } | 516 | } |
517 | drelease->release_list = release_list; | 517 | drelease->release_list = release_list; |