aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/mm/fault.c5
-rw-r--r--include/asm-x86/pgalloc_64.h10
2 files changed, 9 insertions, 6 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index d8ed4006b3d2..621afb6343dc 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -958,11 +958,12 @@ void vmalloc_sync_all(void)
958 for (address = start; address <= VMALLOC_END; address += PGDIR_SIZE) { 958 for (address = start; address <= VMALLOC_END; address += PGDIR_SIZE) {
959 if (!test_bit(pgd_index(address), insync)) { 959 if (!test_bit(pgd_index(address), insync)) {
960 const pgd_t *pgd_ref = pgd_offset_k(address); 960 const pgd_t *pgd_ref = pgd_offset_k(address);
961 unsigned long flags;
961 struct page *page; 962 struct page *page;
962 963
963 if (pgd_none(*pgd_ref)) 964 if (pgd_none(*pgd_ref))
964 continue; 965 continue;
965 spin_lock(&pgd_lock); 966 spin_lock_irqsave(&pgd_lock, flags);
966 list_for_each_entry(page, &pgd_list, lru) { 967 list_for_each_entry(page, &pgd_list, lru) {
967 pgd_t *pgd; 968 pgd_t *pgd;
968 pgd = (pgd_t *)page_address(page) + pgd_index(address); 969 pgd = (pgd_t *)page_address(page) + pgd_index(address);
@@ -971,7 +972,7 @@ void vmalloc_sync_all(void)
971 else 972 else
972 BUG_ON(pgd_page_vaddr(*pgd) != pgd_page_vaddr(*pgd_ref)); 973 BUG_ON(pgd_page_vaddr(*pgd) != pgd_page_vaddr(*pgd_ref));
973 } 974 }
974 spin_unlock(&pgd_lock); 975 spin_unlock_irqrestore(&pgd_lock, flags);
975 set_bit(pgd_index(address), insync); 976 set_bit(pgd_index(address), insync);
976 } 977 }
977 if (address == start) 978 if (address == start)
diff --git a/include/asm-x86/pgalloc_64.h b/include/asm-x86/pgalloc_64.h
index 315314ce4bfb..4f6220db22b1 100644
--- a/include/asm-x86/pgalloc_64.h
+++ b/include/asm-x86/pgalloc_64.h
@@ -42,19 +42,21 @@ static inline void pud_free(struct mm_struct *mm, pud_t *pud)
42static inline void pgd_list_add(pgd_t *pgd) 42static inline void pgd_list_add(pgd_t *pgd)
43{ 43{
44 struct page *page = virt_to_page(pgd); 44 struct page *page = virt_to_page(pgd);
45 unsigned long flags;
45 46
46 spin_lock(&pgd_lock); 47 spin_lock_irqsave(&pgd_lock, flags);
47 list_add(&page->lru, &pgd_list); 48 list_add(&page->lru, &pgd_list);
48 spin_unlock(&pgd_lock); 49 spin_unlock_irqrestore(&pgd_lock, flags);
49} 50}
50 51
51static inline void pgd_list_del(pgd_t *pgd) 52static inline void pgd_list_del(pgd_t *pgd)
52{ 53{
53 struct page *page = virt_to_page(pgd); 54 struct page *page = virt_to_page(pgd);
55 unsigned long flags;
54 56
55 spin_lock(&pgd_lock); 57 spin_lock_irqsave(&pgd_lock, flags);
56 list_del(&page->lru); 58 list_del(&page->lru);
57 spin_unlock(&pgd_lock); 59 spin_unlock_irqrestore(&pgd_lock, flags);
58} 60}
59 61
60static inline pgd_t *pgd_alloc(struct mm_struct *mm) 62static inline pgd_t *pgd_alloc(struct mm_struct *mm)