aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/pat.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2012-05-30 15:11:26 -0400
committerH. Peter Anvin <hpa@zytor.com>2012-05-30 15:11:32 -0400
commitbbd771474ec44b516107685d77e1c80bbe09f141 (patch)
tree0cb15781539a68f27b4ea6c89f827282630cbce6 /arch/x86/mm/pat.c
parent403e1c5b7495d7b80fae9fc4d0a7a6f5abdc3307 (diff)
parent319b6ffc6df892e4ccffff823cc5521a4a5d2dca (diff)
Merge branch 'x86/trampoline' into x86/urgent
x86/trampoline contains an urgent commit which is necessarily on a newer baseline. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/mm/pat.c')
-rw-r--r--arch/x86/mm/pat.c42
1 files changed, 19 insertions, 23 deletions
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
index bea6e573e02b..3d68ef6d2266 100644
--- a/arch/x86/mm/pat.c
+++ b/arch/x86/mm/pat.c
@@ -225,9 +225,8 @@ static int reserve_ram_pages_type(u64 start, u64 end, unsigned long req_type,
225 page = pfn_to_page(pfn); 225 page = pfn_to_page(pfn);
226 type = get_page_memtype(page); 226 type = get_page_memtype(page);
227 if (type != -1) { 227 if (type != -1) {
228 printk(KERN_INFO "reserve_ram_pages_type failed " 228 printk(KERN_INFO "reserve_ram_pages_type failed [mem %#010Lx-%#010Lx], track 0x%lx, req 0x%lx\n",
229 "0x%Lx-0x%Lx, track 0x%lx, req 0x%lx\n", 229 start, end - 1, type, req_type);
230 start, end, type, req_type);
231 if (new_type) 230 if (new_type)
232 *new_type = type; 231 *new_type = type;
233 232
@@ -330,9 +329,9 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
330 329
331 err = rbt_memtype_check_insert(new, new_type); 330 err = rbt_memtype_check_insert(new, new_type);
332 if (err) { 331 if (err) {
333 printk(KERN_INFO "reserve_memtype failed 0x%Lx-0x%Lx, " 332 printk(KERN_INFO "reserve_memtype failed [mem %#010Lx-%#010Lx], track %s, req %s\n",
334 "track %s, req %s\n", 333 start, end - 1,
335 start, end, cattr_name(new->type), cattr_name(req_type)); 334 cattr_name(new->type), cattr_name(req_type));
336 kfree(new); 335 kfree(new);
337 spin_unlock(&memtype_lock); 336 spin_unlock(&memtype_lock);
338 337
@@ -341,8 +340,8 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
341 340
342 spin_unlock(&memtype_lock); 341 spin_unlock(&memtype_lock);
343 342
344 dprintk("reserve_memtype added 0x%Lx-0x%Lx, track %s, req %s, ret %s\n", 343 dprintk("reserve_memtype added [mem %#010Lx-%#010Lx], track %s, req %s, ret %s\n",
345 start, end, cattr_name(new->type), cattr_name(req_type), 344 start, end - 1, cattr_name(new->type), cattr_name(req_type),
346 new_type ? cattr_name(*new_type) : "-"); 345 new_type ? cattr_name(*new_type) : "-");
347 346
348 return err; 347 return err;
@@ -376,14 +375,14 @@ int free_memtype(u64 start, u64 end)
376 spin_unlock(&memtype_lock); 375 spin_unlock(&memtype_lock);
377 376
378 if (!entry) { 377 if (!entry) {
379 printk(KERN_INFO "%s:%d freeing invalid memtype %Lx-%Lx\n", 378 printk(KERN_INFO "%s:%d freeing invalid memtype [mem %#010Lx-%#010Lx]\n",
380 current->comm, current->pid, start, end); 379 current->comm, current->pid, start, end - 1);
381 return -EINVAL; 380 return -EINVAL;
382 } 381 }
383 382
384 kfree(entry); 383 kfree(entry);
385 384
386 dprintk("free_memtype request 0x%Lx-0x%Lx\n", start, end); 385 dprintk("free_memtype request [mem %#010Lx-%#010Lx]\n", start, end - 1);
387 386
388 return 0; 387 return 0;
389} 388}
@@ -507,9 +506,8 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size)
507 506
508 while (cursor < to) { 507 while (cursor < to) {
509 if (!devmem_is_allowed(pfn)) { 508 if (!devmem_is_allowed(pfn)) {
510 printk(KERN_INFO 509 printk(KERN_INFO "Program %s tried to access /dev/mem between [mem %#010Lx-%#010Lx]\n",
511 "Program %s tried to access /dev/mem between %Lx->%Lx.\n", 510 current->comm, from, to - 1);
512 current->comm, from, to);
513 return 0; 511 return 0;
514 } 512 }
515 cursor += PAGE_SIZE; 513 cursor += PAGE_SIZE;
@@ -570,12 +568,11 @@ int kernel_map_sync_memtype(u64 base, unsigned long size, unsigned long flags)
570 size; 568 size;
571 569
572 if (ioremap_change_attr((unsigned long)__va(base), id_sz, flags) < 0) { 570 if (ioremap_change_attr((unsigned long)__va(base), id_sz, flags) < 0) {
573 printk(KERN_INFO 571 printk(KERN_INFO "%s:%d ioremap_change_attr failed %s "
574 "%s:%d ioremap_change_attr failed %s " 572 "for [mem %#010Lx-%#010Lx]\n",
575 "for %Lx-%Lx\n",
576 current->comm, current->pid, 573 current->comm, current->pid,
577 cattr_name(flags), 574 cattr_name(flags),
578 base, (unsigned long long)(base + size)); 575 base, (unsigned long long)(base + size-1));
579 return -EINVAL; 576 return -EINVAL;
580 } 577 }
581 return 0; 578 return 0;
@@ -607,12 +604,11 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
607 604
608 flags = lookup_memtype(paddr); 605 flags = lookup_memtype(paddr);
609 if (want_flags != flags) { 606 if (want_flags != flags) {
610 printk(KERN_WARNING 607 printk(KERN_WARNING "%s:%d map pfn RAM range req %s for [mem %#010Lx-%#010Lx], got %s\n",
611 "%s:%d map pfn RAM range req %s for %Lx-%Lx, got %s\n",
612 current->comm, current->pid, 608 current->comm, current->pid,
613 cattr_name(want_flags), 609 cattr_name(want_flags),
614 (unsigned long long)paddr, 610 (unsigned long long)paddr,
615 (unsigned long long)(paddr + size), 611 (unsigned long long)(paddr + size - 1),
616 cattr_name(flags)); 612 cattr_name(flags));
617 *vma_prot = __pgprot((pgprot_val(*vma_prot) & 613 *vma_prot = __pgprot((pgprot_val(*vma_prot) &
618 (~_PAGE_CACHE_MASK)) | 614 (~_PAGE_CACHE_MASK)) |
@@ -630,11 +626,11 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
630 !is_new_memtype_allowed(paddr, size, want_flags, flags)) { 626 !is_new_memtype_allowed(paddr, size, want_flags, flags)) {
631 free_memtype(paddr, paddr + size); 627 free_memtype(paddr, paddr + size);
632 printk(KERN_ERR "%s:%d map pfn expected mapping type %s" 628 printk(KERN_ERR "%s:%d map pfn expected mapping type %s"
633 " for %Lx-%Lx, got %s\n", 629 " for [mem %#010Lx-%#010Lx], got %s\n",
634 current->comm, current->pid, 630 current->comm, current->pid,
635 cattr_name(want_flags), 631 cattr_name(want_flags),
636 (unsigned long long)paddr, 632 (unsigned long long)paddr,
637 (unsigned long long)(paddr + size), 633 (unsigned long long)(paddr + size - 1),
638 cattr_name(flags)); 634 cattr_name(flags));
639 return -EINVAL; 635 return -EINVAL;
640 } 636 }