qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 00/33] Alpha system emulation, v3


From: Richard Henderson
Subject: [Qemu-devel] [PATCH 00/33] Alpha system emulation, v3
Date: Thu, 28 Apr 2011 13:50:42 -0700

Patch tree at

    git://repo.or.cz/srv/git/qemu/rth.git axp-system-3

Changes from v2 -> v3

  * Emulation target is now CLIPPER instead of SX164.  I had forgotten
    how many bugs there were in various revisions of the CIA chipset,
    and the Linux kernel checks for them.  Which means that we have to
    have all sorts of things like an IOMMU loopback mode to even get
    booted.  That's way too much trouble.  It also means that once the
    emulation PALcode is SMP capable, the QEMU emulation will be as well.

  * Allow the CPU to halt til the next interrupt.
  * Allow the CPU access to the host clock, and a high-res alarm.

    Both of these things, with appropriate kernel support, drastically
    reduce QEMU's CPU usage when the guest is idle.

  * Fix gdb single-stepping in the presence of timer interrupts.
    Sparc also uses CPU_INTERRUPT_TIMER; I assume that one could not
    reasonably debug a kernel there either.

  * Fix gdb single-stepping past branches.  This was a alpha-specific
    translation problem in issuing the proper DEBUG exceptions.

  * We now make it all the way into userland.  Below the diffstat is
    a copy of the boot log.

Caveats

  * We need the IOMMU patches in order to proceed further with the
    system emulation.  Alpha always uses an IOMMU, and failing to 
    emulate it will mean we can't do much better than ramdisks and
    serial consoles.

  * The PALcode still needs work to have all of the run-time support
    that SRM has.  Getting ABOOT to work will be the next big milestone.

  * A kernel tree with the QEMU support is at

        git://repo.or.cz/srv/git/linux-2.6/rth.git axp-qemu

    In particular the patch therein to change HZ is pretty much required.
    The default of 1024Hz is nearly too fast for QEMU to emulate everything
    done in the clock interrupt before the next interrupt occurs.  Indeed,
    if non-trivial logging is enabled, QEMU will slow to the point that we
    will actually take clock interrupts recursively and die.

    Things ought to be moving in the right direction though, since the
    patches also enable NO_HZ mode.  I believe there's still work left to
    be done on the kernel side, since there's little point in issuing so
    many process time accounting timers on an idle system.

  * I still don't think I know how git submodules really work.  When I
    updated the one patch containing the PALcode blob, I couldn't figure
    out how to change the submodule revision hash number to HEAD.

  * Could someone please at least have a glance over the hw/ files?
    I'm looking for QEMU emulation style more than how the code matches
    the hardware reference manuals...


r~



