diff options
author | Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> | 2005-09-20 03:34:41 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2005-09-22 16:27:59 -0400 |
commit | 4881e2cd25d2d9cf9fca263caff3a0ce732d7d6b (patch) | |
tree | 6d93cddd18ed37395d4522799f2d31a862669d10 /arch | |
parent | 20bb86852a6b7d9ca8c48ff921ff3904038959cf (diff) |
[IA64] MCA recovery verify pfn_valid
Verify the pfn is valid before calling pfn_to_page(),
and cut isolation message if nothing was done.
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Acked-by: Russ Anderson <rja@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ia64/kernel/mca_drv.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/arch/ia64/kernel/mca_drv.c b/arch/ia64/kernel/mca_drv.c index 80f83d6cdbfc..f081c60ab206 100644 --- a/arch/ia64/kernel/mca_drv.c +++ b/arch/ia64/kernel/mca_drv.c | |||
@@ -56,8 +56,9 @@ static struct page *page_isolate[MAX_PAGE_ISOLATE]; | |||
56 | static int num_page_isolate = 0; | 56 | static int num_page_isolate = 0; |
57 | 57 | ||
58 | typedef enum { | 58 | typedef enum { |
59 | ISOLATE_NG = 0, | 59 | ISOLATE_NG, |
60 | ISOLATE_OK = 1 | 60 | ISOLATE_OK, |
61 | ISOLATE_NONE | ||
61 | } isolate_status_t; | 62 | } isolate_status_t; |
62 | 63 | ||
63 | /* | 64 | /* |
@@ -74,7 +75,7 @@ static struct { | |||
74 | * @paddr: poisoned memory location | 75 | * @paddr: poisoned memory location |
75 | * | 76 | * |
76 | * Return value: | 77 | * Return value: |
77 | * ISOLATE_OK / ISOLATE_NG | 78 | * one of isolate_status_t, ISOLATE_OK/NG/NONE. |
78 | */ | 79 | */ |
79 | 80 | ||
80 | static isolate_status_t | 81 | static isolate_status_t |
@@ -85,7 +86,10 @@ mca_page_isolate(unsigned long paddr) | |||
85 | 86 | ||
86 | /* whether physical address is valid or not */ | 87 | /* whether physical address is valid or not */ |
87 | if (!ia64_phys_addr_valid(paddr)) | 88 | if (!ia64_phys_addr_valid(paddr)) |
88 | return ISOLATE_NG; | 89 | return ISOLATE_NONE; |
90 | |||
91 | if (!pfn_valid(paddr)) | ||
92 | return ISOLATE_NONE; | ||
89 | 93 | ||
90 | /* convert physical address to physical page number */ | 94 | /* convert physical address to physical page number */ |
91 | p = pfn_to_page(paddr>>PAGE_SHIFT); | 95 | p = pfn_to_page(paddr>>PAGE_SHIFT); |
@@ -122,10 +126,15 @@ mca_handler_bh(unsigned long paddr) | |||
122 | current->pid, current->comm); | 126 | current->pid, current->comm); |
123 | 127 | ||
124 | spin_lock(&mca_bh_lock); | 128 | spin_lock(&mca_bh_lock); |
125 | if (mca_page_isolate(paddr) == ISOLATE_OK) { | 129 | switch (mca_page_isolate(paddr)) { |
130 | case ISOLATE_OK: | ||
126 | printk(KERN_DEBUG "Page isolation: ( %lx ) success.\n", paddr); | 131 | printk(KERN_DEBUG "Page isolation: ( %lx ) success.\n", paddr); |
127 | } else { | 132 | break; |
133 | case ISOLATE_NG: | ||
128 | printk(KERN_DEBUG "Page isolation: ( %lx ) failure.\n", paddr); | 134 | printk(KERN_DEBUG "Page isolation: ( %lx ) failure.\n", paddr); |
135 | break; | ||
136 | default: | ||
137 | break; | ||
129 | } | 138 | } |
130 | spin_unlock(&mca_bh_lock); | 139 | spin_unlock(&mca_bh_lock); |
131 | 140 | ||