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

Commit 46bdfe6a authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
  x86: avoid high BIOS area when allocating address space
  x86: avoid E820 regions when allocating address space
  x86: avoid low BIOS area when allocating address space
  resources: add arch hook for preventing allocation in reserved areas
  Revert "resources: support allocating space within a region from the top down"
  Revert "PCI: allocate bus resources from the top down"
  Revert "x86/PCI: allocate space from the end of a region, not the beginning"
  Revert "x86: allocate space within a region top-down"
  Revert "PCI: fix pci_bus_alloc_resource() hang, prefer positive decode"
  PCI: Update MCP55 quirk to not affect non HyperTransport variants
parents c15524a4 a2c606d5
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -2175,11 +2175,6 @@ and is between 256 and 4096 characters. It is defined in the file
	reset_devices	[KNL] Force drivers to reset the underlying device
			during initialization.

	resource_alloc_from_bottom
			Allocate new resources from the beginning of available
			space, not the end.  If you need to use this, please
			report a bug.

	resume=		[SWSUSP]
			Specify the partition device for software suspend

+3 −0
Original line number Diff line number Diff line
@@ -72,6 +72,9 @@ struct e820map {
#define BIOS_BEGIN		0x000a0000
#define BIOS_END		0x00100000

#define BIOS_ROM_BASE		0xffe00000
#define BIOS_ROM_END		0xffffffff

#ifdef __KERNEL__
/* see comment in arch/x86/kernel/e820.c */
extern struct e820map e820;
+1 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ obj-y += pci-dma.o quirks.o i8237.o topology.o kdebugfs.o
obj-y			+= alternative.o i8253.o pci-nommu.o hw_breakpoint.o
obj-y			+= tsc.o io_delay.o rtc.o
obj-y			+= pci-iommu_table.o
obj-y			+= resource.o

obj-$(CONFIG_X86_TRAMPOLINE)	+= trampoline.o
obj-y				+= process.o
+48 −0
Original line number Diff line number Diff line
#include <linux/ioport.h>
#include <asm/e820.h>

static void resource_clip(struct resource *res, resource_size_t start,
			  resource_size_t end)
{
	resource_size_t low = 0, high = 0;

	if (res->end < start || res->start > end)
		return;		/* no conflict */

	if (res->start < start)
		low = start - res->start;

	if (res->end > end)
		high = res->end - end;

	/* Keep the area above or below the conflict, whichever is larger */
	if (low > high)
		res->end = start - 1;
	else
		res->start = end + 1;
}

static void remove_e820_regions(struct resource *avail)
{
	int i;
	struct e820entry *entry;

	for (i = 0; i < e820.nr_map; i++) {
		entry = &e820.map[i];

		resource_clip(avail, entry->addr,
			      entry->addr + entry->size - 1);
	}
}

void arch_remove_reservations(struct resource *avail)
{
	/* Trim out BIOS areas (low 1MB and high 2MB) and E820 regions */
	if (avail->flags & IORESOURCE_MEM) {
		if (avail->start < BIOS_END)
			avail->start = BIOS_END;
		resource_clip(avail, BIOS_ROM_BASE, BIOS_ROM_END);

		remove_e820_regions(avail);
	}
}
+0 −1
Original line number Diff line number Diff line
@@ -769,7 +769,6 @@ void __init setup_arch(char **cmdline_p)

	x86_init.oem.arch_setup();

	resource_alloc_from_bottom = 0;
	iomem_resource.end = (1ULL << boot_cpu_data.x86_phys_bits) - 1;
	setup_memory_map();
	parse_setup_data();
Loading