Skip to content

Commit be71cb5

Browse files
committed
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/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
2 parents b5482d4 + 07a66d7 commit be71cb5

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

‎arch/x86/kernel/vmiclock_32.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,13 @@ void __devinit vmi_time_ap_init(void)
283283
#endif
284284

285285
/** vmi clocksource */
286+
static struct clocksource clocksource_vmi;
286287

287288
static cycle_t read_real_cycles(void)
288289
{
289-
return vmi_timer_ops.get_cycle_counter(VMI_CYCLES_REAL);
290+
cycle_t ret = (cycle_t)vmi_timer_ops.get_cycle_counter(VMI_CYCLES_REAL);
291+
return ret >= clocksource_vmi.cycle_last ?
292+
ret : clocksource_vmi.cycle_last;
290293
}
291294

292295
static struct clocksource clocksource_vmi = {

‎arch/x86/mm/pageattr.c‎

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -508,18 +508,13 @@ static int split_large_page(pte_t *kpte, unsigned long address)
508508
#endif
509509

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

525520
out_unlock:

0 commit comments

Comments
 (0)