aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mm/pgd.c6
-rw-r--r--arch/m68k/kernel/entry.S4
-rw-r--r--arch/m68knommu/defconfig112
-rw-r--r--arch/m68knommu/kernel/syscalltable.S4
-rw-r--r--arch/m68knommu/platform/68328/timers.c10
-rw-r--r--arch/powerpc/boot/cuboot-bamboo.c1
-rw-r--r--arch/powerpc/boot/cuboot-ebony.c1
-rw-r--r--arch/powerpc/boot/cuboot-katmai.c1
-rw-r--r--arch/powerpc/boot/cuboot-taishan.c2
-rw-r--r--arch/powerpc/boot/cuboot-warp.c1
-rw-r--r--arch/powerpc/boot/dts/haleakala.dts2
-rw-r--r--arch/powerpc/boot/dts/katmai.dts58
-rw-r--r--arch/powerpc/oprofile/op_model_cell.c2
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_common.c1
-rw-r--r--arch/powerpc/platforms/cell/iommu.c151
-rw-r--r--arch/powerpc/platforms/cell/setup.c7
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c16
-rw-r--r--arch/powerpc/platforms/cell/spufs/context.c7
-rw-r--r--arch/powerpc/platforms/cell/spufs/file.c12
-rw-r--r--arch/powerpc/platforms/cell/spufs/sched.c2
-rw-r--r--arch/powerpc/platforms/cell/spufs/sputrace.c7
-rw-r--r--arch/powerpc/platforms/cell/spufs/switch.c6
-rw-r--r--arch/powerpc/platforms/celleb/beat.h3
-rw-r--r--arch/x86/mm/pageattr.c21
24 files changed, 245 insertions, 192 deletions
diff --git a/arch/arm/mm/pgd.c b/arch/arm/mm/pgd.c
index 500c9610ab30..e0f19ab91163 100644
--- a/arch/arm/mm/pgd.c
+++ b/arch/arm/mm/pgd.c
@@ -75,7 +75,7 @@ no_pgd:
75void free_pgd_slow(struct mm_struct *mm, pgd_t *pgd) 75void free_pgd_slow(struct mm_struct *mm, pgd_t *pgd)
76{ 76{
77 pmd_t *pmd; 77 pmd_t *pmd;
78 struct page *pte; 78 pgtable_t pte;
79 79
80 if (!pgd) 80 if (!pgd)
81 return; 81 return;
@@ -90,10 +90,8 @@ void free_pgd_slow(struct mm_struct *mm, pgd_t *pgd)
90 goto free; 90 goto free;
91 } 91 }
92 92
93 pte = pmd_page(*pmd); 93 pte = pmd_pgtable(*pmd);
94 pmd_clear(pmd); 94 pmd_clear(pmd);
95 dec_zone_page_state(virt_to_page((unsigned long *)pgd), NR_PAGETABLE);
96 pte_lock_deinit(pte);
97 pte_free(mm, pte); 95 pte_free(mm, pte);
98 pmd_free(mm, pmd); 96 pmd_free(mm, pmd);
99free: 97free:
diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S
index 6dfa3b3c0e2a..18a9c5f4b00d 100644
--- a/arch/m68k/kernel/entry.S
+++ b/arch/m68k/kernel/entry.S
@@ -742,7 +742,9 @@ sys_call_table:
742 .long sys_epoll_pwait /* 315 */ 742 .long sys_epoll_pwait /* 315 */
743 .long sys_utimensat 743 .long sys_utimensat
744 .long sys_signalfd 744 .long sys_signalfd
745 .long sys_ni_syscall 745 .long sys_timerfd_create
746 .long sys_eventfd 746 .long sys_eventfd
747 .long sys_fallocate /* 320 */ 747 .long sys_fallocate /* 320 */
748 .long sys_timerfd_settime
749 .long sys_timerfd_gettime
748 750
diff --git a/arch/m68knommu/defconfig b/arch/m68knommu/defconfig
index 648113075f97..670b0a99cfa0 100644
--- a/arch/m68knommu/defconfig
+++ b/arch/m68knommu/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.23 3# Linux kernel version: 2.6.25-rc3
4# Thu Oct 18 13:17:38 2007 4# Mon Feb 25 15:03:00 2008
5# 5#
6CONFIG_M68K=y 6CONFIG_M68K=y
7# CONFIG_MMU is not set 7# CONFIG_MMU is not set
@@ -15,8 +15,10 @@ CONFIG_GENERIC_FIND_NEXT_BIT=y
15CONFIG_GENERIC_HWEIGHT=y 15CONFIG_GENERIC_HWEIGHT=y
16CONFIG_GENERIC_HARDIRQS=y 16CONFIG_GENERIC_HARDIRQS=y
17CONFIG_GENERIC_CALIBRATE_DELAY=y 17CONFIG_GENERIC_CALIBRATE_DELAY=y
18CONFIG_GENERIC_TIME=y
18CONFIG_TIME_LOW_RES=y 19CONFIG_TIME_LOW_RES=y
19CONFIG_NO_IOPORT=y 20CONFIG_NO_IOPORT=y
21CONFIG_ARCH_SUPPORTS_AOUT=y
20CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 22CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
21 23
22# 24#
@@ -31,12 +33,14 @@ CONFIG_LOCALVERSION_AUTO=y
31# CONFIG_POSIX_MQUEUE is not set 33# CONFIG_POSIX_MQUEUE is not set
32# CONFIG_BSD_PROCESS_ACCT is not set 34# CONFIG_BSD_PROCESS_ACCT is not set
33# CONFIG_TASKSTATS is not set 35# CONFIG_TASKSTATS is not set
34# CONFIG_USER_NS is not set
35# CONFIG_AUDIT is not set 36# CONFIG_AUDIT is not set
36# CONFIG_IKCONFIG is not set 37# CONFIG_IKCONFIG is not set
37CONFIG_LOG_BUF_SHIFT=14 38CONFIG_LOG_BUF_SHIFT=14
39# CONFIG_CGROUPS is not set
40# CONFIG_GROUP_SCHED is not set
38# CONFIG_SYSFS_DEPRECATED is not set 41# CONFIG_SYSFS_DEPRECATED is not set
39# CONFIG_RELAY is not set 42# CONFIG_RELAY is not set
43# CONFIG_NAMESPACES is not set
40# CONFIG_BLK_DEV_INITRD is not set 44# CONFIG_BLK_DEV_INITRD is not set
41# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
42CONFIG_SYSCTL=y 46CONFIG_SYSCTL=y
@@ -48,15 +52,22 @@ CONFIG_SYSCTL_SYSCALL=y
48CONFIG_PRINTK=y 52CONFIG_PRINTK=y
49CONFIG_BUG=y 53CONFIG_BUG=y
50CONFIG_ELF_CORE=y 54CONFIG_ELF_CORE=y
55CONFIG_COMPAT_BRK=y
51CONFIG_BASE_FULL=y 56CONFIG_BASE_FULL=y
52# CONFIG_FUTEX is not set 57# CONFIG_FUTEX is not set
53# CONFIG_EPOLL is not set 58# CONFIG_EPOLL is not set
54# CONFIG_SIGNALFD is not set 59# CONFIG_SIGNALFD is not set
60# CONFIG_TIMERFD is not set
55# CONFIG_EVENTFD is not set 61# CONFIG_EVENTFD is not set
56# CONFIG_VM_EVENT_COUNTERS is not set 62# CONFIG_VM_EVENT_COUNTERS is not set
57CONFIG_SLAB=y 63CONFIG_SLAB=y
58# CONFIG_SLUB is not set 64# CONFIG_SLUB is not set
59# CONFIG_SLOB is not set 65# CONFIG_SLOB is not set
66# CONFIG_PROFILING is not set
67# CONFIG_MARKERS is not set
68# CONFIG_HAVE_OPROFILE is not set
69# CONFIG_HAVE_KPROBES is not set
70CONFIG_SLABINFO=y
60CONFIG_TINY_SHMEM=y 71CONFIG_TINY_SHMEM=y
61CONFIG_BASE_SMALL=0 72CONFIG_BASE_SMALL=0
62CONFIG_MODULES=y 73CONFIG_MODULES=y
@@ -83,6 +94,8 @@ CONFIG_IOSCHED_NOOP=y
83# CONFIG_DEFAULT_CFQ is not set 94# CONFIG_DEFAULT_CFQ is not set
84CONFIG_DEFAULT_NOOP=y 95CONFIG_DEFAULT_NOOP=y
85CONFIG_DEFAULT_IOSCHED="noop" 96CONFIG_DEFAULT_IOSCHED="noop"
97CONFIG_CLASSIC_RCU=y
98# CONFIG_PREEMPT_RCU is not set
86 99
87# 100#
88# Processor type and features 101# Processor type and features
@@ -121,6 +134,7 @@ CONFIG_M5272C3=y
121# CONFIG_MOD5272 is not set 134# CONFIG_MOD5272 is not set
122CONFIG_FREESCALE=y 135CONFIG_FREESCALE=y
123CONFIG_4KSTACKS=y 136CONFIG_4KSTACKS=y
137CONFIG_HZ=100
124 138
125# 139#
126# RAM configuration 140# RAM configuration
@@ -147,6 +161,7 @@ CONFIG_FLATMEM_MANUAL=y
147CONFIG_FLATMEM=y 161CONFIG_FLATMEM=y
148CONFIG_FLAT_NODE_MEM_MAP=y 162CONFIG_FLAT_NODE_MEM_MAP=y
149# CONFIG_SPARSEMEM_STATIC is not set 163# CONFIG_SPARSEMEM_STATIC is not set
164# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
150CONFIG_SPLIT_PTLOCK_CPUS=4 165CONFIG_SPLIT_PTLOCK_CPUS=4
151# CONFIG_RESOURCES_64BIT is not set 166# CONFIG_RESOURCES_64BIT is not set
152CONFIG_ZONE_DMA_FLAG=1 167CONFIG_ZONE_DMA_FLAG=1
@@ -159,10 +174,6 @@ CONFIG_VIRT_TO_BUS=y
159# CONFIG_ARCH_SUPPORTS_MSI is not set 174# CONFIG_ARCH_SUPPORTS_MSI is not set
160 175
161# 176#
162# PCCARD (PCMCIA/CardBus) support
163#
164
165#
166# Executable file formats 177# Executable file formats
167# 178#
168CONFIG_BINFMT_FLAT=y 179CONFIG_BINFMT_FLAT=y
@@ -205,6 +216,7 @@ CONFIG_IP_FIB_HASH=y
205# CONFIG_INET_XFRM_MODE_TRANSPORT is not set 216# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
206# CONFIG_INET_XFRM_MODE_TUNNEL is not set 217# CONFIG_INET_XFRM_MODE_TUNNEL is not set
207# CONFIG_INET_XFRM_MODE_BEET is not set 218# CONFIG_INET_XFRM_MODE_BEET is not set
219# CONFIG_INET_LRO is not set
208# CONFIG_INET_DIAG is not set 220# CONFIG_INET_DIAG is not set
209# CONFIG_TCP_CONG_ADVANCED is not set 221# CONFIG_TCP_CONG_ADVANCED is not set
210CONFIG_TCP_CONG_CUBIC=y 222CONFIG_TCP_CONG_CUBIC=y
@@ -229,10 +241,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
229# CONFIG_LAPB is not set 241# CONFIG_LAPB is not set
230# CONFIG_ECONET is not set 242# CONFIG_ECONET is not set
231# CONFIG_WAN_ROUTER is not set 243# CONFIG_WAN_ROUTER is not set
232
233#
234# QoS and/or fair queueing
235#
236# CONFIG_NET_SCHED is not set 244# CONFIG_NET_SCHED is not set
237 245
238# 246#
@@ -240,6 +248,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
240# 248#
241# CONFIG_NET_PKTGEN is not set 249# CONFIG_NET_PKTGEN is not set
242# CONFIG_HAMRADIO is not set 250# CONFIG_HAMRADIO is not set
251# CONFIG_CAN is not set
243# CONFIG_IRDA is not set 252# CONFIG_IRDA is not set
244# CONFIG_BT is not set 253# CONFIG_BT is not set
245# CONFIG_AF_RXRPC is not set 254# CONFIG_AF_RXRPC is not set
@@ -283,6 +292,7 @@ CONFIG_MTD_BLOCK=y
283# CONFIG_INFTL is not set 292# CONFIG_INFTL is not set
284# CONFIG_RFD_FTL is not set 293# CONFIG_RFD_FTL is not set
285# CONFIG_SSFDC is not set 294# CONFIG_SSFDC is not set
295# CONFIG_MTD_OOPS is not set
286 296
287# 297#
288# RAM/ROM/Flash chip drivers 298# RAM/ROM/Flash chip drivers
@@ -339,10 +349,11 @@ CONFIG_BLK_DEV=y
339CONFIG_BLK_DEV_RAM=y 349CONFIG_BLK_DEV_RAM=y
340CONFIG_BLK_DEV_RAM_COUNT=16 350CONFIG_BLK_DEV_RAM_COUNT=16
341CONFIG_BLK_DEV_RAM_SIZE=4096 351CONFIG_BLK_DEV_RAM_SIZE=4096
342CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 352# CONFIG_BLK_DEV_XIP is not set
343# CONFIG_CDROM_PKTCDVD is not set 353# CONFIG_CDROM_PKTCDVD is not set
344# CONFIG_ATA_OVER_ETH is not set 354# CONFIG_ATA_OVER_ETH is not set
345# CONFIG_MISC_DEVICES is not set 355# CONFIG_MISC_DEVICES is not set
356CONFIG_HAVE_IDE=y
346# CONFIG_IDE is not set 357# CONFIG_IDE is not set
347 358
348# 359#
@@ -360,9 +371,15 @@ CONFIG_NETDEVICES=y
360# CONFIG_MACVLAN is not set 371# CONFIG_MACVLAN is not set
361# CONFIG_EQUALIZER is not set 372# CONFIG_EQUALIZER is not set
362# CONFIG_TUN is not set 373# CONFIG_TUN is not set
374# CONFIG_VETH is not set
363# CONFIG_PHYLIB is not set 375# CONFIG_PHYLIB is not set
364CONFIG_NET_ETHERNET=y 376CONFIG_NET_ETHERNET=y
365# CONFIG_MII is not set 377# CONFIG_MII is not set
378# CONFIG_IBM_NEW_EMAC_ZMII is not set
379# CONFIG_IBM_NEW_EMAC_RGMII is not set
380# CONFIG_IBM_NEW_EMAC_TAH is not set
381# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
382# CONFIG_B44 is not set
366CONFIG_FEC=y 383CONFIG_FEC=y
367# CONFIG_FEC2 is not set 384# CONFIG_FEC2 is not set
368# CONFIG_NETDEV_1000 is not set 385# CONFIG_NETDEV_1000 is not set
@@ -377,7 +394,7 @@ CONFIG_FEC=y
377CONFIG_PPP=y 394CONFIG_PPP=y
378# CONFIG_PPP_MULTILINK is not set 395# CONFIG_PPP_MULTILINK is not set
379# CONFIG_PPP_FILTER is not set 396# CONFIG_PPP_FILTER is not set
380# CONFIG_PPP_ASYNC is not set 397CONFIG_PPP_ASYNC=y
381# CONFIG_PPP_SYNC_TTY is not set 398# CONFIG_PPP_SYNC_TTY is not set
382# CONFIG_PPP_DEFLATE is not set 399# CONFIG_PPP_DEFLATE is not set
383# CONFIG_PPP_BSDCOMP is not set 400# CONFIG_PPP_BSDCOMP is not set
@@ -386,7 +403,6 @@ CONFIG_PPP=y
386# CONFIG_PPPOL2TP is not set 403# CONFIG_PPPOL2TP is not set
387# CONFIG_SLIP is not set 404# CONFIG_SLIP is not set
388CONFIG_SLHC=y 405CONFIG_SLHC=y
389# CONFIG_SHAPER is not set
390# CONFIG_NETCONSOLE is not set 406# CONFIG_NETCONSOLE is not set
391# CONFIG_NETPOLL is not set 407# CONFIG_NETPOLL is not set
392# CONFIG_NET_POLL_CONTROLLER is not set 408# CONFIG_NET_POLL_CONTROLLER is not set
@@ -418,12 +434,16 @@ CONFIG_SLHC=y
418# 434#
419# Non-8250 serial port support 435# Non-8250 serial port support
420# 436#
421CONFIG_SERIAL_COLDFIRE=y 437CONFIG_SERIAL_CORE=y
438CONFIG_SERIAL_CORE_CONSOLE=y
439# CONFIG_SERIAL_COLDFIRE is not set
440CONFIG_SERIAL_MCF=y
441CONFIG_SERIAL_MCF_BAUDRATE=19200
442CONFIG_SERIAL_MCF_CONSOLE=y
422# CONFIG_UNIX98_PTYS is not set 443# CONFIG_UNIX98_PTYS is not set
423CONFIG_LEGACY_PTYS=y 444CONFIG_LEGACY_PTYS=y
424CONFIG_LEGACY_PTY_COUNT=256 445CONFIG_LEGACY_PTY_COUNT=256
425# CONFIG_IPMI_HANDLER is not set 446# CONFIG_IPMI_HANDLER is not set
426# CONFIG_WATCHDOG is not set
427# CONFIG_HW_RANDOM is not set 447# CONFIG_HW_RANDOM is not set
428# CONFIG_GEN_RTC is not set 448# CONFIG_GEN_RTC is not set
429# CONFIG_R3964 is not set 449# CONFIG_R3964 is not set
@@ -439,6 +459,14 @@ CONFIG_LEGACY_PTY_COUNT=256
439# CONFIG_W1 is not set 459# CONFIG_W1 is not set
440# CONFIG_POWER_SUPPLY is not set 460# CONFIG_POWER_SUPPLY is not set
441# CONFIG_HWMON is not set 461# CONFIG_HWMON is not set
462# CONFIG_THERMAL is not set
463# CONFIG_WATCHDOG is not set
464
465#
466# Sonics Silicon Backplane
467#
468CONFIG_SSB_POSSIBLE=y
469# CONFIG_SSB is not set
442 470
443# 471#
444# Multifunction device drivers 472# Multifunction device drivers
@@ -450,20 +478,20 @@ CONFIG_LEGACY_PTY_COUNT=256
450# 478#
451# CONFIG_VIDEO_DEV is not set 479# CONFIG_VIDEO_DEV is not set
452# CONFIG_DVB_CORE is not set 480# CONFIG_DVB_CORE is not set
453CONFIG_DAB=y 481# CONFIG_DAB is not set
454 482
455# 483#
456# Graphics support 484# Graphics support
457# 485#
486# CONFIG_VGASTATE is not set
487# CONFIG_VIDEO_OUTPUT_CONTROL is not set
488# CONFIG_FB is not set
458# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 489# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
459 490
460# 491#
461# Display device support 492# Display device support
462# 493#
463# CONFIG_DISPLAY_SUPPORT is not set 494# CONFIG_DISPLAY_SUPPORT is not set
464# CONFIG_VGASTATE is not set
465CONFIG_VIDEO_OUTPUT_CONTROL=y
466# CONFIG_FB is not set
467 495
468# 496#
469# Sound 497# Sound
@@ -471,23 +499,11 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y
471# CONFIG_SOUND is not set 499# CONFIG_SOUND is not set
472# CONFIG_USB_SUPPORT is not set 500# CONFIG_USB_SUPPORT is not set
473# CONFIG_MMC is not set 501# CONFIG_MMC is not set
502# CONFIG_MEMSTICK is not set
474# CONFIG_NEW_LEDS is not set 503# CONFIG_NEW_LEDS is not set
475# CONFIG_RTC_CLASS is not set 504# CONFIG_RTC_CLASS is not set
476 505
477# 506#
478# DMA Engine support
479#
480# CONFIG_DMA_ENGINE is not set
481
482#
483# DMA Clients
484#
485
486#
487# DMA Devices
488#
489
490#
491# Userspace I/O 507# Userspace I/O
492# 508#
493# CONFIG_UIO is not set 509# CONFIG_UIO is not set
@@ -505,11 +521,9 @@ CONFIG_EXT2_FS=y
505# CONFIG_XFS_FS is not set 521# CONFIG_XFS_FS is not set
506# CONFIG_GFS2_FS is not set 522# CONFIG_GFS2_FS is not set
507# CONFIG_OCFS2_FS is not set 523# CONFIG_OCFS2_FS is not set
508# CONFIG_MINIX_FS is not set 524# CONFIG_DNOTIFY is not set
509CONFIG_ROMFS_FS=y
510# CONFIG_INOTIFY is not set 525# CONFIG_INOTIFY is not set
511# CONFIG_QUOTA is not set 526# CONFIG_QUOTA is not set
512# CONFIG_DNOTIFY is not set
513# CONFIG_AUTOFS_FS is not set 527# CONFIG_AUTOFS_FS is not set
514# CONFIG_AUTOFS4_FS is not set 528# CONFIG_AUTOFS4_FS is not set
515# CONFIG_FUSE_FS is not set 529# CONFIG_FUSE_FS is not set
@@ -535,7 +549,6 @@ CONFIG_PROC_SYSCTL=y
535CONFIG_SYSFS=y 549CONFIG_SYSFS=y
536# CONFIG_TMPFS is not set 550# CONFIG_TMPFS is not set
537# CONFIG_HUGETLB_PAGE is not set 551# CONFIG_HUGETLB_PAGE is not set
538CONFIG_RAMFS=y
539# CONFIG_CONFIGFS_FS is not set 552# CONFIG_CONFIGFS_FS is not set
540 553
541# 554#
@@ -551,42 +564,27 @@ CONFIG_RAMFS=y
551# CONFIG_JFFS2_FS is not set 564# CONFIG_JFFS2_FS is not set
552# CONFIG_CRAMFS is not set 565# CONFIG_CRAMFS is not set
553# CONFIG_VXFS_FS is not set 566# CONFIG_VXFS_FS is not set
567# CONFIG_MINIX_FS is not set
554# CONFIG_HPFS_FS is not set 568# CONFIG_HPFS_FS is not set
555# CONFIG_QNX4FS_FS is not set 569# CONFIG_QNX4FS_FS is not set
570CONFIG_ROMFS_FS=y
556# CONFIG_SYSV_FS is not set 571# CONFIG_SYSV_FS is not set
557# CONFIG_UFS_FS is not set 572# CONFIG_UFS_FS is not set
558 573# CONFIG_NETWORK_FILESYSTEMS is not set
559#
560# Network File Systems
561#
562# CONFIG_NFS_FS is not set
563# CONFIG_NFSD is not set
564# CONFIG_SMB_FS is not set
565# CONFIG_CIFS is not set
566# CONFIG_NCP_FS is not set
567# CONFIG_CODA_FS is not set
568# CONFIG_AFS_FS is not set
569 574
570# 575#
571# Partition Types 576# Partition Types
572# 577#
573# CONFIG_PARTITION_ADVANCED is not set 578# CONFIG_PARTITION_ADVANCED is not set
574CONFIG_MSDOS_PARTITION=y 579CONFIG_MSDOS_PARTITION=y
575
576#
577# Native Language Support
578#
579# CONFIG_NLS is not set 580# CONFIG_NLS is not set
580
581#
582# Distributed Lock Manager
583#
584# CONFIG_DLM is not set 581# CONFIG_DLM is not set
585 582
586# 583#
587# Kernel hacking 584# Kernel hacking
588# 585#
589# CONFIG_PRINTK_TIME is not set 586# CONFIG_PRINTK_TIME is not set
587CONFIG_ENABLE_WARN_DEPRECATED=y
590# CONFIG_ENABLE_MUST_CHECK is not set 588# CONFIG_ENABLE_MUST_CHECK is not set
591# CONFIG_MAGIC_SYSRQ is not set 589# CONFIG_MAGIC_SYSRQ is not set
592# CONFIG_UNUSED_SYMBOLS is not set 590# CONFIG_UNUSED_SYMBOLS is not set
@@ -594,6 +592,7 @@ CONFIG_MSDOS_PARTITION=y
594# CONFIG_HEADERS_CHECK is not set 592# CONFIG_HEADERS_CHECK is not set
595# CONFIG_DEBUG_KERNEL is not set 593# CONFIG_DEBUG_KERNEL is not set
596# CONFIG_DEBUG_BUGVERBOSE is not set 594# CONFIG_DEBUG_BUGVERBOSE is not set
595# CONFIG_SAMPLES is not set
597# CONFIG_FULLDEBUG is not set 596# CONFIG_FULLDEBUG is not set
598# CONFIG_HIGHPROFILE is not set 597# CONFIG_HIGHPROFILE is not set
599# CONFIG_BOOTPARAM is not set 598# CONFIG_BOOTPARAM is not set
@@ -605,6 +604,7 @@ CONFIG_MSDOS_PARTITION=y
605# 604#
606# CONFIG_KEYS is not set 605# CONFIG_KEYS is not set
607# CONFIG_SECURITY is not set 606# CONFIG_SECURITY is not set
607# CONFIG_SECURITY_FILE_CAPABILITIES is not set
608# CONFIG_CRYPTO is not set 608# CONFIG_CRYPTO is not set
609 609
610# 610#
diff --git a/arch/m68knommu/kernel/syscalltable.S b/arch/m68knommu/kernel/syscalltable.S
index 1b02b8820068..fca2e49917a3 100644
--- a/arch/m68knommu/kernel/syscalltable.S
+++ b/arch/m68knommu/kernel/syscalltable.S
@@ -336,9 +336,11 @@ ENTRY(sys_call_table)
336 .long sys_epoll_pwait /* 315 */ 336 .long sys_epoll_pwait /* 315 */
337 .long sys_utimensat 337 .long sys_utimensat
338 .long sys_signalfd 338 .long sys_signalfd
339 .long sys_ni_syscall 339 .long sys_timerfd_create
340 .long sys_eventfd 340 .long sys_eventfd
341 .long sys_fallocate /* 320 */ 341 .long sys_fallocate /* 320 */
342 .long sys_timerfd_settime
343 .long sys_timerfd_gettime
342 344
343 .rept NR_syscalls-(.-sys_call_table)/4 345 .rept NR_syscalls-(.-sys_call_table)/4
344 .long sys_ni_syscall 346 .long sys_ni_syscall
diff --git a/arch/m68knommu/platform/68328/timers.c b/arch/m68knommu/platform/68328/timers.c
index 9159fd05c9ac..6bafefa546e5 100644
--- a/arch/m68knommu/platform/68328/timers.c
+++ b/arch/m68knommu/platform/68328/timers.c
@@ -67,16 +67,6 @@ static irqreturn_t hw_tick(int irq, void *dummy)
67 67
68/***************************************************************************/ 68/***************************************************************************/
69 69
70static irqreturn_t hw_tick(int irq, void *dummy)
71{
72 /* Reset Timer1 */
73 TSTAT &= 0;
74
75 return arch_timer_interrupt(irq, dummy);
76}
77
78/***************************************************************************/
79
80static struct irqaction m68328_timer_irq = { 70static struct irqaction m68328_timer_irq = {
81 .name = "timer", 71 .name = "timer",
82 .flags = IRQF_DISABLED | IRQF_TIMER, 72 .flags = IRQF_DISABLED | IRQF_TIMER,
diff --git a/arch/powerpc/boot/cuboot-bamboo.c b/arch/powerpc/boot/cuboot-bamboo.c
index 900c7ff2b7e9..b5c30f766c40 100644
--- a/arch/powerpc/boot/cuboot-bamboo.c
+++ b/arch/powerpc/boot/cuboot-bamboo.c
@@ -17,6 +17,7 @@
17#include "44x.h" 17#include "44x.h"
18#include "cuboot.h" 18#include "cuboot.h"
19 19
20#define TARGET_4xx
20#define TARGET_44x 21#define TARGET_44x
21#include "ppcboot.h" 22#include "ppcboot.h"
22 23
diff --git a/arch/powerpc/boot/cuboot-ebony.c b/arch/powerpc/boot/cuboot-ebony.c
index c5f37ce172ea..56564ba37f62 100644
--- a/arch/powerpc/boot/cuboot-ebony.c
+++ b/arch/powerpc/boot/cuboot-ebony.c
@@ -17,6 +17,7 @@
17#include "44x.h" 17#include "44x.h"
18#include "cuboot.h" 18#include "cuboot.h"
19 19
20#define TARGET_4xx
20#define TARGET_44x 21#define TARGET_44x
21#include "ppcboot.h" 22#include "ppcboot.h"
22 23
diff --git a/arch/powerpc/boot/cuboot-katmai.c b/arch/powerpc/boot/cuboot-katmai.c
index c021167f9381..5434d70b5660 100644
--- a/arch/powerpc/boot/cuboot-katmai.c
+++ b/arch/powerpc/boot/cuboot-katmai.c
@@ -22,6 +22,7 @@
22#include "44x.h" 22#include "44x.h"
23#include "cuboot.h" 23#include "cuboot.h"
24 24
25#define TARGET_4xx
25#define TARGET_44x 26#define TARGET_44x
26#include "ppcboot.h" 27#include "ppcboot.h"
27 28
diff --git a/arch/powerpc/boot/cuboot-taishan.c b/arch/powerpc/boot/cuboot-taishan.c
index f66455a45ab1..b55b80467eed 100644
--- a/arch/powerpc/boot/cuboot-taishan.c
+++ b/arch/powerpc/boot/cuboot-taishan.c
@@ -21,7 +21,9 @@
21#include "dcr.h" 21#include "dcr.h"
22#include "4xx.h" 22#include "4xx.h"
23 23
24#define TARGET_4xx
24#define TARGET_44x 25#define TARGET_44x
26#define TARGET_440GX
25#include "ppcboot.h" 27#include "ppcboot.h"
26 28
27static bd_t bd; 29static bd_t bd;
diff --git a/arch/powerpc/boot/cuboot-warp.c b/arch/powerpc/boot/cuboot-warp.c
index bdedebe1bc14..3db93e85e9ea 100644
--- a/arch/powerpc/boot/cuboot-warp.c
+++ b/arch/powerpc/boot/cuboot-warp.c
@@ -11,6 +11,7 @@
11#include "4xx.h" 11#include "4xx.h"
12#include "cuboot.h" 12#include "cuboot.h"
13 13
14#define TARGET_4xx
14#define TARGET_44x 15#define TARGET_44x
15#include "ppcboot.h" 16#include "ppcboot.h"
16 17
diff --git a/arch/powerpc/boot/dts/haleakala.dts b/arch/powerpc/boot/dts/haleakala.dts
index 5dd3d15f0feb..ae68fefc01b6 100644
--- a/arch/powerpc/boot/dts/haleakala.dts
+++ b/arch/powerpc/boot/dts/haleakala.dts
@@ -235,7 +235,7 @@
235 #interrupt-cells = <1>; 235 #interrupt-cells = <1>;
236 #size-cells = <2>; 236 #size-cells = <2>;
237 #address-cells = <3>; 237 #address-cells = <3>;
238 compatible = "ibm,plb-pciex-405exr", "ibm,plb-pciex"; 238 compatible = "ibm,plb-pciex-405ex", "ibm,plb-pciex";
239 primary; 239 primary;
240 port = <0>; /* port number */ 240 port = <0>; /* port number */
241 reg = <a0000000 20000000 /* Config space access */ 241 reg = <a0000000 20000000 /* Config space access */
diff --git a/arch/powerpc/boot/dts/katmai.dts b/arch/powerpc/boot/dts/katmai.dts
index bc32ac7250ec..fc86e5a3afc4 100644
--- a/arch/powerpc/boot/dts/katmai.dts
+++ b/arch/powerpc/boot/dts/katmai.dts
@@ -38,8 +38,8 @@
38 timebase-frequency = <0>; /* Filled in by zImage */ 38 timebase-frequency = <0>; /* Filled in by zImage */
39 i-cache-line-size = <20>; 39 i-cache-line-size = <20>;
40 d-cache-line-size = <20>; 40 d-cache-line-size = <20>;
41 i-cache-size = <20000>; 41 i-cache-size = <8000>;
42 d-cache-size = <20000>; 42 d-cache-size = <8000>;
43 dcr-controller; 43 dcr-controller;
44 dcr-access-method = "native"; 44 dcr-access-method = "native";
45 }; 45 };
@@ -136,11 +136,11 @@
136 }; 136 };
137 137
138 POB0: opb { 138 POB0: opb {
139 compatible = "ibm,opb-440spe", "ibm,opb-440gp", "ibm,opb"; 139 compatible = "ibm,opb-440spe", "ibm,opb-440gp", "ibm,opb";
140 #address-cells = <1>; 140 #address-cells = <1>;
141 #size-cells = <1>; 141 #size-cells = <1>;
142 ranges = <00000000 4 e0000000 20000000>; 142 ranges = <00000000 4 e0000000 20000000>;
143 clock-frequency = <0>; /* Filled in by zImage */ 143 clock-frequency = <0>; /* Filled in by zImage */
144 144
145 EBC0: ebc { 145 EBC0: ebc {
146 compatible = "ibm,ebc-440spe", "ibm,ebc-440gp", "ibm,ebc"; 146 compatible = "ibm,ebc-440spe", "ibm,ebc-440gp", "ibm,ebc";
@@ -153,38 +153,38 @@
153 }; 153 };
154 154
155 UART0: serial@10000200 { 155 UART0: serial@10000200 {
156 device_type = "serial"; 156 device_type = "serial";
157 compatible = "ns16550"; 157 compatible = "ns16550";
158 reg = <10000200 8>; 158 reg = <10000200 8>;
159 virtual-reg = <a0000200>; 159 virtual-reg = <a0000200>;
160 clock-frequency = <0>; /* Filled in by zImage */ 160 clock-frequency = <0>; /* Filled in by zImage */
161 current-speed = <1c200>; 161 current-speed = <1c200>;
162 interrupt-parent = <&UIC0>; 162 interrupt-parent = <&UIC0>;
163 interrupts = <0 4>; 163 interrupts = <0 4>;
164 }; 164 };
165 165
166 UART1: serial@10000300 { 166 UART1: serial@10000300 {
167 device_type = "serial"; 167 device_type = "serial";
168 compatible = "ns16550"; 168 compatible = "ns16550";
169 reg = <10000300 8>; 169 reg = <10000300 8>;
170 virtual-reg = <a0000300>; 170 virtual-reg = <a0000300>;
171 clock-frequency = <0>; 171 clock-frequency = <0>;
172 current-speed = <0>; 172 current-speed = <0>;
173 interrupt-parent = <&UIC0>; 173 interrupt-parent = <&UIC0>;
174 interrupts = <1 4>; 174 interrupts = <1 4>;
175 }; 175 };
176 176
177 177
178 UART2: serial@10000600 { 178 UART2: serial@10000600 {
179 device_type = "serial"; 179 device_type = "serial";
180 compatible = "ns16550"; 180 compatible = "ns16550";
181 reg = <10000600 8>; 181 reg = <10000600 8>;
182 virtual-reg = <a0000600>; 182 virtual-reg = <a0000600>;
183 clock-frequency = <0>; 183 clock-frequency = <0>;
184 current-speed = <0>; 184 current-speed = <0>;
185 interrupt-parent = <&UIC1>; 185 interrupt-parent = <&UIC1>;
186 interrupts = <5 4>; 186 interrupts = <5 4>;
187 }; 187 };
188 188
189 IIC0: i2c@10000400 { 189 IIC0: i2c@10000400 {
190 compatible = "ibm,iic-440spe", "ibm,iic-440gp", "ibm,iic"; 190 compatible = "ibm,iic-440spe", "ibm,iic-440gp", "ibm,iic";
diff --git a/arch/powerpc/oprofile/op_model_cell.c b/arch/powerpc/oprofile/op_model_cell.c
index 13929771bee7..9eed1f68fcab 100644
--- a/arch/powerpc/oprofile/op_model_cell.c
+++ b/arch/powerpc/oprofile/op_model_cell.c
@@ -1151,7 +1151,7 @@ static void cell_handle_interrupt(struct pt_regs *regs,
1151 for (i = 0; i < num_counters; ++i) { 1151 for (i = 0; i < num_counters; ++i) {
1152 if ((interrupt_mask & CBE_PM_CTR_OVERFLOW_INTR(i)) 1152 if ((interrupt_mask & CBE_PM_CTR_OVERFLOW_INTR(i))
1153 && ctr[i].enabled) { 1153 && ctr[i].enabled) {
1154 oprofile_add_pc(pc, is_kernel, i); 1154 oprofile_add_ext_sample(pc, regs, i, is_kernel);
1155 cbe_write_ctr(cpu, i, reset_value[i]); 1155 cbe_write_ctr(cpu, i, reset_value[i]);
1156 } 1156 }
1157 } 1157 }
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_common.c b/arch/powerpc/platforms/52xx/mpc52xx_common.c
index 9aa4425d80b2..4d5fd1dbd400 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_common.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_common.c
@@ -199,6 +199,7 @@ int mpc52xx_set_psc_clkdiv(int psc_id, int clkdiv)
199 199
200 return 0; 200 return 0;
201} 201}
202EXPORT_SYMBOL(mpc52xx_set_psc_clkdiv);
202 203
203/** 204/**
204 * mpc52xx_restart: ppc_md->restart hook for mpc5200 using the watchdog timer 205 * mpc52xx_restart: ppc_md->restart hook for mpc5200 using the watchdog timer
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index edab631a8dcb..20ea0e118f24 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -113,7 +113,7 @@
113 113
114/* IOMMU sizing */ 114/* IOMMU sizing */
115#define IO_SEGMENT_SHIFT 28 115#define IO_SEGMENT_SHIFT 28
116#define IO_PAGENO_BITS (IO_SEGMENT_SHIFT - IOMMU_PAGE_SHIFT) 116#define IO_PAGENO_BITS(shift) (IO_SEGMENT_SHIFT - (shift))
117 117
118/* The high bit needs to be set on every DMA address */ 118/* The high bit needs to be set on every DMA address */
119#define SPIDER_DMA_OFFSET 0x80000000ul 119#define SPIDER_DMA_OFFSET 0x80000000ul
@@ -123,7 +123,6 @@ struct iommu_window {
123 struct cbe_iommu *iommu; 123 struct cbe_iommu *iommu;
124 unsigned long offset; 124 unsigned long offset;
125 unsigned long size; 125 unsigned long size;
126 unsigned long pte_offset;
127 unsigned int ioid; 126 unsigned int ioid;
128 struct iommu_table table; 127 struct iommu_table table;
129}; 128};
@@ -200,7 +199,7 @@ static void tce_build_cell(struct iommu_table *tbl, long index, long npages,
200 (window->ioid & IOPTE_IOID_Mask); 199 (window->ioid & IOPTE_IOID_Mask);
201#endif 200#endif
202 201
203 io_pte = (unsigned long *)tbl->it_base + (index - window->pte_offset); 202 io_pte = (unsigned long *)tbl->it_base + (index - tbl->it_offset);
204 203
205 for (i = 0; i < npages; i++, uaddr += IOMMU_PAGE_SIZE) 204 for (i = 0; i < npages; i++, uaddr += IOMMU_PAGE_SIZE)
206 io_pte[i] = base_pte | (__pa(uaddr) & IOPTE_RPN_Mask); 205 io_pte[i] = base_pte | (__pa(uaddr) & IOPTE_RPN_Mask);
@@ -232,7 +231,7 @@ static void tce_free_cell(struct iommu_table *tbl, long index, long npages)
232 | (window->ioid & IOPTE_IOID_Mask); 231 | (window->ioid & IOPTE_IOID_Mask);
233#endif 232#endif
234 233
235 io_pte = (unsigned long *)tbl->it_base + (index - window->pte_offset); 234 io_pte = (unsigned long *)tbl->it_base + (index - tbl->it_offset);
236 235
237 for (i = 0; i < npages; i++) 236 for (i = 0; i < npages; i++)
238 io_pte[i] = pte; 237 io_pte[i] = pte;
@@ -307,76 +306,84 @@ static int cell_iommu_find_ioc(int nid, unsigned long *base)
307 return -ENODEV; 306 return -ENODEV;
308} 307}
309 308
310static void cell_iommu_setup_page_tables(struct cbe_iommu *iommu, 309static void cell_iommu_setup_stab(struct cbe_iommu *iommu,
311 unsigned long dbase, unsigned long dsize, 310 unsigned long dbase, unsigned long dsize,
312 unsigned long fbase, unsigned long fsize) 311 unsigned long fbase, unsigned long fsize)
313{ 312{
314 struct page *page; 313 struct page *page;
315 int i; 314 unsigned long segments, stab_size;
316 unsigned long reg, segments, pages_per_segment, ptab_size, stab_size,
317 n_pte_pages, base;
318
319 base = dbase;
320 if (fsize != 0)
321 base = min(fbase, dbase);
322 315
323 segments = max(dbase + dsize, fbase + fsize) >> IO_SEGMENT_SHIFT; 316 segments = max(dbase + dsize, fbase + fsize) >> IO_SEGMENT_SHIFT;
324 pages_per_segment = 1ull << IO_PAGENO_BITS;
325 317
326 pr_debug("%s: iommu[%d]: segments: %lu, pages per segment: %lu\n", 318 pr_debug("%s: iommu[%d]: segments: %lu\n",
327 __FUNCTION__, iommu->nid, segments, pages_per_segment); 319 __FUNCTION__, iommu->nid, segments);
328 320
329 /* set up the segment table */ 321 /* set up the segment table */
330 stab_size = segments * sizeof(unsigned long); 322 stab_size = segments * sizeof(unsigned long);
331 page = alloc_pages_node(iommu->nid, GFP_KERNEL, get_order(stab_size)); 323 page = alloc_pages_node(iommu->nid, GFP_KERNEL, get_order(stab_size));
332 BUG_ON(!page); 324 BUG_ON(!page);
333 iommu->stab = page_address(page); 325 iommu->stab = page_address(page);
334 clear_page(iommu->stab); 326 memset(iommu->stab, 0, stab_size);
327}
328
329static unsigned long *cell_iommu_alloc_ptab(struct cbe_iommu *iommu,
330 unsigned long base, unsigned long size, unsigned long gap_base,
331 unsigned long gap_size, unsigned long page_shift)
332{
333 struct page *page;
334 int i;
335 unsigned long reg, segments, pages_per_segment, ptab_size,
336 n_pte_pages, start_seg, *ptab;
337
338 start_seg = base >> IO_SEGMENT_SHIFT;
339 segments = size >> IO_SEGMENT_SHIFT;
340 pages_per_segment = 1ull << IO_PAGENO_BITS(page_shift);
341 /* PTEs for each segment must start on a 4K bounday */
342 pages_per_segment = max(pages_per_segment,
343 (1 << 12) / sizeof(unsigned long));
335 344
336 /* ... and the page tables. Since these are contiguous, we can treat
337 * the page tables as one array of ptes, like pSeries does.
338 */
339 ptab_size = segments * pages_per_segment * sizeof(unsigned long); 345 ptab_size = segments * pages_per_segment * sizeof(unsigned long);
340 pr_debug("%s: iommu[%d]: ptab_size: %lu, order: %d\n", __FUNCTION__, 346 pr_debug("%s: iommu[%d]: ptab_size: %lu, order: %d\n", __FUNCTION__,
341 iommu->nid, ptab_size, get_order(ptab_size)); 347 iommu->nid, ptab_size, get_order(ptab_size));
342 page = alloc_pages_node(iommu->nid, GFP_KERNEL, get_order(ptab_size)); 348 page = alloc_pages_node(iommu->nid, GFP_KERNEL, get_order(ptab_size));
343 BUG_ON(!page); 349 BUG_ON(!page);
344 350
345 iommu->ptab = page_address(page); 351 ptab = page_address(page);
346 memset(iommu->ptab, 0, ptab_size); 352 memset(ptab, 0, ptab_size);
347 353
348 /* allocate a bogus page for the end of each mapping */ 354 /* number of 4K pages needed for a page table */
349 page = alloc_pages_node(iommu->nid, GFP_KERNEL, 0); 355 n_pte_pages = (pages_per_segment * sizeof(unsigned long)) >> 12;
350 BUG_ON(!page);
351 iommu->pad_page = page_address(page);
352 clear_page(iommu->pad_page);
353
354 /* number of pages needed for a page table */
355 n_pte_pages = (pages_per_segment *
356 sizeof(unsigned long)) >> IOMMU_PAGE_SHIFT;
357 356
358 pr_debug("%s: iommu[%d]: stab at %p, ptab at %p, n_pte_pages: %lu\n", 357 pr_debug("%s: iommu[%d]: stab at %p, ptab at %p, n_pte_pages: %lu\n",
359 __FUNCTION__, iommu->nid, iommu->stab, iommu->ptab, 358 __FUNCTION__, iommu->nid, iommu->stab, ptab,
360 n_pte_pages); 359 n_pte_pages);
361 360
362 /* initialise the STEs */ 361 /* initialise the STEs */
363 reg = IOSTE_V | ((n_pte_pages - 1) << 5); 362 reg = IOSTE_V | ((n_pte_pages - 1) << 5);
364 363
365 if (IOMMU_PAGE_SIZE == 0x1000) 364 switch (page_shift) {
366 reg |= IOSTE_PS_4K; 365 case 12: reg |= IOSTE_PS_4K; break;
367 else if (IOMMU_PAGE_SIZE == 0x10000) 366 case 16: reg |= IOSTE_PS_64K; break;
368 reg |= IOSTE_PS_64K; 367 case 20: reg |= IOSTE_PS_1M; break;
369 else { 368 case 24: reg |= IOSTE_PS_16M; break;
370 extern void __unknown_page_size_error(void); 369 default: BUG();
371 __unknown_page_size_error();
372 } 370 }
373 371
372 gap_base = gap_base >> IO_SEGMENT_SHIFT;
373 gap_size = gap_size >> IO_SEGMENT_SHIFT;
374
374 pr_debug("Setting up IOMMU stab:\n"); 375 pr_debug("Setting up IOMMU stab:\n");
375 for (i = base >> IO_SEGMENT_SHIFT; i < segments; i++) { 376 for (i = start_seg; i < (start_seg + segments); i++) {
376 iommu->stab[i] = reg | 377 if (i >= gap_base && i < (gap_base + gap_size)) {
377 (__pa(iommu->ptab) + n_pte_pages * IOMMU_PAGE_SIZE * i); 378 pr_debug("\toverlap at %d, skipping\n", i);
379 continue;
380 }
381 iommu->stab[i] = reg | (__pa(ptab) + (n_pte_pages << 12) *
382 (i - start_seg));
378 pr_debug("\t[%d] 0x%016lx\n", i, iommu->stab[i]); 383 pr_debug("\t[%d] 0x%016lx\n", i, iommu->stab[i]);
379 } 384 }
385
386 return ptab;
380} 387}
381 388
382static void cell_iommu_enable_hardware(struct cbe_iommu *iommu) 389static void cell_iommu_enable_hardware(struct cbe_iommu *iommu)
@@ -423,7 +430,9 @@ static void cell_iommu_enable_hardware(struct cbe_iommu *iommu)
423static void cell_iommu_setup_hardware(struct cbe_iommu *iommu, 430static void cell_iommu_setup_hardware(struct cbe_iommu *iommu,
424 unsigned long base, unsigned long size) 431 unsigned long base, unsigned long size)
425{ 432{
426 cell_iommu_setup_page_tables(iommu, base, size, 0, 0); 433 cell_iommu_setup_stab(iommu, base, size, 0, 0);
434 iommu->ptab = cell_iommu_alloc_ptab(iommu, base, size, 0, 0,
435 IOMMU_PAGE_SHIFT);
427 cell_iommu_enable_hardware(iommu); 436 cell_iommu_enable_hardware(iommu);
428} 437}
429 438
@@ -464,6 +473,7 @@ cell_iommu_setup_window(struct cbe_iommu *iommu, struct device_node *np,
464 unsigned long pte_offset) 473 unsigned long pte_offset)
465{ 474{
466 struct iommu_window *window; 475 struct iommu_window *window;
476 struct page *page;
467 u32 ioid; 477 u32 ioid;
468 478
469 ioid = cell_iommu_get_ioid(np); 479 ioid = cell_iommu_get_ioid(np);
@@ -475,13 +485,11 @@ cell_iommu_setup_window(struct cbe_iommu *iommu, struct device_node *np,
475 window->size = size; 485 window->size = size;
476 window->ioid = ioid; 486 window->ioid = ioid;
477 window->iommu = iommu; 487 window->iommu = iommu;
478 window->pte_offset = pte_offset;
479 488
480 window->table.it_blocksize = 16; 489 window->table.it_blocksize = 16;
481 window->table.it_base = (unsigned long)iommu->ptab; 490 window->table.it_base = (unsigned long)iommu->ptab;
482 window->table.it_index = iommu->nid; 491 window->table.it_index = iommu->nid;
483 window->table.it_offset = (offset >> IOMMU_PAGE_SHIFT) + 492 window->table.it_offset = (offset >> IOMMU_PAGE_SHIFT) + pte_offset;
484 window->pte_offset;
485 window->table.it_size = size >> IOMMU_PAGE_SHIFT; 493 window->table.it_size = size >> IOMMU_PAGE_SHIFT;
486 494
487 iommu_init_table(&window->table, iommu->nid); 495 iommu_init_table(&window->table, iommu->nid);
@@ -504,6 +512,11 @@ cell_iommu_setup_window(struct cbe_iommu *iommu, struct device_node *np,
504 * This code also assumes that we have a window that starts at 0, 512 * This code also assumes that we have a window that starts at 0,
505 * which is the case on all spider based blades. 513 * which is the case on all spider based blades.
506 */ 514 */
515 page = alloc_pages_node(iommu->nid, GFP_KERNEL, 0);
516 BUG_ON(!page);
517 iommu->pad_page = page_address(page);
518 clear_page(iommu->pad_page);
519
507 __set_bit(0, window->table.it_map); 520 __set_bit(0, window->table.it_map);
508 tce_build_cell(&window->table, window->table.it_offset, 1, 521 tce_build_cell(&window->table, window->table.it_offset, 1,
509 (unsigned long)iommu->pad_page, DMA_TO_DEVICE); 522 (unsigned long)iommu->pad_page, DMA_TO_DEVICE);
@@ -549,7 +562,7 @@ static void cell_dma_dev_setup_iommu(struct device *dev)
549 archdata->dma_data = &window->table; 562 archdata->dma_data = &window->table;
550} 563}
551 564
552static void cell_dma_dev_setup_static(struct device *dev); 565static void cell_dma_dev_setup_fixed(struct device *dev);
553 566
554static void cell_dma_dev_setup(struct device *dev) 567static void cell_dma_dev_setup(struct device *dev)
555{ 568{
@@ -557,7 +570,7 @@ static void cell_dma_dev_setup(struct device *dev)
557 570
558 /* Order is important here, these are not mutually exclusive */ 571 /* Order is important here, these are not mutually exclusive */
559 if (get_dma_ops(dev) == &dma_iommu_fixed_ops) 572 if (get_dma_ops(dev) == &dma_iommu_fixed_ops)
560 cell_dma_dev_setup_static(dev); 573 cell_dma_dev_setup_fixed(dev);
561 else if (get_pci_dma_ops() == &dma_iommu_ops) 574 else if (get_pci_dma_ops() == &dma_iommu_ops)
562 cell_dma_dev_setup_iommu(dev); 575 cell_dma_dev_setup_iommu(dev);
563 else if (get_pci_dma_ops() == &dma_direct_ops) 576 else if (get_pci_dma_ops() == &dma_direct_ops)
@@ -858,7 +871,7 @@ static int dma_set_mask_and_switch(struct device *dev, u64 dma_mask)
858 return 0; 871 return 0;
859} 872}
860 873
861static void cell_dma_dev_setup_static(struct device *dev) 874static void cell_dma_dev_setup_fixed(struct device *dev)
862{ 875{
863 struct dev_archdata *archdata = &dev->archdata; 876 struct dev_archdata *archdata = &dev->archdata;
864 u64 addr; 877 u64 addr;
@@ -869,35 +882,45 @@ static void cell_dma_dev_setup_static(struct device *dev)
869 dev_dbg(dev, "iommu: fixed addr = %lx\n", addr); 882 dev_dbg(dev, "iommu: fixed addr = %lx\n", addr);
870} 883}
871 884
885static void insert_16M_pte(unsigned long addr, unsigned long *ptab,
886 unsigned long base_pte)
887{
888 unsigned long segment, offset;
889
890 segment = addr >> IO_SEGMENT_SHIFT;
891 offset = (addr >> 24) - (segment << IO_PAGENO_BITS(24));
892 ptab = ptab + (segment * (1 << 12) / sizeof(unsigned long));
893
894 pr_debug("iommu: addr %lx ptab %p segment %lx offset %lx\n",
895 addr, ptab, segment, offset);
896
897 ptab[offset] = base_pte | (__pa(addr) & IOPTE_RPN_Mask);
898}
899
872static void cell_iommu_setup_fixed_ptab(struct cbe_iommu *iommu, 900static void cell_iommu_setup_fixed_ptab(struct cbe_iommu *iommu,
873 struct device_node *np, unsigned long dbase, unsigned long dsize, 901 struct device_node *np, unsigned long dbase, unsigned long dsize,
874 unsigned long fbase, unsigned long fsize) 902 unsigned long fbase, unsigned long fsize)
875{ 903{
876 unsigned long base_pte, uaddr, *io_pte; 904 unsigned long base_pte, uaddr, ioaddr, *ptab;
877 int i;
878 905
879 dma_iommu_fixed_base = fbase; 906 ptab = cell_iommu_alloc_ptab(iommu, fbase, fsize, dbase, dsize, 24);
880 907
881 /* convert from bytes into page table indices */ 908 dma_iommu_fixed_base = fbase;
882 dbase = dbase >> IOMMU_PAGE_SHIFT;
883 dsize = dsize >> IOMMU_PAGE_SHIFT;
884 fbase = fbase >> IOMMU_PAGE_SHIFT;
885 fsize = fsize >> IOMMU_PAGE_SHIFT;
886 909
887 pr_debug("iommu: mapping 0x%lx pages from 0x%lx\n", fsize, fbase); 910 pr_debug("iommu: mapping 0x%lx pages from 0x%lx\n", fsize, fbase);
888 911
889 io_pte = iommu->ptab;
890 base_pte = IOPTE_PP_W | IOPTE_PP_R | IOPTE_M | IOPTE_SO_RW 912 base_pte = IOPTE_PP_W | IOPTE_PP_R | IOPTE_M | IOPTE_SO_RW
891 | (cell_iommu_get_ioid(np) & IOPTE_IOID_Mask); 913 | (cell_iommu_get_ioid(np) & IOPTE_IOID_Mask);
892 914
893 uaddr = 0; 915 for (uaddr = 0; uaddr < fsize; uaddr += (1 << 24)) {
894 for (i = fbase; i < fbase + fsize; i++, uaddr += IOMMU_PAGE_SIZE) {
895 /* Don't touch the dynamic region */ 916 /* Don't touch the dynamic region */
896 if (i >= dbase && i < (dbase + dsize)) { 917 ioaddr = uaddr + fbase;
897 pr_debug("iommu: static/dynamic overlap, skipping\n"); 918 if (ioaddr >= dbase && ioaddr < (dbase + dsize)) {
919 pr_debug("iommu: fixed/dynamic overlap, skipping\n");
898 continue; 920 continue;
899 } 921 }
900 io_pte[i] = base_pte | (__pa(uaddr) & IOPTE_RPN_Mask); 922
923 insert_16M_pte(uaddr, ptab, base_pte);
901 } 924 }
902 925
903 mb(); 926 mb();
@@ -995,7 +1018,9 @@ static int __init cell_iommu_fixed_mapping_init(void)
995 "fixed window 0x%lx-0x%lx\n", iommu->nid, dbase, 1018 "fixed window 0x%lx-0x%lx\n", iommu->nid, dbase,
996 dbase + dsize, fbase, fbase + fsize); 1019 dbase + dsize, fbase, fbase + fsize);
997 1020
998 cell_iommu_setup_page_tables(iommu, dbase, dsize, fbase, fsize); 1021 cell_iommu_setup_stab(iommu, dbase, dsize, fbase, fsize);
1022 iommu->ptab = cell_iommu_alloc_ptab(iommu, dbase, dsize, 0, 0,
1023 IOMMU_PAGE_SHIFT);
999 cell_iommu_setup_fixed_ptab(iommu, np, dbase, dsize, 1024 cell_iommu_setup_fixed_ptab(iommu, np, dbase, dsize,
1000 fbase, fsize); 1025 fbase, fsize);
1001 cell_iommu_enable_hardware(iommu); 1026 cell_iommu_enable_hardware(iommu);
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c
index a7f609b3b876..dda34650cb07 100644
--- a/arch/powerpc/platforms/cell/setup.c
+++ b/arch/powerpc/platforms/cell/setup.c
@@ -149,6 +149,11 @@ static void __init cell_init_irq(void)
149 mpic_init_IRQ(); 149 mpic_init_IRQ();
150} 150}
151 151
152static void __init cell_set_dabrx(void)
153{
154 mtspr(SPRN_DABRX, DABRX_KERNEL | DABRX_USER);
155}
156
152static void __init cell_setup_arch(void) 157static void __init cell_setup_arch(void)
153{ 158{
154#ifdef CONFIG_SPU_BASE 159#ifdef CONFIG_SPU_BASE
@@ -158,6 +163,8 @@ static void __init cell_setup_arch(void)
158 163
159 cbe_regs_init(); 164 cbe_regs_init();
160 165
166 cell_set_dabrx();
167
161#ifdef CONFIG_CBE_RAS 168#ifdef CONFIG_CBE_RAS
162 cbe_ras_init(); 169 cbe_ras_init();
163#endif 170#endif
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index 87eb07f94c5f..712001f6b7da 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -81,9 +81,12 @@ struct spu_slb {
81void spu_invalidate_slbs(struct spu *spu) 81void spu_invalidate_slbs(struct spu *spu)
82{ 82{
83 struct spu_priv2 __iomem *priv2 = spu->priv2; 83 struct spu_priv2 __iomem *priv2 = spu->priv2;
84 unsigned long flags;
84 85
86 spin_lock_irqsave(&spu->register_lock, flags);
85 if (spu_mfc_sr1_get(spu) & MFC_STATE1_RELOCATE_MASK) 87 if (spu_mfc_sr1_get(spu) & MFC_STATE1_RELOCATE_MASK)
86 out_be64(&priv2->slb_invalidate_all_W, 0UL); 88 out_be64(&priv2->slb_invalidate_all_W, 0UL);
89 spin_unlock_irqrestore(&spu->register_lock, flags);
87} 90}
88EXPORT_SYMBOL_GPL(spu_invalidate_slbs); 91EXPORT_SYMBOL_GPL(spu_invalidate_slbs);
89 92
@@ -148,7 +151,11 @@ static inline void spu_load_slb(struct spu *spu, int slbe, struct spu_slb *slb)
148 __func__, slbe, slb->vsid, slb->esid); 151 __func__, slbe, slb->vsid, slb->esid);
149 152
150 out_be64(&priv2->slb_index_W, slbe); 153 out_be64(&priv2->slb_index_W, slbe);
154 /* set invalid before writing vsid */
155 out_be64(&priv2->slb_esid_RW, 0);
156 /* now it's safe to write the vsid */
151 out_be64(&priv2->slb_vsid_RW, slb->vsid); 157 out_be64(&priv2->slb_vsid_RW, slb->vsid);
158 /* setting the new esid makes the entry valid again */
152 out_be64(&priv2->slb_esid_RW, slb->esid); 159 out_be64(&priv2->slb_esid_RW, slb->esid);
153} 160}
154 161
@@ -290,9 +297,11 @@ void spu_setup_kernel_slbs(struct spu *spu, struct spu_lscsa *lscsa,
290 nr_slbs++; 297 nr_slbs++;
291 } 298 }
292 299
300 spin_lock_irq(&spu->register_lock);
293 /* Add the set of SLBs */ 301 /* Add the set of SLBs */
294 for (i = 0; i < nr_slbs; i++) 302 for (i = 0; i < nr_slbs; i++)
295 spu_load_slb(spu, i, &slbs[i]); 303 spu_load_slb(spu, i, &slbs[i]);
304 spin_unlock_irq(&spu->register_lock);
296} 305}
297EXPORT_SYMBOL_GPL(spu_setup_kernel_slbs); 306EXPORT_SYMBOL_GPL(spu_setup_kernel_slbs);
298 307
@@ -337,13 +346,14 @@ spu_irq_class_1(int irq, void *data)
337 if (stat & CLASS1_STORAGE_FAULT_INTR) 346 if (stat & CLASS1_STORAGE_FAULT_INTR)
338 spu_mfc_dsisr_set(spu, 0ul); 347 spu_mfc_dsisr_set(spu, 0ul);
339 spu_int_stat_clear(spu, 1, stat); 348 spu_int_stat_clear(spu, 1, stat);
340 spin_unlock(&spu->register_lock);
341 pr_debug("%s: %lx %lx %lx %lx\n", __FUNCTION__, mask, stat,
342 dar, dsisr);
343 349
344 if (stat & CLASS1_SEGMENT_FAULT_INTR) 350 if (stat & CLASS1_SEGMENT_FAULT_INTR)
345 __spu_trap_data_seg(spu, dar); 351 __spu_trap_data_seg(spu, dar);
346 352
353 spin_unlock(&spu->register_lock);
354 pr_debug("%s: %lx %lx %lx %lx\n", __FUNCTION__, mask, stat,
355 dar, dsisr);
356
347 if (stat & CLASS1_STORAGE_FAULT_INTR) 357 if (stat & CLASS1_STORAGE_FAULT_INTR)
348 __spu_trap_data_map(spu, dar, dsisr); 358 __spu_trap_data_map(spu, dar, dsisr);
349 359
diff --git a/arch/powerpc/platforms/cell/spufs/context.c b/arch/powerpc/platforms/cell/spufs/context.c
index 133995ed5cc7..cf6c2c89211d 100644
--- a/arch/powerpc/platforms/cell/spufs/context.c
+++ b/arch/powerpc/platforms/cell/spufs/context.c
@@ -109,13 +109,12 @@ void spu_forget(struct spu_context *ctx)
109 109
110 /* 110 /*
111 * This is basically an open-coded spu_acquire_saved, except that 111 * This is basically an open-coded spu_acquire_saved, except that
112 * we don't acquire the state mutex interruptible. 112 * we don't acquire the state mutex interruptible, and we don't
113 * want this context to be rescheduled on release.
113 */ 114 */
114 mutex_lock(&ctx->state_mutex); 115 mutex_lock(&ctx->state_mutex);
115 if (ctx->state != SPU_STATE_SAVED) { 116 if (ctx->state != SPU_STATE_SAVED)
116 set_bit(SPU_SCHED_WAS_ACTIVE, &ctx->sched_flags);
117 spu_deactivate(ctx); 117 spu_deactivate(ctx);
118 }
119 118
120 mm = ctx->owner; 119 mm = ctx->owner;
121 ctx->owner = NULL; 120 ctx->owner = NULL;
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index c66c3756970d..f7a7e8635fb6 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -367,6 +367,13 @@ static unsigned long spufs_ps_nopfn(struct vm_area_struct *vma,
367 return NOPFN_SIGBUS; 367 return NOPFN_SIGBUS;
368 368
369 /* 369 /*
370 * Because we release the mmap_sem, the context may be destroyed while
371 * we're in spu_wait. Grab an extra reference so it isn't destroyed
372 * in the meantime.
373 */
374 get_spu_context(ctx);
375
376 /*
370 * We have to wait for context to be loaded before we have 377 * We have to wait for context to be loaded before we have
371 * pages to hand out to the user, but we don't want to wait 378 * pages to hand out to the user, but we don't want to wait
372 * with the mmap_sem held. 379 * with the mmap_sem held.
@@ -375,7 +382,7 @@ static unsigned long spufs_ps_nopfn(struct vm_area_struct *vma,
375 * hanged. 382 * hanged.
376 */ 383 */
377 if (spu_acquire(ctx)) 384 if (spu_acquire(ctx))
378 return NOPFN_REFAULT; 385 goto refault;
379 386
380 if (ctx->state == SPU_STATE_SAVED) { 387 if (ctx->state == SPU_STATE_SAVED) {
381 up_read(&current->mm->mmap_sem); 388 up_read(&current->mm->mmap_sem);
@@ -391,6 +398,9 @@ static unsigned long spufs_ps_nopfn(struct vm_area_struct *vma,
391 398
392 if (!ret) 399 if (!ret)
393 spu_release(ctx); 400 spu_release(ctx);
401
402refault:
403 put_spu_context(ctx);
394 return NOPFN_REFAULT; 404 return NOPFN_REFAULT;
395} 405}
396 406
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index 3a5972117de7..5d5f680cd0b8 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -246,7 +246,7 @@ static void spu_bind_context(struct spu *spu, struct spu_context *ctx)
246 spu_switch_notify(spu, ctx); 246 spu_switch_notify(spu, ctx);
247 ctx->state = SPU_STATE_RUNNABLE; 247 ctx->state = SPU_STATE_RUNNABLE;
248 248
249 spuctx_switch_state(ctx, SPU_UTIL_IDLE_LOADED); 249 spuctx_switch_state(ctx, SPU_UTIL_USER);
250} 250}
251 251
252/* 252/*
diff --git a/arch/powerpc/platforms/cell/spufs/sputrace.c b/arch/powerpc/platforms/cell/spufs/sputrace.c
index 01974f7776e1..79aa773f3c99 100644
--- a/arch/powerpc/platforms/cell/spufs/sputrace.c
+++ b/arch/powerpc/platforms/cell/spufs/sputrace.c
@@ -58,12 +58,12 @@ static int sputrace_sprint(char *tbuf, int n)
58 ktime_to_timespec(ktime_sub(t->tstamp, sputrace_start)); 58 ktime_to_timespec(ktime_sub(t->tstamp, sputrace_start));
59 59
60 return snprintf(tbuf, n, 60 return snprintf(tbuf, n,
61 "[%lu.%09lu] %d: %s (thread = %d, spu = %d)\n", 61 "[%lu.%09lu] %d: %s (ctxthread = %d, spu = %d)\n",
62 (unsigned long) tv.tv_sec, 62 (unsigned long) tv.tv_sec,
63 (unsigned long) tv.tv_nsec, 63 (unsigned long) tv.tv_nsec,
64 t->owner_tid,
65 t->name,
66 t->curr_tid, 64 t->curr_tid,
65 t->name,
66 t->owner_tid,
67 t->number); 67 t->number);
68} 68}
69 69
@@ -188,6 +188,7 @@ struct spu_probe spu_probes[] = {
188 { "spufs_ps_nopfn__insert", "%p %p", spu_context_event }, 188 { "spufs_ps_nopfn__insert", "%p %p", spu_context_event },
189 { "spu_acquire_saved__enter", "%p", spu_context_nospu_event }, 189 { "spu_acquire_saved__enter", "%p", spu_context_nospu_event },
190 { "destroy_spu_context__enter", "%p", spu_context_nospu_event }, 190 { "destroy_spu_context__enter", "%p", spu_context_nospu_event },
191 { "spufs_stop_callback__enter", "%p %p", spu_context_event },
191}; 192};
192 193
193static int __init sputrace_init(void) 194static int __init sputrace_init(void)
diff --git a/arch/powerpc/platforms/cell/spufs/switch.c b/arch/powerpc/platforms/cell/spufs/switch.c
index 6f5886c7b1f9..e9dc7a55d1b9 100644
--- a/arch/powerpc/platforms/cell/spufs/switch.c
+++ b/arch/powerpc/platforms/cell/spufs/switch.c
@@ -34,6 +34,7 @@
34 34
35#include <linux/module.h> 35#include <linux/module.h>
36#include <linux/errno.h> 36#include <linux/errno.h>
37#include <linux/hardirq.h>
37#include <linux/sched.h> 38#include <linux/sched.h>
38#include <linux/kernel.h> 39#include <linux/kernel.h>
39#include <linux/mm.h> 40#include <linux/mm.h>
@@ -117,6 +118,8 @@ static inline void disable_interrupts(struct spu_state *csa, struct spu *spu)
117 * Write INT_MASK_class1 with value of 0. 118 * Write INT_MASK_class1 with value of 0.
118 * Save INT_Mask_class2 in CSA. 119 * Save INT_Mask_class2 in CSA.
119 * Write INT_MASK_class2 with value of 0. 120 * Write INT_MASK_class2 with value of 0.
121 * Synchronize all three interrupts to be sure
122 * we no longer execute a handler on another CPU.
120 */ 123 */
121 spin_lock_irq(&spu->register_lock); 124 spin_lock_irq(&spu->register_lock);
122 if (csa) { 125 if (csa) {
@@ -129,6 +132,9 @@ static inline void disable_interrupts(struct spu_state *csa, struct spu *spu)
129 spu_int_mask_set(spu, 2, 0ul); 132 spu_int_mask_set(spu, 2, 0ul);
130 eieio(); 133 eieio();
131 spin_unlock_irq(&spu->register_lock); 134 spin_unlock_irq(&spu->register_lock);
135 synchronize_irq(spu->irqs[0]);
136 synchronize_irq(spu->irqs[1]);
137 synchronize_irq(spu->irqs[2]);
132} 138}
133 139
134static inline void set_watchdog_timer(struct spu_state *csa, struct spu *spu) 140static inline void set_watchdog_timer(struct spu_state *csa, struct spu *spu)
diff --git a/arch/powerpc/platforms/celleb/beat.h b/arch/powerpc/platforms/celleb/beat.h
index b2e292df13ca..ac82ac35b991 100644
--- a/arch/powerpc/platforms/celleb/beat.h
+++ b/arch/powerpc/platforms/celleb/beat.h
@@ -21,9 +21,6 @@
21#ifndef _CELLEB_BEAT_H 21#ifndef _CELLEB_BEAT_H
22#define _CELLEB_BEAT_H 22#define _CELLEB_BEAT_H
23 23
24#define DABRX_KERNEL (1UL<<1)
25#define DABRX_USER (1UL<<0)
26
27int64_t beat_get_term_char(uint64_t,uint64_t*,uint64_t*,uint64_t*); 24int64_t beat_get_term_char(uint64_t,uint64_t*,uint64_t*,uint64_t*);
28int64_t beat_put_term_char(uint64_t,uint64_t,uint64_t,uint64_t); 25int64_t beat_put_term_char(uint64_t,uint64_t,uint64_t,uint64_t);
29int64_t beat_repository_encode(int, const char *, uint64_t[4]); 26int64_t beat_repository_encode(int, const char *, uint64_t[4]);
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 7049294fb469..14e48b5a94ba 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -26,7 +26,6 @@ struct cpa_data {
26 pgprot_t mask_set; 26 pgprot_t mask_set;
27 pgprot_t mask_clr; 27 pgprot_t mask_clr;
28 int numpages; 28 int numpages;
29 int processed;
30 int flushtlb; 29 int flushtlb;
31 unsigned long pfn; 30 unsigned long pfn;
32}; 31};
@@ -291,8 +290,8 @@ try_preserve_large_page(pte_t *kpte, unsigned long address,
291 */ 290 */
292 nextpage_addr = (address + psize) & pmask; 291 nextpage_addr = (address + psize) & pmask;
293 numpages = (nextpage_addr - address) >> PAGE_SHIFT; 292 numpages = (nextpage_addr - address) >> PAGE_SHIFT;
294 if (numpages < cpa->processed) 293 if (numpages < cpa->numpages)
295 cpa->processed = numpages; 294 cpa->numpages = numpages;
296 295
297 /* 296 /*
298 * We are safe now. Check whether the new pgprot is the same: 297 * We are safe now. Check whether the new pgprot is the same:
@@ -319,7 +318,7 @@ try_preserve_large_page(pte_t *kpte, unsigned long address,
319 */ 318 */
320 addr = address + PAGE_SIZE; 319 addr = address + PAGE_SIZE;
321 pfn++; 320 pfn++;
322 for (i = 1; i < cpa->processed; i++, addr += PAGE_SIZE, pfn++) { 321 for (i = 1; i < cpa->numpages; i++, addr += PAGE_SIZE, pfn++) {
323 pgprot_t chk_prot = static_protections(new_prot, addr, pfn); 322 pgprot_t chk_prot = static_protections(new_prot, addr, pfn);
324 323
325 if (pgprot_val(chk_prot) != pgprot_val(new_prot)) 324 if (pgprot_val(chk_prot) != pgprot_val(new_prot))
@@ -343,7 +342,7 @@ try_preserve_large_page(pte_t *kpte, unsigned long address,
343 * that we limited the number of possible pages already to 342 * that we limited the number of possible pages already to
344 * the number of pages in the large page. 343 * the number of pages in the large page.
345 */ 344 */
346 if (address == (nextpage_addr - psize) && cpa->processed == numpages) { 345 if (address == (nextpage_addr - psize) && cpa->numpages == numpages) {
347 /* 346 /*
348 * The address is aligned and the number of pages 347 * The address is aligned and the number of pages
349 * covers the full page. 348 * covers the full page.
@@ -573,7 +572,7 @@ repeat:
573 set_pte_atomic(kpte, new_pte); 572 set_pte_atomic(kpte, new_pte);
574 cpa->flushtlb = 1; 573 cpa->flushtlb = 1;
575 } 574 }
576 cpa->processed = 1; 575 cpa->numpages = 1;
577 return 0; 576 return 0;
578 } 577 }
579 578
@@ -584,7 +583,7 @@ repeat:
584 do_split = try_preserve_large_page(kpte, address, cpa); 583 do_split = try_preserve_large_page(kpte, address, cpa);
585 /* 584 /*
586 * When the range fits into the existing large page, 585 * When the range fits into the existing large page,
587 * return. cp->processed and cpa->tlbflush have been updated in 586 * return. cp->numpages and cpa->tlbflush have been updated in
588 * try_large_page: 587 * try_large_page:
589 */ 588 */
590 if (do_split <= 0) 589 if (do_split <= 0)
@@ -663,7 +662,7 @@ static int __change_page_attr_set_clr(struct cpa_data *cpa, int checkalias)
663 * Store the remaining nr of pages for the large page 662 * Store the remaining nr of pages for the large page
664 * preservation check. 663 * preservation check.
665 */ 664 */
666 cpa->numpages = cpa->processed = numpages; 665 cpa->numpages = numpages;
667 666
668 ret = __change_page_attr(cpa, checkalias); 667 ret = __change_page_attr(cpa, checkalias);
669 if (ret) 668 if (ret)
@@ -680,9 +679,9 @@ static int __change_page_attr_set_clr(struct cpa_data *cpa, int checkalias)
680 * CPA operation. Either a large page has been 679 * CPA operation. Either a large page has been
681 * preserved or a single page update happened. 680 * preserved or a single page update happened.
682 */ 681 */
683 BUG_ON(cpa->processed > numpages); 682 BUG_ON(cpa->numpages > numpages);
684 numpages -= cpa->processed; 683 numpages -= cpa->numpages;
685 cpa->vaddr += cpa->processed * PAGE_SIZE; 684 cpa->vaddr += cpa->numpages * PAGE_SIZE;
686 } 685 }
687 return 0; 686 return 0;
688} 687}