Merge branch 'merge' of master.kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc

* 'merge' of master.kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc:
[POWERPC] sys_move_pages should be callable from an SPU
[POWERPC] Wire up sys_epoll_pwait
[POWERPC] Allocate syscall number for sys_getcpu
[POWERPC] update cell_defconfig
[POWERPC] ps3: always make sure were running on a PS3
[POWERPC] Fix spu SLB invalidations
[POWERPC] avoid SPU_ACTIVATE_NOWAKE optimization
[POWERPC] spufs: fix possible memory corruption is spufs_mem_write

+263 -134
+130 -21
arch/powerpc/configs/cell_defconfig
··· 1 1 # 2 2 # Automatically generated make config: don't edit 3 - # Linux kernel version: 2.6.20-rc5 4 - # Mon Jan 22 22:12:56 2007 3 + # Linux kernel version: 2.6.21-rc3 4 + # Fri Mar 9 23:34:53 2007 5 5 # 6 6 CONFIG_PPC64=y 7 7 CONFIG_64BIT=y ··· 61 61 CONFIG_SWAP=y 62 62 CONFIG_SYSVIPC=y 63 63 # CONFIG_IPC_NS is not set 64 + CONFIG_SYSVIPC_SYSCTL=y 64 65 # CONFIG_POSIX_MQUEUE is not set 65 66 # CONFIG_BSD_PROCESS_ACCT is not set 66 67 # CONFIG_TASKSTATS is not set ··· 72 71 CONFIG_CPUSETS=y 73 72 CONFIG_SYSFS_DEPRECATED=y 74 73 # CONFIG_RELAY is not set 74 + CONFIG_BLK_DEV_INITRD=y 75 75 CONFIG_INITRAMFS_SOURCE="" 76 76 CONFIG_CC_OPTIMIZE_FOR_SIZE=y 77 77 CONFIG_SYSCTL=y ··· 135 133 # CONFIG_PPC_PSERIES is not set 136 134 # CONFIG_PPC_ISERIES is not set 137 135 # CONFIG_PPC_MPC52xx is not set 136 + # CONFIG_PPC_MPC5200 is not set 138 137 # CONFIG_PPC_PMAC is not set 139 138 # CONFIG_PPC_MAPLE is not set 140 139 # CONFIG_PPC_PASEMI is not set ··· 143 140 CONFIG_PPC_CELL_NATIVE=y 144 141 CONFIG_PPC_IBM_CELL_BLADE=y 145 142 CONFIG_PPC_PS3=y 143 + CONFIG_PPC_CELLEB=y 146 144 CONFIG_PPC_NATIVE=y 147 145 CONFIG_UDBG_RTAS_CONSOLE=y 146 + CONFIG_PPC_UDBG_BEAT=y 148 147 # CONFIG_U3_DART is not set 149 148 CONFIG_PPC_RTAS=y 150 149 # CONFIG_RTAS_ERROR_LOGGING is not set ··· 186 181 # 187 182 # PS3 Platform Options 188 183 # 184 + # CONFIG_PS3_ADVANCED is not set 189 185 CONFIG_PS3_HTAB_SIZE=20 190 186 # CONFIG_PS3_DYNAMIC_DMA is not set 191 187 CONFIG_PS3_USE_LPAR_ADDR=y 192 188 CONFIG_PS3_VUART=y 189 + CONFIG_PS3_PS3AV=y 190 + CONFIG_PS3_SYS_MANAGER=y 193 191 194 192 # 195 193 # Kernel options ··· 234 226 CONFIG_SPLIT_PTLOCK_CPUS=4 235 227 CONFIG_MIGRATION=y 236 228 CONFIG_RESOURCES_64BIT=y 229 + CONFIG_ZONE_DMA_FLAG=1 237 230 CONFIG_ARCH_MEMORY_PROBE=y 238 231 CONFIG_NODES_SPAN_OTHER_NODES=y 239 232 CONFIG_PPC_64K_PAGES=y ··· 248 239 # 249 240 # Bus options 250 241 # 242 + CONFIG_ZONE_DMA=y 251 243 CONFIG_GENERIC_ISA_DMA=y 252 244 # CONFIG_MPIC_WEIRD is not set 253 245 # CONFIG_PPC_I8259 is not set ··· 284 274 CONFIG_XFRM=y 285 275 # CONFIG_XFRM_USER is not set 286 276 # CONFIG_XFRM_SUB_POLICY is not set 277 + # CONFIG_XFRM_MIGRATE is not set 287 278 # CONFIG_NET_KEY is not set 288 279 CONFIG_INET=y 289 280 CONFIG_IP_MULTICAST=y ··· 351 340 CONFIG_NETFILTER_XT_TARGET_MARK=m 352 341 CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 353 342 CONFIG_NETFILTER_XT_TARGET_NFLOG=m 343 + CONFIG_NETFILTER_XT_TARGET_TCPMSS=m 354 344 CONFIG_NETFILTER_XT_MATCH_COMMENT=m 355 345 CONFIG_NETFILTER_XT_MATCH_DCCP=m 356 346 CONFIG_NETFILTER_XT_MATCH_DSCP=m ··· 388 376 CONFIG_IP_NF_TARGET_REJECT=m 389 377 CONFIG_IP_NF_TARGET_LOG=m 390 378 CONFIG_IP_NF_TARGET_ULOG=m 391 - CONFIG_IP_NF_TARGET_TCPMSS=m 392 379 CONFIG_IP_NF_MANGLE=m 393 380 CONFIG_IP_NF_TARGET_TOS=m 394 381 CONFIG_IP_NF_TARGET_ECN=m ··· 455 444 CONFIG_PREVENT_FIRMWARE_BUILD=y 456 445 CONFIG_FW_LOADER=y 457 446 # CONFIG_DEBUG_DRIVER is not set 447 + # CONFIG_DEBUG_DEVRES is not set 458 448 # CONFIG_SYS_HYPERVISOR is not set 459 449 460 450 # ··· 476 464 # 477 465 # Plug and Play support 478 466 # 467 + # CONFIG_PNPACPI is not set 479 468 480 469 # 481 470 # Block devices ··· 496 483 CONFIG_BLK_DEV_RAM_COUNT=16 497 484 CONFIG_BLK_DEV_RAM_SIZE=131072 498 485 CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 499 - CONFIG_BLK_DEV_INITRD=y 500 486 # CONFIG_CDROM_PKTCDVD is not set 501 487 # CONFIG_ATA_OVER_ETH is not set 502 488 ··· 549 537 # CONFIG_BLK_DEV_JMICRON is not set 550 538 # CONFIG_BLK_DEV_SC1200 is not set 551 539 # CONFIG_BLK_DEV_PIIX is not set 540 + # CONFIG_BLK_DEV_IT8213 is not set 552 541 # CONFIG_BLK_DEV_IT821X is not set 553 542 # CONFIG_BLK_DEV_NS87415 is not set 554 543 # CONFIG_BLK_DEV_PDC202XX_OLD is not set ··· 560 547 # CONFIG_BLK_DEV_SLC90E66 is not set 561 548 # CONFIG_BLK_DEV_TRM290 is not set 562 549 # CONFIG_BLK_DEV_VIA82CXXX is not set 550 + # CONFIG_BLK_DEV_TC86C001 is not set 551 + CONFIG_BLK_DEV_IDE_CELLEB=y 563 552 # CONFIG_IDE_ARM is not set 564 553 CONFIG_BLK_DEV_IDEDMA=y 565 554 # CONFIG_IDEDMA_IVB is not set ··· 572 557 # SCSI device support 573 558 # 574 559 # CONFIG_RAID_ATTRS is not set 575 - CONFIG_SCSI=m 560 + CONFIG_SCSI=y 576 561 # CONFIG_SCSI_TGT is not set 577 562 # CONFIG_SCSI_NETLINK is not set 578 563 CONFIG_SCSI_PROC_FS=y ··· 580 565 # 581 566 # SCSI support type (disk, tape, CD-ROM) 582 567 # 583 - CONFIG_BLK_DEV_SD=m 568 + CONFIG_BLK_DEV_SD=y 584 569 # CONFIG_CHR_DEV_ST is not set 585 570 # CONFIG_CHR_DEV_OSST is not set 586 571 CONFIG_BLK_DEV_SR=m 587 572 # CONFIG_BLK_DEV_SR_VENDOR is not set 588 - CONFIG_CHR_DEV_SG=m 573 + CONFIG_CHR_DEV_SG=y 589 574 # CONFIG_CHR_DEV_SCH is not set 590 575 591 576 # ··· 602 587 # CONFIG_SCSI_SPI_ATTRS is not set 603 588 # CONFIG_SCSI_FC_ATTRS is not set 604 589 # CONFIG_SCSI_ISCSI_ATTRS is not set 605 - # CONFIG_SCSI_SAS_ATTRS is not set 590 + CONFIG_SCSI_SAS_ATTRS=y 606 591 # CONFIG_SCSI_SAS_LIBSAS is not set 607 592 608 593 # ··· 632 617 # CONFIG_SCSI_INIA100 is not set 633 618 # CONFIG_SCSI_STEX is not set 634 619 # CONFIG_SCSI_SYM53C8XX_2 is not set 620 + # CONFIG_SCSI_IPR is not set 635 621 # CONFIG_SCSI_QLOGIC_1280 is not set 636 622 # CONFIG_SCSI_QLA_FC is not set 637 623 # CONFIG_SCSI_QLA_ISCSI is not set ··· 645 629 # 646 630 # Serial ATA (prod) and Parallel ATA (experimental) drivers 647 631 # 648 - # CONFIG_ATA is not set 632 + CONFIG_ATA=y 633 + # CONFIG_ATA_NONSTANDARD is not set 634 + # CONFIG_SATA_AHCI is not set 635 + # CONFIG_SATA_SVW is not set 636 + # CONFIG_ATA_PIIX is not set 637 + # CONFIG_SATA_MV is not set 638 + # CONFIG_SATA_NV is not set 639 + # CONFIG_PDC_ADMA is not set 640 + # CONFIG_SATA_QSTOR is not set 641 + CONFIG_SATA_PROMISE=y 642 + # CONFIG_SATA_SX4 is not set 643 + # CONFIG_SATA_SIL is not set 644 + # CONFIG_SATA_SIL24 is not set 645 + # CONFIG_SATA_SIS is not set 646 + # CONFIG_SATA_ULI is not set 647 + # CONFIG_SATA_VIA is not set 648 + # CONFIG_SATA_VITESSE is not set 649 + # CONFIG_SATA_INIC162X is not set 650 + # CONFIG_PATA_ALI is not set 651 + # CONFIG_PATA_AMD is not set 652 + # CONFIG_PATA_ARTOP is not set 653 + # CONFIG_PATA_ATIIXP is not set 654 + # CONFIG_PATA_CMD64X is not set 655 + # CONFIG_PATA_CS5520 is not set 656 + # CONFIG_PATA_CS5530 is not set 657 + # CONFIG_PATA_CYPRESS is not set 658 + # CONFIG_PATA_EFAR is not set 659 + # CONFIG_ATA_GENERIC is not set 660 + # CONFIG_PATA_HPT366 is not set 661 + # CONFIG_PATA_HPT37X is not set 662 + # CONFIG_PATA_HPT3X2N is not set 663 + # CONFIG_PATA_HPT3X3 is not set 664 + # CONFIG_PATA_IT821X is not set 665 + # CONFIG_PATA_IT8213 is not set 666 + # CONFIG_PATA_JMICRON is not set 667 + # CONFIG_PATA_TRIFLEX is not set 668 + # CONFIG_PATA_MARVELL is not set 669 + # CONFIG_PATA_MPIIX is not set 670 + # CONFIG_PATA_OLDPIIX is not set 671 + # CONFIG_PATA_NETCELL is not set 672 + # CONFIG_PATA_NS87410 is not set 673 + # CONFIG_PATA_OPTI is not set 674 + # CONFIG_PATA_OPTIDMA is not set 675 + # CONFIG_PATA_PDC_OLD is not set 676 + # CONFIG_PATA_RADISYS is not set 677 + # CONFIG_PATA_RZ1000 is not set 678 + # CONFIG_PATA_SC1200 is not set 679 + # CONFIG_PATA_SERVERWORKS is not set 680 + CONFIG_PATA_PDC2027X=m 681 + # CONFIG_PATA_SIL680 is not set 682 + # CONFIG_PATA_SIS is not set 683 + # CONFIG_PATA_VIA is not set 684 + # CONFIG_PATA_WINBOND is not set 685 + # CONFIG_PATA_SCC is not set 649 686 650 687 # 651 688 # Multi-device support (RAID and LVM) ··· 724 655 # 725 656 # Fusion MPT device support 726 657 # 727 - # CONFIG_FUSION is not set 658 + CONFIG_FUSION=y 728 659 # CONFIG_FUSION_SPI is not set 729 660 # CONFIG_FUSION_FC is not set 730 - # CONFIG_FUSION_SAS is not set 661 + CONFIG_FUSION_SAS=y 662 + CONFIG_FUSION_MAX_SGE=128 663 + # CONFIG_FUSION_CTL is not set 731 664 732 665 # 733 666 # IEEE 1394 (FireWire) support ··· 803 732 # CONFIG_BNX2 is not set 804 733 CONFIG_SPIDER_NET=y 805 734 # CONFIG_QLA3XXX is not set 735 + # CONFIG_ATL1 is not set 806 736 807 737 # 808 738 # Ethernet (10000 Mbit) 809 739 # 810 740 # CONFIG_CHELSIO_T1 is not set 741 + # CONFIG_CHELSIO_T3 is not set 811 742 # CONFIG_IXGB is not set 812 743 # CONFIG_S2IO is not set 813 744 # CONFIG_MYRI10GE is not set 814 745 # CONFIG_NETXEN_NIC is not set 746 + # CONFIG_PASEMI_MAC is not set 815 747 816 748 # 817 749 # Token Ring devices ··· 927 853 # 928 854 CONFIG_SERIAL_CORE=y 929 855 CONFIG_SERIAL_CORE_CONSOLE=y 856 + CONFIG_SERIAL_TXX9=y 857 + CONFIG_HAS_TXX9_SERIAL=y 858 + CONFIG_SERIAL_TXX9_NR_UARTS=2 859 + CONFIG_SERIAL_TXX9_CONSOLE=y 930 860 # CONFIG_SERIAL_JSM is not set 861 + CONFIG_SERIAL_OF_PLATFORM=y 931 862 CONFIG_UNIX98_PTYS=y 932 863 # CONFIG_LEGACY_PTYS is not set 933 864 CONFIG_HVC_DRIVER=y 934 865 CONFIG_HVC_RTAS=y 866 + # CONFIG_HVC_BEAT is not set 935 867 936 868 # 937 869 # IPMI 938 870 # 939 - # CONFIG_IPMI_HANDLER is not set 871 + CONFIG_IPMI_HANDLER=m 872 + # CONFIG_IPMI_PANIC_EVENT is not set 873 + CONFIG_IPMI_DEVICE_INTERFACE=m 874 + CONFIG_IPMI_SI=m 875 + CONFIG_IPMI_WATCHDOG=m 876 + CONFIG_IPMI_POWEROFF=m 940 877 941 878 # 942 879 # Watchdog Cards ··· 959 874 # Watchdog Device Drivers 960 875 # 961 876 # CONFIG_SOFT_WATCHDOG is not set 962 - CONFIG_WATCHDOG_RTAS=y 877 + # CONFIG_WATCHDOG_RTAS is not set 963 878 964 879 # 965 880 # PCI-based Watchdog Cards ··· 1014 929 # CONFIG_I2C_NFORCE2 is not set 1015 930 # CONFIG_I2C_OCORES is not set 1016 931 # CONFIG_I2C_PARPORT_LIGHT is not set 932 + # CONFIG_I2C_PASEMI is not set 1017 933 # CONFIG_I2C_PROSAVAGE is not set 1018 934 # CONFIG_I2C_SAVAGE4 is not set 1019 935 # CONFIG_I2C_SIS5595 is not set ··· 1059 973 # CONFIG_HWMON_VID is not set 1060 974 1061 975 # 976 + # Multifunction device drivers 977 + # 978 + # CONFIG_MFD_SM501 is not set 979 + 980 + # 1062 981 # Multimedia devices 1063 982 # 1064 983 # CONFIG_VIDEO_DEV is not set ··· 1077 986 # 1078 987 # Graphics support 1079 988 # 1080 - CONFIG_FIRMWARE_EDID=y 989 + # CONFIG_BACKLIGHT_LCD_SUPPORT is not set 1081 990 # CONFIG_FB is not set 1082 991 # CONFIG_FB_IBM_GXT4500 is not set 1083 992 ··· 1086 995 # 1087 996 # CONFIG_VGA_CONSOLE is not set 1088 997 CONFIG_DUMMY_CONSOLE=y 1089 - # CONFIG_BACKLIGHT_LCD_SUPPORT is not set 1090 998 1091 999 # 1092 1000 # Sound ··· 1096 1006 # HID Devices 1097 1007 # 1098 1008 CONFIG_HID=m 1009 + # CONFIG_HID_DEBUG is not set 1099 1010 1100 1011 # 1101 1012 # USB support ··· 1111 1020 # Miscellaneous USB options 1112 1021 # 1113 1022 CONFIG_USB_DEVICEFS=y 1114 - # CONFIG_USB_BANDWIDTH is not set 1115 1023 # CONFIG_USB_DYNAMIC_MINORS is not set 1116 - # CONFIG_USB_MULTITHREAD_PROBE is not set 1117 1024 # CONFIG_USB_OTG is not set 1118 1025 1119 1026 # ··· 1121 1032 # CONFIG_USB_EHCI_SPLIT_ISO is not set 1122 1033 # CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1123 1034 # CONFIG_USB_EHCI_TT_NEWSCHED is not set 1035 + CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y 1124 1036 # CONFIG_USB_ISP116X_HCD is not set 1125 1037 CONFIG_USB_OHCI_HCD=m 1126 - # CONFIG_USB_OHCI_BIG_ENDIAN is not set 1038 + CONFIG_USB_OHCI_HCD_PPC_OF=y 1039 + CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1040 + # CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set 1041 + CONFIG_USB_OHCI_HCD_PCI=y 1042 + CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y 1043 + CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y 1127 1044 CONFIG_USB_OHCI_LITTLE_ENDIAN=y 1128 1045 # CONFIG_USB_UHCI_HCD is not set 1129 1046 # CONFIG_USB_SL811_HCD is not set ··· 1183 1088 # CONFIG_USB_ATI_REMOTE2 is not set 1184 1089 # CONFIG_USB_KEYSPAN_REMOTE is not set 1185 1090 # CONFIG_USB_APPLETOUCH is not set 1091 + # CONFIG_USB_GTCO is not set 1186 1092 1187 1093 # 1188 1094 # USB Imaging devices ··· 1221 1125 # CONFIG_USB_RIO500 is not set 1222 1126 # CONFIG_USB_LEGOTOWER is not set 1223 1127 # CONFIG_USB_LCD is not set 1128 + # CONFIG_USB_BERRY_CHARGE is not set 1224 1129 # CONFIG_USB_LED is not set 1225 1130 # CONFIG_USB_CYPRESS_CY7C63 is not set 1226 1131 # CONFIG_USB_CYTHERM is not set ··· 1232 1135 # CONFIG_USB_SISUSBVGA is not set 1233 1136 # CONFIG_USB_LD is not set 1234 1137 # CONFIG_USB_TRANCEVIBRATOR is not set 1138 + # CONFIG_USB_IOWARRIOR is not set 1235 1139 # CONFIG_USB_TEST is not set 1236 1140 1237 1141 # ··· 1273 1175 CONFIG_INFINIBAND_MTHCA_DEBUG=y 1274 1176 # CONFIG_INFINIBAND_AMSO1100 is not set 1275 1177 CONFIG_INFINIBAND_IPOIB=m 1178 + # CONFIG_INFINIBAND_IPOIB_CM is not set 1276 1179 CONFIG_INFINIBAND_IPOIB_DEBUG=y 1277 1180 CONFIG_INFINIBAND_IPOIB_DEBUG_DATA=y 1278 1181 # CONFIG_INFINIBAND_SRP is not set ··· 1299 1200 1300 1201 # 1301 1202 # DMA Devices 1203 + # 1204 + 1205 + # 1206 + # Auxiliary Display support 1302 1207 # 1303 1208 1304 1209 # ··· 1498 1395 CONFIG_TEXTSEARCH_BM=m 1499 1396 CONFIG_TEXTSEARCH_FSM=m 1500 1397 CONFIG_PLIST=y 1501 - CONFIG_IOMAP_COPY=y 1398 + CONFIG_HAS_IOMEM=y 1399 + CONFIG_HAS_IOPORT=y 1502 1400 1503 1401 # 1504 1402 # Instrumentation Support ··· 1518 1414 CONFIG_DEBUG_FS=y 1519 1415 # CONFIG_HEADERS_CHECK is not set 1520 1416 CONFIG_DEBUG_KERNEL=y 1417 + # CONFIG_DEBUG_SHIRQ is not set 1521 1418 CONFIG_LOG_BUF_SHIFT=15 1522 - CONFIG_DETECT_SOFTLOCKUP=y 1419 + # CONFIG_DETECT_SOFTLOCKUP is not set 1523 1420 # CONFIG_SCHEDSTATS is not set 1421 + # CONFIG_TIMER_STATS is not set 1524 1422 # CONFIG_DEBUG_SLAB is not set 1525 1423 # CONFIG_DEBUG_RT_MUTEXES is not set 1526 1424 # CONFIG_RT_MUTEX_TESTER is not set 1527 1425 # CONFIG_DEBUG_SPINLOCK is not set 1528 1426 CONFIG_DEBUG_MUTEXES=y 1529 - # CONFIG_DEBUG_RWSEMS is not set 1530 1427 CONFIG_DEBUG_SPINLOCK_SLEEP=y 1531 1428 # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1532 1429 # CONFIG_DEBUG_KOBJECT is not set ··· 1537 1432 # CONFIG_DEBUG_LIST is not set 1538 1433 # CONFIG_FORCED_INLINING is not set 1539 1434 # CONFIG_RCU_TORTURE_TEST is not set 1435 + # CONFIG_FAULT_INJECTION is not set 1540 1436 # CONFIG_DEBUG_STACKOVERFLOW is not set 1541 1437 # CONFIG_DEBUG_STACK_USAGE is not set 1542 1438 CONFIG_DEBUGGER=y ··· 1575 1469 # CONFIG_CRYPTO_GF128MUL is not set 1576 1470 CONFIG_CRYPTO_ECB=m 1577 1471 CONFIG_CRYPTO_CBC=m 1472 + CONFIG_CRYPTO_PCBC=m 1578 1473 # CONFIG_CRYPTO_LRW is not set 1579 1474 CONFIG_CRYPTO_DES=m 1475 + # CONFIG_CRYPTO_FCRYPT is not set 1580 1476 # CONFIG_CRYPTO_BLOWFISH is not set 1581 1477 # CONFIG_CRYPTO_TWOFISH is not set 1582 1478 # CONFIG_CRYPTO_SERPENT is not set ··· 1592 1484 CONFIG_CRYPTO_DEFLATE=m 1593 1485 # CONFIG_CRYPTO_MICHAEL_MIC is not set 1594 1486 # CONFIG_CRYPTO_CRC32C is not set 1487 + # CONFIG_CRYPTO_CAMELLIA is not set 1595 1488 # CONFIG_CRYPTO_TEST is not set 1596 1489 1597 1490 #
+6
arch/powerpc/mm/hash_utils_64.c
··· 685 685 "non-cacheable mapping\n"); 686 686 psize = mmu_vmalloc_psize = MMU_PAGE_4K; 687 687 } 688 + #ifdef CONFIG_SPE_BASE 689 + spu_flush_all_slbs(mm); 690 + #endif 688 691 } 689 692 if (user_region) { 690 693 if (psize != get_paca()->context.user_psize) { ··· 762 759 mmu_psize_defs[MMU_PAGE_4K].sllp; 763 760 get_paca()->context = mm->context; 764 761 slb_flush_and_rebolt(); 762 + #ifdef CONFIG_SPE_BASE 763 + spu_flush_all_slbs(mm); 764 + #endif 765 765 } 766 766 } 767 767 if (mm->context.user_psize == MMU_PAGE_64K)
+4
arch/powerpc/mm/hugetlbpage.c
··· 24 24 #include <asm/machdep.h> 25 25 #include <asm/cputable.h> 26 26 #include <asm/tlb.h> 27 + #include <asm/spu.h> 27 28 28 29 #include <linux/sysctl.h> 29 30 ··· 514 513 if ((addr + len) > 0x100000000UL) 515 514 err = open_high_hpage_areas(current->mm, 516 515 HTLB_AREA_MASK(addr, len)); 516 + #ifdef CONFIG_SPE_BASE 517 + spu_flush_all_slbs(current->mm); 518 + #endif 517 519 if (err) { 518 520 printk(KERN_DEBUG "prepare_hugepage_range(%lx, %lx)" 519 521 " failed (lowmask: 0x%04hx, highmask: 0x%04hx)\n",
+69 -12
arch/powerpc/platforms/cell/spu_base.c
··· 38 38 const struct spu_management_ops *spu_management_ops; 39 39 const struct spu_priv1_ops *spu_priv1_ops; 40 40 41 + static struct list_head spu_list[MAX_NUMNODES]; 42 + static LIST_HEAD(spu_full_list); 43 + static DEFINE_MUTEX(spu_mutex); 44 + static spinlock_t spu_list_lock = SPIN_LOCK_UNLOCKED; 45 + 41 46 EXPORT_SYMBOL_GPL(spu_priv1_ops); 47 + 48 + void spu_invalidate_slbs(struct spu *spu) 49 + { 50 + struct spu_priv2 __iomem *priv2 = spu->priv2; 51 + 52 + if (spu_mfc_sr1_get(spu) & MFC_STATE1_RELOCATE_MASK) 53 + out_be64(&priv2->slb_invalidate_all_W, 0UL); 54 + } 55 + EXPORT_SYMBOL_GPL(spu_invalidate_slbs); 56 + 57 + /* This is called by the MM core when a segment size is changed, to 58 + * request a flush of all the SPEs using a given mm 59 + */ 60 + void spu_flush_all_slbs(struct mm_struct *mm) 61 + { 62 + struct spu *spu; 63 + unsigned long flags; 64 + 65 + spin_lock_irqsave(&spu_list_lock, flags); 66 + list_for_each_entry(spu, &spu_full_list, full_list) { 67 + if (spu->mm == mm) 68 + spu_invalidate_slbs(spu); 69 + } 70 + spin_unlock_irqrestore(&spu_list_lock, flags); 71 + } 72 + 73 + /* The hack below stinks... try to do something better one of 74 + * these days... Does it even work properly with NR_CPUS == 1 ? 75 + */ 76 + static inline void mm_needs_global_tlbie(struct mm_struct *mm) 77 + { 78 + int nr = (NR_CPUS > 1) ? NR_CPUS : NR_CPUS + 1; 79 + 80 + /* Global TLBIE broadcast required with SPEs. */ 81 + __cpus_setall(&mm->cpu_vm_mask, nr); 82 + } 83 + 84 + void spu_associate_mm(struct spu *spu, struct mm_struct *mm) 85 + { 86 + unsigned long flags; 87 + 88 + spin_lock_irqsave(&spu_list_lock, flags); 89 + spu->mm = mm; 90 + spin_unlock_irqrestore(&spu_list_lock, flags); 91 + if (mm) 92 + mm_needs_global_tlbie(mm); 93 + } 94 + EXPORT_SYMBOL_GPL(spu_associate_mm); 42 95 43 96 static int __spu_trap_invalid_dma(struct spu *spu) 44 97 { ··· 127 74 struct spu_priv2 __iomem *priv2 = spu->priv2; 128 75 struct mm_struct *mm = spu->mm; 129 76 u64 esid, vsid, llp; 77 + int psize; 130 78 131 79 pr_debug("%s\n", __FUNCTION__); 132 80 ··· 144 90 case USER_REGION_ID: 145 91 #ifdef CONFIG_HUGETLB_PAGE 146 92 if (in_hugepage_area(mm->context, ea)) 147 - llp = mmu_psize_defs[mmu_huge_psize].sllp; 93 + psize = mmu_huge_psize; 148 94 else 149 95 #endif 150 - llp = mmu_psize_defs[mmu_virtual_psize].sllp; 96 + psize = mm->context.user_psize; 151 97 vsid = (get_vsid(mm->context.id, ea) << SLB_VSID_SHIFT) | 152 - SLB_VSID_USER | llp; 98 + SLB_VSID_USER; 153 99 break; 154 100 case VMALLOC_REGION_ID: 155 - llp = mmu_psize_defs[mmu_virtual_psize].sllp; 101 + if (ea < VMALLOC_END) 102 + psize = mmu_vmalloc_psize; 103 + else 104 + psize = mmu_io_psize; 156 105 vsid = (get_kernel_vsid(ea) << SLB_VSID_SHIFT) | 157 - SLB_VSID_KERNEL | llp; 106 + SLB_VSID_KERNEL; 158 107 break; 159 108 case KERNEL_REGION_ID: 160 - llp = mmu_psize_defs[mmu_linear_psize].sllp; 109 + psize = mmu_linear_psize; 161 110 vsid = (get_kernel_vsid(ea) << SLB_VSID_SHIFT) | 162 - SLB_VSID_KERNEL | llp; 111 + SLB_VSID_KERNEL; 163 112 break; 164 113 default: 165 114 /* Future: support kernel segments so that drivers ··· 171 114 pr_debug("invalid region access at %016lx\n", ea); 172 115 return 1; 173 116 } 117 + llp = mmu_psize_defs[psize].sllp; 174 118 175 119 out_be64(&priv2->slb_index_W, spu->slb_replace); 176 - out_be64(&priv2->slb_vsid_RW, vsid); 120 + out_be64(&priv2->slb_vsid_RW, vsid | llp); 177 121 out_be64(&priv2->slb_esid_RW, esid); 178 122 179 123 spu->slb_replace++; ··· 387 329 if (spu->irqs[2] != NO_IRQ) 388 330 free_irq(spu->irqs[2], spu); 389 331 } 390 - 391 - static struct list_head spu_list[MAX_NUMNODES]; 392 - static LIST_HEAD(spu_full_list); 393 - static DEFINE_MUTEX(spu_mutex); 394 332 395 333 static void spu_init_channels(struct spu *spu) 396 334 { ··· 647 593 struct spu *spu; 648 594 int ret; 649 595 static int number; 596 + unsigned long flags; 650 597 651 598 ret = -ENOMEM; 652 599 spu = kzalloc(sizeof (*spu), GFP_KERNEL); ··· 675 620 goto out_free_irqs; 676 621 677 622 mutex_lock(&spu_mutex); 623 + spin_lock_irqsave(&spu_list_lock, flags); 678 624 list_add(&spu->list, &spu_list[spu->node]); 679 625 list_add(&spu->full_list, &spu_full_list); 626 + spin_unlock_irqrestore(&spu_list_lock, flags); 680 627 mutex_unlock(&spu_mutex); 681 628 682 629 goto out;
+14 -10
arch/powerpc/platforms/cell/spufs/file.c
··· 63 63 spufs_mem_read(struct file *file, char __user *buffer, 64 64 size_t size, loff_t *pos) 65 65 { 66 - int ret; 67 66 struct spu_context *ctx = file->private_data; 67 + ssize_t ret; 68 68 69 69 spu_acquire(ctx); 70 70 ret = __spufs_mem_read(ctx, buffer, size, pos); ··· 74 74 75 75 static ssize_t 76 76 spufs_mem_write(struct file *file, const char __user *buffer, 77 - size_t size, loff_t *pos) 77 + size_t size, loff_t *ppos) 78 78 { 79 79 struct spu_context *ctx = file->private_data; 80 80 char *local_store; 81 + loff_t pos = *ppos; 81 82 int ret; 82 83 83 - size = min_t(ssize_t, LS_SIZE - *pos, size); 84 - if (size <= 0) 84 + if (pos < 0) 85 + return -EINVAL; 86 + if (pos > LS_SIZE) 85 87 return -EFBIG; 86 - *pos += size; 88 + if (size > LS_SIZE - pos) 89 + size = LS_SIZE - pos; 87 90 88 91 spu_acquire(ctx); 89 - 90 92 local_store = ctx->ops->get_ls(ctx); 91 - ret = copy_from_user(local_store + *pos - size, 92 - buffer, size) ? -EFAULT : size; 93 - 93 + ret = copy_from_user(local_store + pos, buffer, size); 94 94 spu_release(ctx); 95 - return ret; 95 + 96 + if (ret) 97 + return -EFAULT; 98 + *ppos = pos + size; 99 + return size; 96 100 } 97 101 98 102 static unsigned long spufs_mem_mmap_nopfn(struct vm_area_struct *vma,
+2 -2
arch/powerpc/platforms/cell/spufs/run.c
··· 143 143 int ret; 144 144 unsigned long runcntl = SPU_RUNCNTL_RUNNABLE; 145 145 146 - ret = spu_acquire_runnable(ctx, SPU_ACTIVATE_NOWAKE); 146 + ret = spu_acquire_runnable(ctx, 0); 147 147 if (ret) 148 148 return ret; 149 149 ··· 155 155 spu_release(ctx); 156 156 ret = spu_setup_isolated(ctx); 157 157 if (!ret) 158 - ret = spu_acquire_runnable(ctx, SPU_ACTIVATE_NOWAKE); 158 + ret = spu_acquire_runnable(ctx, 0); 159 159 } 160 160 161 161 /* if userspace has set the runcntrl register (eg, to issue an
+4 -16
arch/powerpc/platforms/cell/spufs/sched.c
··· 127 127 mutex_unlock(&spu_prio->active_mutex[node]); 128 128 } 129 129 130 - static inline void mm_needs_global_tlbie(struct mm_struct *mm) 131 - { 132 - int nr = (NR_CPUS > 1) ? NR_CPUS : NR_CPUS + 1; 133 - 134 - /* Global TLBIE broadcast required with SPEs. */ 135 - __cpus_setall(&mm->cpu_vm_mask, nr); 136 - } 137 - 138 130 static BLOCKING_NOTIFIER_HEAD(spu_switch_notifier); 139 131 140 132 static void spu_switch_notify(struct spu *spu, struct spu_context *ctx) ··· 159 167 ctx->spu = spu; 160 168 ctx->ops = &spu_hw_ops; 161 169 spu->pid = current->pid; 162 - spu->mm = ctx->owner; 163 - mm_needs_global_tlbie(spu->mm); 170 + spu_associate_mm(spu, ctx->owner); 164 171 spu->ibox_callback = spufs_ibox_callback; 165 172 spu->wbox_callback = spufs_wbox_callback; 166 173 spu->stop_callback = spufs_stop_callback; ··· 196 205 spu->stop_callback = NULL; 197 206 spu->mfc_callback = NULL; 198 207 spu->dma_callback = NULL; 199 - spu->mm = NULL; 208 + spu_associate_mm(spu, NULL); 200 209 spu->pid = 0; 201 210 ctx->ops = &spu_backing_ops; 202 211 ctx->spu = NULL; ··· 254 263 { 255 264 DEFINE_WAIT(wait); 256 265 257 - set_bit(SPU_SCHED_WAKE, &ctx->sched_flags); 258 266 prepare_to_wait_exclusive(&ctx->stop_wq, &wait, TASK_INTERRUPTIBLE); 259 267 if (!signal_pending(current)) { 260 268 mutex_unlock(&ctx->state_mutex); ··· 262 272 } 263 273 __set_current_state(TASK_RUNNING); 264 274 remove_wait_queue(&ctx->stop_wq, &wait); 265 - clear_bit(SPU_SCHED_WAKE, &ctx->sched_flags); 266 275 } 267 276 268 277 /** ··· 281 292 best = sched_find_first_bit(spu_prio->bitmap); 282 293 if (best < MAX_PRIO) { 283 294 struct spu_context *ctx = spu_grab_context(best); 284 - if (ctx && test_bit(SPU_SCHED_WAKE, &ctx->sched_flags)) 295 + if (ctx) 285 296 wake_up(&ctx->stop_wq); 286 297 } 287 298 spin_unlock(&spu_prio->runq_lock); ··· 403 414 } 404 415 405 416 spu_add_to_rq(ctx); 406 - if (!(flags & SPU_ACTIVATE_NOWAKE)) 407 - spu_prio_wait(ctx); 417 + spu_prio_wait(ctx); 408 418 spu_del_from_rq(ctx); 409 419 } while (!signal_pending(current)); 410 420
+2 -4
arch/powerpc/platforms/cell/spufs/spufs.h
··· 41 41 42 42 /* ctx->sched_flags */ 43 43 enum { 44 - SPU_SCHED_WAKE = 0, 44 + SPU_SCHED_WAKE = 0, /* currently unused */ 45 45 }; 46 46 47 47 struct spu_context { ··· 191 191 int spu_acquire_runnable(struct spu_context *ctx, unsigned long flags); 192 192 void spu_acquire_saved(struct spu_context *ctx); 193 193 int spu_acquire_exclusive(struct spu_context *ctx); 194 - enum { 195 - SPU_ACTIVATE_NOWAKE = 1, 196 - }; 194 + 197 195 int spu_activate(struct spu_context *ctx, unsigned long flags); 198 196 void spu_deactivate(struct spu_context *ctx); 199 197 void spu_yield(struct spu_context *ctx);
+3 -59
arch/powerpc/platforms/cell/spufs/switch.c
··· 468 468 MFC_CNTL_PURGE_DMA_COMPLETE); 469 469 } 470 470 471 - static inline void save_mfc_slbs(struct spu_state *csa, struct spu *spu) 472 - { 473 - struct spu_priv2 __iomem *priv2 = spu->priv2; 474 - int i; 475 - 476 - /* Save, Step 29: 477 - * If MFC_SR1[R]='1', save SLBs in CSA. 478 - */ 479 - if (spu_mfc_sr1_get(spu) & MFC_STATE1_RELOCATE_MASK) { 480 - csa->priv2.slb_index_W = in_be64(&priv2->slb_index_W); 481 - for (i = 0; i < 8; i++) { 482 - out_be64(&priv2->slb_index_W, i); 483 - eieio(); 484 - csa->slb_esid_RW[i] = in_be64(&priv2->slb_esid_RW); 485 - csa->slb_vsid_RW[i] = in_be64(&priv2->slb_vsid_RW); 486 - eieio(); 487 - } 488 - } 489 - } 490 - 491 471 static inline void setup_mfc_sr1(struct spu_state *csa, struct spu *spu) 492 472 { 493 473 /* Save, Step 30: ··· 688 708 out_be64(&priv2->mfc_control_RW, MFC_CNTL_RESUME_DMA_QUEUE); 689 709 } 690 710 691 - static inline void invalidate_slbs(struct spu_state *csa, struct spu *spu) 692 - { 693 - struct spu_priv2 __iomem *priv2 = spu->priv2; 694 - 695 - /* Save, Step 45: 696 - * Restore, Step 19: 697 - * If MFC_SR1[R]=1, write 0 to SLB_Invalidate_All. 698 - */ 699 - if (spu_mfc_sr1_get(spu) & MFC_STATE1_RELOCATE_MASK) { 700 - out_be64(&priv2->slb_invalidate_all_W, 0UL); 701 - eieio(); 702 - } 703 - } 704 - 705 711 static inline void get_kernel_slb(u64 ea, u64 slb[2]) 706 712 { 707 713 u64 llp; ··· 731 765 * MFC_SR1[R]=1 (in other words, assume that 732 766 * translation is desired by OS environment). 733 767 */ 734 - invalidate_slbs(csa, spu); 768 + spu_invalidate_slbs(spu); 735 769 get_kernel_slb((unsigned long)&spu_save_code[0], code_slb); 736 770 get_kernel_slb((unsigned long)csa->lscsa, lscsa_slb); 737 771 load_mfc_slb(spu, code_slb, 0); ··· 1684 1718 } 1685 1719 } 1686 1720 1687 - static inline void restore_mfc_slbs(struct spu_state *csa, struct spu *spu) 1688 - { 1689 - struct spu_priv2 __iomem *priv2 = spu->priv2; 1690 - int i; 1691 - 1692 - /* Restore, Step 68: 1693 - * If MFC_SR1[R]='1', restore SLBs from CSA. 1694 - */ 1695 - if (csa->priv1.mfc_sr1_RW & MFC_STATE1_RELOCATE_MASK) { 1696 - for (i = 0; i < 8; i++) { 1697 - out_be64(&priv2->slb_index_W, i); 1698 - eieio(); 1699 - out_be64(&priv2->slb_esid_RW, csa->slb_esid_RW[i]); 1700 - out_be64(&priv2->slb_vsid_RW, csa->slb_vsid_RW[i]); 1701 - eieio(); 1702 - } 1703 - out_be64(&priv2->slb_index_W, csa->priv2.slb_index_W); 1704 - eieio(); 1705 - } 1706 - } 1707 - 1708 1721 static inline void restore_mfc_sr1(struct spu_state *csa, struct spu *spu) 1709 1722 { 1710 1723 /* Restore, Step 69: ··· 1820 1875 set_mfc_tclass_id(prev, spu); /* Step 26. */ 1821 1876 purge_mfc_queue(prev, spu); /* Step 27. */ 1822 1877 wait_purge_complete(prev, spu); /* Step 28. */ 1823 - save_mfc_slbs(prev, spu); /* Step 29. */ 1824 1878 setup_mfc_sr1(prev, spu); /* Step 30. */ 1825 1879 save_spu_npc(prev, spu); /* Step 31. */ 1826 1880 save_spu_privcntl(prev, spu); /* Step 32. */ ··· 1931 1987 reset_spu_privcntl(prev, spu); /* Step 16. */ 1932 1988 reset_spu_lslr(prev, spu); /* Step 17. */ 1933 1989 setup_mfc_sr1(prev, spu); /* Step 18. */ 1934 - invalidate_slbs(prev, spu); /* Step 19. */ 1990 + spu_invalidate_slbs(spu); /* Step 19. */ 1935 1991 reset_ch_part1(prev, spu); /* Step 20. */ 1936 1992 reset_ch_part2(prev, spu); /* Step 21. */ 1937 1993 enable_interrupts(prev, spu); /* Step 22. */ ··· 1999 2055 restore_spu_mb(next, spu); /* Step 65. */ 2000 2056 check_ppu_mb_stat(next, spu); /* Step 66. */ 2001 2057 check_ppuint_mb_stat(next, spu); /* Step 67. */ 2002 - restore_mfc_slbs(next, spu); /* Step 68. */ 2058 + spu_invalidate_slbs(spu); /* Modified Step 68. */ 2003 2059 restore_mfc_sr1(next, spu); /* Step 69. */ 2004 2060 restore_other_spu_access(next, spu); /* Step 70. */ 2005 2061 restore_spu_runcntl(next, spu); /* Step 71. */
+1 -1
arch/powerpc/platforms/ps3/mm.c
··· 294 294 unsigned long nr_pages; 295 295 296 296 if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) 297 - return 0; 297 + return -ENODEV; 298 298 299 299 BUG_ON(!mem_init_done); 300 300
+1 -1
arch/powerpc/platforms/ps3/system-bus.c
··· 172 172 int result; 173 173 174 174 if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) 175 - return 0; 175 + return -ENODEV; 176 176 177 177 result = bus_register(&ps3_system_bus_type); 178 178 BUG_ON(result);
+8 -1
drivers/ps3/ps3av.c
··· 24 24 #include <linux/reboot.h> 25 25 #include <linux/kernel.h> 26 26 #include <linux/ioctl.h> 27 + 28 + #include <asm/firmware.h> 27 29 #include <asm/lv1call.h> 28 30 #include <asm/ps3av.h> 29 31 #include <asm/ps3.h> ··· 949 947 950 948 static int ps3av_module_init(void) 951 949 { 952 - int error = ps3_vuart_port_driver_register(&ps3av_driver); 950 + int error; 951 + 952 + if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) 953 + return -ENODEV; 954 + 955 + error = ps3_vuart_port_driver_register(&ps3av_driver); 953 956 if (error) { 954 957 printk(KERN_ERR 955 958 "%s: ps3_vuart_port_driver_register failed %d\n",
+6
drivers/ps3/sys-manager.c
··· 22 22 #include <linux/module.h> 23 23 #include <linux/workqueue.h> 24 24 #include <linux/reboot.h> 25 + 26 + #include <asm/firmware.h> 25 27 #include <asm/ps3.h> 28 + 26 29 #include "vuart.h" 27 30 28 31 MODULE_AUTHOR("Sony Corporation"); ··· 601 598 602 599 static int __init ps3_sys_manager_init(void) 603 600 { 601 + if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) 602 + return -ENODEV; 603 + 604 604 return ps3_vuart_port_driver_register(&ps3_sys_manager); 605 605 } 606 606
+1 -1
drivers/ps3/vuart.c
··· 1031 1031 pr_debug("%s:%d:\n", __func__, __LINE__); 1032 1032 1033 1033 if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) 1034 - return 0; 1034 + return -ENODEV; 1035 1035 1036 1036 init_MUTEX(&vuart_bus_priv.probe_mutex); 1037 1037 result = bus_register(&ps3_vuart_bus);
+7
include/asm-powerpc/spu.h
··· 165 165 int spu_irq_class_1_bottom(struct spu *spu); 166 166 void spu_irq_setaffinity(struct spu *spu, int cpu); 167 167 168 + extern void spu_invalidate_slbs(struct spu *spu); 169 + extern void spu_associate_mm(struct spu *spu, struct mm_struct *mm); 170 + 171 + /* Calls from the memory management to the SPU */ 172 + struct mm_struct; 173 + extern void spu_flush_all_slbs(struct mm_struct *mm); 174 + 168 175 /* system callbacks from the SPU */ 169 176 struct spu_syscall_block { 170 177 u64 nr_ret;
-4
include/asm-powerpc/spu_csa.h
··· 221 221 * @spu_chnlcnt_RW: Array of saved channel counts. 222 222 * @spu_chnldata_RW: Array of saved channel data. 223 223 * @suspend_time: Time stamp when decrementer disabled. 224 - * @slb_esid_RW: Array of saved SLB esid entries. 225 - * @slb_vsid_RW: Array of saved SLB vsid entries. 226 224 * 227 225 * Structure representing the whole of the SPU 228 226 * context save area (CSA). This struct contains ··· 243 245 u32 spu_mailbox_data[4]; 244 246 u32 pu_mailbox_data[1]; 245 247 unsigned long suspend_time; 246 - u64 slb_esid_RW[8]; 247 - u64 slb_vsid_RW[8]; 248 248 spinlock_t register_lock; 249 249 }; 250 250
+2 -1
include/asm-powerpc/systbl.h
··· 304 304 SYSCALL_SPU(faccessat) 305 305 COMPAT_SYS_SPU(get_robust_list) 306 306 COMPAT_SYS_SPU(set_robust_list) 307 - COMPAT_SYS(move_pages) 307 + COMPAT_SYS_SPU(move_pages) 308 308 SYSCALL_SPU(getcpu) 309 + COMPAT_SYS(epoll_pwait)
+3 -1
include/asm-powerpc/unistd.h
··· 324 324 #define __NR_get_robust_list 299 325 325 #define __NR_set_robust_list 300 326 326 #define __NR_move_pages 301 327 + #define __NR_getcpu 302 328 + #define __NR_epoll_pwait 303 327 329 328 330 #ifdef __KERNEL__ 329 331 330 - #define __NR_syscalls 302 332 + #define __NR_syscalls 304 331 333 332 334 #define __NR__exit __NR_exit 333 335 #define NR_syscalls __NR_syscalls