aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2011-01-14 02:06:31 -0500
committerPaul Mundt <lethal@linux-sh.org>2011-01-14 02:06:31 -0500
commitc488a4731abb53aa1bab9fccd8a7472083159bfd (patch)
treedb6d4a664a1e4b7685c1d2d79da63263f40adf7b /arch
parent6d2ae89c36e2adab5cfa69fecb11290082817ac6 (diff)
parentbba958783b1b4cb0a9420f4e11082467132a334c (diff)
Merge branch 'common/mmcif' into rmobile-latest
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/include/asm/mman.h3
-rw-r--r--arch/arm/kernel/module.c14
-rw-r--r--arch/arm/mm/pgd.c2
-rw-r--r--arch/avr32/boards/atngw100/setup.c2
-rw-r--r--arch/avr32/boards/atstk1000/atstk1002.c2
-rw-r--r--arch/avr32/boards/favr-32/setup.c2
-rw-r--r--arch/avr32/boards/hammerhead/setup.c2
-rw-r--r--arch/avr32/boards/merisc/setup.c2
-rw-r--r--arch/avr32/boards/mimc200/setup.c2
-rw-r--r--arch/avr32/configs/atngw100_defconfig23
-rw-r--r--arch/avr32/configs/atngw100_evklcd100_defconfig17
-rw-r--r--arch/avr32/configs/atngw100_evklcd101_defconfig17
-rw-r--r--arch/avr32/configs/atngw100mkii_defconfig22
-rw-r--r--arch/avr32/configs/atngw100mkii_evklcd100_defconfig17
-rw-r--r--arch/avr32/configs/atngw100mkii_evklcd101_defconfig17
-rw-r--r--arch/avr32/configs/atstk1002_defconfig25
-rw-r--r--arch/avr32/configs/atstk1003_defconfig41
-rw-r--r--arch/avr32/configs/atstk1004_defconfig109
-rw-r--r--arch/avr32/configs/atstk1006_defconfig23
-rw-r--r--arch/avr32/configs/favr-32_defconfig2
-rw-r--r--arch/avr32/configs/hammerhead_defconfig2
-rw-r--r--arch/avr32/include/asm/syscalls.h14
-rw-r--r--arch/avr32/kernel/process.c9
-rw-r--r--arch/avr32/kernel/time.c5
-rw-r--r--arch/ia64/kernel/perfmon.c2
-rw-r--r--arch/ia64/mm/hugetlbpage.c2
-rw-r--r--arch/mips/include/asm/mman.h3
-rw-r--r--arch/mips/kernel/module.c14
-rw-r--r--arch/parisc/include/asm/mman.h3
-rw-r--r--arch/powerpc/mm/gup.c12
-rw-r--r--arch/sh/mm/hugetlbpage.c2
-rw-r--r--arch/sparc/kernel/module.c14
-rw-r--r--arch/sparc/mm/generic_32.c2
-rw-r--r--arch/sparc/mm/generic_64.c2
-rw-r--r--arch/sparc/mm/hugetlbpage.c2
-rw-r--r--arch/um/kernel/skas/mmu.c2
-rw-r--r--arch/x86/include/asm/kvm_host.h1
-rw-r--r--arch/x86/include/asm/paravirt.h25
-rw-r--r--arch/x86/include/asm/paravirt_types.h6
-rw-r--r--arch/x86/include/asm/pgtable-2level.h9
-rw-r--r--arch/x86/include/asm/pgtable-3level.h23
-rw-r--r--arch/x86/include/asm/pgtable.h143
-rw-r--r--arch/x86/include/asm/pgtable_64.h28
-rw-r--r--arch/x86/include/asm/pgtable_types.h3
-rw-r--r--arch/x86/include/asm/xen/page.h16
-rw-r--r--arch/x86/kernel/module.c17
-rw-r--r--arch/x86/kernel/paravirt.c3
-rw-r--r--arch/x86/kernel/tboot.c2
-rw-r--r--arch/x86/kernel/vm86_32.c1
-rw-r--r--arch/x86/kvm/mmu.c125
-rw-r--r--arch/x86/kvm/paging_tmpl.h9
-rw-r--r--arch/x86/mm/gup.c28
-rw-r--r--arch/x86/mm/pgtable.c66
-rw-r--r--arch/x86/xen/Makefile3
-rw-r--r--arch/x86/xen/mmu.c365
-rw-r--r--arch/x86/xen/p2m.c510
-rw-r--r--arch/xtensa/include/asm/mman.h3
57 files changed, 1222 insertions, 598 deletions
diff --git a/arch/alpha/include/asm/mman.h b/arch/alpha/include/asm/mman.h
index 99c56d47879d..72db984f8781 100644
--- a/arch/alpha/include/asm/mman.h
+++ b/arch/alpha/include/asm/mman.h
@@ -53,6 +53,9 @@
53#define MADV_MERGEABLE 12 /* KSM may merge identical pages */ 53#define MADV_MERGEABLE 12 /* KSM may merge identical pages */
54#define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */ 54#define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */
55 55
56#define MADV_HUGEPAGE 14 /* Worth backing with hugepages */
57#define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages */
58
56/* compatibility flags */ 59/* compatibility flags */
57#define MAP_FILE 0 60#define MAP_FILE 0
58 61
diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
index 0c1bb68ff4a8..2cfe8161b478 100644
--- a/arch/arm/kernel/module.c
+++ b/arch/arm/kernel/module.c
@@ -38,17 +38,9 @@
38#ifdef CONFIG_MMU 38#ifdef CONFIG_MMU
39void *module_alloc(unsigned long size) 39void *module_alloc(unsigned long size)
40{ 40{
41 struct vm_struct *area; 41 return __vmalloc_node_range(size, 1, MODULES_VADDR, MODULES_END,
42 42 GFP_KERNEL, PAGE_KERNEL_EXEC, -1,
43 size = PAGE_ALIGN(size); 43 __builtin_return_address(0));
44 if (!size)
45 return NULL;
46
47 area = __get_vm_area(size, VM_ALLOC, MODULES_VADDR, MODULES_END);
48 if (!area)
49 return NULL;
50
51 return __vmalloc_area(area, GFP_KERNEL, PAGE_KERNEL_EXEC);
52} 44}
53#else /* CONFIG_MMU */ 45#else /* CONFIG_MMU */
54void *module_alloc(unsigned long size) 46void *module_alloc(unsigned long size)
diff --git a/arch/arm/mm/pgd.c b/arch/arm/mm/pgd.c
index 93292a18cf77..709244c66fa3 100644
--- a/arch/arm/mm/pgd.c
+++ b/arch/arm/mm/pgd.c
@@ -50,7 +50,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
50 if (!new_pmd) 50 if (!new_pmd)
51 goto no_pmd; 51 goto no_pmd;
52 52
53 new_pte = pte_alloc_map(mm, new_pmd, 0); 53 new_pte = pte_alloc_map(mm, NULL, new_pmd, 0);
54 if (!new_pte) 54 if (!new_pte)
55 goto no_pte; 55 goto no_pte;
56 56
diff --git a/arch/avr32/boards/atngw100/setup.c b/arch/avr32/boards/atngw100/setup.c
index 8c6a2440e345..659d119ce712 100644
--- a/arch/avr32/boards/atngw100/setup.c
+++ b/arch/avr32/boards/atngw100/setup.c
@@ -188,7 +188,7 @@ static void __init set_hw_addr(struct platform_device *pdev)
188 */ 188 */
189 regs = (void __iomem __force *)res->start; 189 regs = (void __iomem __force *)res->start;
190 pclk = clk_get(&pdev->dev, "pclk"); 190 pclk = clk_get(&pdev->dev, "pclk");
191 if (!pclk) 191 if (IS_ERR(pclk))
192 return; 192 return;
193 193
194 clk_enable(pclk); 194 clk_enable(pclk);
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c
index 2adc261c9e3d..6ce30fb2ec94 100644
--- a/arch/avr32/boards/atstk1000/atstk1002.c
+++ b/arch/avr32/boards/atstk1000/atstk1002.c
@@ -203,7 +203,7 @@ static void __init set_hw_addr(struct platform_device *pdev)
203 */ 203 */
204 regs = (void __iomem __force *)res->start; 204 regs = (void __iomem __force *)res->start;
205 pclk = clk_get(&pdev->dev, "pclk"); 205 pclk = clk_get(&pdev->dev, "pclk");
206 if (!pclk) 206 if (IS_ERR(pclk))
207 return; 207 return;
208 208
209 clk_enable(pclk); 209 clk_enable(pclk);
diff --git a/arch/avr32/boards/favr-32/setup.c b/arch/avr32/boards/favr-32/setup.c
index 75f19f47fb2f..86fab77a5a00 100644
--- a/arch/avr32/boards/favr-32/setup.c
+++ b/arch/avr32/boards/favr-32/setup.c
@@ -206,7 +206,7 @@ static void __init set_hw_addr(struct platform_device *pdev)
206 */ 206 */
207 regs = (void __iomem __force *)res->start; 207 regs = (void __iomem __force *)res->start;
208 pclk = clk_get(&pdev->dev, "pclk"); 208 pclk = clk_get(&pdev->dev, "pclk");
209 if (!pclk) 209 if (IS_ERR(pclk))
210 return; 210 return;
211 211
212 clk_enable(pclk); 212 clk_enable(pclk);
diff --git a/arch/avr32/boards/hammerhead/setup.c b/arch/avr32/boards/hammerhead/setup.c
index dd009875a405..da14fbdd4e8e 100644
--- a/arch/avr32/boards/hammerhead/setup.c
+++ b/arch/avr32/boards/hammerhead/setup.c
@@ -150,7 +150,7 @@ static void __init set_hw_addr(struct platform_device *pdev)
150 regs = (void __iomem __force *)res->start; 150 regs = (void __iomem __force *)res->start;
151 pclk = clk_get(&pdev->dev, "pclk"); 151 pclk = clk_get(&pdev->dev, "pclk");
152 152
153 if (!pclk) 153 if (IS_ERR(pclk))
154 return; 154 return;
155 155
156 clk_enable(pclk); 156 clk_enable(pclk);
diff --git a/arch/avr32/boards/merisc/setup.c b/arch/avr32/boards/merisc/setup.c
index 623b077594fc..e61bc948f959 100644
--- a/arch/avr32/boards/merisc/setup.c
+++ b/arch/avr32/boards/merisc/setup.c
@@ -134,7 +134,7 @@ static void __init set_hw_addr(struct platform_device *pdev)
134 134
135 regs = (void __iomem __force *)res->start; 135 regs = (void __iomem __force *)res->start;
136 pclk = clk_get(&pdev->dev, "pclk"); 136 pclk = clk_get(&pdev->dev, "pclk");
137 if (!pclk) 137 if (IS_ERR(pclk))
138 return; 138 return;
139 139
140 clk_enable(pclk); 140 clk_enable(pclk);
diff --git a/arch/avr32/boards/mimc200/setup.c b/arch/avr32/boards/mimc200/setup.c
index 523d8e183bef..c4da5cba2dbf 100644
--- a/arch/avr32/boards/mimc200/setup.c
+++ b/arch/avr32/boards/mimc200/setup.c
@@ -162,7 +162,7 @@ static void __init set_hw_addr(struct platform_device *pdev)
162 */ 162 */
163 regs = (void __iomem __force *)res->start; 163 regs = (void __iomem __force *)res->start;
164 pclk = clk_get(&pdev->dev, "pclk"); 164 pclk = clk_get(&pdev->dev, "pclk");
165 if (!pclk) 165 if (IS_ERR(pclk))
166 return; 166 return;
167 167
168 clk_enable(pclk); 168 clk_enable(pclk);
diff --git a/arch/avr32/configs/atngw100_defconfig b/arch/avr32/configs/atngw100_defconfig
index 9854013d2728..6f9ca56de1f6 100644
--- a/arch/avr32/configs/atngw100_defconfig
+++ b/arch/avr32/configs/atngw100_defconfig
@@ -2,20 +2,17 @@ CONFIG_EXPERIMENTAL=y
2# CONFIG_LOCALVERSION_AUTO is not set 2# CONFIG_LOCALVERSION_AUTO is not set
3CONFIG_SYSVIPC=y 3CONFIG_SYSVIPC=y
4CONFIG_POSIX_MQUEUE=y 4CONFIG_POSIX_MQUEUE=y
5CONFIG_BSD_PROCESS_ACCT=y
6CONFIG_BSD_PROCESS_ACCT_V3=y
7CONFIG_LOG_BUF_SHIFT=14 5CONFIG_LOG_BUF_SHIFT=14
8CONFIG_SYSFS_DEPRECATED_V2=y 6CONFIG_RELAY=y
9CONFIG_BLK_DEV_INITRD=y 7CONFIG_BLK_DEV_INITRD=y
10# CONFIG_SYSCTL_SYSCALL is not set 8# CONFIG_SYSCTL_SYSCALL is not set
11# CONFIG_BASE_FULL is not set 9# CONFIG_BASE_FULL is not set
12# CONFIG_COMPAT_BRK is not set 10# CONFIG_COMPAT_BRK is not set
13CONFIG_PROFILING=y 11CONFIG_PROFILING=y
14CONFIG_OPROFILE=m 12CONFIG_OPROFILE=m
15CONFIG_KPROBES=y 13# CONFIG_KPROBES is not set
16CONFIG_MODULES=y 14CONFIG_MODULES=y
17CONFIG_MODULE_UNLOAD=y 15CONFIG_MODULE_UNLOAD=y
18CONFIG_MODULE_FORCE_UNLOAD=y
19# CONFIG_BLK_DEV_BSG is not set 16# CONFIG_BLK_DEV_BSG is not set
20# CONFIG_IOSCHED_DEADLINE is not set 17# CONFIG_IOSCHED_DEADLINE is not set
21CONFIG_NO_HZ=y 18CONFIG_NO_HZ=y
@@ -29,6 +26,7 @@ CONFIG_CPU_FREQ=y
29CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y 26CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
30CONFIG_CPU_FREQ_GOV_USERSPACE=y 27CONFIG_CPU_FREQ_GOV_USERSPACE=y
31CONFIG_CPU_FREQ_AT32AP=y 28CONFIG_CPU_FREQ_AT32AP=y
29CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
32CONFIG_NET=y 30CONFIG_NET=y
33CONFIG_PACKET=y 31CONFIG_PACKET=y
34CONFIG_UNIX=y 32CONFIG_UNIX=y
@@ -72,8 +70,8 @@ CONFIG_MTD_UBI=y
72CONFIG_BLK_DEV_LOOP=m 70CONFIG_BLK_DEV_LOOP=m
73CONFIG_BLK_DEV_NBD=m 71CONFIG_BLK_DEV_NBD=m
74CONFIG_BLK_DEV_RAM=m 72CONFIG_BLK_DEV_RAM=m
73CONFIG_MISC_DEVICES=y
75CONFIG_ATMEL_TCLIB=y 74CONFIG_ATMEL_TCLIB=y
76CONFIG_EEPROM_AT24=m
77CONFIG_NETDEVICES=y 75CONFIG_NETDEVICES=y
78CONFIG_TUN=m 76CONFIG_TUN=m
79CONFIG_NET_ETHERNET=y 77CONFIG_NET_ETHERNET=y
@@ -106,6 +104,7 @@ CONFIG_GPIO_SYSFS=y
106CONFIG_WATCHDOG=y 104CONFIG_WATCHDOG=y
107CONFIG_AT32AP700X_WDT=y 105CONFIG_AT32AP700X_WDT=y
108CONFIG_USB_GADGET=y 106CONFIG_USB_GADGET=y
107CONFIG_USB_GADGET_VBUS_DRAW=350
109CONFIG_USB_ZERO=m 108CONFIG_USB_ZERO=m
110CONFIG_USB_ETH=m 109CONFIG_USB_ETH=m
111CONFIG_USB_GADGETFS=m 110CONFIG_USB_GADGETFS=m
@@ -115,14 +114,12 @@ CONFIG_USB_CDC_COMPOSITE=m
115CONFIG_MMC=y 114CONFIG_MMC=y
116CONFIG_MMC_TEST=m 115CONFIG_MMC_TEST=m
117CONFIG_MMC_ATMELMCI=y 116CONFIG_MMC_ATMELMCI=y
118CONFIG_MMC_SPI=m
119CONFIG_NEW_LEDS=y 117CONFIG_NEW_LEDS=y
120CONFIG_LEDS_CLASS=y 118CONFIG_LEDS_CLASS=y
121CONFIG_LEDS_GPIO=y 119CONFIG_LEDS_GPIO=y
122CONFIG_LEDS_TRIGGERS=y 120CONFIG_LEDS_TRIGGERS=y
123CONFIG_LEDS_TRIGGER_TIMER=y 121CONFIG_LEDS_TRIGGER_TIMER=y
124CONFIG_LEDS_TRIGGER_HEARTBEAT=y 122CONFIG_LEDS_TRIGGER_HEARTBEAT=y
125CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
126CONFIG_RTC_CLASS=y 123CONFIG_RTC_CLASS=y
127CONFIG_RTC_DRV_AT32AP700X=y 124CONFIG_RTC_DRV_AT32AP700X=y
128CONFIG_DMADEVICES=y 125CONFIG_DMADEVICES=y
@@ -130,21 +127,23 @@ CONFIG_EXT2_FS=y
130CONFIG_EXT3_FS=y 127CONFIG_EXT3_FS=y
131# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 128# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
132# CONFIG_EXT3_FS_XATTR is not set 129# CONFIG_EXT3_FS_XATTR is not set
130CONFIG_EXT4_FS=y
131# CONFIG_EXT4_FS_XATTR is not set
133# CONFIG_DNOTIFY is not set 132# CONFIG_DNOTIFY is not set
134CONFIG_FUSE_FS=m 133CONFIG_FUSE_FS=m
135CONFIG_MSDOS_FS=m 134CONFIG_MSDOS_FS=m
136CONFIG_VFAT_FS=m 135CONFIG_VFAT_FS=m
137CONFIG_FAT_DEFAULT_CODEPAGE=850 136CONFIG_FAT_DEFAULT_CODEPAGE=850
137CONFIG_PROC_KCORE=y
138CONFIG_TMPFS=y 138CONFIG_TMPFS=y
139CONFIG_CONFIGFS_FS=m 139CONFIG_CONFIGFS_FS=y
140CONFIG_JFFS2_FS=y 140CONFIG_JFFS2_FS=y
141CONFIG_UFS_FS=y 141CONFIG_UBIFS_FS=y
142CONFIG_NFS_FS=y 142CONFIG_NFS_FS=y
143CONFIG_NFS_V3=y 143CONFIG_NFS_V3=y
144CONFIG_ROOT_NFS=y 144CONFIG_ROOT_NFS=y
145CONFIG_NFSD=m 145CONFIG_NFSD=m
146CONFIG_NFSD_V3=y 146CONFIG_NFSD_V3=y
147CONFIG_SMB_FS=m
148CONFIG_CIFS=m 147CONFIG_CIFS=m
149CONFIG_NLS_CODEPAGE_437=m 148CONFIG_NLS_CODEPAGE_437=m
150CONFIG_NLS_CODEPAGE_850=m 149CONFIG_NLS_CODEPAGE_850=m
@@ -155,5 +154,3 @@ CONFIG_DEBUG_FS=y
155CONFIG_DEBUG_KERNEL=y 154CONFIG_DEBUG_KERNEL=y
156CONFIG_DETECT_HUNG_TASK=y 155CONFIG_DETECT_HUNG_TASK=y
157CONFIG_FRAME_POINTER=y 156CONFIG_FRAME_POINTER=y
158# CONFIG_RCU_CPU_STALL_DETECTOR is not set
159CONFIG_CRYPTO_PCBC=m
diff --git a/arch/avr32/configs/atngw100_evklcd100_defconfig b/arch/avr32/configs/atngw100_evklcd100_defconfig
index 7ceda354597b..7eece0af34c9 100644
--- a/arch/avr32/configs/atngw100_evklcd100_defconfig
+++ b/arch/avr32/configs/atngw100_evklcd100_defconfig
@@ -2,20 +2,17 @@ CONFIG_EXPERIMENTAL=y
2# CONFIG_LOCALVERSION_AUTO is not set 2# CONFIG_LOCALVERSION_AUTO is not set
3CONFIG_SYSVIPC=y 3CONFIG_SYSVIPC=y
4CONFIG_POSIX_MQUEUE=y 4CONFIG_POSIX_MQUEUE=y
5CONFIG_BSD_PROCESS_ACCT=y
6CONFIG_BSD_PROCESS_ACCT_V3=y
7CONFIG_LOG_BUF_SHIFT=14 5CONFIG_LOG_BUF_SHIFT=14
8CONFIG_SYSFS_DEPRECATED_V2=y 6CONFIG_RELAY=y
9CONFIG_BLK_DEV_INITRD=y 7CONFIG_BLK_DEV_INITRD=y
10# CONFIG_SYSCTL_SYSCALL is not set 8# CONFIG_SYSCTL_SYSCALL is not set
11# CONFIG_BASE_FULL is not set 9# CONFIG_BASE_FULL is not set
12# CONFIG_COMPAT_BRK is not set 10# CONFIG_COMPAT_BRK is not set
13CONFIG_PROFILING=y 11CONFIG_PROFILING=y
14CONFIG_OPROFILE=m 12CONFIG_OPROFILE=m
15CONFIG_KPROBES=y 13# CONFIG_KPROBES is not set
16CONFIG_MODULES=y 14CONFIG_MODULES=y
17CONFIG_MODULE_UNLOAD=y 15CONFIG_MODULE_UNLOAD=y
18CONFIG_MODULE_FORCE_UNLOAD=y
19# CONFIG_BLK_DEV_BSG is not set 16# CONFIG_BLK_DEV_BSG is not set
20# CONFIG_IOSCHED_DEADLINE is not set 17# CONFIG_IOSCHED_DEADLINE is not set
21CONFIG_NO_HZ=y 18CONFIG_NO_HZ=y
@@ -31,6 +28,7 @@ CONFIG_CPU_FREQ=y
31CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y 28CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
32CONFIG_CPU_FREQ_GOV_USERSPACE=y 29CONFIG_CPU_FREQ_GOV_USERSPACE=y
33CONFIG_CPU_FREQ_AT32AP=y 30CONFIG_CPU_FREQ_AT32AP=y
31CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
34CONFIG_NET=y 32CONFIG_NET=y
35CONFIG_PACKET=y 33CONFIG_PACKET=y
36CONFIG_UNIX=y 34CONFIG_UNIX=y
@@ -74,8 +72,10 @@ CONFIG_MTD_UBI=y
74CONFIG_BLK_DEV_LOOP=m 72CONFIG_BLK_DEV_LOOP=m
75CONFIG_BLK_DEV_NBD=m 73CONFIG_BLK_DEV_NBD=m
76CONFIG_BLK_DEV_RAM=m 74CONFIG_BLK_DEV_RAM=m
75CONFIG_MISC_DEVICES=y
77CONFIG_ATMEL_TCLIB=y 76CONFIG_ATMEL_TCLIB=y
78CONFIG_NETDEVICES=y 77CONFIG_NETDEVICES=y
78CONFIG_TUN=m
79CONFIG_NET_ETHERNET=y 79CONFIG_NET_ETHERNET=y
80CONFIG_MACB=y 80CONFIG_MACB=y
81# CONFIG_NETDEV_1000 is not set 81# CONFIG_NETDEV_1000 is not set
@@ -104,6 +104,7 @@ CONFIG_I2C_GPIO=m
104CONFIG_SPI=y 104CONFIG_SPI=y
105CONFIG_SPI_ATMEL=y 105CONFIG_SPI_ATMEL=y
106CONFIG_SPI_SPIDEV=m 106CONFIG_SPI_SPIDEV=m
107CONFIG_GPIO_SYSFS=y
107# CONFIG_HWMON is not set 108# CONFIG_HWMON is not set
108CONFIG_WATCHDOG=y 109CONFIG_WATCHDOG=y
109CONFIG_AT32AP700X_WDT=y 110CONFIG_AT32AP700X_WDT=y
@@ -127,6 +128,7 @@ CONFIG_USB_FILE_STORAGE=m
127CONFIG_USB_G_SERIAL=m 128CONFIG_USB_G_SERIAL=m
128CONFIG_USB_CDC_COMPOSITE=m 129CONFIG_USB_CDC_COMPOSITE=m
129CONFIG_MMC=y 130CONFIG_MMC=y
131CONFIG_MMC_TEST=m
130CONFIG_MMC_ATMELMCI=y 132CONFIG_MMC_ATMELMCI=y
131CONFIG_NEW_LEDS=y 133CONFIG_NEW_LEDS=y
132CONFIG_LEDS_CLASS=y 134CONFIG_LEDS_CLASS=y
@@ -141,11 +143,14 @@ CONFIG_EXT2_FS=y
141CONFIG_EXT3_FS=y 143CONFIG_EXT3_FS=y
142# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 144# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
143# CONFIG_EXT3_FS_XATTR is not set 145# CONFIG_EXT3_FS_XATTR is not set
146CONFIG_EXT4_FS=y
147# CONFIG_EXT4_FS_XATTR is not set
144# CONFIG_DNOTIFY is not set 148# CONFIG_DNOTIFY is not set
145CONFIG_FUSE_FS=m 149CONFIG_FUSE_FS=m
146CONFIG_MSDOS_FS=m 150CONFIG_MSDOS_FS=m
147CONFIG_VFAT_FS=m 151CONFIG_VFAT_FS=m
148CONFIG_FAT_DEFAULT_CODEPAGE=850 152CONFIG_FAT_DEFAULT_CODEPAGE=850
153CONFIG_PROC_KCORE=y
149CONFIG_TMPFS=y 154CONFIG_TMPFS=y
150CONFIG_CONFIGFS_FS=y 155CONFIG_CONFIGFS_FS=y
151CONFIG_JFFS2_FS=y 156CONFIG_JFFS2_FS=y
@@ -155,7 +160,6 @@ CONFIG_NFS_V3=y
155CONFIG_ROOT_NFS=y 160CONFIG_ROOT_NFS=y
156CONFIG_NFSD=m 161CONFIG_NFSD=m
157CONFIG_NFSD_V3=y 162CONFIG_NFSD_V3=y
158CONFIG_SMB_FS=m
159CONFIG_CIFS=m 163CONFIG_CIFS=m
160CONFIG_NLS_CODEPAGE_437=m 164CONFIG_NLS_CODEPAGE_437=m
161CONFIG_NLS_CODEPAGE_850=m 165CONFIG_NLS_CODEPAGE_850=m
@@ -166,4 +170,3 @@ CONFIG_DEBUG_FS=y
166CONFIG_DEBUG_KERNEL=y 170CONFIG_DEBUG_KERNEL=y
167CONFIG_DETECT_HUNG_TASK=y 171CONFIG_DETECT_HUNG_TASK=y
168CONFIG_FRAME_POINTER=y 172CONFIG_FRAME_POINTER=y
169# CONFIG_RCU_CPU_STALL_DETECTOR is not set
diff --git a/arch/avr32/configs/atngw100_evklcd101_defconfig b/arch/avr32/configs/atngw100_evklcd101_defconfig
index 7bc5b2ce68d5..387eb9d6e423 100644
--- a/arch/avr32/configs/atngw100_evklcd101_defconfig
+++ b/arch/avr32/configs/atngw100_evklcd101_defconfig
@@ -2,20 +2,17 @@ CONFIG_EXPERIMENTAL=y
2# CONFIG_LOCALVERSION_AUTO is not set 2# CONFIG_LOCALVERSION_AUTO is not set
3CONFIG_SYSVIPC=y 3CONFIG_SYSVIPC=y
4CONFIG_POSIX_MQUEUE=y 4CONFIG_POSIX_MQUEUE=y
5CONFIG_BSD_PROCESS_ACCT=y
6CONFIG_BSD_PROCESS_ACCT_V3=y
7CONFIG_LOG_BUF_SHIFT=14 5CONFIG_LOG_BUF_SHIFT=14
8CONFIG_SYSFS_DEPRECATED_V2=y 6CONFIG_RELAY=y
9CONFIG_BLK_DEV_INITRD=y 7CONFIG_BLK_DEV_INITRD=y
10# CONFIG_SYSCTL_SYSCALL is not set 8# CONFIG_SYSCTL_SYSCALL is not set
11# CONFIG_BASE_FULL is not set 9# CONFIG_BASE_FULL is not set
12# CONFIG_COMPAT_BRK is not set 10# CONFIG_COMPAT_BRK is not set
13CONFIG_PROFILING=y 11CONFIG_PROFILING=y
14CONFIG_OPROFILE=m 12CONFIG_OPROFILE=m
15CONFIG_KPROBES=y 13# CONFIG_KPROBES is not set
16CONFIG_MODULES=y 14CONFIG_MODULES=y
17CONFIG_MODULE_UNLOAD=y 15CONFIG_MODULE_UNLOAD=y
18CONFIG_MODULE_FORCE_UNLOAD=y
19# CONFIG_BLK_DEV_BSG is not set 16# CONFIG_BLK_DEV_BSG is not set
20# CONFIG_IOSCHED_DEADLINE is not set 17# CONFIG_IOSCHED_DEADLINE is not set
21CONFIG_NO_HZ=y 18CONFIG_NO_HZ=y
@@ -30,6 +27,7 @@ CONFIG_CPU_FREQ=y
30CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y 27CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
31CONFIG_CPU_FREQ_GOV_USERSPACE=y 28CONFIG_CPU_FREQ_GOV_USERSPACE=y
32CONFIG_CPU_FREQ_AT32AP=y 29CONFIG_CPU_FREQ_AT32AP=y
30CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
33CONFIG_NET=y 31CONFIG_NET=y
34CONFIG_PACKET=y 32CONFIG_PACKET=y
35CONFIG_UNIX=y 33CONFIG_UNIX=y
@@ -73,8 +71,10 @@ CONFIG_MTD_UBI=y
73CONFIG_BLK_DEV_LOOP=m 71CONFIG_BLK_DEV_LOOP=m
74CONFIG_BLK_DEV_NBD=m 72CONFIG_BLK_DEV_NBD=m
75CONFIG_BLK_DEV_RAM=m 73CONFIG_BLK_DEV_RAM=m
74CONFIG_MISC_DEVICES=y
76CONFIG_ATMEL_TCLIB=y 75CONFIG_ATMEL_TCLIB=y
77CONFIG_NETDEVICES=y 76CONFIG_NETDEVICES=y
77CONFIG_TUN=m
78CONFIG_NET_ETHERNET=y 78CONFIG_NET_ETHERNET=y
79CONFIG_MACB=y 79CONFIG_MACB=y
80# CONFIG_NETDEV_1000 is not set 80# CONFIG_NETDEV_1000 is not set
@@ -103,6 +103,7 @@ CONFIG_I2C_GPIO=m
103CONFIG_SPI=y 103CONFIG_SPI=y
104CONFIG_SPI_ATMEL=y 104CONFIG_SPI_ATMEL=y
105CONFIG_SPI_SPIDEV=m 105CONFIG_SPI_SPIDEV=m
106CONFIG_GPIO_SYSFS=y
106# CONFIG_HWMON is not set 107# CONFIG_HWMON is not set
107CONFIG_WATCHDOG=y 108CONFIG_WATCHDOG=y
108CONFIG_AT32AP700X_WDT=y 109CONFIG_AT32AP700X_WDT=y
@@ -126,6 +127,7 @@ CONFIG_USB_FILE_STORAGE=m
126CONFIG_USB_G_SERIAL=m 127CONFIG_USB_G_SERIAL=m
127CONFIG_USB_CDC_COMPOSITE=m 128CONFIG_USB_CDC_COMPOSITE=m
128CONFIG_MMC=y 129CONFIG_MMC=y
130CONFIG_MMC_TEST=m
129CONFIG_MMC_ATMELMCI=y 131CONFIG_MMC_ATMELMCI=y
130CONFIG_NEW_LEDS=y 132CONFIG_NEW_LEDS=y
131CONFIG_LEDS_CLASS=y 133CONFIG_LEDS_CLASS=y
@@ -140,11 +142,14 @@ CONFIG_EXT2_FS=y
140CONFIG_EXT3_FS=y 142CONFIG_EXT3_FS=y
141# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 143# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
142# CONFIG_EXT3_FS_XATTR is not set 144# CONFIG_EXT3_FS_XATTR is not set
145CONFIG_EXT4_FS=y
146# CONFIG_EXT4_FS_XATTR is not set
143# CONFIG_DNOTIFY is not set 147# CONFIG_DNOTIFY is not set
144CONFIG_FUSE_FS=m 148CONFIG_FUSE_FS=m
145CONFIG_MSDOS_FS=m 149CONFIG_MSDOS_FS=m
146CONFIG_VFAT_FS=m 150CONFIG_VFAT_FS=m
147CONFIG_FAT_DEFAULT_CODEPAGE=850 151CONFIG_FAT_DEFAULT_CODEPAGE=850
152CONFIG_PROC_KCORE=y
148CONFIG_TMPFS=y 153CONFIG_TMPFS=y
149CONFIG_CONFIGFS_FS=y 154CONFIG_CONFIGFS_FS=y
150CONFIG_JFFS2_FS=y 155CONFIG_JFFS2_FS=y
@@ -154,7 +159,6 @@ CONFIG_NFS_V3=y
154CONFIG_ROOT_NFS=y 159CONFIG_ROOT_NFS=y
155CONFIG_NFSD=m 160CONFIG_NFSD=m
156CONFIG_NFSD_V3=y 161CONFIG_NFSD_V3=y
157CONFIG_SMB_FS=m
158CONFIG_CIFS=m 162CONFIG_CIFS=m
159CONFIG_NLS_CODEPAGE_437=m 163CONFIG_NLS_CODEPAGE_437=m
160CONFIG_NLS_CODEPAGE_850=m 164CONFIG_NLS_CODEPAGE_850=m
@@ -165,4 +169,3 @@ CONFIG_DEBUG_FS=y
165CONFIG_DEBUG_KERNEL=y 169CONFIG_DEBUG_KERNEL=y
166CONFIG_DETECT_HUNG_TASK=y 170CONFIG_DETECT_HUNG_TASK=y
167CONFIG_FRAME_POINTER=y 171CONFIG_FRAME_POINTER=y
168# CONFIG_RCU_CPU_STALL_DETECTOR is not set
diff --git a/arch/avr32/configs/atngw100mkii_defconfig b/arch/avr32/configs/atngw100mkii_defconfig
index 4bd36821d4a2..f0fe237133a9 100644
--- a/arch/avr32/configs/atngw100mkii_defconfig
+++ b/arch/avr32/configs/atngw100mkii_defconfig
@@ -2,20 +2,17 @@ CONFIG_EXPERIMENTAL=y
2# CONFIG_LOCALVERSION_AUTO is not set 2# CONFIG_LOCALVERSION_AUTO is not set
3CONFIG_SYSVIPC=y 3CONFIG_SYSVIPC=y
4CONFIG_POSIX_MQUEUE=y 4CONFIG_POSIX_MQUEUE=y
5CONFIG_BSD_PROCESS_ACCT=y
6CONFIG_BSD_PROCESS_ACCT_V3=y
7CONFIG_LOG_BUF_SHIFT=14 5CONFIG_LOG_BUF_SHIFT=14
8CONFIG_SYSFS_DEPRECATED_V2=y 6CONFIG_RELAY=y
9CONFIG_BLK_DEV_INITRD=y 7CONFIG_BLK_DEV_INITRD=y
10# CONFIG_SYSCTL_SYSCALL is not set 8# CONFIG_SYSCTL_SYSCALL is not set
11# CONFIG_BASE_FULL is not set 9# CONFIG_BASE_FULL is not set
12# CONFIG_COMPAT_BRK is not set 10# CONFIG_COMPAT_BRK is not set
13CONFIG_PROFILING=y 11CONFIG_PROFILING=y
14CONFIG_OPROFILE=m 12CONFIG_OPROFILE=m
15CONFIG_KPROBES=y 13# CONFIG_KPROBES is not set
16CONFIG_MODULES=y 14CONFIG_MODULES=y
17CONFIG_MODULE_UNLOAD=y 15CONFIG_MODULE_UNLOAD=y
18CONFIG_MODULE_FORCE_UNLOAD=y
19# CONFIG_BLK_DEV_BSG is not set 16# CONFIG_BLK_DEV_BSG is not set
20# CONFIG_IOSCHED_DEADLINE is not set 17# CONFIG_IOSCHED_DEADLINE is not set
21CONFIG_NO_HZ=y 18CONFIG_NO_HZ=y
@@ -29,6 +26,7 @@ CONFIG_CPU_FREQ=y
29CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y 26CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
30CONFIG_CPU_FREQ_GOV_USERSPACE=y 27CONFIG_CPU_FREQ_GOV_USERSPACE=y
31CONFIG_CPU_FREQ_AT32AP=y 28CONFIG_CPU_FREQ_AT32AP=y
29CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
32CONFIG_NET=y 30CONFIG_NET=y
33CONFIG_PACKET=y 31CONFIG_PACKET=y
34CONFIG_UNIX=y 32CONFIG_UNIX=y
@@ -74,6 +72,7 @@ CONFIG_MTD_UBI=y
74CONFIG_BLK_DEV_LOOP=m 72CONFIG_BLK_DEV_LOOP=m
75CONFIG_BLK_DEV_NBD=m 73CONFIG_BLK_DEV_NBD=m
76CONFIG_BLK_DEV_RAM=m 74CONFIG_BLK_DEV_RAM=m
75CONFIG_MISC_DEVICES=y
77CONFIG_ATMEL_TCLIB=y 76CONFIG_ATMEL_TCLIB=y
78CONFIG_NETDEVICES=y 77CONFIG_NETDEVICES=y
79CONFIG_TUN=m 78CONFIG_TUN=m
@@ -107,6 +106,7 @@ CONFIG_GPIO_SYSFS=y
107CONFIG_WATCHDOG=y 106CONFIG_WATCHDOG=y
108CONFIG_AT32AP700X_WDT=y 107CONFIG_AT32AP700X_WDT=y
109CONFIG_USB_GADGET=y 108CONFIG_USB_GADGET=y
109CONFIG_USB_GADGET_VBUS_DRAW=350
110CONFIG_USB_ZERO=m 110CONFIG_USB_ZERO=m
111CONFIG_USB_ETH=m 111CONFIG_USB_ETH=m
112CONFIG_USB_GADGETFS=m 112CONFIG_USB_GADGETFS=m
@@ -116,14 +116,12 @@ CONFIG_USB_CDC_COMPOSITE=m
116CONFIG_MMC=y 116CONFIG_MMC=y
117CONFIG_MMC_TEST=m 117CONFIG_MMC_TEST=m
118CONFIG_MMC_ATMELMCI=y 118CONFIG_MMC_ATMELMCI=y
119CONFIG_MMC_SPI=m
120CONFIG_NEW_LEDS=y 119CONFIG_NEW_LEDS=y
121CONFIG_LEDS_CLASS=y 120CONFIG_LEDS_CLASS=y
122CONFIG_LEDS_GPIO=y 121CONFIG_LEDS_GPIO=y
123CONFIG_LEDS_TRIGGERS=y 122CONFIG_LEDS_TRIGGERS=y
124CONFIG_LEDS_TRIGGER_TIMER=y 123CONFIG_LEDS_TRIGGER_TIMER=y
125CONFIG_LEDS_TRIGGER_HEARTBEAT=y 124CONFIG_LEDS_TRIGGER_HEARTBEAT=y
126CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
127CONFIG_RTC_CLASS=y 125CONFIG_RTC_CLASS=y
128CONFIG_RTC_DRV_AT32AP700X=y 126CONFIG_RTC_DRV_AT32AP700X=y
129CONFIG_DMADEVICES=y 127CONFIG_DMADEVICES=y
@@ -131,21 +129,23 @@ CONFIG_EXT2_FS=y
131CONFIG_EXT3_FS=y 129CONFIG_EXT3_FS=y
132# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 130# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
133# CONFIG_EXT3_FS_XATTR is not set 131# CONFIG_EXT3_FS_XATTR is not set
132CONFIG_EXT4_FS=y
133# CONFIG_EXT4_FS_XATTR is not set
134# CONFIG_DNOTIFY is not set 134# CONFIG_DNOTIFY is not set
135CONFIG_FUSE_FS=m 135CONFIG_FUSE_FS=m
136CONFIG_MSDOS_FS=m 136CONFIG_MSDOS_FS=m
137CONFIG_VFAT_FS=m 137CONFIG_VFAT_FS=m
138CONFIG_FAT_DEFAULT_CODEPAGE=850 138CONFIG_FAT_DEFAULT_CODEPAGE=850
139CONFIG_PROC_KCORE=y
139CONFIG_TMPFS=y 140CONFIG_TMPFS=y
140CONFIG_CONFIGFS_FS=m 141CONFIG_CONFIGFS_FS=y
141CONFIG_JFFS2_FS=y 142CONFIG_JFFS2_FS=y
142CONFIG_UFS_FS=y 143CONFIG_UBIFS_FS=y
143CONFIG_NFS_FS=y 144CONFIG_NFS_FS=y
144CONFIG_NFS_V3=y 145CONFIG_NFS_V3=y
145CONFIG_ROOT_NFS=y 146CONFIG_ROOT_NFS=y
146CONFIG_NFSD=m 147CONFIG_NFSD=m
147CONFIG_NFSD_V3=y 148CONFIG_NFSD_V3=y
148CONFIG_SMB_FS=m
149CONFIG_CIFS=m 149CONFIG_CIFS=m
150CONFIG_NLS_CODEPAGE_437=m 150CONFIG_NLS_CODEPAGE_437=m
151CONFIG_NLS_CODEPAGE_850=m 151CONFIG_NLS_CODEPAGE_850=m
@@ -156,5 +156,3 @@ CONFIG_DEBUG_FS=y
156CONFIG_DEBUG_KERNEL=y 156CONFIG_DEBUG_KERNEL=y
157CONFIG_DETECT_HUNG_TASK=y 157CONFIG_DETECT_HUNG_TASK=y
158CONFIG_FRAME_POINTER=y 158CONFIG_FRAME_POINTER=y
159# CONFIG_RCU_CPU_STALL_DETECTOR is not set
160CONFIG_CRYPTO_PCBC=m
diff --git a/arch/avr32/configs/atngw100mkii_evklcd100_defconfig b/arch/avr32/configs/atngw100mkii_evklcd100_defconfig
index f8437ef3237f..e4a7c1dc8380 100644
--- a/arch/avr32/configs/atngw100mkii_evklcd100_defconfig
+++ b/arch/avr32/configs/atngw100mkii_evklcd100_defconfig
@@ -2,20 +2,17 @@ CONFIG_EXPERIMENTAL=y
2# CONFIG_LOCALVERSION_AUTO is not set 2# CONFIG_LOCALVERSION_AUTO is not set
3CONFIG_SYSVIPC=y 3CONFIG_SYSVIPC=y
4CONFIG_POSIX_MQUEUE=y 4CONFIG_POSIX_MQUEUE=y
5CONFIG_BSD_PROCESS_ACCT=y
6CONFIG_BSD_PROCESS_ACCT_V3=y
7CONFIG_LOG_BUF_SHIFT=14 5CONFIG_LOG_BUF_SHIFT=14
8CONFIG_SYSFS_DEPRECATED_V2=y 6CONFIG_RELAY=y
9CONFIG_BLK_DEV_INITRD=y 7CONFIG_BLK_DEV_INITRD=y
10# CONFIG_SYSCTL_SYSCALL is not set 8# CONFIG_SYSCTL_SYSCALL is not set
11# CONFIG_BASE_FULL is not set 9# CONFIG_BASE_FULL is not set
12# CONFIG_COMPAT_BRK is not set 10# CONFIG_COMPAT_BRK is not set
13CONFIG_PROFILING=y 11CONFIG_PROFILING=y
14CONFIG_OPROFILE=m 12CONFIG_OPROFILE=m
15CONFIG_KPROBES=y 13# CONFIG_KPROBES is not set
16CONFIG_MODULES=y 14CONFIG_MODULES=y
17CONFIG_MODULE_UNLOAD=y 15CONFIG_MODULE_UNLOAD=y
18CONFIG_MODULE_FORCE_UNLOAD=y
19# CONFIG_BLK_DEV_BSG is not set 16# CONFIG_BLK_DEV_BSG is not set
20# CONFIG_IOSCHED_DEADLINE is not set 17# CONFIG_IOSCHED_DEADLINE is not set
21CONFIG_NO_HZ=y 18CONFIG_NO_HZ=y
@@ -32,6 +29,7 @@ CONFIG_CPU_FREQ=y
32CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y 29CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
33CONFIG_CPU_FREQ_GOV_USERSPACE=y 30CONFIG_CPU_FREQ_GOV_USERSPACE=y
34CONFIG_CPU_FREQ_AT32AP=y 31CONFIG_CPU_FREQ_AT32AP=y
32CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
35CONFIG_NET=y 33CONFIG_NET=y
36CONFIG_PACKET=y 34CONFIG_PACKET=y
37CONFIG_UNIX=y 35CONFIG_UNIX=y
@@ -77,8 +75,10 @@ CONFIG_MTD_UBI=y
77CONFIG_BLK_DEV_LOOP=m 75CONFIG_BLK_DEV_LOOP=m
78CONFIG_BLK_DEV_NBD=m 76CONFIG_BLK_DEV_NBD=m
79CONFIG_BLK_DEV_RAM=m 77CONFIG_BLK_DEV_RAM=m
78CONFIG_MISC_DEVICES=y
80CONFIG_ATMEL_TCLIB=y 79CONFIG_ATMEL_TCLIB=y
81CONFIG_NETDEVICES=y 80CONFIG_NETDEVICES=y
81CONFIG_TUN=m
82CONFIG_NET_ETHERNET=y 82CONFIG_NET_ETHERNET=y
83CONFIG_MACB=y 83CONFIG_MACB=y
84# CONFIG_NETDEV_1000 is not set 84# CONFIG_NETDEV_1000 is not set
@@ -107,6 +107,7 @@ CONFIG_I2C_GPIO=m
107CONFIG_SPI=y 107CONFIG_SPI=y
108CONFIG_SPI_ATMEL=y 108CONFIG_SPI_ATMEL=y
109CONFIG_SPI_SPIDEV=m 109CONFIG_SPI_SPIDEV=m
110CONFIG_GPIO_SYSFS=y
110# CONFIG_HWMON is not set 111# CONFIG_HWMON is not set
111CONFIG_WATCHDOG=y 112CONFIG_WATCHDOG=y
112CONFIG_AT32AP700X_WDT=y 113CONFIG_AT32AP700X_WDT=y
@@ -130,6 +131,7 @@ CONFIG_USB_FILE_STORAGE=m
130CONFIG_USB_G_SERIAL=m 131CONFIG_USB_G_SERIAL=m
131CONFIG_USB_CDC_COMPOSITE=m 132CONFIG_USB_CDC_COMPOSITE=m
132CONFIG_MMC=y 133CONFIG_MMC=y
134CONFIG_MMC_TEST=m
133CONFIG_MMC_ATMELMCI=y 135CONFIG_MMC_ATMELMCI=y
134CONFIG_NEW_LEDS=y 136CONFIG_NEW_LEDS=y
135CONFIG_LEDS_CLASS=y 137CONFIG_LEDS_CLASS=y
@@ -144,11 +146,14 @@ CONFIG_EXT2_FS=y
144CONFIG_EXT3_FS=y 146CONFIG_EXT3_FS=y
145# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 147# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
146# CONFIG_EXT3_FS_XATTR is not set 148# CONFIG_EXT3_FS_XATTR is not set
149CONFIG_EXT4_FS=y
150# CONFIG_EXT4_FS_XATTR is not set
147# CONFIG_DNOTIFY is not set 151# CONFIG_DNOTIFY is not set
148CONFIG_FUSE_FS=m 152CONFIG_FUSE_FS=m
149CONFIG_MSDOS_FS=m 153CONFIG_MSDOS_FS=m
150CONFIG_VFAT_FS=m 154CONFIG_VFAT_FS=m
151CONFIG_FAT_DEFAULT_CODEPAGE=850 155CONFIG_FAT_DEFAULT_CODEPAGE=850
156CONFIG_PROC_KCORE=y
152CONFIG_TMPFS=y 157CONFIG_TMPFS=y
153CONFIG_CONFIGFS_FS=y 158CONFIG_CONFIGFS_FS=y
154CONFIG_JFFS2_FS=y 159CONFIG_JFFS2_FS=y
@@ -158,7 +163,6 @@ CONFIG_NFS_V3=y
158CONFIG_ROOT_NFS=y 163CONFIG_ROOT_NFS=y
159CONFIG_NFSD=m 164CONFIG_NFSD=m
160CONFIG_NFSD_V3=y 165CONFIG_NFSD_V3=y
161CONFIG_SMB_FS=m
162CONFIG_CIFS=m 166CONFIG_CIFS=m
163CONFIG_NLS_CODEPAGE_437=m 167CONFIG_NLS_CODEPAGE_437=m
164CONFIG_NLS_CODEPAGE_850=m 168CONFIG_NLS_CODEPAGE_850=m
@@ -169,4 +173,3 @@ CONFIG_DEBUG_FS=y
169CONFIG_DEBUG_KERNEL=y 173CONFIG_DEBUG_KERNEL=y
170CONFIG_DETECT_HUNG_TASK=y 174CONFIG_DETECT_HUNG_TASK=y
171CONFIG_FRAME_POINTER=y 175CONFIG_FRAME_POINTER=y
172# CONFIG_RCU_CPU_STALL_DETECTOR is not set
diff --git a/arch/avr32/configs/atngw100mkii_evklcd101_defconfig b/arch/avr32/configs/atngw100mkii_evklcd101_defconfig
index 7f58f996d945..6f37f70c2c37 100644
--- a/arch/avr32/configs/atngw100mkii_evklcd101_defconfig
+++ b/arch/avr32/configs/atngw100mkii_evklcd101_defconfig
@@ -2,20 +2,17 @@ CONFIG_EXPERIMENTAL=y
2# CONFIG_LOCALVERSION_AUTO is not set 2# CONFIG_LOCALVERSION_AUTO is not set
3CONFIG_SYSVIPC=y 3CONFIG_SYSVIPC=y
4CONFIG_POSIX_MQUEUE=y 4CONFIG_POSIX_MQUEUE=y
5CONFIG_BSD_PROCESS_ACCT=y
6CONFIG_BSD_PROCESS_ACCT_V3=y
7CONFIG_LOG_BUF_SHIFT=14 5CONFIG_LOG_BUF_SHIFT=14
8CONFIG_SYSFS_DEPRECATED_V2=y 6CONFIG_RELAY=y
9CONFIG_BLK_DEV_INITRD=y 7CONFIG_BLK_DEV_INITRD=y
10# CONFIG_SYSCTL_SYSCALL is not set 8# CONFIG_SYSCTL_SYSCALL is not set
11# CONFIG_BASE_FULL is not set 9# CONFIG_BASE_FULL is not set
12# CONFIG_COMPAT_BRK is not set 10# CONFIG_COMPAT_BRK is not set
13CONFIG_PROFILING=y 11CONFIG_PROFILING=y
14CONFIG_OPROFILE=m 12CONFIG_OPROFILE=m
15CONFIG_KPROBES=y 13# CONFIG_KPROBES is not set
16CONFIG_MODULES=y 14CONFIG_MODULES=y
17CONFIG_MODULE_UNLOAD=y 15CONFIG_MODULE_UNLOAD=y
18CONFIG_MODULE_FORCE_UNLOAD=y
19# CONFIG_BLK_DEV_BSG is not set 16# CONFIG_BLK_DEV_BSG is not set
20# CONFIG_IOSCHED_DEADLINE is not set 17# CONFIG_IOSCHED_DEADLINE is not set
21CONFIG_NO_HZ=y 18CONFIG_NO_HZ=y
@@ -31,6 +28,7 @@ CONFIG_CPU_FREQ=y
31CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y 28CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
32CONFIG_CPU_FREQ_GOV_USERSPACE=y 29CONFIG_CPU_FREQ_GOV_USERSPACE=y
33CONFIG_CPU_FREQ_AT32AP=y 30CONFIG_CPU_FREQ_AT32AP=y
31CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
34CONFIG_NET=y 32CONFIG_NET=y
35CONFIG_PACKET=y 33CONFIG_PACKET=y
36CONFIG_UNIX=y 34CONFIG_UNIX=y
@@ -76,8 +74,10 @@ CONFIG_MTD_UBI=y
76CONFIG_BLK_DEV_LOOP=m 74CONFIG_BLK_DEV_LOOP=m
77CONFIG_BLK_DEV_NBD=m 75CONFIG_BLK_DEV_NBD=m
78CONFIG_BLK_DEV_RAM=m 76CONFIG_BLK_DEV_RAM=m
77CONFIG_MISC_DEVICES=y
79CONFIG_ATMEL_TCLIB=y 78CONFIG_ATMEL_TCLIB=y
80CONFIG_NETDEVICES=y 79CONFIG_NETDEVICES=y
80CONFIG_TUN=m
81CONFIG_NET_ETHERNET=y 81CONFIG_NET_ETHERNET=y
82CONFIG_MACB=y 82CONFIG_MACB=y
83# CONFIG_NETDEV_1000 is not set 83# CONFIG_NETDEV_1000 is not set
@@ -106,6 +106,7 @@ CONFIG_I2C_GPIO=m
106CONFIG_SPI=y 106CONFIG_SPI=y
107CONFIG_SPI_ATMEL=y 107CONFIG_SPI_ATMEL=y
108CONFIG_SPI_SPIDEV=m 108CONFIG_SPI_SPIDEV=m
109CONFIG_GPIO_SYSFS=y
109# CONFIG_HWMON is not set 110# CONFIG_HWMON is not set
110CONFIG_WATCHDOG=y 111CONFIG_WATCHDOG=y
111CONFIG_AT32AP700X_WDT=y 112CONFIG_AT32AP700X_WDT=y
@@ -129,6 +130,7 @@ CONFIG_USB_FILE_STORAGE=m
129CONFIG_USB_G_SERIAL=m 130CONFIG_USB_G_SERIAL=m
130CONFIG_USB_CDC_COMPOSITE=m 131CONFIG_USB_CDC_COMPOSITE=m
131CONFIG_MMC=y 132CONFIG_MMC=y
133CONFIG_MMC_TEST=m
132CONFIG_MMC_ATMELMCI=y 134CONFIG_MMC_ATMELMCI=y
133CONFIG_NEW_LEDS=y 135CONFIG_NEW_LEDS=y
134CONFIG_LEDS_CLASS=y 136CONFIG_LEDS_CLASS=y
@@ -143,11 +145,14 @@ CONFIG_EXT2_FS=y
143CONFIG_EXT3_FS=y 145CONFIG_EXT3_FS=y
144# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 146# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
145# CONFIG_EXT3_FS_XATTR is not set 147# CONFIG_EXT3_FS_XATTR is not set
148CONFIG_EXT4_FS=y
149# CONFIG_EXT4_FS_XATTR is not set
146# CONFIG_DNOTIFY is not set 150# CONFIG_DNOTIFY is not set
147CONFIG_FUSE_FS=m 151CONFIG_FUSE_FS=m
148CONFIG_MSDOS_FS=m 152CONFIG_MSDOS_FS=m
149CONFIG_VFAT_FS=m 153CONFIG_VFAT_FS=m
150CONFIG_FAT_DEFAULT_CODEPAGE=850 154CONFIG_FAT_DEFAULT_CODEPAGE=850
155CONFIG_PROC_KCORE=y
151CONFIG_TMPFS=y 156CONFIG_TMPFS=y
152CONFIG_CONFIGFS_FS=y 157CONFIG_CONFIGFS_FS=y
153CONFIG_JFFS2_FS=y 158CONFIG_JFFS2_FS=y
@@ -157,7 +162,6 @@ CONFIG_NFS_V3=y
157CONFIG_ROOT_NFS=y 162CONFIG_ROOT_NFS=y
158CONFIG_NFSD=m 163CONFIG_NFSD=m
159CONFIG_NFSD_V3=y 164CONFIG_NFSD_V3=y
160CONFIG_SMB_FS=m
161CONFIG_CIFS=m 165CONFIG_CIFS=m
162CONFIG_NLS_CODEPAGE_437=m 166CONFIG_NLS_CODEPAGE_437=m
163CONFIG_NLS_CODEPAGE_850=m 167CONFIG_NLS_CODEPAGE_850=m
@@ -168,4 +172,3 @@ CONFIG_DEBUG_FS=y
168CONFIG_DEBUG_KERNEL=y 172CONFIG_DEBUG_KERNEL=y
169CONFIG_DETECT_HUNG_TASK=y 173CONFIG_DETECT_HUNG_TASK=y
170CONFIG_FRAME_POINTER=y 174CONFIG_FRAME_POINTER=y
171# CONFIG_RCU_CPU_STALL_DETECTOR is not set
diff --git a/arch/avr32/configs/atstk1002_defconfig b/arch/avr32/configs/atstk1002_defconfig
index aec4c43a75da..4fb01f5ab42f 100644
--- a/arch/avr32/configs/atstk1002_defconfig
+++ b/arch/avr32/configs/atstk1002_defconfig
@@ -3,7 +3,6 @@ CONFIG_EXPERIMENTAL=y
3CONFIG_SYSVIPC=y 3CONFIG_SYSVIPC=y
4CONFIG_POSIX_MQUEUE=y 4CONFIG_POSIX_MQUEUE=y
5CONFIG_LOG_BUF_SHIFT=14 5CONFIG_LOG_BUF_SHIFT=14
6CONFIG_SYSFS_DEPRECATED_V2=y
7CONFIG_RELAY=y 6CONFIG_RELAY=y
8CONFIG_BLK_DEV_INITRD=y 7CONFIG_BLK_DEV_INITRD=y
9# CONFIG_SYSCTL_SYSCALL is not set 8# CONFIG_SYSCTL_SYSCALL is not set
@@ -11,7 +10,7 @@ CONFIG_BLK_DEV_INITRD=y
11# CONFIG_COMPAT_BRK is not set 10# CONFIG_COMPAT_BRK is not set
12CONFIG_PROFILING=y 11CONFIG_PROFILING=y
13CONFIG_OPROFILE=m 12CONFIG_OPROFILE=m
14CONFIG_KPROBES=y 13# CONFIG_KPROBES is not set
15CONFIG_MODULES=y 14CONFIG_MODULES=y
16CONFIG_MODULE_UNLOAD=y 15CONFIG_MODULE_UNLOAD=y
17# CONFIG_BLK_DEV_BSG is not set 16# CONFIG_BLK_DEV_BSG is not set
@@ -26,6 +25,7 @@ CONFIG_CPU_FREQ=y
26CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y 25CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
27CONFIG_CPU_FREQ_GOV_USERSPACE=y 26CONFIG_CPU_FREQ_GOV_USERSPACE=y
28CONFIG_CPU_FREQ_AT32AP=y 27CONFIG_CPU_FREQ_AT32AP=y
28CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
29CONFIG_NET=y 29CONFIG_NET=y
30CONFIG_PACKET=y 30CONFIG_PACKET=y
31CONFIG_UNIX=y 31CONFIG_UNIX=y
@@ -35,6 +35,7 @@ CONFIG_INET=y
35CONFIG_IP_PNP=y 35CONFIG_IP_PNP=y
36CONFIG_IP_PNP_DHCP=y 36CONFIG_IP_PNP_DHCP=y
37CONFIG_NET_IPIP=m 37CONFIG_NET_IPIP=m
38CONFIG_NET_IPGRE_DEMUX=m
38CONFIG_NET_IPGRE=m 39CONFIG_NET_IPGRE=m
39CONFIG_INET_AH=m 40CONFIG_INET_AH=m
40CONFIG_INET_ESP=m 41CONFIG_INET_ESP=m
@@ -58,16 +59,14 @@ CONFIG_MTD_BLOCK=y
58CONFIG_MTD_CFI=y 59CONFIG_MTD_CFI=y
59CONFIG_MTD_CFI_AMDSTD=y 60CONFIG_MTD_CFI_AMDSTD=y
60CONFIG_MTD_PHYSMAP=y 61CONFIG_MTD_PHYSMAP=y
61CONFIG_MTD_DATAFLASH=m
62CONFIG_MTD_M25P80=m
63CONFIG_MTD_UBI=y 62CONFIG_MTD_UBI=y
64CONFIG_BLK_DEV_LOOP=m 63CONFIG_BLK_DEV_LOOP=m
65CONFIG_BLK_DEV_NBD=m 64CONFIG_BLK_DEV_NBD=m
66CONFIG_BLK_DEV_RAM=m 65CONFIG_BLK_DEV_RAM=m
66CONFIG_MISC_DEVICES=y
67CONFIG_ATMEL_PWM=m 67CONFIG_ATMEL_PWM=m
68CONFIG_ATMEL_TCLIB=y 68CONFIG_ATMEL_TCLIB=y
69CONFIG_ATMEL_SSC=m 69CONFIG_ATMEL_SSC=m
70CONFIG_EEPROM_AT24=m
71# CONFIG_SCSI_PROC_FS is not set 70# CONFIG_SCSI_PROC_FS is not set
72CONFIG_BLK_DEV_SD=m 71CONFIG_BLK_DEV_SD=m
73CONFIG_BLK_DEV_SR=m 72CONFIG_BLK_DEV_SR=m
@@ -120,7 +119,6 @@ CONFIG_SND_MIXER_OSS=m
120CONFIG_SND_PCM_OSS=m 119CONFIG_SND_PCM_OSS=m
121# CONFIG_SND_SUPPORT_OLD_API is not set 120# CONFIG_SND_SUPPORT_OLD_API is not set
122# CONFIG_SND_VERBOSE_PROCFS is not set 121# CONFIG_SND_VERBOSE_PROCFS is not set
123# CONFIG_SND_DRIVERS is not set
124CONFIG_SND_AT73C213=m 122CONFIG_SND_AT73C213=m
125# CONFIG_HID_SUPPORT is not set 123# CONFIG_HID_SUPPORT is not set
126CONFIG_USB_GADGET=y 124CONFIG_USB_GADGET=y
@@ -131,16 +129,15 @@ CONFIG_USB_FILE_STORAGE=m
131CONFIG_USB_G_SERIAL=m 129CONFIG_USB_G_SERIAL=m
132CONFIG_USB_CDC_COMPOSITE=m 130CONFIG_USB_CDC_COMPOSITE=m
133CONFIG_MMC=y 131CONFIG_MMC=y
132CONFIG_MMC_TEST=m
134CONFIG_MMC_ATMELMCI=y 133CONFIG_MMC_ATMELMCI=y
135CONFIG_MMC_SPI=m
136CONFIG_NEW_LEDS=y 134CONFIG_NEW_LEDS=y
137CONFIG_LEDS_CLASS=m 135CONFIG_LEDS_CLASS=y
138CONFIG_LEDS_ATMEL_PWM=m 136CONFIG_LEDS_ATMEL_PWM=m
139CONFIG_LEDS_GPIO=m 137CONFIG_LEDS_GPIO=m
140CONFIG_LEDS_TRIGGERS=y 138CONFIG_LEDS_TRIGGERS=y
141CONFIG_LEDS_TRIGGER_TIMER=m 139CONFIG_LEDS_TRIGGER_TIMER=m
142CONFIG_LEDS_TRIGGER_HEARTBEAT=m 140CONFIG_LEDS_TRIGGER_HEARTBEAT=m
143CONFIG_LEDS_TRIGGER_DEFAULT_ON=m
144CONFIG_RTC_CLASS=y 141CONFIG_RTC_CLASS=y
145CONFIG_RTC_DRV_AT32AP700X=y 142CONFIG_RTC_DRV_AT32AP700X=y
146CONFIG_DMADEVICES=y 143CONFIG_DMADEVICES=y
@@ -149,20 +146,23 @@ CONFIG_EXT3_FS=y
149# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 146# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
150# CONFIG_EXT3_FS_XATTR is not set 147# CONFIG_EXT3_FS_XATTR is not set
151CONFIG_EXT4_FS=y 148CONFIG_EXT4_FS=y
149# CONFIG_EXT4_FS_XATTR is not set
152# CONFIG_DNOTIFY is not set 150# CONFIG_DNOTIFY is not set
153CONFIG_FUSE_FS=m 151CONFIG_FUSE_FS=m
154CONFIG_MSDOS_FS=m 152CONFIG_MSDOS_FS=m
155CONFIG_VFAT_FS=m 153CONFIG_VFAT_FS=m
154CONFIG_FAT_DEFAULT_CODEPAGE=850
156CONFIG_PROC_KCORE=y 155CONFIG_PROC_KCORE=y
157CONFIG_TMPFS=y 156CONFIG_TMPFS=y
157CONFIG_CONFIGFS_FS=y
158CONFIG_JFFS2_FS=y 158CONFIG_JFFS2_FS=y
159# CONFIG_JFFS2_FS_WRITEBUFFER is not set
160CONFIG_UBIFS_FS=y 159CONFIG_UBIFS_FS=y
161CONFIG_MINIX_FS=m
162CONFIG_NFS_FS=y 160CONFIG_NFS_FS=y
163CONFIG_NFS_V3=y 161CONFIG_NFS_V3=y
164CONFIG_ROOT_NFS=y 162CONFIG_ROOT_NFS=y
163CONFIG_CIFS=m
165CONFIG_NLS_CODEPAGE_437=m 164CONFIG_NLS_CODEPAGE_437=m
165CONFIG_NLS_CODEPAGE_850=m
166CONFIG_NLS_ISO8859_1=m 166CONFIG_NLS_ISO8859_1=m
167CONFIG_NLS_UTF8=m 167CONFIG_NLS_UTF8=m
168CONFIG_MAGIC_SYSRQ=y 168CONFIG_MAGIC_SYSRQ=y
@@ -170,6 +170,3 @@ CONFIG_DEBUG_FS=y
170CONFIG_DEBUG_KERNEL=y 170CONFIG_DEBUG_KERNEL=y
171CONFIG_DETECT_HUNG_TASK=y 171CONFIG_DETECT_HUNG_TASK=y
172CONFIG_FRAME_POINTER=y 172CONFIG_FRAME_POINTER=y
173# CONFIG_RCU_CPU_STALL_DETECTOR is not set
174# CONFIG_CRYPTO_HW is not set
175CONFIG_CRC_T10DIF=m
diff --git a/arch/avr32/configs/atstk1003_defconfig b/arch/avr32/configs/atstk1003_defconfig
index 50ba3db682ca..9faaf9b900f2 100644
--- a/arch/avr32/configs/atstk1003_defconfig
+++ b/arch/avr32/configs/atstk1003_defconfig
@@ -2,22 +2,15 @@ CONFIG_EXPERIMENTAL=y
2# CONFIG_LOCALVERSION_AUTO is not set 2# CONFIG_LOCALVERSION_AUTO is not set
3CONFIG_SYSVIPC=y 3CONFIG_SYSVIPC=y
4CONFIG_POSIX_MQUEUE=y 4CONFIG_POSIX_MQUEUE=y
5CONFIG_BSD_PROCESS_ACCT=y
6CONFIG_BSD_PROCESS_ACCT_V3=y
7CONFIG_TASKSTATS=y
8CONFIG_TASK_DELAY_ACCT=y
9CONFIG_AUDIT=y
10CONFIG_LOG_BUF_SHIFT=14 5CONFIG_LOG_BUF_SHIFT=14
11CONFIG_SYSFS_DEPRECATED_V2=y
12CONFIG_RELAY=y 6CONFIG_RELAY=y
13CONFIG_BLK_DEV_INITRD=y 7CONFIG_BLK_DEV_INITRD=y
14# CONFIG_SYSCTL_SYSCALL is not set 8# CONFIG_SYSCTL_SYSCALL is not set
15# CONFIG_BASE_FULL is not set 9# CONFIG_BASE_FULL is not set
16# CONFIG_SLUB_DEBUG is not set
17# CONFIG_COMPAT_BRK is not set 10# CONFIG_COMPAT_BRK is not set
18CONFIG_PROFILING=y 11CONFIG_PROFILING=y
19CONFIG_OPROFILE=m 12CONFIG_OPROFILE=m
20CONFIG_KPROBES=y 13# CONFIG_KPROBES is not set
21CONFIG_MODULES=y 14CONFIG_MODULES=y
22CONFIG_MODULE_UNLOAD=y 15CONFIG_MODULE_UNLOAD=y
23# CONFIG_BLK_DEV_BSG is not set 16# CONFIG_BLK_DEV_BSG is not set
@@ -33,6 +26,7 @@ CONFIG_CPU_FREQ=y
33CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y 26CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
34CONFIG_CPU_FREQ_GOV_USERSPACE=y 27CONFIG_CPU_FREQ_GOV_USERSPACE=y
35CONFIG_CPU_FREQ_AT32AP=y 28CONFIG_CPU_FREQ_AT32AP=y
29CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
36CONFIG_NET=y 30CONFIG_NET=y
37CONFIG_PACKET=y 31CONFIG_PACKET=y
38CONFIG_UNIX=y 32CONFIG_UNIX=y
@@ -54,18 +48,18 @@ CONFIG_MTD_BLOCK=y
54CONFIG_MTD_CFI=y 48CONFIG_MTD_CFI=y
55CONFIG_MTD_CFI_AMDSTD=y 49CONFIG_MTD_CFI_AMDSTD=y
56CONFIG_MTD_PHYSMAP=y 50CONFIG_MTD_PHYSMAP=y
57CONFIG_MTD_DATAFLASH=m 51CONFIG_MTD_UBI=y
58CONFIG_MTD_M25P80=m
59CONFIG_BLK_DEV_LOOP=m 52CONFIG_BLK_DEV_LOOP=m
60CONFIG_BLK_DEV_NBD=m 53CONFIG_BLK_DEV_NBD=m
61CONFIG_BLK_DEV_RAM=m 54CONFIG_BLK_DEV_RAM=m
55CONFIG_MISC_DEVICES=y
62CONFIG_ATMEL_PWM=m 56CONFIG_ATMEL_PWM=m
63CONFIG_ATMEL_TCLIB=y 57CONFIG_ATMEL_TCLIB=y
64CONFIG_ATMEL_SSC=m 58CONFIG_ATMEL_SSC=m
65CONFIG_EEPROM_AT24=m
66# CONFIG_SCSI_PROC_FS is not set 59# CONFIG_SCSI_PROC_FS is not set
67CONFIG_BLK_DEV_SD=m 60CONFIG_BLK_DEV_SD=m
68CONFIG_BLK_DEV_SR=m 61CONFIG_BLK_DEV_SR=m
62# CONFIG_SCSI_LOWLEVEL is not set
69CONFIG_ATA=m 63CONFIG_ATA=m
70# CONFIG_SATA_PMP is not set 64# CONFIG_SATA_PMP is not set
71CONFIG_PATA_AT32=m 65CONFIG_PATA_AT32=m
@@ -77,6 +71,7 @@ CONFIG_PPP_ASYNC=m
77CONFIG_PPP_DEFLATE=m 71CONFIG_PPP_DEFLATE=m
78CONFIG_PPP_BSDCOMP=m 72CONFIG_PPP_BSDCOMP=m
79CONFIG_INPUT=m 73CONFIG_INPUT=m
74CONFIG_INPUT_EVDEV=m
80# CONFIG_KEYBOARD_ATKBD is not set 75# CONFIG_KEYBOARD_ATKBD is not set
81CONFIG_KEYBOARD_GPIO=m 76CONFIG_KEYBOARD_GPIO=m
82# CONFIG_MOUSE_PS2 is not set 77# CONFIG_MOUSE_PS2 is not set
@@ -106,7 +101,6 @@ CONFIG_SND_PCM_OSS=m
106CONFIG_SND_AT73C213=m 101CONFIG_SND_AT73C213=m
107# CONFIG_HID_SUPPORT is not set 102# CONFIG_HID_SUPPORT is not set
108CONFIG_USB_GADGET=y 103CONFIG_USB_GADGET=y
109CONFIG_USB_GADGET_DEBUG_FS=y
110CONFIG_USB_ZERO=m 104CONFIG_USB_ZERO=m
111CONFIG_USB_ETH=m 105CONFIG_USB_ETH=m
112CONFIG_USB_GADGETFS=m 106CONFIG_USB_GADGETFS=m
@@ -116,36 +110,39 @@ CONFIG_USB_CDC_COMPOSITE=m
116CONFIG_MMC=y 110CONFIG_MMC=y
117CONFIG_MMC_TEST=m 111CONFIG_MMC_TEST=m
118CONFIG_MMC_ATMELMCI=y 112CONFIG_MMC_ATMELMCI=y
119CONFIG_MMC_SPI=m
120CONFIG_NEW_LEDS=y 113CONFIG_NEW_LEDS=y
121CONFIG_LEDS_CLASS=y 114CONFIG_LEDS_CLASS=y
122CONFIG_LEDS_ATMEL_PWM=m 115CONFIG_LEDS_ATMEL_PWM=m
123CONFIG_LEDS_GPIO=y 116CONFIG_LEDS_GPIO=m
124CONFIG_LEDS_TRIGGERS=y 117CONFIG_LEDS_TRIGGERS=y
125CONFIG_LEDS_TRIGGER_TIMER=y 118CONFIG_LEDS_TRIGGER_TIMER=m
126CONFIG_LEDS_TRIGGER_HEARTBEAT=y 119CONFIG_LEDS_TRIGGER_HEARTBEAT=m
127CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
128CONFIG_RTC_CLASS=y 120CONFIG_RTC_CLASS=y
129CONFIG_RTC_DRV_AT32AP700X=y 121CONFIG_RTC_DRV_AT32AP700X=y
130CONFIG_DMADEVICES=y 122CONFIG_DMADEVICES=y
131CONFIG_DW_DMAC=y 123CONFIG_EXT2_FS=y
132CONFIG_EXT2_FS=m 124CONFIG_EXT3_FS=y
133CONFIG_EXT3_FS=m 125# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
134# CONFIG_EXT3_FS_XATTR is not set 126# CONFIG_EXT3_FS_XATTR is not set
127CONFIG_EXT4_FS=y
128# CONFIG_EXT4_FS_XATTR is not set
135# CONFIG_DNOTIFY is not set 129# CONFIG_DNOTIFY is not set
136CONFIG_FUSE_FS=m 130CONFIG_FUSE_FS=m
137CONFIG_MSDOS_FS=m 131CONFIG_MSDOS_FS=m
138CONFIG_VFAT_FS=m 132CONFIG_VFAT_FS=m
133CONFIG_FAT_DEFAULT_CODEPAGE=850
139CONFIG_PROC_KCORE=y 134CONFIG_PROC_KCORE=y
140CONFIG_TMPFS=y 135CONFIG_TMPFS=y
141CONFIG_CONFIGFS_FS=m 136CONFIG_CONFIGFS_FS=y
142CONFIG_JFFS2_FS=y 137CONFIG_JFFS2_FS=y
138CONFIG_UBIFS_FS=y
143# CONFIG_NETWORK_FILESYSTEMS is not set 139# CONFIG_NETWORK_FILESYSTEMS is not set
144CONFIG_NLS_CODEPAGE_437=m 140CONFIG_NLS_CODEPAGE_437=m
141CONFIG_NLS_CODEPAGE_850=m
145CONFIG_NLS_ISO8859_1=m 142CONFIG_NLS_ISO8859_1=m
146CONFIG_NLS_UTF8=m 143CONFIG_NLS_UTF8=m
147CONFIG_MAGIC_SYSRQ=y 144CONFIG_MAGIC_SYSRQ=y
148CONFIG_DEBUG_FS=y 145CONFIG_DEBUG_FS=y
149CONFIG_DEBUG_KERNEL=y 146CONFIG_DEBUG_KERNEL=y
147CONFIG_DETECT_HUNG_TASK=y
150CONFIG_FRAME_POINTER=y 148CONFIG_FRAME_POINTER=y
151CONFIG_CRC_T10DIF=m
diff --git a/arch/avr32/configs/atstk1004_defconfig b/arch/avr32/configs/atstk1004_defconfig
index 329e10ba3b54..3d2a5d85f970 100644
--- a/arch/avr32/configs/atstk1004_defconfig
+++ b/arch/avr32/configs/atstk1004_defconfig
@@ -1,19 +1,32 @@
1CONFIG_EXPERIMENTAL=y 1CONFIG_EXPERIMENTAL=y
2# CONFIG_LOCALVERSION_AUTO is not set 2# CONFIG_LOCALVERSION_AUTO is not set
3CONFIG_SYSVIPC=y
4CONFIG_POSIX_MQUEUE=y
3CONFIG_LOG_BUF_SHIFT=14 5CONFIG_LOG_BUF_SHIFT=14
4CONFIG_SYSFS_DEPRECATED_V2=y 6CONFIG_RELAY=y
7CONFIG_BLK_DEV_INITRD=y
5# CONFIG_SYSCTL_SYSCALL is not set 8# CONFIG_SYSCTL_SYSCALL is not set
6# CONFIG_BASE_FULL is not set 9# CONFIG_BASE_FULL is not set
7# CONFIG_FUTEX is not set
8# CONFIG_EPOLL is not set
9# CONFIG_SIGNALFD is not set
10# CONFIG_TIMERFD is not set
11# CONFIG_EVENTFD is not set
12# CONFIG_COMPAT_BRK is not set 10# CONFIG_COMPAT_BRK is not set
13CONFIG_SLOB=y 11CONFIG_PROFILING=y
14# CONFIG_BLOCK is not set 12CONFIG_OPROFILE=m
13# CONFIG_KPROBES is not set
14CONFIG_MODULES=y
15CONFIG_MODULE_UNLOAD=y
16# CONFIG_BLK_DEV_BSG is not set
17# CONFIG_IOSCHED_DEADLINE is not set
18CONFIG_NO_HZ=y
19CONFIG_HIGH_RES_TIMERS=y
15CONFIG_BOARD_ATSTK1004=y 20CONFIG_BOARD_ATSTK1004=y
16# CONFIG_OWNERSHIP_TRACE is not set 21# CONFIG_OWNERSHIP_TRACE is not set
22CONFIG_NMI_DEBUGGING=y
23CONFIG_PM=y
24CONFIG_CPU_FREQ=y
25# CONFIG_CPU_FREQ_STAT is not set
26CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
27CONFIG_CPU_FREQ_GOV_USERSPACE=y
28CONFIG_CPU_FREQ_AT32AP=y
29CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
17CONFIG_NET=y 30CONFIG_NET=y
18CONFIG_PACKET=y 31CONFIG_PACKET=y
19CONFIG_UNIX=y 32CONFIG_UNIX=y
@@ -31,40 +44,104 @@ CONFIG_MTD=y
31CONFIG_MTD_PARTITIONS=y 44CONFIG_MTD_PARTITIONS=y
32CONFIG_MTD_CMDLINE_PARTS=y 45CONFIG_MTD_CMDLINE_PARTS=y
33CONFIG_MTD_CHAR=y 46CONFIG_MTD_CHAR=y
47CONFIG_MTD_BLOCK=y
34CONFIG_MTD_CFI=y 48CONFIG_MTD_CFI=y
35CONFIG_MTD_CFI_AMDSTD=y 49CONFIG_MTD_CFI_AMDSTD=y
36CONFIG_MTD_PHYSMAP=y 50CONFIG_MTD_PHYSMAP=y
37# CONFIG_MISC_DEVICES is not set 51CONFIG_MTD_UBI=y
38# CONFIG_INPUT is not set 52CONFIG_BLK_DEV_LOOP=m
53CONFIG_BLK_DEV_NBD=m
54CONFIG_BLK_DEV_RAM=m
55CONFIG_MISC_DEVICES=y
56CONFIG_ATMEL_PWM=m
57CONFIG_ATMEL_TCLIB=y
58CONFIG_ATMEL_SSC=m
59# CONFIG_SCSI_PROC_FS is not set
60CONFIG_BLK_DEV_SD=m
61CONFIG_BLK_DEV_SR=m
62# CONFIG_SCSI_LOWLEVEL is not set
63CONFIG_ATA=m
64# CONFIG_SATA_PMP is not set
65CONFIG_PATA_AT32=m
66CONFIG_NETDEVICES=y
67# CONFIG_NETDEV_1000 is not set
68# CONFIG_NETDEV_10000 is not set
69CONFIG_PPP=m
70CONFIG_PPP_ASYNC=m
71CONFIG_PPP_DEFLATE=m
72CONFIG_PPP_BSDCOMP=m
73CONFIG_INPUT=m
74CONFIG_INPUT_EVDEV=m
75# CONFIG_KEYBOARD_ATKBD is not set
76CONFIG_KEYBOARD_GPIO=m
77# CONFIG_MOUSE_PS2 is not set
78CONFIG_MOUSE_GPIO=m
39# CONFIG_SERIO is not set 79# CONFIG_SERIO is not set
40# CONFIG_VT is not set 80# CONFIG_VT is not set
41# CONFIG_DEVKMEM is not set 81# CONFIG_DEVKMEM is not set
42CONFIG_SERIAL_ATMEL=y 82CONFIG_SERIAL_ATMEL=y
43CONFIG_SERIAL_ATMEL_CONSOLE=y 83CONFIG_SERIAL_ATMEL_CONSOLE=y
44# CONFIG_SERIAL_ATMEL_PDC is not set
45# CONFIG_LEGACY_PTYS is not set 84# CONFIG_LEGACY_PTYS is not set
46# CONFIG_HW_RANDOM is not set 85# CONFIG_HW_RANDOM is not set
86CONFIG_I2C=m
87CONFIG_I2C_CHARDEV=m
88CONFIG_I2C_GPIO=m
47CONFIG_SPI=y 89CONFIG_SPI=y
48CONFIG_SPI_ATMEL=y 90CONFIG_SPI_ATMEL=y
91CONFIG_SPI_SPIDEV=m
92CONFIG_GPIO_SYSFS=y
49# CONFIG_HWMON is not set 93# CONFIG_HWMON is not set
50CONFIG_WATCHDOG=y 94CONFIG_WATCHDOG=y
51CONFIG_AT32AP700X_WDT=y 95CONFIG_AT32AP700X_WDT=y
52CONFIG_FB=y 96CONFIG_FB=y
53CONFIG_FB_ATMEL=y 97CONFIG_FB_ATMEL=y
54CONFIG_BACKLIGHT_LCD_SUPPORT=y 98CONFIG_BACKLIGHT_LCD_SUPPORT=y
99CONFIG_LCD_CLASS_DEVICE=y
55CONFIG_LCD_LTV350QV=y 100CONFIG_LCD_LTV350QV=y
56# CONFIG_BACKLIGHT_CLASS_DEVICE is not set 101# CONFIG_BACKLIGHT_CLASS_DEVICE is not set
57CONFIG_USB_GADGET=y 102CONFIG_USB_GADGET=y
58CONFIG_USB_ETH=y 103CONFIG_USB_ZERO=m
59# CONFIG_USB_ETH_RNDIS is not set 104CONFIG_USB_ETH=m
105CONFIG_USB_GADGETFS=m
106CONFIG_USB_FILE_STORAGE=m
107CONFIG_USB_G_SERIAL=m
108CONFIG_USB_CDC_COMPOSITE=m
109CONFIG_MMC=y
110CONFIG_MMC_TEST=m
111CONFIG_MMC_ATMELMCI=y
112CONFIG_NEW_LEDS=y
113CONFIG_LEDS_CLASS=y
114CONFIG_LEDS_ATMEL_PWM=m
115CONFIG_LEDS_GPIO=m
116CONFIG_LEDS_TRIGGERS=y
117CONFIG_LEDS_TRIGGER_TIMER=m
118CONFIG_LEDS_TRIGGER_HEARTBEAT=m
60CONFIG_RTC_CLASS=y 119CONFIG_RTC_CLASS=y
61# CONFIG_RTC_INTF_PROC is not set
62CONFIG_RTC_DRV_AT32AP700X=y 120CONFIG_RTC_DRV_AT32AP700X=y
121CONFIG_DMADEVICES=y
122CONFIG_EXT2_FS=y
123CONFIG_EXT3_FS=y
124# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
125# CONFIG_EXT3_FS_XATTR is not set
126CONFIG_EXT4_FS=y
127# CONFIG_EXT4_FS_XATTR is not set
63# CONFIG_DNOTIFY is not set 128# CONFIG_DNOTIFY is not set
129CONFIG_FUSE_FS=m
130CONFIG_MSDOS_FS=m
131CONFIG_VFAT_FS=m
132CONFIG_FAT_DEFAULT_CODEPAGE=850
64CONFIG_PROC_KCORE=y 133CONFIG_PROC_KCORE=y
65# CONFIG_PROC_PAGE_MONITOR is not set
66CONFIG_TMPFS=y 134CONFIG_TMPFS=y
135CONFIG_CONFIGFS_FS=y
67CONFIG_JFFS2_FS=y 136CONFIG_JFFS2_FS=y
68# CONFIG_JFFS2_FS_WRITEBUFFER is not set 137CONFIG_UBIFS_FS=y
69# CONFIG_NETWORK_FILESYSTEMS is not set 138# CONFIG_NETWORK_FILESYSTEMS is not set
139CONFIG_NLS_CODEPAGE_437=m
140CONFIG_NLS_CODEPAGE_850=m
141CONFIG_NLS_ISO8859_1=m
142CONFIG_NLS_UTF8=m
70CONFIG_MAGIC_SYSRQ=y 143CONFIG_MAGIC_SYSRQ=y
144CONFIG_DEBUG_FS=y
145CONFIG_DEBUG_KERNEL=y
146CONFIG_DETECT_HUNG_TASK=y
147CONFIG_FRAME_POINTER=y
diff --git a/arch/avr32/configs/atstk1006_defconfig b/arch/avr32/configs/atstk1006_defconfig
index dbcc1b51e506..1ed8f22d4fe2 100644
--- a/arch/avr32/configs/atstk1006_defconfig
+++ b/arch/avr32/configs/atstk1006_defconfig
@@ -3,7 +3,6 @@ CONFIG_EXPERIMENTAL=y
3CONFIG_SYSVIPC=y 3CONFIG_SYSVIPC=y
4CONFIG_POSIX_MQUEUE=y 4CONFIG_POSIX_MQUEUE=y
5CONFIG_LOG_BUF_SHIFT=14 5CONFIG_LOG_BUF_SHIFT=14
6CONFIG_SYSFS_DEPRECATED_V2=y
7CONFIG_RELAY=y 6CONFIG_RELAY=y
8CONFIG_BLK_DEV_INITRD=y 7CONFIG_BLK_DEV_INITRD=y
9# CONFIG_SYSCTL_SYSCALL is not set 8# CONFIG_SYSCTL_SYSCALL is not set
@@ -11,7 +10,7 @@ CONFIG_BLK_DEV_INITRD=y
11# CONFIG_COMPAT_BRK is not set 10# CONFIG_COMPAT_BRK is not set
12CONFIG_PROFILING=y 11CONFIG_PROFILING=y
13CONFIG_OPROFILE=m 12CONFIG_OPROFILE=m
14CONFIG_KPROBES=y 13# CONFIG_KPROBES is not set
15CONFIG_MODULES=y 14CONFIG_MODULES=y
16CONFIG_MODULE_UNLOAD=y 15CONFIG_MODULE_UNLOAD=y
17# CONFIG_BLK_DEV_BSG is not set 16# CONFIG_BLK_DEV_BSG is not set
@@ -37,6 +36,7 @@ CONFIG_INET=y
37CONFIG_IP_PNP=y 36CONFIG_IP_PNP=y
38CONFIG_IP_PNP_DHCP=y 37CONFIG_IP_PNP_DHCP=y
39CONFIG_NET_IPIP=m 38CONFIG_NET_IPIP=m
39CONFIG_NET_IPGRE_DEMUX=m
40CONFIG_NET_IPGRE=m 40CONFIG_NET_IPGRE=m
41CONFIG_INET_AH=m 41CONFIG_INET_AH=m
42CONFIG_INET_ESP=m 42CONFIG_INET_ESP=m
@@ -60,15 +60,13 @@ CONFIG_MTD_BLOCK=y
60CONFIG_MTD_CFI=y 60CONFIG_MTD_CFI=y
61CONFIG_MTD_CFI_AMDSTD=y 61CONFIG_MTD_CFI_AMDSTD=y
62CONFIG_MTD_PHYSMAP=y 62CONFIG_MTD_PHYSMAP=y
63CONFIG_MTD_DATAFLASH=m
64CONFIG_MTD_DATAFLASH_OTP=y
65CONFIG_MTD_M25P80=m
66CONFIG_MTD_NAND=y 63CONFIG_MTD_NAND=y
67CONFIG_MTD_NAND_ATMEL=y 64CONFIG_MTD_NAND_ATMEL=y
68CONFIG_MTD_UBI=y 65CONFIG_MTD_UBI=y
69CONFIG_BLK_DEV_LOOP=m 66CONFIG_BLK_DEV_LOOP=m
70CONFIG_BLK_DEV_NBD=m 67CONFIG_BLK_DEV_NBD=m
71CONFIG_BLK_DEV_RAM=m 68CONFIG_BLK_DEV_RAM=m
69CONFIG_MISC_DEVICES=y
72CONFIG_ATMEL_PWM=m 70CONFIG_ATMEL_PWM=m
73CONFIG_ATMEL_TCLIB=y 71CONFIG_ATMEL_TCLIB=y
74CONFIG_ATMEL_SSC=m 72CONFIG_ATMEL_SSC=m
@@ -132,17 +130,17 @@ CONFIG_USB_ETH=m
132CONFIG_USB_GADGETFS=m 130CONFIG_USB_GADGETFS=m
133CONFIG_USB_FILE_STORAGE=m 131CONFIG_USB_FILE_STORAGE=m
134CONFIG_USB_G_SERIAL=m 132CONFIG_USB_G_SERIAL=m
133CONFIG_USB_CDC_COMPOSITE=m
135CONFIG_MMC=y 134CONFIG_MMC=y
135CONFIG_MMC_TEST=m
136CONFIG_MMC_ATMELMCI=y 136CONFIG_MMC_ATMELMCI=y
137CONFIG_MMC_SPI=m
138CONFIG_NEW_LEDS=y 137CONFIG_NEW_LEDS=y
139CONFIG_LEDS_CLASS=m 138CONFIG_LEDS_CLASS=y
140CONFIG_LEDS_ATMEL_PWM=m 139CONFIG_LEDS_ATMEL_PWM=m
141CONFIG_LEDS_GPIO=m 140CONFIG_LEDS_GPIO=m
142CONFIG_LEDS_TRIGGERS=y 141CONFIG_LEDS_TRIGGERS=y
143CONFIG_LEDS_TRIGGER_TIMER=m 142CONFIG_LEDS_TRIGGER_TIMER=m
144CONFIG_LEDS_TRIGGER_HEARTBEAT=m 143CONFIG_LEDS_TRIGGER_HEARTBEAT=m
145CONFIG_LEDS_TRIGGER_DEFAULT_ON=m
146CONFIG_RTC_CLASS=y 144CONFIG_RTC_CLASS=y
147CONFIG_RTC_DRV_AT32AP700X=y 145CONFIG_RTC_DRV_AT32AP700X=y
148CONFIG_DMADEVICES=y 146CONFIG_DMADEVICES=y
@@ -156,15 +154,18 @@ CONFIG_EXT4_FS=y
156CONFIG_FUSE_FS=m 154CONFIG_FUSE_FS=m
157CONFIG_MSDOS_FS=m 155CONFIG_MSDOS_FS=m
158CONFIG_VFAT_FS=m 156CONFIG_VFAT_FS=m
157CONFIG_FAT_DEFAULT_CODEPAGE=850
159CONFIG_PROC_KCORE=y 158CONFIG_PROC_KCORE=y
160CONFIG_TMPFS=y 159CONFIG_TMPFS=y
160CONFIG_CONFIGFS_FS=y
161CONFIG_JFFS2_FS=y 161CONFIG_JFFS2_FS=y
162CONFIG_UBIFS_FS=y 162CONFIG_UBIFS_FS=y
163CONFIG_MINIX_FS=m
164CONFIG_NFS_FS=y 163CONFIG_NFS_FS=y
165CONFIG_NFS_V3=y 164CONFIG_NFS_V3=y
166CONFIG_ROOT_NFS=y 165CONFIG_ROOT_NFS=y
166CONFIG_CIFS=m
167CONFIG_NLS_CODEPAGE_437=m 167CONFIG_NLS_CODEPAGE_437=m
168CONFIG_NLS_CODEPAGE_850=m
168CONFIG_NLS_ISO8859_1=m 169CONFIG_NLS_ISO8859_1=m
169CONFIG_NLS_UTF8=m 170CONFIG_NLS_UTF8=m
170CONFIG_MAGIC_SYSRQ=y 171CONFIG_MAGIC_SYSRQ=y
@@ -172,7 +173,3 @@ CONFIG_DEBUG_FS=y
172CONFIG_DEBUG_KERNEL=y 173CONFIG_DEBUG_KERNEL=y
173CONFIG_DETECT_HUNG_TASK=y 174CONFIG_DETECT_HUNG_TASK=y
174CONFIG_FRAME_POINTER=y 175CONFIG_FRAME_POINTER=y
175# CONFIG_RCU_CPU_STALL_DETECTOR is not set
176CONFIG_CRYPTO_FIPS=y
177# CONFIG_CRYPTO_HW is not set
178CONFIG_CRC_T10DIF=m
diff --git a/arch/avr32/configs/favr-32_defconfig b/arch/avr32/configs/favr-32_defconfig
index 0c813b661a0a..aeadc955db32 100644
--- a/arch/avr32/configs/favr-32_defconfig
+++ b/arch/avr32/configs/favr-32_defconfig
@@ -11,7 +11,7 @@ CONFIG_BLK_DEV_INITRD=y
11# CONFIG_COMPAT_BRK is not set 11# CONFIG_COMPAT_BRK is not set
12CONFIG_PROFILING=y 12CONFIG_PROFILING=y
13CONFIG_OPROFILE=m 13CONFIG_OPROFILE=m
14CONFIG_KPROBES=y 14# CONFIG_KPROBES is not set
15CONFIG_MODULES=y 15CONFIG_MODULES=y
16CONFIG_MODULE_UNLOAD=y 16CONFIG_MODULE_UNLOAD=y
17# CONFIG_BLK_DEV_BSG is not set 17# CONFIG_BLK_DEV_BSG is not set
diff --git a/arch/avr32/configs/hammerhead_defconfig b/arch/avr32/configs/hammerhead_defconfig
index dcc01f0eb294..1692beeb7ed3 100644
--- a/arch/avr32/configs/hammerhead_defconfig
+++ b/arch/avr32/configs/hammerhead_defconfig
@@ -12,7 +12,7 @@ CONFIG_BLK_DEV_INITRD=y
12# CONFIG_COMPAT_BRK is not set 12# CONFIG_COMPAT_BRK is not set
13CONFIG_PROFILING=y 13CONFIG_PROFILING=y
14CONFIG_OPROFILE=m 14CONFIG_OPROFILE=m
15CONFIG_KPROBES=y 15# CONFIG_KPROBES is not set
16CONFIG_MODULES=y 16CONFIG_MODULES=y
17CONFIG_MODULE_UNLOAD=y 17CONFIG_MODULE_UNLOAD=y
18CONFIG_MODULE_FORCE_UNLOAD=y 18CONFIG_MODULE_FORCE_UNLOAD=y
diff --git a/arch/avr32/include/asm/syscalls.h b/arch/avr32/include/asm/syscalls.h
index ab608b70b24d..244f2acab546 100644
--- a/arch/avr32/include/asm/syscalls.h
+++ b/arch/avr32/include/asm/syscalls.h
@@ -15,20 +15,6 @@
15#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/signal.h> 16#include <linux/signal.h>
17 17
18/* kernel/process.c */
19asmlinkage int sys_fork(struct pt_regs *);
20asmlinkage int sys_clone(unsigned long, unsigned long,
21 unsigned long, unsigned long,
22 struct pt_regs *);
23asmlinkage int sys_vfork(struct pt_regs *);
24asmlinkage int sys_execve(const char __user *, char __user *__user *,
25 char __user *__user *, struct pt_regs *);
26
27/* kernel/signal.c */
28asmlinkage int sys_sigaltstack(const stack_t __user *, stack_t __user *,
29 struct pt_regs *);
30asmlinkage int sys_rt_sigreturn(struct pt_regs *);
31
32/* mm/cache.c */ 18/* mm/cache.c */
33asmlinkage int sys_cacheflush(int, void __user *, size_t); 19asmlinkage int sys_cacheflush(int, void __user *, size_t);
34 20
diff --git a/arch/avr32/kernel/process.c b/arch/avr32/kernel/process.c
index 9c46aaad11ce..ef5a2a08fcca 100644
--- a/arch/avr32/kernel/process.c
+++ b/arch/avr32/kernel/process.c
@@ -367,14 +367,13 @@ asmlinkage int sys_fork(struct pt_regs *regs)
367} 367}
368 368
369asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, 369asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
370 unsigned long parent_tidptr, 370 void __user *parent_tidptr, void __user *child_tidptr,
371 unsigned long child_tidptr, struct pt_regs *regs) 371 struct pt_regs *regs)
372{ 372{
373 if (!newsp) 373 if (!newsp)
374 newsp = regs->sp; 374 newsp = regs->sp;
375 return do_fork(clone_flags, newsp, regs, 0, 375 return do_fork(clone_flags, newsp, regs, 0, parent_tidptr,
376 (int __user *)parent_tidptr, 376 child_tidptr);
377 (int __user *)child_tidptr);
378} 377}
379 378
380asmlinkage int sys_vfork(struct pt_regs *regs) 379asmlinkage int sys_vfork(struct pt_regs *regs)
diff --git a/arch/avr32/kernel/time.c b/arch/avr32/kernel/time.c
index 668ed2817e51..05ad29112ff4 100644
--- a/arch/avr32/kernel/time.c
+++ b/arch/avr32/kernel/time.c
@@ -35,7 +35,6 @@ static struct clocksource counter = {
35 .rating = 50, 35 .rating = 50,
36 .read = read_cycle_count, 36 .read = read_cycle_count,
37 .mask = CLOCKSOURCE_MASK(32), 37 .mask = CLOCKSOURCE_MASK(32),
38 .shift = 16,
39 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 38 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
40}; 39};
41 40
@@ -123,9 +122,7 @@ void __init time_init(void)
123 122
124 /* figure rate for counter */ 123 /* figure rate for counter */
125 counter_hz = clk_get_rate(boot_cpu_data.clk); 124 counter_hz = clk_get_rate(boot_cpu_data.clk);
126 counter.mult = clocksource_hz2mult(counter_hz, counter.shift); 125 ret = clocksource_register_hz(&counter, counter_hz);
127
128 ret = clocksource_register(&counter);
129 if (ret) 126 if (ret)
130 pr_debug("timer: could not register clocksource: %d\n", ret); 127 pr_debug("timer: could not register clocksource: %d\n", ret);
131 128
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index ac76da099a6d..89accc626b86 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -618,7 +618,7 @@ pfm_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
618} 618}
619 619
620/* forward declaration */ 620/* forward declaration */
621static static const struct dentry_operations pfmfs_dentry_operations; 621static const struct dentry_operations pfmfs_dentry_operations;
622 622
623static struct dentry * 623static struct dentry *
624pfmfs_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) 624pfmfs_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data)
diff --git a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c
index 1841ee7e65f9..5ca674b74737 100644
--- a/arch/ia64/mm/hugetlbpage.c
+++ b/arch/ia64/mm/hugetlbpage.c
@@ -38,7 +38,7 @@ huge_pte_alloc(struct mm_struct *mm, unsigned long addr, unsigned long sz)
38 if (pud) { 38 if (pud) {
39 pmd = pmd_alloc(mm, pud, taddr); 39 pmd = pmd_alloc(mm, pud, taddr);
40 if (pmd) 40 if (pmd)
41 pte = pte_alloc_map(mm, pmd, taddr); 41 pte = pte_alloc_map(mm, NULL, pmd, taddr);
42 } 42 }
43 return pte; 43 return pte;
44} 44}
diff --git a/arch/mips/include/asm/mman.h b/arch/mips/include/asm/mman.h
index c892bfb3e2c1..785b4ea4ec3f 100644
--- a/arch/mips/include/asm/mman.h
+++ b/arch/mips/include/asm/mman.h
@@ -77,6 +77,9 @@
77#define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */ 77#define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */
78#define MADV_HWPOISON 100 /* poison a page for testing */ 78#define MADV_HWPOISON 100 /* poison a page for testing */
79 79
80#define MADV_HUGEPAGE 14 /* Worth backing with hugepages */
81#define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages */
82
80/* compatibility flags */ 83/* compatibility flags */
81#define MAP_FILE 0 84#define MAP_FILE 0
82 85
diff --git a/arch/mips/kernel/module.c b/arch/mips/kernel/module.c
index 6f51dda87fce..d87a72e9fac7 100644
--- a/arch/mips/kernel/module.c
+++ b/arch/mips/kernel/module.c
@@ -46,17 +46,9 @@ static DEFINE_SPINLOCK(dbe_lock);
46void *module_alloc(unsigned long size) 46void *module_alloc(unsigned long size)
47{ 47{
48#ifdef MODULE_START 48#ifdef MODULE_START
49 struct vm_struct *area; 49 return __vmalloc_node_range(size, 1, MODULE_START, MODULE_END,
50 50 GFP_KERNEL, PAGE_KERNEL, -1,
51 size = PAGE_ALIGN(size); 51 __builtin_return_address(0));
52 if (!size)
53 return NULL;
54
55 area = __get_vm_area(size, VM_ALLOC, MODULE_START, MODULE_END);
56 if (!area)
57 return NULL;
58
59 return __vmalloc_area(area, GFP_KERNEL, PAGE_KERNEL);
60#else 52#else
61 if (size == 0) 53 if (size == 0)
62 return NULL; 54 return NULL;
diff --git a/arch/parisc/include/asm/mman.h b/arch/parisc/include/asm/mman.h
index 9749c8afe83a..f5b7bf5fba68 100644
--- a/arch/parisc/include/asm/mman.h
+++ b/arch/parisc/include/asm/mman.h
@@ -59,6 +59,9 @@
59#define MADV_MERGEABLE 65 /* KSM may merge identical pages */ 59#define MADV_MERGEABLE 65 /* KSM may merge identical pages */
60#define MADV_UNMERGEABLE 66 /* KSM may not merge identical pages */ 60#define MADV_UNMERGEABLE 66 /* KSM may not merge identical pages */
61 61
62#define MADV_HUGEPAGE 67 /* Worth backing with hugepages */
63#define MADV_NOHUGEPAGE 68 /* Not worth backing with hugepages */
64
62/* compatibility flags */ 65/* compatibility flags */
63#define MAP_FILE 0 66#define MAP_FILE 0
64#define MAP_VARIABLE 0 67#define MAP_VARIABLE 0
diff --git a/arch/powerpc/mm/gup.c b/arch/powerpc/mm/gup.c
index d7efdbf640c7..fec13200868f 100644
--- a/arch/powerpc/mm/gup.c
+++ b/arch/powerpc/mm/gup.c
@@ -16,6 +16,16 @@
16 16
17#ifdef __HAVE_ARCH_PTE_SPECIAL 17#ifdef __HAVE_ARCH_PTE_SPECIAL
18 18
19static inline void get_huge_page_tail(struct page *page)
20{
21 /*
22 * __split_huge_page_refcount() cannot run
23 * from under us.
24 */
25 VM_BUG_ON(atomic_read(&page->_count) < 0);
26 atomic_inc(&page->_count);
27}
28
19/* 29/*
20 * The performance critical leaf functions are made noinline otherwise gcc 30 * The performance critical leaf functions are made noinline otherwise gcc
21 * inlines everything into a single function which results in too much 31 * inlines everything into a single function which results in too much
@@ -47,6 +57,8 @@ static noinline int gup_pte_range(pmd_t pmd, unsigned long addr,
47 put_page(page); 57 put_page(page);
48 return 0; 58 return 0;
49 } 59 }
60 if (PageTail(page))
61 get_huge_page_tail(page);
50 pages[*nr] = page; 62 pages[*nr] = page;
51 (*nr)++; 63 (*nr)++;
52 64
diff --git a/arch/sh/mm/hugetlbpage.c b/arch/sh/mm/hugetlbpage.c
index 9163db3e8d15..d7762349ea48 100644
--- a/arch/sh/mm/hugetlbpage.c
+++ b/arch/sh/mm/hugetlbpage.c
@@ -35,7 +35,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm,
35 if (pud) { 35 if (pud) {
36 pmd = pmd_alloc(mm, pud, addr); 36 pmd = pmd_alloc(mm, pud, addr);
37 if (pmd) 37 if (pmd)
38 pte = pte_alloc_map(mm, pmd, addr); 38 pte = pte_alloc_map(mm, NULL, pmd, addr);
39 } 39 }
40 } 40 }
41 41
diff --git a/arch/sparc/kernel/module.c b/arch/sparc/kernel/module.c
index ee3c7dde8d9f..8d348c474a2f 100644
--- a/arch/sparc/kernel/module.c
+++ b/arch/sparc/kernel/module.c
@@ -23,17 +23,11 @@
23 23
24static void *module_map(unsigned long size) 24static void *module_map(unsigned long size)
25{ 25{
26 struct vm_struct *area; 26 if (PAGE_ALIGN(size) > MODULES_LEN)
27
28 size = PAGE_ALIGN(size);
29 if (!size || size > MODULES_LEN)
30 return NULL;
31
32 area = __get_vm_area(size, VM_ALLOC, MODULES_VADDR, MODULES_END);
33 if (!area)
34 return NULL; 27 return NULL;
35 28 return __vmalloc_node_range(size, 1, MODULES_VADDR, MODULES_END,
36 return __vmalloc_area(area, GFP_KERNEL, PAGE_KERNEL); 29 GFP_KERNEL, PAGE_KERNEL, -1,
30 __builtin_return_address(0));
37} 31}
38 32
39static char *dot2underscore(char *name) 33static char *dot2underscore(char *name)
diff --git a/arch/sparc/mm/generic_32.c b/arch/sparc/mm/generic_32.c
index 5edcac184eaf..e6067b75f11c 100644
--- a/arch/sparc/mm/generic_32.c
+++ b/arch/sparc/mm/generic_32.c
@@ -50,7 +50,7 @@ static inline int io_remap_pmd_range(struct mm_struct *mm, pmd_t * pmd, unsigned
50 end = PGDIR_SIZE; 50 end = PGDIR_SIZE;
51 offset -= address; 51 offset -= address;
52 do { 52 do {
53 pte_t * pte = pte_alloc_map(mm, pmd, address); 53 pte_t *pte = pte_alloc_map(mm, NULL, pmd, address);
54 if (!pte) 54 if (!pte)
55 return -ENOMEM; 55 return -ENOMEM;
56 io_remap_pte_range(mm, pte, address, end - address, address + offset, prot, space); 56 io_remap_pte_range(mm, pte, address, end - address, address + offset, prot, space);
diff --git a/arch/sparc/mm/generic_64.c b/arch/sparc/mm/generic_64.c
index 04f2bf4cd571..3cb00dfd4bd6 100644
--- a/arch/sparc/mm/generic_64.c
+++ b/arch/sparc/mm/generic_64.c
@@ -92,7 +92,7 @@ static inline int io_remap_pmd_range(struct mm_struct *mm, pmd_t * pmd, unsigned
92 end = PGDIR_SIZE; 92 end = PGDIR_SIZE;
93 offset -= address; 93 offset -= address;
94 do { 94 do {
95 pte_t * pte = pte_alloc_map(mm, pmd, address); 95 pte_t *pte = pte_alloc_map(mm, NULL, pmd, address);
96 if (!pte) 96 if (!pte)
97 return -ENOMEM; 97 return -ENOMEM;
98 io_remap_pte_range(mm, pte, address, end - address, address + offset, prot, space); 98 io_remap_pte_range(mm, pte, address, end - address, address + offset, prot, space);
diff --git a/arch/sparc/mm/hugetlbpage.c b/arch/sparc/mm/hugetlbpage.c
index 5fdddf134caa..f4e97646ce23 100644
--- a/arch/sparc/mm/hugetlbpage.c
+++ b/arch/sparc/mm/hugetlbpage.c
@@ -214,7 +214,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm,
214 if (pud) { 214 if (pud) {
215 pmd = pmd_alloc(mm, pud, addr); 215 pmd = pmd_alloc(mm, pud, addr);
216 if (pmd) 216 if (pmd)
217 pte = pte_alloc_map(mm, pmd, addr); 217 pte = pte_alloc_map(mm, NULL, pmd, addr);
218 } 218 }
219 return pte; 219 return pte;
220} 220}
diff --git a/arch/um/kernel/skas/mmu.c b/arch/um/kernel/skas/mmu.c
index 3d099f974785..1aee587e9c5d 100644
--- a/arch/um/kernel/skas/mmu.c
+++ b/arch/um/kernel/skas/mmu.c
@@ -31,7 +31,7 @@ static int init_stub_pte(struct mm_struct *mm, unsigned long proc,
31 if (!pmd) 31 if (!pmd)
32 goto out_pmd; 32 goto out_pmd;
33 33
34 pte = pte_alloc_map(mm, pmd, proc); 34 pte = pte_alloc_map(mm, NULL, pmd, proc);
35 if (!pte) 35 if (!pte)
36 goto out_pte; 36 goto out_pte;
37 37
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index aa75f21a9fba..ffd7f8d29187 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -822,6 +822,7 @@ extern bool kvm_rebooting;
822#define KVM_ARCH_WANT_MMU_NOTIFIER 822#define KVM_ARCH_WANT_MMU_NOTIFIER
823int kvm_unmap_hva(struct kvm *kvm, unsigned long hva); 823int kvm_unmap_hva(struct kvm *kvm, unsigned long hva);
824int kvm_age_hva(struct kvm *kvm, unsigned long hva); 824int kvm_age_hva(struct kvm *kvm, unsigned long hva);
825int kvm_test_age_hva(struct kvm *kvm, unsigned long hva);
825void kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte); 826void kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte);
826int cpuid_maxphyaddr(struct kvm_vcpu *vcpu); 827int cpuid_maxphyaddr(struct kvm_vcpu *vcpu);
827int kvm_cpu_has_interrupt(struct kvm_vcpu *vcpu); 828int kvm_cpu_has_interrupt(struct kvm_vcpu *vcpu);
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
index 7709c12431b8..2071a8b2b32f 100644
--- a/arch/x86/include/asm/paravirt.h
+++ b/arch/x86/include/asm/paravirt.h
@@ -435,6 +435,11 @@ static inline void pte_update(struct mm_struct *mm, unsigned long addr,
435{ 435{
436 PVOP_VCALL3(pv_mmu_ops.pte_update, mm, addr, ptep); 436 PVOP_VCALL3(pv_mmu_ops.pte_update, mm, addr, ptep);
437} 437}
438static inline void pmd_update(struct mm_struct *mm, unsigned long addr,
439 pmd_t *pmdp)
440{
441 PVOP_VCALL3(pv_mmu_ops.pmd_update, mm, addr, pmdp);
442}
438 443
439static inline void pte_update_defer(struct mm_struct *mm, unsigned long addr, 444static inline void pte_update_defer(struct mm_struct *mm, unsigned long addr,
440 pte_t *ptep) 445 pte_t *ptep)
@@ -442,6 +447,12 @@ static inline void pte_update_defer(struct mm_struct *mm, unsigned long addr,
442 PVOP_VCALL3(pv_mmu_ops.pte_update_defer, mm, addr, ptep); 447 PVOP_VCALL3(pv_mmu_ops.pte_update_defer, mm, addr, ptep);
443} 448}
444 449
450static inline void pmd_update_defer(struct mm_struct *mm, unsigned long addr,
451 pmd_t *pmdp)
452{
453 PVOP_VCALL3(pv_mmu_ops.pmd_update_defer, mm, addr, pmdp);
454}
455
445static inline pte_t __pte(pteval_t val) 456static inline pte_t __pte(pteval_t val)
446{ 457{
447 pteval_t ret; 458 pteval_t ret;
@@ -543,6 +554,20 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
543 PVOP_VCALL4(pv_mmu_ops.set_pte_at, mm, addr, ptep, pte.pte); 554 PVOP_VCALL4(pv_mmu_ops.set_pte_at, mm, addr, ptep, pte.pte);
544} 555}
545 556
557#ifdef CONFIG_TRANSPARENT_HUGEPAGE
558static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
559 pmd_t *pmdp, pmd_t pmd)
560{
561#if PAGETABLE_LEVELS >= 3
562 if (sizeof(pmdval_t) > sizeof(long))
563 /* 5 arg words */
564 pv_mmu_ops.set_pmd_at(mm, addr, pmdp, pmd);
565 else
566 PVOP_VCALL4(pv_mmu_ops.set_pmd_at, mm, addr, pmdp, pmd.pmd);
567#endif
568}
569#endif
570
546static inline void set_pmd(pmd_t *pmdp, pmd_t pmd) 571static inline void set_pmd(pmd_t *pmdp, pmd_t pmd)
547{ 572{
548 pmdval_t val = native_pmd_val(pmd); 573 pmdval_t val = native_pmd_val(pmd);
diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
index b82bac975250..82885099c869 100644
--- a/arch/x86/include/asm/paravirt_types.h
+++ b/arch/x86/include/asm/paravirt_types.h
@@ -265,10 +265,16 @@ struct pv_mmu_ops {
265 void (*set_pte_at)(struct mm_struct *mm, unsigned long addr, 265 void (*set_pte_at)(struct mm_struct *mm, unsigned long addr,
266 pte_t *ptep, pte_t pteval); 266 pte_t *ptep, pte_t pteval);
267 void (*set_pmd)(pmd_t *pmdp, pmd_t pmdval); 267 void (*set_pmd)(pmd_t *pmdp, pmd_t pmdval);
268 void (*set_pmd_at)(struct mm_struct *mm, unsigned long addr,
269 pmd_t *pmdp, pmd_t pmdval);
268 void (*pte_update)(struct mm_struct *mm, unsigned long addr, 270 void (*pte_update)(struct mm_struct *mm, unsigned long addr,
269 pte_t *ptep); 271 pte_t *ptep);
270 void (*pte_update_defer)(struct mm_struct *mm, 272 void (*pte_update_defer)(struct mm_struct *mm,
271 unsigned long addr, pte_t *ptep); 273 unsigned long addr, pte_t *ptep);
274 void (*pmd_update)(struct mm_struct *mm, unsigned long addr,
275 pmd_t *pmdp);
276 void (*pmd_update_defer)(struct mm_struct *mm,
277 unsigned long addr, pmd_t *pmdp);
272 278
273 pte_t (*ptep_modify_prot_start)(struct mm_struct *mm, unsigned long addr, 279 pte_t (*ptep_modify_prot_start)(struct mm_struct *mm, unsigned long addr,
274 pte_t *ptep); 280 pte_t *ptep);
diff --git a/arch/x86/include/asm/pgtable-2level.h b/arch/x86/include/asm/pgtable-2level.h
index 2334982b339e..98391db840c6 100644
--- a/arch/x86/include/asm/pgtable-2level.h
+++ b/arch/x86/include/asm/pgtable-2level.h
@@ -46,6 +46,15 @@ static inline pte_t native_ptep_get_and_clear(pte_t *xp)
46#define native_ptep_get_and_clear(xp) native_local_ptep_get_and_clear(xp) 46#define native_ptep_get_and_clear(xp) native_local_ptep_get_and_clear(xp)
47#endif 47#endif
48 48
49#ifdef CONFIG_SMP
50static inline pmd_t native_pmdp_get_and_clear(pmd_t *xp)
51{
52 return __pmd(xchg((pmdval_t *)xp, 0));
53}
54#else
55#define native_pmdp_get_and_clear(xp) native_local_pmdp_get_and_clear(xp)
56#endif
57
49/* 58/*
50 * Bits _PAGE_BIT_PRESENT, _PAGE_BIT_FILE and _PAGE_BIT_PROTNONE are taken, 59 * Bits _PAGE_BIT_PRESENT, _PAGE_BIT_FILE and _PAGE_BIT_PROTNONE are taken,
51 * split up the 29 bits of offset into this range: 60 * split up the 29 bits of offset into this range:
diff --git a/arch/x86/include/asm/pgtable-3level.h b/arch/x86/include/asm/pgtable-3level.h
index 177b0165ea01..94b979d1b58d 100644
--- a/arch/x86/include/asm/pgtable-3level.h
+++ b/arch/x86/include/asm/pgtable-3level.h
@@ -104,6 +104,29 @@ static inline pte_t native_ptep_get_and_clear(pte_t *ptep)
104#define native_ptep_get_and_clear(xp) native_local_ptep_get_and_clear(xp) 104#define native_ptep_get_and_clear(xp) native_local_ptep_get_and_clear(xp)
105#endif 105#endif
106 106
107#ifdef CONFIG_SMP
108union split_pmd {
109 struct {
110 u32 pmd_low;
111 u32 pmd_high;
112 };
113 pmd_t pmd;
114};
115static inline pmd_t native_pmdp_get_and_clear(pmd_t *pmdp)
116{
117 union split_pmd res, *orig = (union split_pmd *)pmdp;
118
119 /* xchg acts as a barrier before setting of the high bits */
120 res.pmd_low = xchg(&orig->pmd_low, 0);
121 res.pmd_high = orig->pmd_high;
122 orig->pmd_high = 0;
123
124 return res.pmd;
125}
126#else
127#define native_pmdp_get_and_clear(xp) native_local_pmdp_get_and_clear(xp)
128#endif
129
107/* 130/*
108 * Bits 0, 6 and 7 are taken in the low part of the pte, 131 * Bits 0, 6 and 7 are taken in the low part of the pte,
109 * put the 32 bits of offset into the high part. 132 * put the 32 bits of offset into the high part.
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index ada823a13c7c..18601c86fab1 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -35,6 +35,7 @@ extern struct mm_struct *pgd_page_get_mm(struct page *page);
35#else /* !CONFIG_PARAVIRT */ 35#else /* !CONFIG_PARAVIRT */
36#define set_pte(ptep, pte) native_set_pte(ptep, pte) 36#define set_pte(ptep, pte) native_set_pte(ptep, pte)
37#define set_pte_at(mm, addr, ptep, pte) native_set_pte_at(mm, addr, ptep, pte) 37#define set_pte_at(mm, addr, ptep, pte) native_set_pte_at(mm, addr, ptep, pte)
38#define set_pmd_at(mm, addr, pmdp, pmd) native_set_pmd_at(mm, addr, pmdp, pmd)
38 39
39#define set_pte_atomic(ptep, pte) \ 40#define set_pte_atomic(ptep, pte) \
40 native_set_pte_atomic(ptep, pte) 41 native_set_pte_atomic(ptep, pte)
@@ -59,6 +60,8 @@ extern struct mm_struct *pgd_page_get_mm(struct page *page);
59 60
60#define pte_update(mm, addr, ptep) do { } while (0) 61#define pte_update(mm, addr, ptep) do { } while (0)
61#define pte_update_defer(mm, addr, ptep) do { } while (0) 62#define pte_update_defer(mm, addr, ptep) do { } while (0)
63#define pmd_update(mm, addr, ptep) do { } while (0)
64#define pmd_update_defer(mm, addr, ptep) do { } while (0)
62 65
63#define pgd_val(x) native_pgd_val(x) 66#define pgd_val(x) native_pgd_val(x)
64#define __pgd(x) native_make_pgd(x) 67#define __pgd(x) native_make_pgd(x)
@@ -94,6 +97,11 @@ static inline int pte_young(pte_t pte)
94 return pte_flags(pte) & _PAGE_ACCESSED; 97 return pte_flags(pte) & _PAGE_ACCESSED;
95} 98}
96 99
100static inline int pmd_young(pmd_t pmd)
101{
102 return pmd_flags(pmd) & _PAGE_ACCESSED;
103}
104
97static inline int pte_write(pte_t pte) 105static inline int pte_write(pte_t pte)
98{ 106{
99 return pte_flags(pte) & _PAGE_RW; 107 return pte_flags(pte) & _PAGE_RW;
@@ -142,6 +150,23 @@ static inline int pmd_large(pmd_t pte)
142 (_PAGE_PSE | _PAGE_PRESENT); 150 (_PAGE_PSE | _PAGE_PRESENT);
143} 151}
144 152
153#ifdef CONFIG_TRANSPARENT_HUGEPAGE
154static inline int pmd_trans_splitting(pmd_t pmd)
155{
156 return pmd_val(pmd) & _PAGE_SPLITTING;
157}
158
159static inline int pmd_trans_huge(pmd_t pmd)
160{
161 return pmd_val(pmd) & _PAGE_PSE;
162}
163
164static inline int has_transparent_hugepage(void)
165{
166 return cpu_has_pse;
167}
168#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
169
145static inline pte_t pte_set_flags(pte_t pte, pteval_t set) 170static inline pte_t pte_set_flags(pte_t pte, pteval_t set)
146{ 171{
147 pteval_t v = native_pte_val(pte); 172 pteval_t v = native_pte_val(pte);
@@ -216,6 +241,55 @@ static inline pte_t pte_mkspecial(pte_t pte)
216 return pte_set_flags(pte, _PAGE_SPECIAL); 241 return pte_set_flags(pte, _PAGE_SPECIAL);
217} 242}
218 243
244static inline pmd_t pmd_set_flags(pmd_t pmd, pmdval_t set)
245{
246 pmdval_t v = native_pmd_val(pmd);
247
248 return __pmd(v | set);
249}
250
251static inline pmd_t pmd_clear_flags(pmd_t pmd, pmdval_t clear)
252{
253 pmdval_t v = native_pmd_val(pmd);
254
255 return __pmd(v & ~clear);
256}
257
258static inline pmd_t pmd_mkold(pmd_t pmd)
259{
260 return pmd_clear_flags(pmd, _PAGE_ACCESSED);
261}
262
263static inline pmd_t pmd_wrprotect(pmd_t pmd)
264{
265 return pmd_clear_flags(pmd, _PAGE_RW);
266}
267
268static inline pmd_t pmd_mkdirty(pmd_t pmd)
269{
270 return pmd_set_flags(pmd, _PAGE_DIRTY);
271}
272
273static inline pmd_t pmd_mkhuge(pmd_t pmd)
274{
275 return pmd_set_flags(pmd, _PAGE_PSE);
276}
277
278static inline pmd_t pmd_mkyoung(pmd_t pmd)
279{
280 return pmd_set_flags(pmd, _PAGE_ACCESSED);
281}
282
283static inline pmd_t pmd_mkwrite(pmd_t pmd)
284{
285 return pmd_set_flags(pmd, _PAGE_RW);
286}
287
288static inline pmd_t pmd_mknotpresent(pmd_t pmd)
289{
290 return pmd_clear_flags(pmd, _PAGE_PRESENT);
291}
292
219/* 293/*
220 * Mask out unsupported bits in a present pgprot. Non-present pgprots 294 * Mask out unsupported bits in a present pgprot. Non-present pgprots
221 * can use those bits for other purposes, so leave them be. 295 * can use those bits for other purposes, so leave them be.
@@ -256,6 +330,16 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
256 return __pte(val); 330 return __pte(val);
257} 331}
258 332
333static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
334{
335 pmdval_t val = pmd_val(pmd);
336
337 val &= _HPAGE_CHG_MASK;
338 val |= massage_pgprot(newprot) & ~_HPAGE_CHG_MASK;
339
340 return __pmd(val);
341}
342
259/* mprotect needs to preserve PAT bits when updating vm_page_prot */ 343/* mprotect needs to preserve PAT bits when updating vm_page_prot */
260#define pgprot_modify pgprot_modify 344#define pgprot_modify pgprot_modify
261static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot) 345static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot)
@@ -350,7 +434,7 @@ static inline unsigned long pmd_page_vaddr(pmd_t pmd)
350 * Currently stuck as a macro due to indirect forward reference to 434 * Currently stuck as a macro due to indirect forward reference to
351 * linux/mmzone.h's __section_mem_map_addr() definition: 435 * linux/mmzone.h's __section_mem_map_addr() definition:
352 */ 436 */
353#define pmd_page(pmd) pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT) 437#define pmd_page(pmd) pfn_to_page((pmd_val(pmd) & PTE_PFN_MASK) >> PAGE_SHIFT)
354 438
355/* 439/*
356 * the pmd page can be thought of an array like this: pmd_t[PTRS_PER_PMD] 440 * the pmd page can be thought of an array like this: pmd_t[PTRS_PER_PMD]
@@ -524,12 +608,26 @@ static inline pte_t native_local_ptep_get_and_clear(pte_t *ptep)
524 return res; 608 return res;
525} 609}
526 610
611static inline pmd_t native_local_pmdp_get_and_clear(pmd_t *pmdp)
612{
613 pmd_t res = *pmdp;
614
615 native_pmd_clear(pmdp);
616 return res;
617}
618
527static inline void native_set_pte_at(struct mm_struct *mm, unsigned long addr, 619static inline void native_set_pte_at(struct mm_struct *mm, unsigned long addr,
528 pte_t *ptep , pte_t pte) 620 pte_t *ptep , pte_t pte)
529{ 621{
530 native_set_pte(ptep, pte); 622 native_set_pte(ptep, pte);
531} 623}
532 624
625static inline void native_set_pmd_at(struct mm_struct *mm, unsigned long addr,
626 pmd_t *pmdp , pmd_t pmd)
627{
628 native_set_pmd(pmdp, pmd);
629}
630
533#ifndef CONFIG_PARAVIRT 631#ifndef CONFIG_PARAVIRT
534/* 632/*
535 * Rules for using pte_update - it must be called after any PTE update which 633 * Rules for using pte_update - it must be called after any PTE update which
@@ -607,6 +705,49 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm,
607 705
608#define flush_tlb_fix_spurious_fault(vma, address) 706#define flush_tlb_fix_spurious_fault(vma, address)
609 707
708#define mk_pmd(page, pgprot) pfn_pmd(page_to_pfn(page), (pgprot))
709
710#define __HAVE_ARCH_PMDP_SET_ACCESS_FLAGS
711extern int pmdp_set_access_flags(struct vm_area_struct *vma,
712 unsigned long address, pmd_t *pmdp,
713 pmd_t entry, int dirty);
714
715#define __HAVE_ARCH_PMDP_TEST_AND_CLEAR_YOUNG
716extern int pmdp_test_and_clear_young(struct vm_area_struct *vma,
717 unsigned long addr, pmd_t *pmdp);
718
719#define __HAVE_ARCH_PMDP_CLEAR_YOUNG_FLUSH
720extern int pmdp_clear_flush_young(struct vm_area_struct *vma,
721 unsigned long address, pmd_t *pmdp);
722
723
724#define __HAVE_ARCH_PMDP_SPLITTING_FLUSH
725extern void pmdp_splitting_flush(struct vm_area_struct *vma,
726 unsigned long addr, pmd_t *pmdp);
727
728#define __HAVE_ARCH_PMD_WRITE
729static inline int pmd_write(pmd_t pmd)
730{
731 return pmd_flags(pmd) & _PAGE_RW;
732}
733
734#define __HAVE_ARCH_PMDP_GET_AND_CLEAR
735static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm, unsigned long addr,
736 pmd_t *pmdp)
737{
738 pmd_t pmd = native_pmdp_get_and_clear(pmdp);
739 pmd_update(mm, addr, pmdp);
740 return pmd;
741}
742
743#define __HAVE_ARCH_PMDP_SET_WRPROTECT
744static inline void pmdp_set_wrprotect(struct mm_struct *mm,
745 unsigned long addr, pmd_t *pmdp)
746{
747 clear_bit(_PAGE_BIT_RW, (unsigned long *)pmdp);
748 pmd_update(mm, addr, pmdp);
749}
750
610/* 751/*
611 * clone_pgd_range(pgd_t *dst, pgd_t *src, int count); 752 * clone_pgd_range(pgd_t *dst, pgd_t *src, int count);
612 * 753 *
diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h
index f86da20347f2..975f709e09ae 100644
--- a/arch/x86/include/asm/pgtable_64.h
+++ b/arch/x86/include/asm/pgtable_64.h
@@ -59,6 +59,16 @@ static inline void native_set_pte_atomic(pte_t *ptep, pte_t pte)
59 native_set_pte(ptep, pte); 59 native_set_pte(ptep, pte);
60} 60}
61 61
62static inline void native_set_pmd(pmd_t *pmdp, pmd_t pmd)
63{
64 *pmdp = pmd;
65}
66
67static inline void native_pmd_clear(pmd_t *pmd)
68{
69 native_set_pmd(pmd, native_make_pmd(0));
70}
71
62static inline pte_t native_ptep_get_and_clear(pte_t *xp) 72static inline pte_t native_ptep_get_and_clear(pte_t *xp)
63{ 73{
64#ifdef CONFIG_SMP 74#ifdef CONFIG_SMP
@@ -72,14 +82,17 @@ static inline pte_t native_ptep_get_and_clear(pte_t *xp)
72#endif 82#endif
73} 83}
74 84
75static inline void native_set_pmd(pmd_t *pmdp, pmd_t pmd) 85static inline pmd_t native_pmdp_get_and_clear(pmd_t *xp)
76{ 86{
77 *pmdp = pmd; 87#ifdef CONFIG_SMP
78} 88 return native_make_pmd(xchg(&xp->pmd, 0));
79 89#else
80static inline void native_pmd_clear(pmd_t *pmd) 90 /* native_local_pmdp_get_and_clear,
81{ 91 but duplicated because of cyclic dependency */
82 native_set_pmd(pmd, native_make_pmd(0)); 92 pmd_t ret = *xp;
93 native_pmd_clear(xp);
94 return ret;
95#endif
83} 96}
84 97
85static inline void native_set_pud(pud_t *pudp, pud_t pud) 98static inline void native_set_pud(pud_t *pudp, pud_t pud)
@@ -168,6 +181,7 @@ extern void cleanup_highmap(void);
168#define kc_offset_to_vaddr(o) ((o) | ~__VIRTUAL_MASK) 181#define kc_offset_to_vaddr(o) ((o) | ~__VIRTUAL_MASK)
169 182
170#define __HAVE_ARCH_PTE_SAME 183#define __HAVE_ARCH_PTE_SAME
184
171#endif /* !__ASSEMBLY__ */ 185#endif /* !__ASSEMBLY__ */
172 186
173#endif /* _ASM_X86_PGTABLE_64_H */ 187#endif /* _ASM_X86_PGTABLE_64_H */
diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h
index d1f4a760be23..7db7723d1f32 100644
--- a/arch/x86/include/asm/pgtable_types.h
+++ b/arch/x86/include/asm/pgtable_types.h
@@ -22,6 +22,7 @@
22#define _PAGE_BIT_PAT_LARGE 12 /* On 2MB or 1GB pages */ 22#define _PAGE_BIT_PAT_LARGE 12 /* On 2MB or 1GB pages */
23#define _PAGE_BIT_SPECIAL _PAGE_BIT_UNUSED1 23#define _PAGE_BIT_SPECIAL _PAGE_BIT_UNUSED1
24#define _PAGE_BIT_CPA_TEST _PAGE_BIT_UNUSED1 24#define _PAGE_BIT_CPA_TEST _PAGE_BIT_UNUSED1
25#define _PAGE_BIT_SPLITTING _PAGE_BIT_UNUSED1 /* only valid on a PSE pmd */
25#define _PAGE_BIT_NX 63 /* No execute: only valid after cpuid check */ 26#define _PAGE_BIT_NX 63 /* No execute: only valid after cpuid check */
26 27
27/* If _PAGE_BIT_PRESENT is clear, we use these: */ 28/* If _PAGE_BIT_PRESENT is clear, we use these: */
@@ -45,6 +46,7 @@
45#define _PAGE_PAT_LARGE (_AT(pteval_t, 1) << _PAGE_BIT_PAT_LARGE) 46#define _PAGE_PAT_LARGE (_AT(pteval_t, 1) << _PAGE_BIT_PAT_LARGE)
46#define _PAGE_SPECIAL (_AT(pteval_t, 1) << _PAGE_BIT_SPECIAL) 47#define _PAGE_SPECIAL (_AT(pteval_t, 1) << _PAGE_BIT_SPECIAL)
47#define _PAGE_CPA_TEST (_AT(pteval_t, 1) << _PAGE_BIT_CPA_TEST) 48#define _PAGE_CPA_TEST (_AT(pteval_t, 1) << _PAGE_BIT_CPA_TEST)
49#define _PAGE_SPLITTING (_AT(pteval_t, 1) << _PAGE_BIT_SPLITTING)
48#define __HAVE_ARCH_PTE_SPECIAL 50#define __HAVE_ARCH_PTE_SPECIAL
49 51
50#ifdef CONFIG_KMEMCHECK 52#ifdef CONFIG_KMEMCHECK
@@ -70,6 +72,7 @@
70/* Set of bits not changed in pte_modify */ 72/* Set of bits not changed in pte_modify */
71#define _PAGE_CHG_MASK (PTE_PFN_MASK | _PAGE_PCD | _PAGE_PWT | \ 73#define _PAGE_CHG_MASK (PTE_PFN_MASK | _PAGE_PCD | _PAGE_PWT | \
72 _PAGE_SPECIAL | _PAGE_ACCESSED | _PAGE_DIRTY) 74 _PAGE_SPECIAL | _PAGE_ACCESSED | _PAGE_DIRTY)
75#define _HPAGE_CHG_MASK (_PAGE_CHG_MASK | _PAGE_PSE)
73 76
74#define _PAGE_CACHE_MASK (_PAGE_PCD | _PAGE_PWT) 77#define _PAGE_CACHE_MASK (_PAGE_PCD | _PAGE_PWT)
75#define _PAGE_CACHE_WB (0) 78#define _PAGE_CACHE_WB (0)
diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm/xen/page.h
index 8760cc60a21c..f25bdf238a33 100644
--- a/arch/x86/include/asm/xen/page.h
+++ b/arch/x86/include/asm/xen/page.h
@@ -42,6 +42,11 @@ extern unsigned int machine_to_phys_order;
42extern unsigned long get_phys_to_machine(unsigned long pfn); 42extern unsigned long get_phys_to_machine(unsigned long pfn);
43extern bool set_phys_to_machine(unsigned long pfn, unsigned long mfn); 43extern bool set_phys_to_machine(unsigned long pfn, unsigned long mfn);
44 44
45extern int m2p_add_override(unsigned long mfn, struct page *page);
46extern int m2p_remove_override(struct page *page);
47extern struct page *m2p_find_override(unsigned long mfn);
48extern unsigned long m2p_find_override_pfn(unsigned long mfn, unsigned long pfn);
49
45static inline unsigned long pfn_to_mfn(unsigned long pfn) 50static inline unsigned long pfn_to_mfn(unsigned long pfn)
46{ 51{
47 unsigned long mfn; 52 unsigned long mfn;
@@ -72,9 +77,6 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn)
72 if (xen_feature(XENFEAT_auto_translated_physmap)) 77 if (xen_feature(XENFEAT_auto_translated_physmap))
73 return mfn; 78 return mfn;
74 79
75 if (unlikely((mfn >> machine_to_phys_order) != 0))
76 return ~0;
77
78 pfn = 0; 80 pfn = 0;
79 /* 81 /*
80 * The array access can fail (e.g., device space beyond end of RAM). 82 * The array access can fail (e.g., device space beyond end of RAM).
@@ -83,6 +85,14 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn)
83 */ 85 */
84 __get_user(pfn, &machine_to_phys_mapping[mfn]); 86 __get_user(pfn, &machine_to_phys_mapping[mfn]);
85 87
88 /*
89 * If this appears to be a foreign mfn (because the pfn
90 * doesn't map back to the mfn), then check the local override
91 * table to see if there's a better pfn to use.
92 */
93 if (get_phys_to_machine(pfn) != mfn)
94 pfn = m2p_find_override_pfn(mfn, pfn);
95
86 return pfn; 96 return pfn;
87} 97}
88 98
diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c
index 8f2956091735..ab23f1ad4bf1 100644
--- a/arch/x86/kernel/module.c
+++ b/arch/x86/kernel/module.c
@@ -37,20 +37,11 @@
37 37
38void *module_alloc(unsigned long size) 38void *module_alloc(unsigned long size)
39{ 39{
40 struct vm_struct *area; 40 if (PAGE_ALIGN(size) > MODULES_LEN)
41
42 if (!size)
43 return NULL;
44 size = PAGE_ALIGN(size);
45 if (size > MODULES_LEN)
46 return NULL; 41 return NULL;
47 42 return __vmalloc_node_range(size, 1, MODULES_VADDR, MODULES_END,
48 area = __get_vm_area(size, VM_ALLOC, MODULES_VADDR, MODULES_END); 43 GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL_EXEC,
49 if (!area) 44 -1, __builtin_return_address(0));
50 return NULL;
51
52 return __vmalloc_area(area, GFP_KERNEL | __GFP_HIGHMEM,
53 PAGE_KERNEL_EXEC);
54} 45}
55 46
56/* Free memory returned from module_alloc */ 47/* Free memory returned from module_alloc */
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index c5b250011fd4..869e1aeeb71b 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -421,8 +421,11 @@ struct pv_mmu_ops pv_mmu_ops = {
421 .set_pte = native_set_pte, 421 .set_pte = native_set_pte,
422 .set_pte_at = native_set_pte_at, 422 .set_pte_at = native_set_pte_at,
423 .set_pmd = native_set_pmd, 423 .set_pmd = native_set_pmd,
424 .set_pmd_at = native_set_pmd_at,
424 .pte_update = paravirt_nop, 425 .pte_update = paravirt_nop,
425 .pte_update_defer = paravirt_nop, 426 .pte_update_defer = paravirt_nop,
427 .pmd_update = paravirt_nop,
428 .pmd_update_defer = paravirt_nop,
426 429
427 .ptep_modify_prot_start = __ptep_modify_prot_start, 430 .ptep_modify_prot_start = __ptep_modify_prot_start,
428 .ptep_modify_prot_commit = __ptep_modify_prot_commit, 431 .ptep_modify_prot_commit = __ptep_modify_prot_commit,
diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
index c2f1b26141e2..998e972f3b1a 100644
--- a/arch/x86/kernel/tboot.c
+++ b/arch/x86/kernel/tboot.c
@@ -133,7 +133,7 @@ static int map_tboot_page(unsigned long vaddr, unsigned long pfn,
133 pmd = pmd_alloc(&tboot_mm, pud, vaddr); 133 pmd = pmd_alloc(&tboot_mm, pud, vaddr);
134 if (!pmd) 134 if (!pmd)
135 return -1; 135 return -1;
136 pte = pte_alloc_map(&tboot_mm, pmd, vaddr); 136 pte = pte_alloc_map(&tboot_mm, NULL, pmd, vaddr);
137 if (!pte) 137 if (!pte)
138 return -1; 138 return -1;
139 set_pte_at(&tboot_mm, vaddr, pte, pfn_pte(pfn, prot)); 139 set_pte_at(&tboot_mm, vaddr, pte, pfn_pte(pfn, prot));
diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c
index 61fb98519622..863f8753ab0a 100644
--- a/arch/x86/kernel/vm86_32.c
+++ b/arch/x86/kernel/vm86_32.c
@@ -179,6 +179,7 @@ static void mark_screen_rdonly(struct mm_struct *mm)
179 if (pud_none_or_clear_bad(pud)) 179 if (pud_none_or_clear_bad(pud))
180 goto out; 180 goto out;
181 pmd = pmd_offset(pud, 0xA0000); 181 pmd = pmd_offset(pud, 0xA0000);
182 split_huge_page_pmd(mm, pmd);
182 if (pmd_none_or_clear_bad(pmd)) 183 if (pmd_none_or_clear_bad(pmd))
183 goto out; 184 goto out;
184 pte = pte_offset_map_lock(mm, pmd, 0xA0000, &ptl); 185 pte = pte_offset_map_lock(mm, pmd, 0xA0000, &ptl);
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 9cafbb499813..f02b8edc3d44 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -554,14 +554,18 @@ static int host_mapping_level(struct kvm *kvm, gfn_t gfn)
554 return ret; 554 return ret;
555} 555}
556 556
557static int mapping_level(struct kvm_vcpu *vcpu, gfn_t large_gfn) 557static bool mapping_level_dirty_bitmap(struct kvm_vcpu *vcpu, gfn_t large_gfn)
558{ 558{
559 struct kvm_memory_slot *slot; 559 struct kvm_memory_slot *slot;
560 int host_level, level, max_level;
561
562 slot = gfn_to_memslot(vcpu->kvm, large_gfn); 560 slot = gfn_to_memslot(vcpu->kvm, large_gfn);
563 if (slot && slot->dirty_bitmap) 561 if (slot && slot->dirty_bitmap)
564 return PT_PAGE_TABLE_LEVEL; 562 return true;
563 return false;
564}
565
566static int mapping_level(struct kvm_vcpu *vcpu, gfn_t large_gfn)
567{
568 int host_level, level, max_level;
565 569
566 host_level = host_mapping_level(vcpu->kvm, large_gfn); 570 host_level = host_mapping_level(vcpu->kvm, large_gfn);
567 571
@@ -941,6 +945,35 @@ static int kvm_age_rmapp(struct kvm *kvm, unsigned long *rmapp,
941 return young; 945 return young;
942} 946}
943 947
948static int kvm_test_age_rmapp(struct kvm *kvm, unsigned long *rmapp,
949 unsigned long data)
950{
951 u64 *spte;
952 int young = 0;
953
954 /*
955 * If there's no access bit in the secondary pte set by the
956 * hardware it's up to gup-fast/gup to set the access bit in
957 * the primary pte or in the page structure.
958 */
959 if (!shadow_accessed_mask)
960 goto out;
961
962 spte = rmap_next(kvm, rmapp, NULL);
963 while (spte) {
964 u64 _spte = *spte;
965 BUG_ON(!(_spte & PT_PRESENT_MASK));
966 young = _spte & PT_ACCESSED_MASK;
967 if (young) {
968 young = 1;
969 break;
970 }
971 spte = rmap_next(kvm, rmapp, spte);
972 }
973out:
974 return young;
975}
976
944#define RMAP_RECYCLE_THRESHOLD 1000 977#define RMAP_RECYCLE_THRESHOLD 1000
945 978
946static void rmap_recycle(struct kvm_vcpu *vcpu, u64 *spte, gfn_t gfn) 979static void rmap_recycle(struct kvm_vcpu *vcpu, u64 *spte, gfn_t gfn)
@@ -961,6 +994,11 @@ int kvm_age_hva(struct kvm *kvm, unsigned long hva)
961 return kvm_handle_hva(kvm, hva, 0, kvm_age_rmapp); 994 return kvm_handle_hva(kvm, hva, 0, kvm_age_rmapp);
962} 995}
963 996
997int kvm_test_age_hva(struct kvm *kvm, unsigned long hva)
998{
999 return kvm_handle_hva(kvm, hva, 0, kvm_test_age_rmapp);
1000}
1001
964#ifdef MMU_DEBUG 1002#ifdef MMU_DEBUG
965static int is_empty_shadow_page(u64 *spt) 1003static int is_empty_shadow_page(u64 *spt)
966{ 1004{
@@ -2281,6 +2319,48 @@ static int kvm_handle_bad_page(struct kvm *kvm, gfn_t gfn, pfn_t pfn)
2281 return 1; 2319 return 1;
2282} 2320}
2283 2321
2322static void transparent_hugepage_adjust(struct kvm_vcpu *vcpu,
2323 gfn_t *gfnp, pfn_t *pfnp, int *levelp)
2324{
2325 pfn_t pfn = *pfnp;
2326 gfn_t gfn = *gfnp;
2327 int level = *levelp;
2328
2329 /*
2330 * Check if it's a transparent hugepage. If this would be an
2331 * hugetlbfs page, level wouldn't be set to
2332 * PT_PAGE_TABLE_LEVEL and there would be no adjustment done
2333 * here.
2334 */
2335 if (!is_error_pfn(pfn) && !kvm_is_mmio_pfn(pfn) &&
2336 level == PT_PAGE_TABLE_LEVEL &&
2337 PageTransCompound(pfn_to_page(pfn)) &&
2338 !has_wrprotected_page(vcpu->kvm, gfn, PT_DIRECTORY_LEVEL)) {
2339 unsigned long mask;
2340 /*
2341 * mmu_notifier_retry was successful and we hold the
2342 * mmu_lock here, so the pmd can't become splitting
2343 * from under us, and in turn
2344 * __split_huge_page_refcount() can't run from under
2345 * us and we can safely transfer the refcount from
2346 * PG_tail to PG_head as we switch the pfn to tail to
2347 * head.
2348 */
2349 *levelp = level = PT_DIRECTORY_LEVEL;
2350 mask = KVM_PAGES_PER_HPAGE(level) - 1;
2351 VM_BUG_ON((gfn & mask) != (pfn & mask));
2352 if (pfn & mask) {
2353 gfn &= ~mask;
2354 *gfnp = gfn;
2355 kvm_release_pfn_clean(pfn);
2356 pfn &= ~mask;
2357 if (!get_page_unless_zero(pfn_to_page(pfn)))
2358 BUG();
2359 *pfnp = pfn;
2360 }
2361 }
2362}
2363
2284static bool try_async_pf(struct kvm_vcpu *vcpu, bool prefault, gfn_t gfn, 2364static bool try_async_pf(struct kvm_vcpu *vcpu, bool prefault, gfn_t gfn,
2285 gva_t gva, pfn_t *pfn, bool write, bool *writable); 2365 gva_t gva, pfn_t *pfn, bool write, bool *writable);
2286 2366
@@ -2289,20 +2369,25 @@ static int nonpaging_map(struct kvm_vcpu *vcpu, gva_t v, int write, gfn_t gfn,
2289{ 2369{
2290 int r; 2370 int r;
2291 int level; 2371 int level;
2372 int force_pt_level;
2292 pfn_t pfn; 2373 pfn_t pfn;
2293 unsigned long mmu_seq; 2374 unsigned long mmu_seq;
2294 bool map_writable; 2375 bool map_writable;
2295 2376
2296 level = mapping_level(vcpu, gfn); 2377 force_pt_level = mapping_level_dirty_bitmap(vcpu, gfn);
2297 2378 if (likely(!force_pt_level)) {
2298 /* 2379 level = mapping_level(vcpu, gfn);
2299 * This path builds a PAE pagetable - so we can map 2mb pages at 2380 /*
2300 * maximum. Therefore check if the level is larger than that. 2381 * This path builds a PAE pagetable - so we can map
2301 */ 2382 * 2mb pages at maximum. Therefore check if the level
2302 if (level > PT_DIRECTORY_LEVEL) 2383 * is larger than that.
2303 level = PT_DIRECTORY_LEVEL; 2384 */
2385 if (level > PT_DIRECTORY_LEVEL)
2386 level = PT_DIRECTORY_LEVEL;
2304 2387
2305 gfn &= ~(KVM_PAGES_PER_HPAGE(level) - 1); 2388 gfn &= ~(KVM_PAGES_PER_HPAGE(level) - 1);
2389 } else
2390 level = PT_PAGE_TABLE_LEVEL;
2306 2391
2307 mmu_seq = vcpu->kvm->mmu_notifier_seq; 2392 mmu_seq = vcpu->kvm->mmu_notifier_seq;
2308 smp_rmb(); 2393 smp_rmb();
@@ -2318,6 +2403,8 @@ static int nonpaging_map(struct kvm_vcpu *vcpu, gva_t v, int write, gfn_t gfn,
2318 if (mmu_notifier_retry(vcpu, mmu_seq)) 2403 if (mmu_notifier_retry(vcpu, mmu_seq))
2319 goto out_unlock; 2404 goto out_unlock;
2320 kvm_mmu_free_some_pages(vcpu); 2405 kvm_mmu_free_some_pages(vcpu);
2406 if (likely(!force_pt_level))
2407 transparent_hugepage_adjust(vcpu, &gfn, &pfn, &level);
2321 r = __direct_map(vcpu, v, write, map_writable, level, gfn, pfn, 2408 r = __direct_map(vcpu, v, write, map_writable, level, gfn, pfn,
2322 prefault); 2409 prefault);
2323 spin_unlock(&vcpu->kvm->mmu_lock); 2410 spin_unlock(&vcpu->kvm->mmu_lock);
@@ -2655,6 +2742,7 @@ static int tdp_page_fault(struct kvm_vcpu *vcpu, gva_t gpa, u32 error_code,
2655 pfn_t pfn; 2742 pfn_t pfn;
2656 int r; 2743 int r;
2657 int level; 2744 int level;
2745 int force_pt_level;
2658 gfn_t gfn = gpa >> PAGE_SHIFT; 2746 gfn_t gfn = gpa >> PAGE_SHIFT;
2659 unsigned long mmu_seq; 2747 unsigned long mmu_seq;
2660 int write = error_code & PFERR_WRITE_MASK; 2748 int write = error_code & PFERR_WRITE_MASK;
@@ -2667,9 +2755,12 @@ static int tdp_page_fault(struct kvm_vcpu *vcpu, gva_t gpa, u32 error_code,
2667 if (r) 2755 if (r)
2668 return r; 2756 return r;
2669 2757
2670 level = mapping_level(vcpu, gfn); 2758 force_pt_level = mapping_level_dirty_bitmap(vcpu, gfn);
2671 2759 if (likely(!force_pt_level)) {
2672 gfn &= ~(KVM_PAGES_PER_HPAGE(level) - 1); 2760 level = mapping_level(vcpu, gfn);
2761 gfn &= ~(KVM_PAGES_PER_HPAGE(level) - 1);
2762 } else
2763 level = PT_PAGE_TABLE_LEVEL;
2673 2764
2674 mmu_seq = vcpu->kvm->mmu_notifier_seq; 2765 mmu_seq = vcpu->kvm->mmu_notifier_seq;
2675 smp_rmb(); 2766 smp_rmb();
@@ -2684,6 +2775,8 @@ static int tdp_page_fault(struct kvm_vcpu *vcpu, gva_t gpa, u32 error_code,
2684 if (mmu_notifier_retry(vcpu, mmu_seq)) 2775 if (mmu_notifier_retry(vcpu, mmu_seq))
2685 goto out_unlock; 2776 goto out_unlock;
2686 kvm_mmu_free_some_pages(vcpu); 2777 kvm_mmu_free_some_pages(vcpu);
2778 if (likely(!force_pt_level))
2779 transparent_hugepage_adjust(vcpu, &gfn, &pfn, &level);
2687 r = __direct_map(vcpu, gpa, write, map_writable, 2780 r = __direct_map(vcpu, gpa, write, map_writable,
2688 level, gfn, pfn, prefault); 2781 level, gfn, pfn, prefault);
2689 spin_unlock(&vcpu->kvm->mmu_lock); 2782 spin_unlock(&vcpu->kvm->mmu_lock);
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
index 53210f1e94c2..6bccc24c4181 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -550,6 +550,7 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr, u32 error_code,
550 int r; 550 int r;
551 pfn_t pfn; 551 pfn_t pfn;
552 int level = PT_PAGE_TABLE_LEVEL; 552 int level = PT_PAGE_TABLE_LEVEL;
553 int force_pt_level;
553 unsigned long mmu_seq; 554 unsigned long mmu_seq;
554 bool map_writable; 555 bool map_writable;
555 556
@@ -577,7 +578,11 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr, u32 error_code,
577 return 0; 578 return 0;
578 } 579 }
579 580
580 if (walker.level >= PT_DIRECTORY_LEVEL) { 581 if (walker.level >= PT_DIRECTORY_LEVEL)
582 force_pt_level = mapping_level_dirty_bitmap(vcpu, walker.gfn);
583 else
584 force_pt_level = 1;
585 if (!force_pt_level) {
581 level = min(walker.level, mapping_level(vcpu, walker.gfn)); 586 level = min(walker.level, mapping_level(vcpu, walker.gfn));
582 walker.gfn = walker.gfn & ~(KVM_PAGES_PER_HPAGE(level) - 1); 587 walker.gfn = walker.gfn & ~(KVM_PAGES_PER_HPAGE(level) - 1);
583 } 588 }
@@ -599,6 +604,8 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr, u32 error_code,
599 604
600 trace_kvm_mmu_audit(vcpu, AUDIT_PRE_PAGE_FAULT); 605 trace_kvm_mmu_audit(vcpu, AUDIT_PRE_PAGE_FAULT);
601 kvm_mmu_free_some_pages(vcpu); 606 kvm_mmu_free_some_pages(vcpu);
607 if (!force_pt_level)
608 transparent_hugepage_adjust(vcpu, &walker.gfn, &pfn, &level);
602 sptep = FNAME(fetch)(vcpu, addr, &walker, user_fault, write_fault, 609 sptep = FNAME(fetch)(vcpu, addr, &walker, user_fault, write_fault,
603 level, &write_pt, pfn, map_writable, prefault); 610 level, &write_pt, pfn, map_writable, prefault);
604 (void)sptep; 611 (void)sptep;
diff --git a/arch/x86/mm/gup.c b/arch/x86/mm/gup.c
index 738e6593799d..dbe34b931374 100644
--- a/arch/x86/mm/gup.c
+++ b/arch/x86/mm/gup.c
@@ -8,6 +8,7 @@
8#include <linux/mm.h> 8#include <linux/mm.h>
9#include <linux/vmstat.h> 9#include <linux/vmstat.h>
10#include <linux/highmem.h> 10#include <linux/highmem.h>
11#include <linux/swap.h>
11 12
12#include <asm/pgtable.h> 13#include <asm/pgtable.h>
13 14
@@ -89,6 +90,7 @@ static noinline int gup_pte_range(pmd_t pmd, unsigned long addr,
89 VM_BUG_ON(!pfn_valid(pte_pfn(pte))); 90 VM_BUG_ON(!pfn_valid(pte_pfn(pte)));
90 page = pte_page(pte); 91 page = pte_page(pte);
91 get_page(page); 92 get_page(page);
93 SetPageReferenced(page);
92 pages[*nr] = page; 94 pages[*nr] = page;
93 (*nr)++; 95 (*nr)++;
94 96
@@ -103,6 +105,17 @@ static inline void get_head_page_multiple(struct page *page, int nr)
103 VM_BUG_ON(page != compound_head(page)); 105 VM_BUG_ON(page != compound_head(page));
104 VM_BUG_ON(page_count(page) == 0); 106 VM_BUG_ON(page_count(page) == 0);
105 atomic_add(nr, &page->_count); 107 atomic_add(nr, &page->_count);
108 SetPageReferenced(page);
109}
110
111static inline void get_huge_page_tail(struct page *page)
112{
113 /*
114 * __split_huge_page_refcount() cannot run
115 * from under us.
116 */
117 VM_BUG_ON(atomic_read(&page->_count) < 0);
118 atomic_inc(&page->_count);
106} 119}
107 120
108static noinline int gup_huge_pmd(pmd_t pmd, unsigned long addr, 121static noinline int gup_huge_pmd(pmd_t pmd, unsigned long addr,
@@ -128,6 +141,8 @@ static noinline int gup_huge_pmd(pmd_t pmd, unsigned long addr,
128 do { 141 do {
129 VM_BUG_ON(compound_head(page) != head); 142 VM_BUG_ON(compound_head(page) != head);
130 pages[*nr] = page; 143 pages[*nr] = page;
144 if (PageTail(page))
145 get_huge_page_tail(page);
131 (*nr)++; 146 (*nr)++;
132 page++; 147 page++;
133 refs++; 148 refs++;
@@ -148,7 +163,18 @@ static int gup_pmd_range(pud_t pud, unsigned long addr, unsigned long end,
148 pmd_t pmd = *pmdp; 163 pmd_t pmd = *pmdp;
149 164
150 next = pmd_addr_end(addr, end); 165 next = pmd_addr_end(addr, end);
151 if (pmd_none(pmd)) 166 /*
167 * The pmd_trans_splitting() check below explains why
168 * pmdp_splitting_flush has to flush the tlb, to stop
169 * this gup-fast code from running while we set the
170 * splitting bit in the pmd. Returning zero will take
171 * the slow path that will call wait_split_huge_page()
172 * if the pmd is still in splitting state. gup-fast
173 * can't because it has irq disabled and
174 * wait_split_huge_page() would never return as the
175 * tlb flush IPI wouldn't run.
176 */
177 if (pmd_none(pmd) || pmd_trans_splitting(pmd))
152 return 0; 178 return 0;
153 if (unlikely(pmd_large(pmd))) { 179 if (unlikely(pmd_large(pmd))) {
154 if (!gup_huge_pmd(pmd, addr, next, write, pages, nr)) 180 if (!gup_huge_pmd(pmd, addr, next, write, pages, nr))
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index 8be8c7d7bc89..500242d3c96d 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -320,6 +320,25 @@ int ptep_set_access_flags(struct vm_area_struct *vma,
320 return changed; 320 return changed;
321} 321}
322 322
323#ifdef CONFIG_TRANSPARENT_HUGEPAGE
324int pmdp_set_access_flags(struct vm_area_struct *vma,
325 unsigned long address, pmd_t *pmdp,
326 pmd_t entry, int dirty)
327{
328 int changed = !pmd_same(*pmdp, entry);
329
330 VM_BUG_ON(address & ~HPAGE_PMD_MASK);
331
332 if (changed && dirty) {
333 *pmdp = entry;
334 pmd_update_defer(vma->vm_mm, address, pmdp);
335 flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
336 }
337
338 return changed;
339}
340#endif
341
323int ptep_test_and_clear_young(struct vm_area_struct *vma, 342int ptep_test_and_clear_young(struct vm_area_struct *vma,
324 unsigned long addr, pte_t *ptep) 343 unsigned long addr, pte_t *ptep)
325{ 344{
@@ -335,6 +354,23 @@ int ptep_test_and_clear_young(struct vm_area_struct *vma,
335 return ret; 354 return ret;
336} 355}
337 356
357#ifdef CONFIG_TRANSPARENT_HUGEPAGE
358int pmdp_test_and_clear_young(struct vm_area_struct *vma,
359 unsigned long addr, pmd_t *pmdp)
360{
361 int ret = 0;
362
363 if (pmd_young(*pmdp))
364 ret = test_and_clear_bit(_PAGE_BIT_ACCESSED,
365 (unsigned long *)pmdp);
366
367 if (ret)
368 pmd_update(vma->vm_mm, addr, pmdp);
369
370 return ret;
371}
372#endif
373
338int ptep_clear_flush_young(struct vm_area_struct *vma, 374int ptep_clear_flush_young(struct vm_area_struct *vma,
339 unsigned long address, pte_t *ptep) 375 unsigned long address, pte_t *ptep)
340{ 376{
@@ -347,6 +383,36 @@ int ptep_clear_flush_young(struct vm_area_struct *vma,
347 return young; 383 return young;
348} 384}
349 385
386#ifdef CONFIG_TRANSPARENT_HUGEPAGE
387int pmdp_clear_flush_young(struct vm_area_struct *vma,
388 unsigned long address, pmd_t *pmdp)
389{
390 int young;
391
392 VM_BUG_ON(address & ~HPAGE_PMD_MASK);
393
394 young = pmdp_test_and_clear_young(vma, address, pmdp);
395 if (young)
396 flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
397
398 return young;
399}
400
401void pmdp_splitting_flush(struct vm_area_struct *vma,
402 unsigned long address, pmd_t *pmdp)
403{
404 int set;
405 VM_BUG_ON(address & ~HPAGE_PMD_MASK);
406 set = !test_and_set_bit(_PAGE_BIT_SPLITTING,
407 (unsigned long *)pmdp);
408 if (set) {
409 pmd_update(vma->vm_mm, address, pmdp);
410 /* need tlb flush only to serialize against gup-fast */
411 flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
412 }
413}
414#endif
415
350/** 416/**
351 * reserve_top_address - reserves a hole in the top of kernel address space 417 * reserve_top_address - reserves a hole in the top of kernel address space
352 * @reserve - size of hole to reserve 418 * @reserve - size of hole to reserve
diff --git a/arch/x86/xen/Makefile b/arch/x86/xen/Makefile
index 779385158915..17c565de3d64 100644
--- a/arch/x86/xen/Makefile
+++ b/arch/x86/xen/Makefile
@@ -12,7 +12,8 @@ CFLAGS_mmu.o := $(nostackp)
12 12
13obj-y := enlighten.o setup.o multicalls.o mmu.o irq.o \ 13obj-y := enlighten.o setup.o multicalls.o mmu.o irq.o \
14 time.o xen-asm.o xen-asm_$(BITS).o \ 14 time.o xen-asm.o xen-asm_$(BITS).o \
15 grant-table.o suspend.o platform-pci-unplug.o 15 grant-table.o suspend.o platform-pci-unplug.o \
16 p2m.o
16 17
17obj-$(CONFIG_SMP) += smp.o 18obj-$(CONFIG_SMP) += smp.o
18obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= spinlock.o 19obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= spinlock.o
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 44924e551fde..7575e55cd52e 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -173,371 +173,6 @@ DEFINE_PER_CPU(unsigned long, xen_current_cr3); /* actual vcpu cr3 */
173 */ 173 */
174#define USER_LIMIT ((STACK_TOP_MAX + PGDIR_SIZE - 1) & PGDIR_MASK) 174#define USER_LIMIT ((STACK_TOP_MAX + PGDIR_SIZE - 1) & PGDIR_MASK)
175 175
176/*
177 * Xen leaves the responsibility for maintaining p2m mappings to the
178 * guests themselves, but it must also access and update the p2m array
179 * during suspend/resume when all the pages are reallocated.
180 *
181 * The p2m table is logically a flat array, but we implement it as a
182 * three-level tree to allow the address space to be sparse.
183 *
184 * Xen
185 * |
186 * p2m_top p2m_top_mfn
187 * / \ / \
188 * p2m_mid p2m_mid p2m_mid_mfn p2m_mid_mfn
189 * / \ / \ / /
190 * p2m p2m p2m p2m p2m p2m p2m ...
191 *
192 * The p2m_mid_mfn pages are mapped by p2m_top_mfn_p.
193 *
194 * The p2m_top and p2m_top_mfn levels are limited to 1 page, so the
195 * maximum representable pseudo-physical address space is:
196 * P2M_TOP_PER_PAGE * P2M_MID_PER_PAGE * P2M_PER_PAGE pages
197 *
198 * P2M_PER_PAGE depends on the architecture, as a mfn is always
199 * unsigned long (8 bytes on 64-bit, 4 bytes on 32), leading to
200 * 512 and 1024 entries respectively.
201 */
202
203unsigned long xen_max_p2m_pfn __read_mostly;
204
205#define P2M_PER_PAGE (PAGE_SIZE / sizeof(unsigned long))
206#define P2M_MID_PER_PAGE (PAGE_SIZE / sizeof(unsigned long *))
207#define P2M_TOP_PER_PAGE (PAGE_SIZE / sizeof(unsigned long **))
208
209#define MAX_P2M_PFN (P2M_TOP_PER_PAGE * P2M_MID_PER_PAGE * P2M_PER_PAGE)
210
211/* Placeholders for holes in the address space */
212static RESERVE_BRK_ARRAY(unsigned long, p2m_missing, P2M_PER_PAGE);
213static RESERVE_BRK_ARRAY(unsigned long *, p2m_mid_missing, P2M_MID_PER_PAGE);
214static RESERVE_BRK_ARRAY(unsigned long, p2m_mid_missing_mfn, P2M_MID_PER_PAGE);
215
216static RESERVE_BRK_ARRAY(unsigned long **, p2m_top, P2M_TOP_PER_PAGE);
217static RESERVE_BRK_ARRAY(unsigned long, p2m_top_mfn, P2M_TOP_PER_PAGE);
218static RESERVE_BRK_ARRAY(unsigned long *, p2m_top_mfn_p, P2M_TOP_PER_PAGE);
219
220RESERVE_BRK(p2m_mid, PAGE_SIZE * (MAX_DOMAIN_PAGES / (P2M_PER_PAGE * P2M_MID_PER_PAGE)));
221RESERVE_BRK(p2m_mid_mfn, PAGE_SIZE * (MAX_DOMAIN_PAGES / (P2M_PER_PAGE * P2M_MID_PER_PAGE)));
222
223static inline unsigned p2m_top_index(unsigned long pfn)
224{
225 BUG_ON(pfn >= MAX_P2M_PFN);
226 return pfn / (P2M_MID_PER_PAGE * P2M_PER_PAGE);
227}
228
229static inline unsigned p2m_mid_index(unsigned long pfn)
230{
231 return (pfn / P2M_PER_PAGE) % P2M_MID_PER_PAGE;
232}
233
234static inline unsigned p2m_index(unsigned long pfn)
235{
236 return pfn % P2M_PER_PAGE;
237}
238
239static void p2m_top_init(unsigned long ***top)
240{
241 unsigned i;
242
243 for (i = 0; i < P2M_TOP_PER_PAGE; i++)
244 top[i] = p2m_mid_missing;
245}
246
247static void p2m_top_mfn_init(unsigned long *top)
248{
249 unsigned i;
250
251 for (i = 0; i < P2M_TOP_PER_PAGE; i++)
252 top[i] = virt_to_mfn(p2m_mid_missing_mfn);
253}
254
255static void p2m_top_mfn_p_init(unsigned long **top)
256{
257 unsigned i;
258
259 for (i = 0; i < P2M_TOP_PER_PAGE; i++)
260 top[i] = p2m_mid_missing_mfn;
261}
262
263static void p2m_mid_init(unsigned long **mid)
264{
265 unsigned i;
266
267 for (i = 0; i < P2M_MID_PER_PAGE; i++)
268 mid[i] = p2m_missing;
269}
270
271static void p2m_mid_mfn_init(unsigned long *mid)
272{
273 unsigned i;
274
275 for (i = 0; i < P2M_MID_PER_PAGE; i++)
276 mid[i] = virt_to_mfn(p2m_missing);
277}
278
279static void p2m_init(unsigned long *p2m)
280{
281 unsigned i;
282
283 for (i = 0; i < P2M_MID_PER_PAGE; i++)
284 p2m[i] = INVALID_P2M_ENTRY;
285}
286
287/*
288 * Build the parallel p2m_top_mfn and p2m_mid_mfn structures
289 *
290 * This is called both at boot time, and after resuming from suspend:
291 * - At boot time we're called very early, and must use extend_brk()
292 * to allocate memory.
293 *
294 * - After resume we're called from within stop_machine, but the mfn
295 * tree should alreay be completely allocated.
296 */
297void xen_build_mfn_list_list(void)
298{
299 unsigned long pfn;
300
301 /* Pre-initialize p2m_top_mfn to be completely missing */
302 if (p2m_top_mfn == NULL) {
303 p2m_mid_missing_mfn = extend_brk(PAGE_SIZE, PAGE_SIZE);
304 p2m_mid_mfn_init(p2m_mid_missing_mfn);
305
306 p2m_top_mfn_p = extend_brk(PAGE_SIZE, PAGE_SIZE);
307 p2m_top_mfn_p_init(p2m_top_mfn_p);
308
309 p2m_top_mfn = extend_brk(PAGE_SIZE, PAGE_SIZE);
310 p2m_top_mfn_init(p2m_top_mfn);
311 } else {
312 /* Reinitialise, mfn's all change after migration */
313 p2m_mid_mfn_init(p2m_mid_missing_mfn);
314 }
315
316 for (pfn = 0; pfn < xen_max_p2m_pfn; pfn += P2M_PER_PAGE) {
317 unsigned topidx = p2m_top_index(pfn);
318 unsigned mididx = p2m_mid_index(pfn);
319 unsigned long **mid;
320 unsigned long *mid_mfn_p;
321
322 mid = p2m_top[topidx];
323 mid_mfn_p = p2m_top_mfn_p[topidx];
324
325 /* Don't bother allocating any mfn mid levels if
326 * they're just missing, just update the stored mfn,
327 * since all could have changed over a migrate.
328 */
329 if (mid == p2m_mid_missing) {
330 BUG_ON(mididx);
331 BUG_ON(mid_mfn_p != p2m_mid_missing_mfn);
332 p2m_top_mfn[topidx] = virt_to_mfn(p2m_mid_missing_mfn);
333 pfn += (P2M_MID_PER_PAGE - 1) * P2M_PER_PAGE;
334 continue;
335 }
336
337 if (mid_mfn_p == p2m_mid_missing_mfn) {
338 /*
339 * XXX boot-time only! We should never find
340 * missing parts of the mfn tree after
341 * runtime. extend_brk() will BUG if we call
342 * it too late.
343 */
344 mid_mfn_p = extend_brk(PAGE_SIZE, PAGE_SIZE);
345 p2m_mid_mfn_init(mid_mfn_p);
346
347 p2m_top_mfn_p[topidx] = mid_mfn_p;
348 }
349
350 p2m_top_mfn[topidx] = virt_to_mfn(mid_mfn_p);
351 mid_mfn_p[mididx] = virt_to_mfn(mid[mididx]);
352 }
353}
354
355void xen_setup_mfn_list_list(void)
356{
357 BUG_ON(HYPERVISOR_shared_info == &xen_dummy_shared_info);
358
359 HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list_list =
360 virt_to_mfn(p2m_top_mfn);
361 HYPERVISOR_shared_info->arch.max_pfn = xen_max_p2m_pfn;
362}
363
364/* Set up p2m_top to point to the domain-builder provided p2m pages */
365void __init xen_build_dynamic_phys_to_machine(void)
366{
367 unsigned long *mfn_list = (unsigned long *)xen_start_info->mfn_list;
368 unsigned long max_pfn = min(MAX_DOMAIN_PAGES, xen_start_info->nr_pages);
369 unsigned long pfn;
370
371 xen_max_p2m_pfn = max_pfn;
372
373 p2m_missing = extend_brk(PAGE_SIZE, PAGE_SIZE);
374 p2m_init(p2m_missing);
375
376 p2m_mid_missing = extend_brk(PAGE_SIZE, PAGE_SIZE);
377 p2m_mid_init(p2m_mid_missing);
378
379 p2m_top = extend_brk(PAGE_SIZE, PAGE_SIZE);
380 p2m_top_init(p2m_top);
381
382 /*
383 * The domain builder gives us a pre-constructed p2m array in
384 * mfn_list for all the pages initially given to us, so we just
385 * need to graft that into our tree structure.
386 */
387 for (pfn = 0; pfn < max_pfn; pfn += P2M_PER_PAGE) {
388 unsigned topidx = p2m_top_index(pfn);
389 unsigned mididx = p2m_mid_index(pfn);
390
391 if (p2m_top[topidx] == p2m_mid_missing) {
392 unsigned long **mid = extend_brk(PAGE_SIZE, PAGE_SIZE);
393 p2m_mid_init(mid);
394
395 p2m_top[topidx] = mid;
396 }
397
398 p2m_top[topidx][mididx] = &mfn_list[pfn];
399 }
400}
401
402unsigned long get_phys_to_machine(unsigned long pfn)
403{
404 unsigned topidx, mididx, idx;
405
406 if (unlikely(pfn >= MAX_P2M_PFN))
407 return INVALID_P2M_ENTRY;
408
409 topidx = p2m_top_index(pfn);
410 mididx = p2m_mid_index(pfn);
411 idx = p2m_index(pfn);
412
413 return p2m_top[topidx][mididx][idx];
414}
415EXPORT_SYMBOL_GPL(get_phys_to_machine);
416
417static void *alloc_p2m_page(void)
418{
419 return (void *)__get_free_page(GFP_KERNEL | __GFP_REPEAT);
420}
421
422static void free_p2m_page(void *p)
423{
424 free_page((unsigned long)p);
425}
426
427/*
428 * Fully allocate the p2m structure for a given pfn. We need to check
429 * that both the top and mid levels are allocated, and make sure the
430 * parallel mfn tree is kept in sync. We may race with other cpus, so
431 * the new pages are installed with cmpxchg; if we lose the race then
432 * simply free the page we allocated and use the one that's there.
433 */
434static bool alloc_p2m(unsigned long pfn)
435{
436 unsigned topidx, mididx;
437 unsigned long ***top_p, **mid;
438 unsigned long *top_mfn_p, *mid_mfn;
439
440 topidx = p2m_top_index(pfn);
441 mididx = p2m_mid_index(pfn);
442
443 top_p = &p2m_top[topidx];
444 mid = *top_p;
445
446 if (mid == p2m_mid_missing) {
447 /* Mid level is missing, allocate a new one */
448 mid = alloc_p2m_page();
449 if (!mid)
450 return false;
451
452 p2m_mid_init(mid);
453
454 if (cmpxchg(top_p, p2m_mid_missing, mid) != p2m_mid_missing)
455 free_p2m_page(mid);
456 }
457
458 top_mfn_p = &p2m_top_mfn[topidx];
459 mid_mfn = p2m_top_mfn_p[topidx];
460
461 BUG_ON(virt_to_mfn(mid_mfn) != *top_mfn_p);
462
463 if (mid_mfn == p2m_mid_missing_mfn) {
464 /* Separately check the mid mfn level */
465 unsigned long missing_mfn;
466 unsigned long mid_mfn_mfn;
467
468 mid_mfn = alloc_p2m_page();
469 if (!mid_mfn)
470 return false;
471
472 p2m_mid_mfn_init(mid_mfn);
473
474 missing_mfn = virt_to_mfn(p2m_mid_missing_mfn);
475 mid_mfn_mfn = virt_to_mfn(mid_mfn);
476 if (cmpxchg(top_mfn_p, missing_mfn, mid_mfn_mfn) != missing_mfn)
477 free_p2m_page(mid_mfn);
478 else
479 p2m_top_mfn_p[topidx] = mid_mfn;
480 }
481
482 if (p2m_top[topidx][mididx] == p2m_missing) {
483 /* p2m leaf page is missing */
484 unsigned long *p2m;
485
486 p2m = alloc_p2m_page();
487 if (!p2m)
488 return false;
489
490 p2m_init(p2m);
491
492 if (cmpxchg(&mid[mididx], p2m_missing, p2m) != p2m_missing)
493 free_p2m_page(p2m);
494 else
495 mid_mfn[mididx] = virt_to_mfn(p2m);
496 }
497
498 return true;
499}
500
501/* Try to install p2m mapping; fail if intermediate bits missing */
502bool __set_phys_to_machine(unsigned long pfn, unsigned long mfn)
503{
504 unsigned topidx, mididx, idx;
505
506 if (unlikely(pfn >= MAX_P2M_PFN)) {
507 BUG_ON(mfn != INVALID_P2M_ENTRY);
508 return true;
509 }
510
511 topidx = p2m_top_index(pfn);
512 mididx = p2m_mid_index(pfn);
513 idx = p2m_index(pfn);
514
515 if (p2m_top[topidx][mididx] == p2m_missing)
516 return mfn == INVALID_P2M_ENTRY;
517
518 p2m_top[topidx][mididx][idx] = mfn;
519
520 return true;
521}
522
523bool set_phys_to_machine(unsigned long pfn, unsigned long mfn)
524{
525 if (unlikely(xen_feature(XENFEAT_auto_translated_physmap))) {
526 BUG_ON(pfn != mfn && mfn != INVALID_P2M_ENTRY);
527 return true;
528 }
529
530 if (unlikely(!__set_phys_to_machine(pfn, mfn))) {
531 if (!alloc_p2m(pfn))
532 return false;
533
534 if (!__set_phys_to_machine(pfn, mfn))
535 return false;
536 }
537
538 return true;
539}
540
541unsigned long arbitrary_virt_to_mfn(void *vaddr) 176unsigned long arbitrary_virt_to_mfn(void *vaddr)
542{ 177{
543 xmaddr_t maddr = arbitrary_virt_to_machine(vaddr); 178 xmaddr_t maddr = arbitrary_virt_to_machine(vaddr);
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
new file mode 100644
index 000000000000..8f2251d2a3f8
--- /dev/null
+++ b/arch/x86/xen/p2m.c
@@ -0,0 +1,510 @@
1/*
2 * Xen leaves the responsibility for maintaining p2m mappings to the
3 * guests themselves, but it must also access and update the p2m array
4 * during suspend/resume when all the pages are reallocated.
5 *
6 * The p2m table is logically a flat array, but we implement it as a
7 * three-level tree to allow the address space to be sparse.
8 *
9 * Xen
10 * |
11 * p2m_top p2m_top_mfn
12 * / \ / \
13 * p2m_mid p2m_mid p2m_mid_mfn p2m_mid_mfn
14 * / \ / \ / /
15 * p2m p2m p2m p2m p2m p2m p2m ...
16 *
17 * The p2m_mid_mfn pages are mapped by p2m_top_mfn_p.
18 *
19 * The p2m_top and p2m_top_mfn levels are limited to 1 page, so the
20 * maximum representable pseudo-physical address space is:
21 * P2M_TOP_PER_PAGE * P2M_MID_PER_PAGE * P2M_PER_PAGE pages
22 *
23 * P2M_PER_PAGE depends on the architecture, as a mfn is always
24 * unsigned long (8 bytes on 64-bit, 4 bytes on 32), leading to
25 * 512 and 1024 entries respectively.
26 */
27
28#include <linux/init.h>
29#include <linux/module.h>
30#include <linux/list.h>
31#include <linux/hash.h>
32#include <linux/sched.h>
33
34#include <asm/cache.h>
35#include <asm/setup.h>
36
37#include <asm/xen/page.h>
38#include <asm/xen/hypercall.h>
39#include <asm/xen/hypervisor.h>
40
41#include "xen-ops.h"
42
43static void __init m2p_override_init(void);
44
45unsigned long xen_max_p2m_pfn __read_mostly;
46
47#define P2M_PER_PAGE (PAGE_SIZE / sizeof(unsigned long))
48#define P2M_MID_PER_PAGE (PAGE_SIZE / sizeof(unsigned long *))
49#define P2M_TOP_PER_PAGE (PAGE_SIZE / sizeof(unsigned long **))
50
51#define MAX_P2M_PFN (P2M_TOP_PER_PAGE * P2M_MID_PER_PAGE * P2M_PER_PAGE)
52
53/* Placeholders for holes in the address space */
54static RESERVE_BRK_ARRAY(unsigned long, p2m_missing, P2M_PER_PAGE);
55static RESERVE_BRK_ARRAY(unsigned long *, p2m_mid_missing, P2M_MID_PER_PAGE);
56static RESERVE_BRK_ARRAY(unsigned long, p2m_mid_missing_mfn, P2M_MID_PER_PAGE);
57
58static RESERVE_BRK_ARRAY(unsigned long **, p2m_top, P2M_TOP_PER_PAGE);
59static RESERVE_BRK_ARRAY(unsigned long, p2m_top_mfn, P2M_TOP_PER_PAGE);
60static RESERVE_BRK_ARRAY(unsigned long *, p2m_top_mfn_p, P2M_TOP_PER_PAGE);
61
62RESERVE_BRK(p2m_mid, PAGE_SIZE * (MAX_DOMAIN_PAGES / (P2M_PER_PAGE * P2M_MID_PER_PAGE)));
63RESERVE_BRK(p2m_mid_mfn, PAGE_SIZE * (MAX_DOMAIN_PAGES / (P2M_PER_PAGE * P2M_MID_PER_PAGE)));
64
65static inline unsigned p2m_top_index(unsigned long pfn)
66{
67 BUG_ON(pfn >= MAX_P2M_PFN);
68 return pfn / (P2M_MID_PER_PAGE * P2M_PER_PAGE);
69}
70
71static inline unsigned p2m_mid_index(unsigned long pfn)
72{
73 return (pfn / P2M_PER_PAGE) % P2M_MID_PER_PAGE;
74}
75
76static inline unsigned p2m_index(unsigned long pfn)
77{
78 return pfn % P2M_PER_PAGE;
79}
80
81static void p2m_top_init(unsigned long ***top)
82{
83 unsigned i;
84
85 for (i = 0; i < P2M_TOP_PER_PAGE; i++)
86 top[i] = p2m_mid_missing;
87}
88
89static void p2m_top_mfn_init(unsigned long *top)
90{
91 unsigned i;
92
93 for (i = 0; i < P2M_TOP_PER_PAGE; i++)
94 top[i] = virt_to_mfn(p2m_mid_missing_mfn);
95}
96
97static void p2m_top_mfn_p_init(unsigned long **top)
98{
99 unsigned i;
100
101 for (i = 0; i < P2M_TOP_PER_PAGE; i++)
102 top[i] = p2m_mid_missing_mfn;
103}
104
105static void p2m_mid_init(unsigned long **mid)
106{
107 unsigned i;
108
109 for (i = 0; i < P2M_MID_PER_PAGE; i++)
110 mid[i] = p2m_missing;
111}
112
113static void p2m_mid_mfn_init(unsigned long *mid)
114{
115 unsigned i;
116
117 for (i = 0; i < P2M_MID_PER_PAGE; i++)
118 mid[i] = virt_to_mfn(p2m_missing);
119}
120
121static void p2m_init(unsigned long *p2m)
122{
123 unsigned i;
124
125 for (i = 0; i < P2M_MID_PER_PAGE; i++)
126 p2m[i] = INVALID_P2M_ENTRY;
127}
128
129/*
130 * Build the parallel p2m_top_mfn and p2m_mid_mfn structures
131 *
132 * This is called both at boot time, and after resuming from suspend:
133 * - At boot time we're called very early, and must use extend_brk()
134 * to allocate memory.
135 *
136 * - After resume we're called from within stop_machine, but the mfn
137 * tree should alreay be completely allocated.
138 */
139void xen_build_mfn_list_list(void)
140{
141 unsigned long pfn;
142
143 /* Pre-initialize p2m_top_mfn to be completely missing */
144 if (p2m_top_mfn == NULL) {
145 p2m_mid_missing_mfn = extend_brk(PAGE_SIZE, PAGE_SIZE);
146 p2m_mid_mfn_init(p2m_mid_missing_mfn);
147
148 p2m_top_mfn_p = extend_brk(PAGE_SIZE, PAGE_SIZE);
149 p2m_top_mfn_p_init(p2m_top_mfn_p);
150
151 p2m_top_mfn = extend_brk(PAGE_SIZE, PAGE_SIZE);
152 p2m_top_mfn_init(p2m_top_mfn);
153 } else {
154 /* Reinitialise, mfn's all change after migration */
155 p2m_mid_mfn_init(p2m_mid_missing_mfn);
156 }
157
158 for (pfn = 0; pfn < xen_max_p2m_pfn; pfn += P2M_PER_PAGE) {
159 unsigned topidx = p2m_top_index(pfn);
160 unsigned mididx = p2m_mid_index(pfn);
161 unsigned long **mid;
162 unsigned long *mid_mfn_p;
163
164 mid = p2m_top[topidx];
165 mid_mfn_p = p2m_top_mfn_p[topidx];
166
167 /* Don't bother allocating any mfn mid levels if
168 * they're just missing, just update the stored mfn,
169 * since all could have changed over a migrate.
170 */
171 if (mid == p2m_mid_missing) {
172 BUG_ON(mididx);
173 BUG_ON(mid_mfn_p != p2m_mid_missing_mfn);
174 p2m_top_mfn[topidx] = virt_to_mfn(p2m_mid_missing_mfn);
175 pfn += (P2M_MID_PER_PAGE - 1) * P2M_PER_PAGE;
176 continue;
177 }
178
179 if (mid_mfn_p == p2m_mid_missing_mfn) {
180 /*
181 * XXX boot-time only! We should never find
182 * missing parts of the mfn tree after
183 * runtime. extend_brk() will BUG if we call
184 * it too late.
185 */
186 mid_mfn_p = extend_brk(PAGE_SIZE, PAGE_SIZE);
187 p2m_mid_mfn_init(mid_mfn_p);
188
189 p2m_top_mfn_p[topidx] = mid_mfn_p;
190 }
191
192 p2m_top_mfn[topidx] = virt_to_mfn(mid_mfn_p);
193 mid_mfn_p[mididx] = virt_to_mfn(mid[mididx]);
194 }
195}
196
197void xen_setup_mfn_list_list(void)
198{
199 BUG_ON(HYPERVISOR_shared_info == &xen_dummy_shared_info);
200
201 HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list_list =
202 virt_to_mfn(p2m_top_mfn);
203 HYPERVISOR_shared_info->arch.max_pfn = xen_max_p2m_pfn;
204}
205
206/* Set up p2m_top to point to the domain-builder provided p2m pages */
207void __init xen_build_dynamic_phys_to_machine(void)
208{
209 unsigned long *mfn_list = (unsigned long *)xen_start_info->mfn_list;
210 unsigned long max_pfn = min(MAX_DOMAIN_PAGES, xen_start_info->nr_pages);
211 unsigned long pfn;
212
213 xen_max_p2m_pfn = max_pfn;
214
215 p2m_missing = extend_brk(PAGE_SIZE, PAGE_SIZE);
216 p2m_init(p2m_missing);
217
218 p2m_mid_missing = extend_brk(PAGE_SIZE, PAGE_SIZE);
219 p2m_mid_init(p2m_mid_missing);
220
221 p2m_top = extend_brk(PAGE_SIZE, PAGE_SIZE);
222 p2m_top_init(p2m_top);
223
224 /*
225 * The domain builder gives us a pre-constructed p2m array in
226 * mfn_list for all the pages initially given to us, so we just
227 * need to graft that into our tree structure.
228 */
229 for (pfn = 0; pfn < max_pfn; pfn += P2M_PER_PAGE) {
230 unsigned topidx = p2m_top_index(pfn);
231 unsigned mididx = p2m_mid_index(pfn);
232
233 if (p2m_top[topidx] == p2m_mid_missing) {
234 unsigned long **mid = extend_brk(PAGE_SIZE, PAGE_SIZE);
235 p2m_mid_init(mid);
236
237 p2m_top[topidx] = mid;
238 }
239
240 p2m_top[topidx][mididx] = &mfn_list[pfn];
241 }
242
243 m2p_override_init();
244}
245
246unsigned long get_phys_to_machine(unsigned long pfn)
247{
248 unsigned topidx, mididx, idx;
249
250 if (unlikely(pfn >= MAX_P2M_PFN))
251 return INVALID_P2M_ENTRY;
252
253 topidx = p2m_top_index(pfn);
254 mididx = p2m_mid_index(pfn);
255 idx = p2m_index(pfn);
256
257 return p2m_top[topidx][mididx][idx];
258}
259EXPORT_SYMBOL_GPL(get_phys_to_machine);
260
261static void *alloc_p2m_page(void)
262{
263 return (void *)__get_free_page(GFP_KERNEL | __GFP_REPEAT);
264}
265
266static void free_p2m_page(void *p)
267{
268 free_page((unsigned long)p);
269}
270
271/*
272 * Fully allocate the p2m structure for a given pfn. We need to check
273 * that both the top and mid levels are allocated, and make sure the
274 * parallel mfn tree is kept in sync. We may race with other cpus, so
275 * the new pages are installed with cmpxchg; if we lose the race then
276 * simply free the page we allocated and use the one that's there.
277 */
278static bool alloc_p2m(unsigned long pfn)
279{
280 unsigned topidx, mididx;
281 unsigned long ***top_p, **mid;
282 unsigned long *top_mfn_p, *mid_mfn;
283
284 topidx = p2m_top_index(pfn);
285 mididx = p2m_mid_index(pfn);
286
287 top_p = &p2m_top[topidx];
288 mid = *top_p;
289
290 if (mid == p2m_mid_missing) {
291 /* Mid level is missing, allocate a new one */
292 mid = alloc_p2m_page();
293 if (!mid)
294 return false;
295
296 p2m_mid_init(mid);
297
298 if (cmpxchg(top_p, p2m_mid_missing, mid) != p2m_mid_missing)
299 free_p2m_page(mid);
300 }
301
302 top_mfn_p = &p2m_top_mfn[topidx];
303 mid_mfn = p2m_top_mfn_p[topidx];
304
305 BUG_ON(virt_to_mfn(mid_mfn) != *top_mfn_p);
306
307 if (mid_mfn == p2m_mid_missing_mfn) {
308 /* Separately check the mid mfn level */
309 unsigned long missing_mfn;
310 unsigned long mid_mfn_mfn;
311
312 mid_mfn = alloc_p2m_page();
313 if (!mid_mfn)
314 return false;
315
316 p2m_mid_mfn_init(mid_mfn);
317
318 missing_mfn = virt_to_mfn(p2m_mid_missing_mfn);
319 mid_mfn_mfn = virt_to_mfn(mid_mfn);
320 if (cmpxchg(top_mfn_p, missing_mfn, mid_mfn_mfn) != missing_mfn)
321 free_p2m_page(mid_mfn);
322 else
323 p2m_top_mfn_p[topidx] = mid_mfn;
324 }
325
326 if (p2m_top[topidx][mididx] == p2m_missing) {
327 /* p2m leaf page is missing */
328 unsigned long *p2m;
329
330 p2m = alloc_p2m_page();
331 if (!p2m)
332 return false;
333
334 p2m_init(p2m);
335
336 if (cmpxchg(&mid[mididx], p2m_missing, p2m) != p2m_missing)
337 free_p2m_page(p2m);
338 else
339 mid_mfn[mididx] = virt_to_mfn(p2m);
340 }
341
342 return true;
343}
344
345/* Try to install p2m mapping; fail if intermediate bits missing */
346bool __set_phys_to_machine(unsigned long pfn, unsigned long mfn)
347{
348 unsigned topidx, mididx, idx;
349
350 if (unlikely(pfn >= MAX_P2M_PFN)) {
351 BUG_ON(mfn != INVALID_P2M_ENTRY);
352 return true;
353 }
354
355 topidx = p2m_top_index(pfn);
356 mididx = p2m_mid_index(pfn);
357 idx = p2m_index(pfn);
358
359 if (p2m_top[topidx][mididx] == p2m_missing)
360 return mfn == INVALID_P2M_ENTRY;
361
362 p2m_top[topidx][mididx][idx] = mfn;
363
364 return true;
365}
366
367bool set_phys_to_machine(unsigned long pfn, unsigned long mfn)
368{
369 if (unlikely(xen_feature(XENFEAT_auto_translated_physmap))) {
370 BUG_ON(pfn != mfn && mfn != INVALID_P2M_ENTRY);
371 return true;
372 }
373
374 if (unlikely(!__set_phys_to_machine(pfn, mfn))) {
375 if (!alloc_p2m(pfn))
376 return false;
377
378 if (!__set_phys_to_machine(pfn, mfn))
379 return false;
380 }
381
382 return true;
383}
384
385#define M2P_OVERRIDE_HASH_SHIFT 10
386#define M2P_OVERRIDE_HASH (1 << M2P_OVERRIDE_HASH_SHIFT)
387
388static RESERVE_BRK_ARRAY(struct list_head, m2p_overrides, M2P_OVERRIDE_HASH);
389static DEFINE_SPINLOCK(m2p_override_lock);
390
391static void __init m2p_override_init(void)
392{
393 unsigned i;
394
395 m2p_overrides = extend_brk(sizeof(*m2p_overrides) * M2P_OVERRIDE_HASH,
396 sizeof(unsigned long));
397
398 for (i = 0; i < M2P_OVERRIDE_HASH; i++)
399 INIT_LIST_HEAD(&m2p_overrides[i]);
400}
401
402static unsigned long mfn_hash(unsigned long mfn)
403{
404 return hash_long(mfn, M2P_OVERRIDE_HASH_SHIFT);
405}
406
407/* Add an MFN override for a particular page */
408int m2p_add_override(unsigned long mfn, struct page *page)
409{
410 unsigned long flags;
411 unsigned long pfn;
412 unsigned long address;
413 unsigned level;
414 pte_t *ptep = NULL;
415
416 pfn = page_to_pfn(page);
417 if (!PageHighMem(page)) {
418 address = (unsigned long)__va(pfn << PAGE_SHIFT);
419 ptep = lookup_address(address, &level);
420
421 if (WARN(ptep == NULL || level != PG_LEVEL_4K,
422 "m2p_add_override: pfn %lx not mapped", pfn))
423 return -EINVAL;
424 }
425
426 page->private = mfn;
427 page->index = pfn_to_mfn(pfn);
428
429 __set_phys_to_machine(pfn, FOREIGN_FRAME(mfn));
430 if (!PageHighMem(page))
431 /* Just zap old mapping for now */
432 pte_clear(&init_mm, address, ptep);
433
434 spin_lock_irqsave(&m2p_override_lock, flags);
435 list_add(&page->lru, &m2p_overrides[mfn_hash(mfn)]);
436 spin_unlock_irqrestore(&m2p_override_lock, flags);
437
438 return 0;
439}
440
441int m2p_remove_override(struct page *page)
442{
443 unsigned long flags;
444 unsigned long mfn;
445 unsigned long pfn;
446 unsigned long address;
447 unsigned level;
448 pte_t *ptep = NULL;
449
450 pfn = page_to_pfn(page);
451 mfn = get_phys_to_machine(pfn);
452 if (mfn == INVALID_P2M_ENTRY || !(mfn & FOREIGN_FRAME_BIT))
453 return -EINVAL;
454
455 if (!PageHighMem(page)) {
456 address = (unsigned long)__va(pfn << PAGE_SHIFT);
457 ptep = lookup_address(address, &level);
458
459 if (WARN(ptep == NULL || level != PG_LEVEL_4K,
460 "m2p_remove_override: pfn %lx not mapped", pfn))
461 return -EINVAL;
462 }
463
464 spin_lock_irqsave(&m2p_override_lock, flags);
465 list_del(&page->lru);
466 spin_unlock_irqrestore(&m2p_override_lock, flags);
467 __set_phys_to_machine(pfn, page->index);
468
469 if (!PageHighMem(page))
470 set_pte_at(&init_mm, address, ptep,
471 pfn_pte(pfn, PAGE_KERNEL));
472 /* No tlb flush necessary because the caller already
473 * left the pte unmapped. */
474
475 return 0;
476}
477
478struct page *m2p_find_override(unsigned long mfn)
479{
480 unsigned long flags;
481 struct list_head *bucket = &m2p_overrides[mfn_hash(mfn)];
482 struct page *p, *ret;
483
484 ret = NULL;
485
486 spin_lock_irqsave(&m2p_override_lock, flags);
487
488 list_for_each_entry(p, bucket, lru) {
489 if (p->private == mfn) {
490 ret = p;
491 break;
492 }
493 }
494
495 spin_unlock_irqrestore(&m2p_override_lock, flags);
496
497 return ret;
498}
499
500unsigned long m2p_find_override_pfn(unsigned long mfn, unsigned long pfn)
501{
502 struct page *p = m2p_find_override(mfn);
503 unsigned long ret = pfn;
504
505 if (p)
506 ret = page_to_pfn(p);
507
508 return ret;
509}
510EXPORT_SYMBOL_GPL(m2p_find_override_pfn);
diff --git a/arch/xtensa/include/asm/mman.h b/arch/xtensa/include/asm/mman.h
index fca4db425f6e..30789010733d 100644
--- a/arch/xtensa/include/asm/mman.h
+++ b/arch/xtensa/include/asm/mman.h
@@ -83,6 +83,9 @@
83#define MADV_MERGEABLE 12 /* KSM may merge identical pages */ 83#define MADV_MERGEABLE 12 /* KSM may merge identical pages */
84#define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */ 84#define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */
85 85
86#define MADV_HUGEPAGE 14 /* Worth backing with hugepages */
87#define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages */
88
86/* compatibility flags */ 89/* compatibility flags */
87#define MAP_FILE 0 90#define MAP_FILE 0
88 91