aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-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/**