On Fri, Feb 26, 2016 at 10:44 AM, Mark Cave-Ayland <mark.cave-ayl...@ilande.co.uk> wrote: > On 23/02/16 21:11, Richard Henderson wrote: > >> The primary focus of this patch set is to reduce the number of >> helpers that modify TCG globals, and thus increase the lifetime >> of those globals within each TB, and thus decrease the number >> of times that tcg must spill and fill them from backing store. >> >> As a byproduct, I also implement the bulk of the interesting v9 ASIs >> inline, thus exposing e.g. the little-endian loads and stores as >> simple tcg operations. >> >> The patch set is relative to my outstanding tcg pull request. >> For reference, the complete tree can be found at >> >> git://github.com/rth7680/qemu.git tgt-sparc >> >> Changes from v1 to v2: >> * Commit message refers to UA2005 instead of UA2011 when >> introducing new asi.h defines. (Artyom) >> * Drop the MMU_REAL_IDX, and inline handling of ASI_REAL_*. >> This appears to be the source of the regression that Artyom >> identified wrt ss5 emulation. >> >> >> r~ >> >> >> Richard Henderson (24): >> target-sparc: Mark more flags for helpers >> target-sparc: Remove softint as a TCG global >> target-sparc: Store mmu index in TB flags >> target-sparc: Create gen_exception >> target-sparc: Unify asi handling between 32 and 64-bit >> target-sparc: Store %asi in TB flags >> target-sparc: Introduce get_asi >> target-sparc: Pass TCGMemOp to gen_ld/st_asi >> target-sparc: Import linux/arch/sparc/include/uapi/asm/asi.h >> target-sparc: Add UA2005 defines to asi.h >> target-sparc: Use defines from asi.h >> target-sparc: Directly implement easy ld/st asis >> target-sparc: Use QT0 to return results from ldda >> target-sparc: Introduce gen_check_align >> target-sparc: Directly implement easy ldd/std asis >> target-sparc: Fix obvious error in ASI_M_BFILL >> target-sparc: Pass TCGMemOp constants to helper_ld/st_asi >> target-sparc: Directly implement easy ldf/stf asis >> target-sparc: Directly implement block and short ldf/stf asis >> target-sparc: Remove helper_ldf_asi, helper_stf_asi >> target-sparc: Use explicit writes to cpu_fsr >> target-sparc: Use cpu_fsr in stfsr >> target-sparc: Use cpu_loop_exit_restore from >> helper_check_ieee_exceptions >> target-sparc: Elide duplicate updates to fprs >> >> target-sparc/asi.h | 311 +++++++++++ >> target-sparc/cpu.h | 28 +- >> target-sparc/fop_helper.c | 229 +++----- >> target-sparc/helper.h | 168 +++--- >> target-sparc/ldst_helper.c | 696 +++++++++++------------- >> target-sparc/translate.c | 1250 >> +++++++++++++++++++++++++++----------------- >> 6 files changed, 1580 insertions(+), 1102 deletions(-) >> create mode 100644 target-sparc/asi.h > > Hi Richard, > > I've just applied this to git master and run through my local tests and > while I see no problems with qemu-system-sparc,
Can confirm this. 32 bit code passes my tests too (including running a Java-written installer for a proprietary database). Concerning the regression reported by Mark: it looks like asi 0xe0 is broken. Artyom > I do see a regression > with qemu-system-sparc64 when trying to boot my Debian test image: > > > $ ./qemu-system-sparc64 -cdrom debian-7.8.0-sparc-netinst.iso -boot d > -nographic > > OpenBIOS for Sparc64 > Configuration device id QEMU version 1 machine id 0 > kernel cmdline > CPUs: 1 x SUNW,UltraSPARC-IIi > UUID: 00000000-0000-0000-0000-000000000000 > Welcome to OpenBIOS v1.1 built on Feb 4 2016 10:29 > Type 'help' for detailed information > Trying cdrom:f... > Not a bootable ELF image > Loading a.out image... > Loaded 7680 bytes > entry point is 0x4000 > > Jumping to entry point 0000000000004000 for type 0000000000000005... > switching to new context: entry point 0x4000 stack 0x00000000ffe84a09 > SILO Version 1.4.14 > EXT2 superblock magic is wrong > EXT2 superblock magic is wrong > \ > > > Welcome to Debian GNU/Linux wheezy! > > This is a Debian installation CDROM, built on 20150110-20:41. > Keep it once you have installed your system, as you can boot from it > to repair the system on your hard disk if that ever becomes necessary. > > WARNING: You should completely back up all of your hard disks before > proceeding. The installation procedure can completely and irreversibly > erase them! If you haven't made backups yet, remove the rescue CD from > the drive and press L1-A to get back to the OpenBoot prompt. > > Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted > by applicable law. > > [ ENTER - Boot install ] [ Type "expert" - Boot into expert mode ] > [ Type "rescue" - Boot into rescue mode ] > boot: > Allocated 64 Megs of memory at 0x40000000 for kernel > EXT2 superblock magic is wrong > Loaded kernel version 3.2.65 > EXT2 superblock magic is wrong > Loading initial ramdisk (5047556 bytes at 0x4400000 phys, 0x40C00000 > virt)... > - > [ 0.000000] PROMLIB: Sun IEEE Boot Prom 'OBP 3.10.24 1999/01/01 01:01' > [ 0.000000] PROMLIB: Root node compatible: sun4u > [ 0.000000] Initializing cgroup subsys cpuset > [ 0.000000] Initializing cgroup subsys cpu > [ 0.000000] Linux version 3.2.0-4-sparc64 > (debian-ker...@lists.debian.org) (gcc version 4.6.3 (Debian 4.6.3-14) ) > #1 Debian 3.2.65-1 > [ 0.000000] bootconsole [earlyprom0] enabled > [ 0.000000] ARCH: SUN4U > [ 0.000000] Ethernet address: 52:54:00:12:34:56 > [ 0.000000] Kernel: Using 2 locked TLB entries for main kernel image. > [ 0.000000] Remapping the kernel... done. > [ 0.000000] OF stdout device is: /pci@1fe,0/ebus@3/su > [ 0.000000] PROM: Built device tree with 33902 bytes of memory. > [ 0.000000] Top of RAM: 0x7e80000, Total RAM: 0x7e80000 > [ 0.000000] Memory hole size: 0MB > [ 0.000000] Zone PFN ranges: > [ 0.000000] Normal 0x00000000 -> 0x00003f40 > [ 0.000000] Movable zone start PFN for each node > [ 0.000000] early_node_map[1] active PFN ranges > [ 0.000000] 0: 0x00000000 -> 0x00003f40 > [ 0.000000] Booting Linux... > [ 0.000000] CPU CAPS: [flush,stbar,swap,muldiv,v9,mul32,div32,v8plus] > [ 0.000000] CPU CAPS: [vis] > [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. > Total pages: 16065 > [ 0.000000] Kernel command line: > [ 0.000000] PID hash table entries: 512 (order: -1, 4096 bytes) > [ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 131072 > bytes) > [ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 65536 bytes) > [ 0.000000] Memory: 110256k available (3440k kernel code, 1432k data, > 192k init) [fffff80000000000,0000000007e80000] > [ 0.000000] NR_IRQS:255 > [ 0.000000] clocksource: mult[a000000] shift[24] > [ 0.000000] clockevent: mult[1999999a] shift[32] > [ 0.000000] Console: colour dummy device 80x25 > [ 0.000000] console [tty0] enabled, bootconsole disabled > [ 0.000000] PROMLIB: Sun IEEE Boot Prom 'OBP 3.10.24 1999/01/01 01:01' > [ 0.000000] PROMLIB: Root node compatible: sun4u > [ 0.000000] Initializing cgroup subsys cpuset > [ 0.000000] Initializing cgroup subsys cpu > [ 0.000000] Linux version 3.2.0-4-sparc64 > (debian-ker...@lists.debian.org) (gcc version 4.6.3 (Debian 4.6.3-14) ) > #1 Debian 3.2.65-1 > [ 0.000000] bootconsole [earlyprom0] enabled > [ 0.000000] ARCH: SUN4U > [ 0.000000] Ethernet address: 52:54:00:12:34:56 > [ 0.000000] Kernel: Using 2 locked TLB entries for main kernel image. > [ 0.000000] Remapping the kernel... done. > [ 0.000000] OF stdout device is: /pci@1fe,0/ebus@3/su > [ 0.000000] PROM: Built device tree with 33902 bytes of memory. > [ 0.000000] Top of RAM: 0x7e80000, Total RAM: 0x7e80000 > [ 0.000000] Memory hole size: 0MB > [ 0.000000] Zone PFN ranges: > [ 0.000000] Normal 0x00000000 -> 0x00003f40 > [ 0.000000] Movable zone start PFN for each node > [ 0.000000] early_node_map[1] active PFN ranges > [ 0.000000] 0: 0x00000000 -> 0x00003f40 > [ 0.000000] Booting Linux... > [ 0.000000] CPU CAPS: [flush,stbar,swap,muldiv,v9,mul32,div32,v8plus] > [ 0.000000] CPU CAPS: [vis] > [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. > Total pages: 16065 > [ 0.000000] Kernel command line: > [ 0.000000] PID hash table entries: 512 (order: -1, 4096 bytes) > [ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 131072 > bytes) > [ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 65536 bytes) > [ 0.000000] Memory: 110256k available (3440k kernel code, 1432k data, > 192k init) [fffff80000000000,0000000007e80000] > [ 0.000000] NR_IRQS:255 > [ 0.000000] clocksource: mult[a000000] shift[24] > [ 0.000000] clockevent: mult[1999999a] shift[32] > [ 0.000000] Console: colour dummy device 80x25 > [ 0.000000] console [tty0] enabled, bootconsole disabled > [ 14.439250] Calibrating delay using timer specific routine.. 205.83 > BogoMIPS (lpj=411662) > [ 14.439720] pid_max: default: 32768 minimum: 301 > [ 14.441449] Security Framework initialized > [ 14.445801] AppArmor: AppArmor disabled by boot time parameter > [ 14.446635] Mount-cache hash table entries: 512 > [ 14.463952] Initializing cgroup subsys cpuacct > [ 14.464321] Initializing cgroup subsys memory > [ 14.465418] Initializing cgroup subsys devices > [ 14.465634] Initializing cgroup subsys freezer > [ 14.465783] Initializing cgroup subsys net_cls > [ 14.465931] Initializing cgroup subsys blkio > [ 14.466086] Initializing cgroup subsys perf_event > [ 14.487872] Performance events: No support for PMU type 'ultra12' > [ 14.512521] devtmpfs: initialized > [ 14.534351] print_constraints: dummy: > [ 14.539353] NET: Registered protocol family 16 > [ 14.566037] /pci@1f,0: PCI IO[1fe02000000] MEM[1ff00100000] > [ 14.566715] /pci@1f,0: Unable to request IOMMU resource. > [ 14.566859] /pci@1f,0: SABRE PCI Bus Module ver[0:0] > [ 14.567021] PCI: Scanning PBM /pci@1f,0 > [ 14.612234] bio: create slab <bio-0> at 0 > [ 14.622526] vgaarb: device added: > PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none > [ 14.623085] vgaarb: loaded > [ 14.623252] vgaarb: bridge control possible 0000:00:02.0 > [ 14.638423] /pci@1f,0/ebus@3/eeprom@14,2000: Mostek regs at 0x1fe02006000 > [ 14.641411] Switching to clocksource tick > [ 14.722725] NET: Registered protocol family 2 > [ 14.740078] IP route cache hash table entries: 1024 (order: 0, 8192 > bytes) > [ 14.752835] TCP established hash table entries: 4096 (order: 3, 65536 > bytes) > [ 14.753211] TCP bind hash table entries: 4096 (order: 2, 32768 bytes) > [ 14.753735] TCP: Hash tables configured (established 4096 bind 4096) > [ 14.754141] TCP reno registered > [ 14.754409] UDP hash table entries: 256 (order: 0, 8192 bytes) > [ 14.754809] UDP-Lite hash table entries: 256 (order: 0, 8192 bytes) > [ 14.758452] NET: Registered protocol family 1 > [ 14.768740] Unpacking initramfs... > [ 15.559629] Freeing initrd memory: 4929k freed > [ 15.570520] audit: initializing netlink socket (disabled) > [ 15.571909] type=2000 audit(1.212:1): initialized > [ 15.696295] HugeTLB registered 4 MB page size, pre-allocated 0 pages > [ 15.703163] VFS: Disk quotas dquot_6.5.2 > [ 15.703698] Dquot-cache hash table entries: 1024 (order 0, 8192 bytes) > [ 15.708357] msgmni has been set to 224 > [ 15.735781] alg: No test for stdrng (krng) > [ 15.736607] Block layer SCSI generic (bsg) driver version 0.4 loaded > (major 253) > [ 15.737119] io scheduler noop registered > [ 15.737263] io scheduler deadline registered > [ 15.737707] io scheduler cfq registered (default) > [ 15.749665] ffe2ec08: ttyS0 at MMIO 0x1fe020043f8 (irq = 5) is a 16550A > [ 15.750278] Console: ttyS0 (SU) > [ 15.806336] console [ttyS0] enabled > [ 15.828670] mousedev: PS/2 mouse device common for all mice > [ 15.839948] rtc-m48t59 rtc-m48t59.0: rtc core: registered m48t59 as rtc0 > [ 15.846628] TCP cubic registered > [ 15.848261] NET: Registered protocol family 10 > [ 15.868512] Mobile IPv6 > [ 15.869183] NET: Registered protocol family 17 > [ 15.870273] Registering the dns_resolver key type > [ 15.873276] registered taskstats version 1 > [ 15.877320] rtc-m48t59 rtc-m48t59.0: setting system clock to > 2016-02-26 09:38:30 UTC (1456479510) > [ 15.878673] Initializing network drop monitor service > [ 15.979585] \|/ ____ \|/ > [ 15.981373] "@'/ .. \`@" > [ 15.981390] /_| \__/ |_\ > [ 15.981405] \__U_/ > [ 15.985965] init(1): Kernel illegal instruction [#1] > [ 15.986777] TSTATE: 00000000e0001601 TPC: 00000000005d014c TNPC: > 00000000005d0150 Y: 00000000 Not tainted > [ 15.988453] TPC: <cheetah_copy_page_insn+0x1c0/0x278> > [ 15.988966] g0: 0000005000000040 g1: 0000000006002000 g2: > 800000000675bff6 g3: 0000000000000080 > [ 15.990016] g4: fffff8000703b6e0 g5: 0000000000000000 g6: > fffff80007040000 g7: 00000000005d0000 > [ 15.990843] o0: 0000000006002000 o1: 0000000006006080 o2: > 0000000000002000 o3: 0000000006000000 > [ 15.991648] o4: 0000000000000002 o5: 0000000000000000 sp: > fffff80007042981 ret_pc: 00000000004dd098 > [ 15.992484] RPC: <__do_fault+0x13c/0x448> > [ 15.992949] l0: 0000000000000200 l1: 0000000000000000 l2: > 00000000005c5e78 l3: 0000010000011f40 > [ 15.993750] l4: 0000000000000001 l5: 0000000000000002 l6: > 0000000000000000 l7: 0000000000000008 > [ 15.994658] i0: fffff80005d039c0 i1: fffff80005d08978 i2: > 000000000007a001 i3: fffff80005d14000 > [ 15.995503] i4: 0000000000000000 i5: 00000100000ceb40 i6: > fffff80007042a51 i7: 00000000004df3b4 > [ 15.996327] I7: <handle_pte_fault+0x2e8/0x860> > [ 15.996851] Call Trace: > [ 15.997277] [00000000004df3b4] handle_pte_fault+0x2e8/0x860 > [ 15.997972] [000000000075cf9c] do_sparc64_fault+0x408/0x780 > [ 15.998525] [0000000000407880] sparc64_realfault_common+0x10/0x20 > [ 15.999158] [00000000005cfc7c] __clear_user+0x18/0xb8 > [ 15.999666] [0000000000542128] load_elf_binary+0x760/0x1194 > [ 16.000203] [0000000000504500] search_binary_handler+0x120/0x354 > [ 16.000769] [000000000053f38c] load_script+0x23c/0x250 > [ 16.001259] [0000000000504500] search_binary_handler+0x120/0x354 > [ 16.001901] [0000000000505b84] do_execve_common.isra.25+0x190/0x28c > [ 16.002485] [000000000042b560] sparc_execve+0x54/0x98 > [ 16.002967] [00000000004060b4] linux_sparc_syscall+0x34/0x44 > [ 16.003502] [000000000042d8b4] kernel_execve+0x14/0x60 > [ 16.003988] [00000000007554a8] init_post+0x38/0xb8 > [ 16.004538] [00000000008ce938] kernel_init+0x150/0x15c > [ 16.005029] [000000000042a7c0] kernel_thread+0x30/0x48 > [ 16.005627] [0000000000744720] rest_init+0x10/0x68 > [ 16.006357] Disabling lock debugging due to kernel taint > [ 16.007464] Caller[00000000004df3b4]: handle_pte_fault+0x2e8/0x860 > [ 16.008173] Caller[000000000075cf9c]: do_sparc64_fault+0x408/0x780 > [ 16.008743] Caller[0000000000407880]: sparc64_realfault_common+0x10/0x20 > [ 16.009348] Caller[0000000000541758]: padzero+0x20/0x38 > [ 16.009936] Caller[0000000000542128]: load_elf_binary+0x760/0x1194 > [ 16.010506] Caller[0000000000504500]: search_binary_handler+0x120/0x354 > [ 16.011106] Caller[000000000053f38c]: load_script+0x23c/0x250 > [ 16.011672] Caller[0000000000504500]: search_binary_handler+0x120/0x354 > [ 16.012273] Caller[0000000000505b84]: > do_execve_common.isra.25+0x190/0x28c > [ 16.012891] Caller[000000000042b560]: sparc_execve+0x54/0x98 > [ 16.013410] Caller[00000000004060b4]: linux_sparc_syscall+0x34/0x44 > [ 16.014064] Caller[0000000000447a84]: free_initmem+0x94/0xcc > [ 16.014587] Caller[00000000007554a8]: init_post+0x38/0xb8 > [ 16.015089] Caller[00000000008ce938]: kernel_init+0x150/0x15c > [ 16.015622] Caller[000000000042a7c0]: kernel_thread+0x30/0x48 > [ 16.016146] Caller[0000000000744720]: rest_init+0x10/0x68 > [ 16.016671] Instruction DUMP: bba0004c bfa0004e c39a5e00 <e3ba2000> > 92026040 9422a040 90022040 a3a00050 a7a00052 > [ 16.019983] note: init[1] exited with preempt_count 3 > [ 16.041382] BUG: scheduling while atomic: init/1/0x10000003 > [ 16.042284] Modules linked in: > [ 16.043054] Call Trace: > [ 16.044961] [0000000000455178] __cond_resched+0x10/0x2c > [ 16.045537] [000000000075a5b4] _cond_resched+0x28/0x38 > [ 16.046185] [000000000045ddec] put_files_struct+0x98/0xec > [ 16.046706] [000000000045e388] do_exit+0x26c/0x6c8 > [ 16.047183] [0000000000427550] die_if_kernel+0x2a0/0x2c8 > [ 16.047689] [0000000000429660] do_illegal_instruction+0x4c/0x174 > [ 16.048262] [0000000000420210] tl0_ill+0x10/0x20 > [ 16.048792] [00000000005d014c] cheetah_copy_page_insn+0x1c0/0x278 > [ 16.049361] [00000000004df3b4] handle_pte_fault+0x2e8/0x860 > [ 16.049984] [000000000075cf9c] do_sparc64_fault+0x408/0x780 > [ 16.050529] [0000000000407880] sparc64_realfault_common+0x10/0x20 > [ 16.051094] [00000000005cfc7c] __clear_user+0x18/0xb8 > [ 16.051579] [0000000000542128] load_elf_binary+0x760/0x1194 > [ 16.052099] [0000000000504500] search_binary_handler+0x120/0x354 > [ 16.052652] [000000000053f38c] load_script+0x23c/0x250 > [ 16.053134] [0000000000504500] search_binary_handler+0x120/0x354 > [ 16.054327] Kernel panic - not syncing: Attempted to kill init! > [ 16.054875] Call Trace: > [ 16.055139] [000000000045e1b0] do_exit+0x94/0x6c8 > [ 16.055588] [0000000000427550] die_if_kernel+0x2a0/0x2c8 > [ 16.056079] [0000000000429660] do_illegal_instruction+0x4c/0x174 > [ 16.056624] [0000000000420210] tl0_ill+0x10/0x20 > [ 16.057060] [00000000005d014c] cheetah_copy_page_insn+0x1c0/0x278 > [ 16.057614] [00000000004df3b4] handle_pte_fault+0x2e8/0x860 > [ 16.058232] [000000000075cf9c] do_sparc64_fault+0x408/0x780 > [ 16.058773] [0000000000407880] sparc64_realfault_common+0x10/0x20 > [ 16.059336] [00000000005cfc7c] __clear_user+0x18/0xb8 > [ 16.059817] [0000000000542128] load_elf_binary+0x760/0x1194 > [ 16.060329] [0000000000504500] search_binary_handler+0x120/0x354 > [ 16.060872] [000000000053f38c] load_script+0x23c/0x250 > [ 16.061347] [0000000000504500] search_binary_handler+0x120/0x354 > [ 16.062019] [0000000000505b84] do_execve_common.isra.25+0x190/0x28c > [ 16.062593] [000000000042b560] sparc_execve+0x54/0x98 > [ 16.063067] [00000000004060b4] linux_sparc_syscall+0x34/0x44 > [ 16.064420] Press Stop-A (L1-A) to return to the boot prom > > > ATB, > > Mark. > -- Regards, Artyom Tarasenko SPARC and PPC PReP under qemu blog: http://tyom.blogspot.com/search/label/qemu