Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
authorDavid S. Miller <davem@davemloft.net>
Wed, 6 Aug 2014 01:57:18 +0000 (18:57 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Aug 2014 01:57:18 +0000 (18:57 -0700)
Conflicts:
arch/sparc/mm/init_64.c

Conflict was simple non-overlapping additions.

Signed-off-by: David S. Miller <davem@davemloft.net>
1  2 
arch/sparc/mm/init_64.c

index 9f4f532e2627ecca5062f4351b7c19dde30a8c12,2cfb0f25e0ed37718388e245dd8df68300c856bd..cdc9f145e3c35529a346dac9159437bdf887e795
@@@ -2701,66 -2708,25 +2709,90 @@@ void hugetlb_setup(struct pt_regs *regs
  }
  #endif
  
 +static struct resource code_resource = {
 +      .name   = "Kernel code",
 +      .flags  = IORESOURCE_BUSY | IORESOURCE_MEM
 +};
 +
 +static struct resource data_resource = {
 +      .name   = "Kernel data",
 +      .flags  = IORESOURCE_BUSY | IORESOURCE_MEM
 +};
 +
 +static struct resource bss_resource = {
 +      .name   = "Kernel bss",
 +      .flags  = IORESOURCE_BUSY | IORESOURCE_MEM
 +};
 +
 +static inline resource_size_t compute_kern_paddr(void *addr)
 +{
 +      return (resource_size_t) (addr - KERNBASE + kern_base);
 +}
 +
 +static void __init kernel_lds_init(void)
 +{
 +      code_resource.start = compute_kern_paddr(_text);
 +      code_resource.end   = compute_kern_paddr(_etext - 1);
 +      data_resource.start = compute_kern_paddr(_etext);
 +      data_resource.end   = compute_kern_paddr(_edata - 1);
 +      bss_resource.start  = compute_kern_paddr(__bss_start);
 +      bss_resource.end    = compute_kern_paddr(_end - 1);
 +}
 +
 +static int __init report_memory(void)
 +{
 +      int i;
 +      struct resource *res;
 +
 +      kernel_lds_init();
 +
 +      for (i = 0; i < pavail_ents; i++) {
 +              res = kzalloc(sizeof(struct resource), GFP_KERNEL);
 +
 +              if (!res) {
 +                      pr_warn("Failed to allocate source.\n");
 +                      break;
 +              }
 +
 +              res->name = "System RAM";
 +              res->start = pavail[i].phys_addr;
 +              res->end = pavail[i].phys_addr + pavail[i].reg_size - 1;
 +              res->flags = IORESOURCE_BUSY | IORESOURCE_MEM;
 +
 +              if (insert_resource(&iomem_resource, res) < 0) {
 +                      pr_warn("Resource insertion failed.\n");
 +                      break;
 +              }
 +
 +              insert_resource(res, &code_resource);
 +              insert_resource(res, &data_resource);
 +              insert_resource(res, &bss_resource);
 +      }
 +
 +      return 0;
 +}
 +device_initcall(report_memory);
++
+ #ifdef CONFIG_SMP
+ #define do_flush_tlb_kernel_range     smp_flush_tlb_kernel_range
+ #else
+ #define do_flush_tlb_kernel_range     __flush_tlb_kernel_range
+ #endif
+ void flush_tlb_kernel_range(unsigned long start, unsigned long end)
+ {
+       if (start < HI_OBP_ADDRESS && end > LOW_OBP_ADDRESS) {
+               if (start < LOW_OBP_ADDRESS) {
+                       flush_tsb_kernel_range(start, LOW_OBP_ADDRESS);
+                       do_flush_tlb_kernel_range(start, LOW_OBP_ADDRESS);
+               }
+               if (end > HI_OBP_ADDRESS) {
+                       flush_tsb_kernel_range(end, HI_OBP_ADDRESS);
+                       do_flush_tlb_kernel_range(end, HI_OBP_ADDRESS);
+               }
+       } else {
+               flush_tsb_kernel_range(start, end);
+               do_flush_tlb_kernel_range(start, end);
+       }
+ }
++>>>>>>> c78f77e20d2ba5d4d5e478e85a6fb42556893e2d