aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-02-04 10:48:10 -0500
committerIngo Molnar <mingo@elte.hu>2008-02-04 10:48:10 -0500
commit87f7f8fe328388a1430a4c27cbe684f3925fd8a5 (patch)
tree175f262540488db3ee5e3fa027a0167e14b7f733 /arch/x86/mm
parentbeaff6333b4a21e8f3b7f9a7c3c8f8716b2334bc (diff)
x86: cpa, clean up code flow
Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/mm')
-rw-r--r--arch/x86/mm/pageattr.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index fb2eedba76ad..4f033505127e 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -423,8 +423,8 @@ out_unlock:
423 423
424static int __change_page_attr(unsigned long address, struct cpa_data *cpa) 424static int __change_page_attr(unsigned long address, struct cpa_data *cpa)
425{ 425{
426 int level, do_split, err;
426 struct page *kpte_page; 427 struct page *kpte_page;
427 int level, do_split;
428 pte_t *kpte; 428 pte_t *kpte;
429 429
430repeat: 430repeat:
@@ -476,26 +476,24 @@ repeat:
476 * and just change the pte: 476 * and just change the pte:
477 */ 477 */
478 do_split = try_preserve_large_page(kpte, address, cpa); 478 do_split = try_preserve_large_page(kpte, address, cpa);
479 if (do_split < 0)
480 return do_split;
481
482 /* 479 /*
483 * When the range fits into the existing large page, 480 * When the range fits into the existing large page,
484 * return. cp->numpages and cpa->tlbflush have been updated in 481 * return. cp->numpages and cpa->tlbflush have been updated in
485 * try_large_page: 482 * try_large_page:
486 */ 483 */
487 if (do_split == 0) 484 if (do_split <= 0)
488 return 0; 485 return do_split;
489 486
490 /* 487 /*
491 * We have to split the large page: 488 * We have to split the large page:
492 */ 489 */
493 do_split = split_large_page(kpte, address); 490 err = split_large_page(kpte, address);
494 if (do_split) 491 if (!err) {
495 return do_split; 492 cpa->flushtlb = 1;
496 cpa->flushtlb = 1; 493 goto repeat;
494 }
497 495
498 goto repeat; 496 return err;
499} 497}
500 498
501/** 499/**