Richard Henderson (33):
  Export the unassigned_mem read/write functions.
  gdbserver: Don't deliver TIMER interrupts when SSTEP_NOIRQ either.
  target-alpha: Disassemble EV6 PALcode instructions.
  pci: Export pci_to_cpu_addr.
  target-alpha: Single-step properly across branches.
  target-alpha: Remove partial support for palcode emulation.
  target-alpha: Enable the alpha-softmmu target.
  target-alpha: Tidy exception constants.
  target-alpha: Rationalize internal processor registers.
  target-alpha: Cleanup MMU modes.
  target-alpha: Fixup translation of PALmode instructions.
  target-alpha: Add IPRs to be used by the emulation PALcode.
  target-alpha: Tidy up arithmetic exceptions.
  target-alpha: Use do_restore_state for arithmetic exceptions.
  target-alpha: Merge HW_REI and HW_RET implementations.
  target-alpha: Implement do_interrupt for system mode.
  target-alpha: Swap shadow registers moving to/from PALmode.
  target-alpha: Add various symbolic constants.
  target-alpha: Use kernel mmu_idx for pal_mode.
  target-alpha: All ISA checks to use TB->FLAGS.
  target-alpha: Disable interrupts properly.
  target-alpha: Implement more CALL_PAL values inline.
  target-alpha: Implement cpu_alpha_handle_mmu_fault for system mode.
  target-alpha: Remap PIO space for 43-bit KSEG for EV6.
  target-alpha: Trap for unassigned and unaligned addresses.
  target-alpha: Include the PCC_OFS in the RPCC return value.
  target-alpha: Use a fixed frequency for the RPCC in system mode.
  target-alpha: Implement TLB flush primitives.
  target-alpha: Add custom PALcode image for CLIPPER emulation.
  target-alpha: Add CLIPPER emulation.
  target-alpha: Implement WAIT IPR.
  target-alpha: Implement HALT IPR.
  target-alpha: Add high-resolution access to wall clock and an alarm.

 .gitmodules                       |    3 +
 Makefile                          |    3 +-
 Makefile.target                   |    4 +-
 alpha-dis.c                       |    4 -
 configure                         |    9 +-
 cpu-common.h                      |    7 +
 cpu-exec.c                        |   29 +-
 default-configs/alpha-softmmu.mak |    9 +
 dis-asm.h                         |    3 +
 disas.c                           |    2 +-
 exec-all.h                        |    2 +-
 exec.c                            |   24 +-
 hw/alpha_dp264.c                  |  170 ++++++
 hw/alpha_palcode.c                | 1048 -------------------------------------
 hw/alpha_pci.c                    |  327 ++++++++++++
 hw/alpha_sys.h                    |   42 ++
 hw/alpha_typhoon.c                |  797 ++++++++++++++++++++++++++++
 hw/pci.c                          |    3 +-
 hw/pci.h                          |    1 +
 linux-user/main.c                 |   50 +--
 pc-bios/README                    |    3 +
 pc-bios/palcode-clipper           |  Bin 0 -> 107565 bytes
 roms/qemu-palcode                 |    1 +
 target-alpha/cpu.h                |  372 ++++++--------
 target-alpha/exec.h               |   11 +-
 target-alpha/helper.c             |  589 +++++++++------------
 target-alpha/helper.h             |   37 +-
 target-alpha/machine.c            |   87 +++
 target-alpha/op_helper.c          |  289 +++++------
 target-alpha/translate.c          |  836 +++++++++++++++++------------
 30 files changed, 2593 insertions(+), 2169 deletions(-)
 create mode 100644 default-configs/alpha-softmmu.mak
 create mode 100644 hw/alpha_dp264.c
 delete mode 100644 hw/alpha_palcode.c
 create mode 100644 hw/alpha_pci.c
 create mode 100644 hw/alpha_sys.h
 create mode 100644 hw/alpha_typhoon.c
 create mode 100755 pc-bios/palcode-clipper
 create mode 160000 roms/qemu-palcode
 create mode 100644 target-alpha/machine.c

==================

