提交 87f7f8fe 编写于 作者: I Ingo Molnar

x86: cpa, clean up code flow

Signed-off-by: NIngo Molnar <mingo@elte.hu>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 beaff633
...@@ -423,8 +423,8 @@ static int split_large_page(pte_t *kpte, unsigned long address) ...@@ -423,8 +423,8 @@ static int split_large_page(pte_t *kpte, unsigned long address)
static int __change_page_attr(unsigned long address, struct cpa_data *cpa) static int __change_page_attr(unsigned long address, struct cpa_data *cpa)
{ {
int level, do_split, err;
struct page *kpte_page; struct page *kpte_page;
int level, do_split;
pte_t *kpte; pte_t *kpte;
repeat: repeat:
...@@ -476,26 +476,24 @@ static int __change_page_attr(unsigned long address, struct cpa_data *cpa) ...@@ -476,26 +476,24 @@ static int __change_page_attr(unsigned long address, struct cpa_data *cpa)
* and just change the pte: * and just change the pte:
*/ */
do_split = try_preserve_large_page(kpte, address, cpa); do_split = try_preserve_large_page(kpte, address, cpa);
if (do_split < 0)
return do_split;
/* /*
* When the range fits into the existing large page, * When the range fits into the existing large page,
* return. cp->numpages and cpa->tlbflush have been updated in * return. cp->numpages and cpa->tlbflush have been updated in
* try_large_page: * try_large_page:
*/ */
if (do_split == 0) if (do_split <= 0)
return 0; return do_split;
/* /*
* We have to split the large page: * We have to split the large page:
*/ */
do_split = split_large_page(kpte, address); err = split_large_page(kpte, address);
if (do_split) if (!err) {
return do_split; cpa->flushtlb = 1;
cpa->flushtlb = 1; goto repeat;
}
goto repeat; return err;
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册