diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arc/include/asm/irqflags.h | 12 | ||||
-rw-r--r-- | arch/c6x/include/asm/irqflags.h | 2 | ||||
-rw-r--r-- | arch/ia64/kernel/palinfo.c | 77 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/lpar.c | 8 | ||||
-rw-r--r-- | arch/tile/include/asm/irqflags.h | 10 | ||||
-rw-r--r-- | arch/x86/xen/mmu.c | 12 |
6 files changed, 46 insertions, 75 deletions
diff --git a/arch/arc/include/asm/irqflags.h b/arch/arc/include/asm/irqflags.h index ccd84806b62f..eac071668201 100644 --- a/arch/arc/include/asm/irqflags.h +++ b/arch/arc/include/asm/irqflags.h | |||
@@ -39,7 +39,7 @@ static inline long arch_local_irq_save(void) | |||
39 | " flag.nz %0 \n" | 39 | " flag.nz %0 \n" |
40 | : "=r"(temp), "=r"(flags) | 40 | : "=r"(temp), "=r"(flags) |
41 | : "n"((STATUS_E1_MASK | STATUS_E2_MASK)) | 41 | : "n"((STATUS_E1_MASK | STATUS_E2_MASK)) |
42 | : "cc"); | 42 | : "memory", "cc"); |
43 | 43 | ||
44 | return flags; | 44 | return flags; |
45 | } | 45 | } |
@@ -53,7 +53,8 @@ static inline void arch_local_irq_restore(unsigned long flags) | |||
53 | __asm__ __volatile__( | 53 | __asm__ __volatile__( |
54 | " flag %0 \n" | 54 | " flag %0 \n" |
55 | : | 55 | : |
56 | : "r"(flags)); | 56 | : "r"(flags) |
57 | : "memory"); | ||
57 | } | 58 | } |
58 | 59 | ||
59 | /* | 60 | /* |
@@ -73,7 +74,8 @@ static inline void arch_local_irq_disable(void) | |||
73 | " and %0, %0, %1 \n" | 74 | " and %0, %0, %1 \n" |
74 | " flag %0 \n" | 75 | " flag %0 \n" |
75 | : "=&r"(temp) | 76 | : "=&r"(temp) |
76 | : "n"(~(STATUS_E1_MASK | STATUS_E2_MASK))); | 77 | : "n"(~(STATUS_E1_MASK | STATUS_E2_MASK)) |
78 | : "memory"); | ||
77 | } | 79 | } |
78 | 80 | ||
79 | /* | 81 | /* |
@@ -85,7 +87,9 @@ static inline long arch_local_save_flags(void) | |||
85 | 87 | ||
86 | __asm__ __volatile__( | 88 | __asm__ __volatile__( |
87 | " lr %0, [status32] \n" | 89 | " lr %0, [status32] \n" |
88 | : "=&r"(temp)); | 90 | : "=&r"(temp) |
91 | : | ||
92 | : "memory"); | ||
89 | 93 | ||
90 | return temp; | 94 | return temp; |
91 | } | 95 | } |
diff --git a/arch/c6x/include/asm/irqflags.h b/arch/c6x/include/asm/irqflags.h index cf78e09e18c3..2c71d5634ec2 100644 --- a/arch/c6x/include/asm/irqflags.h +++ b/arch/c6x/include/asm/irqflags.h | |||
@@ -27,7 +27,7 @@ static inline unsigned long arch_local_save_flags(void) | |||
27 | /* set interrupt enabled status */ | 27 | /* set interrupt enabled status */ |
28 | static inline void arch_local_irq_restore(unsigned long flags) | 28 | static inline void arch_local_irq_restore(unsigned long flags) |
29 | { | 29 | { |
30 | asm volatile (" mvc .s2 %0,CSR\n" : : "b"(flags)); | 30 | asm volatile (" mvc .s2 %0,CSR\n" : : "b"(flags) : "memory"); |
31 | } | 31 | } |
32 | 32 | ||
33 | /* unconditionally enable interrupts */ | 33 | /* unconditionally enable interrupts */ |
diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c index 77597e5ea60a..79521d5499f9 100644 --- a/arch/ia64/kernel/palinfo.c +++ b/arch/ia64/kernel/palinfo.c | |||
@@ -849,17 +849,6 @@ static palinfo_entry_t palinfo_entries[]={ | |||
849 | 849 | ||
850 | #define NR_PALINFO_ENTRIES (int) ARRAY_SIZE(palinfo_entries) | 850 | #define NR_PALINFO_ENTRIES (int) ARRAY_SIZE(palinfo_entries) |
851 | 851 | ||
852 | /* | ||
853 | * this array is used to keep track of the proc entries we create. This is | ||
854 | * required in the module mode when we need to remove all entries. The procfs code | ||
855 | * does not do recursion of deletion | ||
856 | * | ||
857 | * Notes: | ||
858 | * - +1 accounts for the cpuN directory entry in /proc/pal | ||
859 | */ | ||
860 | #define NR_PALINFO_PROC_ENTRIES (NR_CPUS*(NR_PALINFO_ENTRIES+1)) | ||
861 | |||
862 | static struct proc_dir_entry *palinfo_proc_entries[NR_PALINFO_PROC_ENTRIES]; | ||
863 | static struct proc_dir_entry *palinfo_dir; | 852 | static struct proc_dir_entry *palinfo_dir; |
864 | 853 | ||
865 | /* | 854 | /* |
@@ -971,60 +960,32 @@ palinfo_read_entry(char *page, char **start, off_t off, int count, int *eof, voi | |||
971 | static void __cpuinit | 960 | static void __cpuinit |
972 | create_palinfo_proc_entries(unsigned int cpu) | 961 | create_palinfo_proc_entries(unsigned int cpu) |
973 | { | 962 | { |
974 | # define CPUSTR "cpu%d" | ||
975 | |||
976 | pal_func_cpu_u_t f; | 963 | pal_func_cpu_u_t f; |
977 | struct proc_dir_entry **pdir; | ||
978 | struct proc_dir_entry *cpu_dir; | 964 | struct proc_dir_entry *cpu_dir; |
979 | int j; | 965 | int j; |
980 | char cpustr[sizeof(CPUSTR)]; | 966 | char cpustr[3+4+1]; /* cpu numbers are up to 4095 on itanic */ |
981 | 967 | sprintf(cpustr, "cpu%d", cpu); | |
982 | |||
983 | /* | ||
984 | * we keep track of created entries in a depth-first order for | ||
985 | * cleanup purposes. Each entry is stored into palinfo_proc_entries | ||
986 | */ | ||
987 | sprintf(cpustr,CPUSTR, cpu); | ||
988 | 968 | ||
989 | cpu_dir = proc_mkdir(cpustr, palinfo_dir); | 969 | cpu_dir = proc_mkdir(cpustr, palinfo_dir); |
970 | if (!cpu_dir) | ||
971 | return; | ||
990 | 972 | ||
991 | f.req_cpu = cpu; | 973 | f.req_cpu = cpu; |
992 | 974 | ||
993 | /* | ||
994 | * Compute the location to store per cpu entries | ||
995 | * We dont store the top level entry in this list, but | ||
996 | * remove it finally after removing all cpu entries. | ||
997 | */ | ||
998 | pdir = &palinfo_proc_entries[cpu*(NR_PALINFO_ENTRIES+1)]; | ||
999 | *pdir++ = cpu_dir; | ||
1000 | for (j=0; j < NR_PALINFO_ENTRIES; j++) { | 975 | for (j=0; j < NR_PALINFO_ENTRIES; j++) { |
1001 | f.func_id = j; | 976 | f.func_id = j; |
1002 | *pdir = create_proc_read_entry( | 977 | create_proc_read_entry( |
1003 | palinfo_entries[j].name, 0, cpu_dir, | 978 | palinfo_entries[j].name, 0, cpu_dir, |
1004 | palinfo_read_entry, (void *)f.value); | 979 | palinfo_read_entry, (void *)f.value); |
1005 | pdir++; | ||
1006 | } | 980 | } |
1007 | } | 981 | } |
1008 | 982 | ||
1009 | static void | 983 | static void |
1010 | remove_palinfo_proc_entries(unsigned int hcpu) | 984 | remove_palinfo_proc_entries(unsigned int hcpu) |
1011 | { | 985 | { |
1012 | int j; | 986 | char cpustr[3+4+1]; /* cpu numbers are up to 4095 on itanic */ |
1013 | struct proc_dir_entry *cpu_dir, **pdir; | 987 | sprintf(cpustr, "cpu%d", hcpu); |
1014 | 988 | remove_proc_subtree(cpustr, palinfo_dir); | |
1015 | pdir = &palinfo_proc_entries[hcpu*(NR_PALINFO_ENTRIES+1)]; | ||
1016 | cpu_dir = *pdir; | ||
1017 | *pdir++=NULL; | ||
1018 | for (j=0; j < (NR_PALINFO_ENTRIES); j++) { | ||
1019 | if ((*pdir)) { | ||
1020 | remove_proc_entry ((*pdir)->name, cpu_dir); | ||
1021 | *pdir ++= NULL; | ||
1022 | } | ||
1023 | } | ||
1024 | |||
1025 | if (cpu_dir) { | ||
1026 | remove_proc_entry(cpu_dir->name, palinfo_dir); | ||
1027 | } | ||
1028 | } | 989 | } |
1029 | 990 | ||
1030 | static int __cpuinit palinfo_cpu_callback(struct notifier_block *nfb, | 991 | static int __cpuinit palinfo_cpu_callback(struct notifier_block *nfb, |
@@ -1058,6 +1019,8 @@ palinfo_init(void) | |||
1058 | 1019 | ||
1059 | printk(KERN_INFO "PAL Information Facility v%s\n", PALINFO_VERSION); | 1020 | printk(KERN_INFO "PAL Information Facility v%s\n", PALINFO_VERSION); |
1060 | palinfo_dir = proc_mkdir("pal", NULL); | 1021 | palinfo_dir = proc_mkdir("pal", NULL); |
1022 | if (!palinfo_dir) | ||
1023 | return -ENOMEM; | ||
1061 | 1024 | ||
1062 | /* Create palinfo dirs in /proc for all online cpus */ | 1025 | /* Create palinfo dirs in /proc for all online cpus */ |
1063 | for_each_online_cpu(i) { | 1026 | for_each_online_cpu(i) { |
@@ -1073,22 +1036,8 @@ palinfo_init(void) | |||
1073 | static void __exit | 1036 | static void __exit |
1074 | palinfo_exit(void) | 1037 | palinfo_exit(void) |
1075 | { | 1038 | { |
1076 | int i = 0; | ||
1077 | |||
1078 | /* remove all nodes: depth first pass. Could optimize this */ | ||
1079 | for_each_online_cpu(i) { | ||
1080 | remove_palinfo_proc_entries(i); | ||
1081 | } | ||
1082 | |||
1083 | /* | ||
1084 | * Remove the top level entry finally | ||
1085 | */ | ||
1086 | remove_proc_entry(palinfo_dir->name, NULL); | ||
1087 | |||
1088 | /* | ||
1089 | * Unregister from cpu notifier callbacks | ||
1090 | */ | ||
1091 | unregister_hotcpu_notifier(&palinfo_cpu_notifier); | 1039 | unregister_hotcpu_notifier(&palinfo_cpu_notifier); |
1040 | remove_proc_subtree("pal", NULL); | ||
1092 | } | 1041 | } |
1093 | 1042 | ||
1094 | module_init(palinfo_init); | 1043 | module_init(palinfo_init); |
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c index 0da39fed355a..299731e9036b 100644 --- a/arch/powerpc/platforms/pseries/lpar.c +++ b/arch/powerpc/platforms/pseries/lpar.c | |||
@@ -186,7 +186,13 @@ static long pSeries_lpar_hpte_remove(unsigned long hpte_group) | |||
186 | (0x1UL << 4), &dummy1, &dummy2); | 186 | (0x1UL << 4), &dummy1, &dummy2); |
187 | if (lpar_rc == H_SUCCESS) | 187 | if (lpar_rc == H_SUCCESS) |
188 | return i; | 188 | return i; |
189 | BUG_ON(lpar_rc != H_NOT_FOUND); | 189 | |
190 | /* | ||
191 | * The test for adjunct partition is performed before the | ||
192 | * ANDCOND test. H_RESOURCE may be returned, so we need to | ||
193 | * check for that as well. | ||
194 | */ | ||
195 | BUG_ON(lpar_rc != H_NOT_FOUND && lpar_rc != H_RESOURCE); | ||
190 | 196 | ||
191 | slot_offset++; | 197 | slot_offset++; |
192 | slot_offset &= 0x7; | 198 | slot_offset &= 0x7; |
diff --git a/arch/tile/include/asm/irqflags.h b/arch/tile/include/asm/irqflags.h index 241c0bb60b12..c96f9bbb760d 100644 --- a/arch/tile/include/asm/irqflags.h +++ b/arch/tile/include/asm/irqflags.h | |||
@@ -40,7 +40,15 @@ | |||
40 | #include <asm/percpu.h> | 40 | #include <asm/percpu.h> |
41 | #include <arch/spr_def.h> | 41 | #include <arch/spr_def.h> |
42 | 42 | ||
43 | /* Set and clear kernel interrupt masks. */ | 43 | /* |
44 | * Set and clear kernel interrupt masks. | ||
45 | * | ||
46 | * NOTE: __insn_mtspr() is a compiler builtin marked as a memory | ||
47 | * clobber. We rely on it being equivalent to a compiler barrier in | ||
48 | * this code since arch_local_irq_save() and friends must act as | ||
49 | * compiler barriers. This compiler semantic is baked into enough | ||
50 | * places that the compiler will maintain it going forward. | ||
51 | */ | ||
44 | #if CHIP_HAS_SPLIT_INTR_MASK() | 52 | #if CHIP_HAS_SPLIT_INTR_MASK() |
45 | #if INT_PERF_COUNT < 32 || INT_AUX_PERF_COUNT < 32 || INT_MEM_ERROR >= 32 | 53 | #if INT_PERF_COUNT < 32 || INT_AUX_PERF_COUNT < 32 || INT_MEM_ERROR >= 32 |
46 | # error Fix assumptions about which word various interrupts are in | 54 | # error Fix assumptions about which word various interrupts are in |
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 6afbb2ca9a0a..a4ea92477e01 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -1748,14 +1748,18 @@ static void *m2v(phys_addr_t maddr) | |||
1748 | } | 1748 | } |
1749 | 1749 | ||
1750 | /* Set the page permissions on an identity-mapped pages */ | 1750 | /* Set the page permissions on an identity-mapped pages */ |
1751 | static void set_page_prot(void *addr, pgprot_t prot) | 1751 | static void set_page_prot_flags(void *addr, pgprot_t prot, unsigned long flags) |
1752 | { | 1752 | { |
1753 | unsigned long pfn = __pa(addr) >> PAGE_SHIFT; | 1753 | unsigned long pfn = __pa(addr) >> PAGE_SHIFT; |
1754 | pte_t pte = pfn_pte(pfn, prot); | 1754 | pte_t pte = pfn_pte(pfn, prot); |
1755 | 1755 | ||
1756 | if (HYPERVISOR_update_va_mapping((unsigned long)addr, pte, 0)) | 1756 | if (HYPERVISOR_update_va_mapping((unsigned long)addr, pte, flags)) |
1757 | BUG(); | 1757 | BUG(); |
1758 | } | 1758 | } |
1759 | static void set_page_prot(void *addr, pgprot_t prot) | ||
1760 | { | ||
1761 | return set_page_prot_flags(addr, prot, UVMF_NONE); | ||
1762 | } | ||
1759 | #ifdef CONFIG_X86_32 | 1763 | #ifdef CONFIG_X86_32 |
1760 | static void __init xen_map_identity_early(pmd_t *pmd, unsigned long max_pfn) | 1764 | static void __init xen_map_identity_early(pmd_t *pmd, unsigned long max_pfn) |
1761 | { | 1765 | { |
@@ -1839,12 +1843,12 @@ static void __init check_pt_base(unsigned long *pt_base, unsigned long *pt_end, | |||
1839 | unsigned long addr) | 1843 | unsigned long addr) |
1840 | { | 1844 | { |
1841 | if (*pt_base == PFN_DOWN(__pa(addr))) { | 1845 | if (*pt_base == PFN_DOWN(__pa(addr))) { |
1842 | set_page_prot((void *)addr, PAGE_KERNEL); | 1846 | set_page_prot_flags((void *)addr, PAGE_KERNEL, UVMF_INVLPG); |
1843 | clear_page((void *)addr); | 1847 | clear_page((void *)addr); |
1844 | (*pt_base)++; | 1848 | (*pt_base)++; |
1845 | } | 1849 | } |
1846 | if (*pt_end == PFN_DOWN(__pa(addr))) { | 1850 | if (*pt_end == PFN_DOWN(__pa(addr))) { |
1847 | set_page_prot((void *)addr, PAGE_KERNEL); | 1851 | set_page_prot_flags((void *)addr, PAGE_KERNEL, UVMF_INVLPG); |
1848 | clear_page((void *)addr); | 1852 | clear_page((void *)addr); |
1849 | (*pt_end)--; | 1853 | (*pt_end)--; |
1850 | } | 1854 | } |