Skip to content

Commit

Permalink
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/li…
Browse files Browse the repository at this point in the history
…nux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: use the right protections for split-up pagetables
  x86, vmi: TSC going backwards check in vmi clocksource
  • Loading branch information
Linus Torvalds committed Feb 21, 2009
2 parents b5482d4 + 07a66d7 commit be71cb5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
5 changes: 4 additions & 1 deletion arch/x86/kernel/vmiclock_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,13 @@ void __devinit vmi_time_ap_init(void)
#endif

/** vmi clocksource */
static struct clocksource clocksource_vmi;

static cycle_t read_real_cycles(void)
{
return vmi_timer_ops.get_cycle_counter(VMI_CYCLES_REAL);
cycle_t ret = (cycle_t)vmi_timer_ops.get_cycle_counter(VMI_CYCLES_REAL);
return ret >= clocksource_vmi.cycle_last ?
ret : clocksource_vmi.cycle_last;
}

static struct clocksource clocksource_vmi = {
Expand Down
15 changes: 5 additions & 10 deletions arch/x86/mm/pageattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,18 +508,13 @@ static int split_large_page(pte_t *kpte, unsigned long address)
#endif

/*
* Install the new, split up pagetable. Important details here:
* Install the new, split up pagetable.
*
* On Intel the NX bit of all levels must be cleared to make a
* page executable. See section 4.13.2 of Intel 64 and IA-32
* Architectures Software Developer's Manual).
*
* Mark the entry present. The current mapping might be
* set to not present, which we preserved above.
* We use the standard kernel pagetable protections for the new
* pagetable protections, the actual ptes set above control the
* primary protection behavior:
*/
ref_prot = pte_pgprot(pte_mkexec(pte_clrhuge(*kpte)));
pgprot_val(ref_prot) |= _PAGE_PRESENT;
__set_pmd_pte(kpte, address, mk_pte(base, ref_prot));
__set_pmd_pte(kpte, address, mk_pte(base, __pgprot(_KERNPG_TABLE)));
base = NULL;

out_unlock:
Expand Down

0 comments on commit be71cb5

Please sign in to comment.