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

Commit d7ab95f8 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86:
  x86: pit_clockevent can be static
  x86: EFI runtime code mapping enhancement
  x86: EFI: fix use of unitialized variable and the cache logic
  x86: CPA: fix gbpages support in try_preserve_large_page
  xen: unpin initial Xen pagetable once we're finished with it
  x86/early_ioremap: don't assume we're using swapper_pg_dir
  x86: fixup machine_ops reboot_{32|64}.c unification fallout
  x86: fix sigcontext.h user export
parents 282ea441 c2a9cc7e
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -384,9 +384,6 @@ static void __init runtime_code_page_mkexec(void)
	efi_memory_desc_t *md;
	void *p;

	if (!(__supported_pte_mask & _PAGE_NX))
		return;

	/* Make EFI runtime service code area executable */
	for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
		md = p;
@@ -428,9 +425,6 @@ void __init efi_enter_virtual_mode(void)
		else
			va = efi_ioremap(md->phys_addr, size);

		if (md->attribute & EFI_MEMORY_WB)
			set_memory_uc(md->virt_addr, size);

		md->virt_addr = (u64) (unsigned long) va;

		if (!va) {
@@ -439,6 +433,9 @@ void __init efi_enter_virtual_mode(void)
			continue;
		}

		if (!(md->attribute & EFI_MEMORY_WB))
			set_memory_uc(md->virt_addr, size);

		systab = (u64) (unsigned long) efi_phys.systab;
		if (md->phys_addr <= systab && systab < end) {
			systab += md->virt_addr - md->phys_addr;
@@ -476,6 +473,7 @@ void __init efi_enter_virtual_mode(void)
	efi.get_next_high_mono_count = virt_efi_get_next_high_mono_count;
	efi.reset_system = virt_efi_reset_system;
	efi.set_virtual_address_map = virt_efi_set_virtual_address_map;
	if (__supported_pte_mask & _PAGE_NX)
		runtime_code_page_mkexec();
	early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size);
	memmap.map = NULL;
+13 −19
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@
#include <asm/tlbflush.h>
#include <asm/proto.h>
#include <asm/efi.h>
#include <asm/cacheflush.h>

static pgd_t save_pgd __initdata;
static unsigned long efi_flags __initdata;
@@ -43,22 +44,15 @@ static void __init early_mapping_set_exec(unsigned long start,
					  unsigned long end,
					  int executable)
{
	pte_t *kpte;
	unsigned int level;
	unsigned long num_pages;

	while (start < end) {
		kpte = lookup_address((unsigned long)__va(start), &level);
		BUG_ON(!kpte);
	start &= PMD_MASK;
	end = (end + PMD_SIZE - 1) & PMD_MASK;
	num_pages = (end - start) >> PAGE_SHIFT;
	if (executable)
			set_pte(kpte, pte_mkexec(*kpte));
		set_memory_x((unsigned long)__va(start), num_pages);
	else
			set_pte(kpte, __pte((pte_val(*kpte) | _PAGE_NX) & \
					    __supported_pte_mask));
		if (level == PG_LEVEL_4K)
			start = (start + PAGE_SIZE) & PAGE_MASK;
		else
			start = (start + PMD_SIZE) & PMD_MASK;
	}
		set_memory_nx((unsigned long)__va(start), num_pages);
}

static void __init early_runtime_code_mapping_set_exec(int executable)
@@ -74,7 +68,7 @@ static void __init early_runtime_code_mapping_set_exec(int executable)
		md = p;
		if (md->type == EFI_RUNTIME_SERVICES_CODE) {
			unsigned long end;
			end = md->phys_addr + (md->num_pages << PAGE_SHIFT);
			end = md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT);
			early_mapping_set_exec(md->phys_addr, end, executable);
		}
	}
@@ -84,8 +78,8 @@ void __init efi_call_phys_prelog(void)
{
	unsigned long vaddress;

	local_irq_save(efi_flags);
	early_runtime_code_mapping_set_exec(1);
	local_irq_save(efi_flags);
	vaddress = (unsigned long)__va(0x0UL);
	save_pgd = *pgd_offset_k(0x0UL);
	set_pgd(pgd_offset_k(0x0UL), *pgd_offset_k(vaddress));
@@ -98,9 +92,9 @@ void __init efi_call_phys_epilog(void)
	 * After the lock is released, the original page table is restored.
	 */
	set_pgd(pgd_offset_k(0x0UL), save_pgd);
	early_runtime_code_mapping_set_exec(0);
	__flush_tlb_all();
	local_irq_restore(efi_flags);
	early_runtime_code_mapping_set_exec(0);
}

void __init efi_reserve_bootmem(void)
+1 −1
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ static int pit_next_event(unsigned long delta, struct clock_event_device *evt)
 * registered. This mechanism replaces the previous #ifdef LOCAL_APIC -
 * !using_apic_timer decisions in do_timer_interrupt_hook()
 */
struct clock_event_device pit_clockevent = {
static struct clock_event_device pit_clockevent = {
	.name		= "pit",
	.features	= CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
	.set_mode	= init_pit_timer,
+36 −10
Original line number Diff line number Diff line
@@ -326,7 +326,7 @@ static inline void kb_wait(void)
	}
}

void machine_emergency_restart(void)
static void native_machine_emergency_restart(void)
{
	int i;

@@ -376,7 +376,7 @@ void machine_emergency_restart(void)
	}
}

void machine_shutdown(void)
static void native_machine_shutdown(void)
{
	/* Stop the cpus and apics */
#ifdef CONFIG_SMP
@@ -420,7 +420,7 @@ void machine_shutdown(void)
#endif
}

void machine_restart(char *__unused)
static void native_machine_restart(char *__unused)
{
	printk("machine restart\n");

@@ -429,11 +429,11 @@ void machine_restart(char *__unused)
	machine_emergency_restart();
}

void machine_halt(void)
static void native_machine_halt(void)
{
}

void machine_power_off(void)
static void native_machine_power_off(void)
{
	if (pm_power_off) {
		if (!reboot_force)
@@ -443,9 +443,35 @@ void machine_power_off(void)
}

struct machine_ops machine_ops = {
	.power_off = machine_power_off,
	.shutdown = machine_shutdown,
	.emergency_restart = machine_emergency_restart,
	.restart = machine_restart,
	.halt = machine_halt
	.power_off = native_machine_power_off,
	.shutdown = native_machine_shutdown,
	.emergency_restart = native_machine_emergency_restart,
	.restart = native_machine_restart,
	.halt = native_machine_halt
};

void machine_power_off(void)
{
	machine_ops.power_off();
}

void machine_shutdown(void)
{
	machine_ops.shutdown();
}

void machine_emergency_restart(void)
{
	machine_ops.emergency_restart();
}

void machine_restart(char *cmd)
{
	machine_ops.restart(cmd);
}

void machine_halt(void)
{
	machine_ops.halt();
}
+3 −1
Original line number Diff line number Diff line
@@ -265,7 +265,9 @@ static __initdata pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)]

static inline pmd_t * __init early_ioremap_pmd(unsigned long addr)
{
	pgd_t *pgd = &swapper_pg_dir[pgd_index(addr)];
	/* Don't assume we're using swapper_pg_dir at this point */
	pgd_t *base = __va(read_cr3());
	pgd_t *pgd = &base[pgd_index(addr)];
	pud_t *pud = pud_offset(pgd, addr);
	pmd_t *pmd = pmd_offset(pud, addr);

Loading