diff options
| -rw-r--r-- | arch/x86/mm/pageattr.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index 84ba74820ad6..f664bc1c4093 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c | |||
| @@ -576,6 +576,13 @@ static int __change_page_attr(struct cpa_data *cpa, int primary) | |||
| 576 | else | 576 | else |
| 577 | address = *cpa->vaddr; | 577 | address = *cpa->vaddr; |
| 578 | 578 | ||
| 579 | /* | ||
| 580 | * If we're called with lazy mmu updates enabled, the | ||
| 581 | * in-memory pte state may be stale. Flush pending updates to | ||
| 582 | * bring them up to date. | ||
| 583 | */ | ||
| 584 | arch_flush_lazy_mmu_mode(); | ||
| 585 | |||
| 579 | repeat: | 586 | repeat: |
| 580 | kpte = lookup_address(address, &level); | 587 | kpte = lookup_address(address, &level); |
| 581 | if (!kpte) | 588 | if (!kpte) |
| @@ -854,6 +861,13 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages, | |||
| 854 | } else | 861 | } else |
| 855 | cpa_flush_all(cache); | 862 | cpa_flush_all(cache); |
| 856 | 863 | ||
| 864 | /* | ||
| 865 | * If we've been called with lazy mmu updates enabled, then | ||
| 866 | * make sure that everything gets flushed out before we | ||
| 867 | * return. | ||
| 868 | */ | ||
| 869 | arch_flush_lazy_mmu_mode(); | ||
| 870 | |||
| 857 | out: | 871 | out: |
| 858 | return ret; | 872 | return ret; |
| 859 | } | 873 | } |
