Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dcd4693c authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull powerpc fixes from Michael Ellerman:
 "Fixes marked for stable:
   - Prevent unlikely crash in copro_calculate_slb() (Frederic Barrat)
   - cxl: Prevent adapter reset if an active context exists (Vaibhav Jain)

  Fixes for code merged this cycle:
   - Fix boot on systems with uncompressed kernel image (Heiner Kallweit)
   - Drop dump_numa_memory_topology() (Michael Ellerman)
   - Fix numa topology console print (Aneesh Kumar K.V)
   - Ignore the pkey system calls for now (Stephen Rothwell)"

* tag 'powerpc-4.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc: Ignore the pkey system calls for now
  powerpc: Fix numa topology console print
  powerpc/mm: Drop dump_numa_memory_topology()
  cxl: Prevent adapter reset if an active context exists
  powerpc/boot: Fix boot on systems with uncompressed kernel image
  powerpc/mm: Prevent unlikely crash in copro_calculate_slb()
parents a23b27ae 78914ff0
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -220,8 +220,11 @@ What: /sys/class/cxl/<card>/reset
Date:           October 2014
Contact:        linuxppc-dev@lists.ozlabs.org
Description:    write only
                Writing 1 will issue a PERST to card which may cause the card
                to reload the FPGA depending on load_image_on_perst.
                Writing 1 will issue a PERST to card provided there are no
                contexts active on any one of the card AFUs. This may cause
                the card to reload the FPGA depending on load_image_on_perst.
                Writing -1 will do a force PERST irrespective of any active
                contexts on the card AFUs.
Users:		https://github.com/ibm-capi/libcxl

What:		/sys/class/cxl/<card>/perst_reloads_same_image (not in a guest)
+16 −2
Original line number Diff line number Diff line
@@ -32,9 +32,16 @@ static struct addr_range prep_kernel(void)
	void *addr = 0;
	struct elf_info ei;
	long len;
	int uncompressed_image = 0;

	partial_decompress(vmlinuz_addr, vmlinuz_size,
	len = partial_decompress(vmlinuz_addr, vmlinuz_size,
		elfheader, sizeof(elfheader), 0);
	/* assume uncompressed data if -1 is returned */
	if (len == -1) {
		uncompressed_image = 1;
		memcpy(elfheader, vmlinuz_addr, sizeof(elfheader));
		printf("No valid compressed data found, assume uncompressed data\n\r");
	}

	if (!parse_elf64(elfheader, &ei) && !parse_elf32(elfheader, &ei))
		fatal("Error: not a valid PPC32 or PPC64 ELF file!\n\r");
@@ -67,6 +74,13 @@ static struct addr_range prep_kernel(void)
					"device tree\n\r");
	}

	if (uncompressed_image) {
		memcpy(addr, vmlinuz_addr + ei.elfoffset, ei.loadsize);
		printf("0x%lx bytes of uncompressed data copied\n\r",
		       ei.loadsize);
		goto out;
	}

	/* Finally, decompress the kernel */
	printf("Decompressing (0x%p <- 0x%p:0x%p)...\n\r", addr,
	       vmlinuz_addr, vmlinuz_addr+vmlinuz_size);
@@ -82,7 +96,7 @@ static struct addr_range prep_kernel(void)
			 len, ei.loadsize);

	printf("Done! Decompressed 0x%lx bytes\n\r", len);

out:
	flush_cache(addr, ei.loadsize);

	return (struct addr_range){addr, ei.memsize};
+4 −0
Original line number Diff line number Diff line
@@ -16,6 +16,10 @@

#define __NR__exit __NR_exit

#define __IGNORE_pkey_mprotect
#define __IGNORE_pkey_alloc
#define __IGNORE_pkey_free

#ifndef __ASSEMBLY__

#include <linux/types.h>
+2 −0
Original line number Diff line number Diff line
@@ -106,6 +106,8 @@ int copro_calculate_slb(struct mm_struct *mm, u64 ea, struct copro_slb *slb)
	switch (REGION_ID(ea)) {
	case USER_REGION_ID:
		pr_devel("%s: 0x%llx -- USER_REGION_ID\n", __func__, ea);
		if (mm == NULL)
			return 1;
		psize = get_slice_psize(mm, ea);
		ssize = user_segment_size(ea);
		vsid = get_vsid(mm->context.id, ea, ssize);
+5 −41
Original line number Diff line number Diff line
@@ -845,7 +845,7 @@ void __init dump_numa_cpu_topology(void)
		return;

	for_each_online_node(node) {
		printk(KERN_DEBUG "Node %d CPUs:", node);
		pr_info("Node %d CPUs:", node);

		count = 0;
		/*
@@ -856,52 +856,18 @@ void __init dump_numa_cpu_topology(void)
			if (cpumask_test_cpu(cpu,
					node_to_cpumask_map[node])) {
				if (count == 0)
					printk(" %u", cpu);
					pr_cont(" %u", cpu);
				++count;
			} else {
				if (count > 1)
					printk("-%u", cpu - 1);
					pr_cont("-%u", cpu - 1);
				count = 0;
			}
		}

		if (count > 1)
			printk("-%u", nr_cpu_ids - 1);
		printk("\n");
	}
}

static void __init dump_numa_memory_topology(void)
{
	unsigned int node;
	unsigned int count;

	if (min_common_depth == -1 || !numa_enabled)
		return;

	for_each_online_node(node) {
		unsigned long i;

		printk(KERN_DEBUG "Node %d Memory:", node);

		count = 0;

		for (i = 0; i < memblock_end_of_DRAM();
		     i += (1 << SECTION_SIZE_BITS)) {
			if (early_pfn_to_nid(i >> PAGE_SHIFT) == node) {
				if (count == 0)
					printk(" 0x%lx", i);
				++count;
			} else {
				if (count > 0)
					printk("-0x%lx", i);
				count = 0;
			}
		}

		if (count > 0)
			printk("-0x%lx", i);
		printk("\n");
			pr_cont("-%u", nr_cpu_ids - 1);
		pr_cont("\n");
	}
}

@@ -947,8 +913,6 @@ void __init initmem_init(void)

	if (parse_numa_properties())
		setup_nonnuma();
	else
		dump_numa_memory_topology();

	memblock_dump_all();

Loading