$ ./alpha-softmmu/qemu-system-alpha -nographic -kernel 
../../linux/linux-git/vmlinux -append 'console=ttyS0 rdinit=/bin/sh' -initrd 
../alpha-test/initrd.gz
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 2.6.39-rc4+ (address@hidden) (gcc version 4.7.0 
20110408 (experimental) (GCC) ) #18 SMP Thu Apr 28 10:11:46 PDT 2011
[    0.000000] Booting GENERIC on Tsunami variation Clipper using machine 
vector Clipper from MILO
[    0.000000] Major Options: SMP MAGIC_SYSRQ 
[    0.000000] Command line: console=ttyS0 rdinit=/bin/sh
[    0.000000] memcluster 0, usage 1, start        0, end        8
[    0.000000] memcluster 1, usage 0, start        8, end    16384
[    0.000000] freeing pages 8:2048
[    0.000000] freeing pages 3813:16384
[    0.000000] reserving pages 3813:3814
[    0.000000] Initial ramdisk at: 0xfffffc0007b26000 (5079886 bytes)
[    0.000000] SMP: 1 CPUs probed -- cpu_present_map = 1
[    0.000000] PERCPU: Embedded 6 pages/cpu @fffffc0000126000 s12608 r8192 
d28352 u49152
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total 
pages: 16272
[    0.000000] Kernel command line: console=ttyS0 rdinit=/bin/sh
[    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] allocated 524288 bytes of page_cgroup
[    0.000000] please try 'cgroup_disable=memory' option if you don't want 
memory cgroups
[    0.000000] Memory: 110088k/131072k available (3489k kernel code, 20920k 
reserved, 8487k data, 384k init)
[    0.000000] SLUB: Genslabs=16, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, 
Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  RCU-based detection of stalled CPUs is disabled.
[    0.000000] NR_IRQS:32784
[    0.000000] Console: colour dummy device 80x25
[    0.000000] console [ttyS0] enabled
[    0.000000] Calibrating delay loop... 10138.40 BogoMIPS (lpj=158408704)
[    1.343750] pid_max: default: 32768 minimum: 301
[    1.343750] Mount-cache hash table entries: 512
[    1.343750] Initializing cgroup subsys ns
[    1.343750] ns_cgroup deprecated: consider using the 'clone_children' flag 
without the ns_cgroup.
[    1.343750] Initializing cgroup subsys cpuacct
[    1.343750] Initializing cgroup subsys memory
[    1.343750] Initializing cgroup subsys devices
[    1.343750] Initializing cgroup subsys freezer
[    1.343750] Initializing cgroup subsys blkio
[    1.343750] SMP mode deactivated.
[    1.343750] Performance events: Supported CPU type!
[    1.343750] Brought up 1 CPUs
[    1.343750] SMP: Total of 1 processors activated (10138.56 BogoMIPS).
[    1.343750] devtmpfs: initialized
[    1.343750] atomic64 test passed
[    1.343750] NET: Registered protocol family 16
[    1.375000] EISA bus registered
[    1.375000] bio: create slab <bio-0> at 0
[    1.375000] vgaarb: loaded
[    1.375000] Switching to clocksource qemu
[    1.375000] NET: Registered protocol family 2
[    1.375000] IP route cache hash table entries: 1024 (order: 0, 8192 bytes)
[    1.375000] IPv4 FIB: Using LC-trie version 0.409
[    1.375000] TCP established hash table entries: 4096 (order: 3, 65536 bytes)
[    1.375000] TCP bind hash table entries: 4096 (order: 3, 65536 bytes)
[    1.375000] TCP: Hash tables configured (established 4096 bind 4096)
[    1.375000] TCP reno registered
[    1.375000] UDP hash table entries: 256 (order: 0, 8192 bytes)
[    1.375000] UDP-Lite hash table entries: 256 (order: 0, 8192 bytes)
[    1.375000] NET: Registered protocol family 1
[    1.375000] Trying to unpack rootfs image as initramfs...
[    1.406250] Switched to NOHz mode on CPU #0
[    1.625000] Freeing initrd memory: 4960k freed
[    1.656250] srm_env_init: This Alpha system doesn't know about SRM (or 
you've booted SRM->MILO->Linux, which gets misdetected)...
[    1.687500] VFS: Disk quotas dquot_6.5.2
[    1.687500] Dquot-cache hash table entries: 1024 (order 0, 8192 bytes)
[    1.687500] ROMFS MTD (C) 2007 Red Hat, Inc.
[    1.687500] msgmni has been set to 224
[    1.687500] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 
253)
[    1.687500] io scheduler noop registered
[    1.687500] io scheduler deadline registered
[    1.687500] io scheduler cfq registered (default)
[    1.687500] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    2.093750] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[    2.125000] brd: module loaded
[    2.125000] mousedev: PS/2 mouse device common for all mice
[    2.125000] TCP cubic registered
[    2.125000] NET: Registered protocol family 17
[    2.156250] drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
[    2.156250] Freeing unused kernel memory: 384k freed


BusyBox v1.10.2 (Debian 1:1.10.2-2) built-in shell (ash)
Enter 'help' for a list of built-in commands.

/bin/sh: can't access tty; job control turned off
~ # mount -t proc none /proc
~ # cat /proc/cpuinfo
cpu                     : Alpha
cpu model               : EV67
cpu variation           : 0
cpu revision            : 0
cpu serial number       : 
system type             : Tsunami
system variation        : Clipper
system revision         : 0
system serial number    : MILO QEMU
cycle frequency [Hz]    : 250000000 
timer frequency [Hz]    : 1024.00
page size [bytes]       : 8192
phys. address bits      : 40
max. addr. space #      : 255
BogoMIPS                : 10138.40
kernel unaligned acc    : 0 (pc=0,va=0)
user unaligned acc      : 0 (pc=0,va=0)
platform string         : N/A
cpus detected           : 0
cpus active             : 1
cpu active mask         : 0000000000000001
L1 Icache               : 64K, 2-way, 64b line
L1 Dcache               : 64K, 2-way, 64b line
L2 cache                : n/a
L3 cache                : n/a
~ # QEMU: Terminated




reply via email to

[Prev in Thread] Current Thread [Next in Thread]