diff options
Diffstat (limited to 'arch/x86/mm/pat.c')
-rw-r--r-- | arch/x86/mm/pat.c | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index f6ff57b7efa5..f11729fd019c 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c | |||
@@ -209,9 +209,8 @@ static int reserve_ram_pages_type(u64 start, u64 end, unsigned long req_type, | |||
209 | page = pfn_to_page(pfn); | 209 | page = pfn_to_page(pfn); |
210 | type = get_page_memtype(page); | 210 | type = get_page_memtype(page); |
211 | if (type != -1) { | 211 | if (type != -1) { |
212 | printk(KERN_INFO "reserve_ram_pages_type failed " | 212 | printk(KERN_INFO "reserve_ram_pages_type failed [mem %#010Lx-%#010Lx], track 0x%lx, req 0x%lx\n", |
213 | "0x%Lx-0x%Lx, track 0x%lx, req 0x%lx\n", | 213 | start, end - 1, type, req_type); |
214 | start, end, type, req_type); | ||
215 | if (new_type) | 214 | if (new_type) |
216 | *new_type = type; | 215 | *new_type = type; |
217 | 216 | ||
@@ -314,9 +313,9 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type, | |||
314 | 313 | ||
315 | err = rbt_memtype_check_insert(new, new_type); | 314 | err = rbt_memtype_check_insert(new, new_type); |
316 | if (err) { | 315 | if (err) { |
317 | printk(KERN_INFO "reserve_memtype failed 0x%Lx-0x%Lx, " | 316 | printk(KERN_INFO "reserve_memtype failed [mem %#010Lx-%#010Lx], track %s, req %s\n", |
318 | "track %s, req %s\n", | 317 | start, end - 1, |
319 | start, end, cattr_name(new->type), cattr_name(req_type)); | 318 | cattr_name(new->type), cattr_name(req_type)); |
320 | kfree(new); | 319 | kfree(new); |
321 | spin_unlock(&memtype_lock); | 320 | spin_unlock(&memtype_lock); |
322 | 321 | ||
@@ -325,8 +324,8 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type, | |||
325 | 324 | ||
326 | spin_unlock(&memtype_lock); | 325 | spin_unlock(&memtype_lock); |
327 | 326 | ||
328 | dprintk("reserve_memtype added 0x%Lx-0x%Lx, track %s, req %s, ret %s\n", | 327 | dprintk("reserve_memtype added [mem %#010Lx-%#010Lx], track %s, req %s, ret %s\n", |
329 | start, end, cattr_name(new->type), cattr_name(req_type), | 328 | start, end - 1, cattr_name(new->type), cattr_name(req_type), |
330 | new_type ? cattr_name(*new_type) : "-"); | 329 | new_type ? cattr_name(*new_type) : "-"); |
331 | 330 | ||
332 | return err; | 331 | return err; |
@@ -360,14 +359,14 @@ int free_memtype(u64 start, u64 end) | |||
360 | spin_unlock(&memtype_lock); | 359 | spin_unlock(&memtype_lock); |
361 | 360 | ||
362 | if (!entry) { | 361 | if (!entry) { |
363 | printk(KERN_INFO "%s:%d freeing invalid memtype %Lx-%Lx\n", | 362 | printk(KERN_INFO "%s:%d freeing invalid memtype [mem %#010Lx-%#010Lx]\n", |
364 | current->comm, current->pid, start, end); | 363 | current->comm, current->pid, start, end - 1); |
365 | return -EINVAL; | 364 | return -EINVAL; |
366 | } | 365 | } |
367 | 366 | ||
368 | kfree(entry); | 367 | kfree(entry); |
369 | 368 | ||
370 | dprintk("free_memtype request 0x%Lx-0x%Lx\n", start, end); | 369 | dprintk("free_memtype request [mem %#010Lx-%#010Lx]\n", start, end - 1); |
371 | 370 | ||
372 | return 0; | 371 | return 0; |
373 | } | 372 | } |
@@ -491,9 +490,8 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size) | |||
491 | 490 | ||
492 | while (cursor < to) { | 491 | while (cursor < to) { |
493 | if (!devmem_is_allowed(pfn)) { | 492 | if (!devmem_is_allowed(pfn)) { |
494 | printk(KERN_INFO | 493 | printk(KERN_INFO "Program %s tried to access /dev/mem between [mem %#010Lx-%#010Lx]\n", |
495 | "Program %s tried to access /dev/mem between %Lx->%Lx.\n", | 494 | current->comm, from, to - 1); |
496 | current->comm, from, to); | ||
497 | return 0; | 495 | return 0; |
498 | } | 496 | } |
499 | cursor += PAGE_SIZE; | 497 | cursor += PAGE_SIZE; |
@@ -554,12 +552,11 @@ int kernel_map_sync_memtype(u64 base, unsigned long size, unsigned long flags) | |||
554 | size; | 552 | size; |
555 | 553 | ||
556 | if (ioremap_change_attr((unsigned long)__va(base), id_sz, flags) < 0) { | 554 | if (ioremap_change_attr((unsigned long)__va(base), id_sz, flags) < 0) { |
557 | printk(KERN_INFO | 555 | printk(KERN_INFO "%s:%d ioremap_change_attr failed %s " |
558 | "%s:%d ioremap_change_attr failed %s " | 556 | "for [mem %#010Lx-%#010Lx]\n", |
559 | "for %Lx-%Lx\n", | ||
560 | current->comm, current->pid, | 557 | current->comm, current->pid, |
561 | cattr_name(flags), | 558 | cattr_name(flags), |
562 | base, (unsigned long long)(base + size)); | 559 | base, (unsigned long long)(base + size-1)); |
563 | return -EINVAL; | 560 | return -EINVAL; |
564 | } | 561 | } |
565 | return 0; | 562 | return 0; |
@@ -591,12 +588,11 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot, | |||
591 | 588 | ||
592 | flags = lookup_memtype(paddr); | 589 | flags = lookup_memtype(paddr); |
593 | if (want_flags != flags) { | 590 | if (want_flags != flags) { |
594 | printk(KERN_WARNING | 591 | printk(KERN_WARNING "%s:%d map pfn RAM range req %s for [mem %#010Lx-%#010Lx], got %s\n", |
595 | "%s:%d map pfn RAM range req %s for %Lx-%Lx, got %s\n", | ||
596 | current->comm, current->pid, | 592 | current->comm, current->pid, |
597 | cattr_name(want_flags), | 593 | cattr_name(want_flags), |
598 | (unsigned long long)paddr, | 594 | (unsigned long long)paddr, |
599 | (unsigned long long)(paddr + size), | 595 | (unsigned long long)(paddr + size - 1), |
600 | cattr_name(flags)); | 596 | cattr_name(flags)); |
601 | *vma_prot = __pgprot((pgprot_val(*vma_prot) & | 597 | *vma_prot = __pgprot((pgprot_val(*vma_prot) & |
602 | (~_PAGE_CACHE_MASK)) | | 598 | (~_PAGE_CACHE_MASK)) | |
@@ -614,11 +610,11 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot, | |||
614 | !is_new_memtype_allowed(paddr, size, want_flags, flags)) { | 610 | !is_new_memtype_allowed(paddr, size, want_flags, flags)) { |
615 | free_memtype(paddr, paddr + size); | 611 | free_memtype(paddr, paddr + size); |
616 | printk(KERN_ERR "%s:%d map pfn expected mapping type %s" | 612 | printk(KERN_ERR "%s:%d map pfn expected mapping type %s" |
617 | " for %Lx-%Lx, got %s\n", | 613 | " for [mem %#010Lx-%#010Lx], got %s\n", |
618 | current->comm, current->pid, | 614 | current->comm, current->pid, |
619 | cattr_name(want_flags), | 615 | cattr_name(want_flags), |
620 | (unsigned long long)paddr, | 616 | (unsigned long long)paddr, |
621 | (unsigned long long)(paddr + size), | 617 | (unsigned long long)(paddr + size - 1), |
622 | cattr_name(flags)); | 618 | cattr_name(flags)); |
623 | return -EINVAL; | 619 | return -EINVAL; |
624 | } | 620 | } |