~ubuntu-branches/ubuntu/trusty/qemu/trusty

« back to all changes in this revision

Viewing changes to target-alpha/translate.c

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2013-10-22 22:47:07 UTC
  • mfrom: (1.8.3) (10.1.42 sid)
  • Revision ID: package-import@ubuntu.com-20131022224707-1lya34fw3k3f24tv
Tags: 1.6.0+dfsg-2ubuntu1
* Merge 1.6.0~rc0+dfsg-2exp from debian experimental.  Remaining changes:
  - debian/control
    * update maintainer
    * remove libiscsi, usb-redir, vde, vnc-jpeg, and libssh2-1-dev
      from build-deps
    * enable rbd
    * add qemu-system and qemu-common B/R to qemu-keymaps
    * add D:udev, R:qemu, R:qemu-common and B:qemu-common to
      qemu-system-common
    * qemu-system-arm, qemu-system-ppc, qemu-system-sparc:
      - add qemu-kvm to Provides
      - add qemu-common, qemu-kvm, kvm to B/R
      - remove openbios-sparc from qemu-system-sparc D
      - drop openbios-ppc and openhackware Depends to Suggests (for now)
    * qemu-system-x86:
      - add qemu-common to Breaks/Replaces.
      - add cpu-checker to Recommends.
    * qemu-user: add B/R:qemu-kvm
    * qemu-kvm:
      - add armhf armel powerpc sparc to Architecture
      - C/R/P: qemu-kvm-spice
    * add qemu-common package
    * drop qemu-slof which is not packaged in ubuntu
  - add qemu-system-common.links for tap ifup/down scripts and OVMF link.
  - qemu-system-x86.links:
    * remove pxe rom links which are in kvm-ipxe
    * add symlink for kvm.1 manpage
  - debian/rules
    * add kvm-spice symlink to qemu-kvm
    * call dh_installmodules for qemu-system-x86
    * update dh_installinit to install upstart script
    * run dh_installman (Closes: #709241) (cherrypicked from 1.5.0+dfsg-2)
  - Add qemu-utils.links for kvm-* symlinks.
  - Add qemu-system-x86.qemu-kvm.upstart and .default
  - Add qemu-system-x86.modprobe to set nesting=1
  - Add qemu-system-common.preinst to add kvm group
  - qemu-system-common.postinst: remove bad group acl if there, then have
    udev relabel /dev/kvm.
  - New linaro patches from qemu-linaro rebasing branch
  - Dropped patches:
    * xen-simplify-xen_enabled.patch
    * sparc-linux-user-fix-missing-symbols-in-.rel-.rela.plt-sections.patch
    * main_loop-do-not-set-nonblocking-if-xen_enabled.patch
    * xen_machine_pv-do-not-create-a-dummy-CPU-in-machine-.patch
    * virtio-rng-fix-crash
  - Kept patches:
    * expose_vms_qemu64cpu.patch - updated
    * linaro arm patches from qemu-linaro rebasing branch
  - New patches:
    * fix-pci-add: change CONFIG variable in ifdef to make sure that
      pci_add is defined.
* Add linaro patches
* Add experimental mach-virt patches for arm virtualization.
* qemu-system-common.install: add debian/tmp/usr/lib to install the
  qemu-bridge-helper

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
typedef struct DisasContext DisasContext;
39
39
struct DisasContext {
40
40
    struct TranslationBlock *tb;
41
 
    CPUAlphaState *env;
42
41
    uint64_t pc;
43
42
    int mem_idx;
44
43
 
46
45
    int tb_rm;
47
46
    /* Current flush-to-zero setting for this TB.  */
48
47
    int tb_ftz;
 
48
 
 
49
    /* implver value for this CPU.  */
 
50
    int implver;
 
51
 
 
52
    bool singlestep_enabled;
49
53
};
50
54
 
51
55
/* Return values from translate_one, indicating the state of the TB.
380
384
    /* Check for the dest on the same page as the start of the TB.  We
381
385
       also want to suppress goto_tb in the case of single-steping and IO.  */
382
386
    return (((ctx->tb->pc ^ dest) & TARGET_PAGE_MASK) == 0
383
 
            && !ctx->env->singlestep_enabled
 
387
            && !ctx->singlestep_enabled
384
388
            && !(ctx->tb->cflags & CF_LAST_IO));
385
389
}
386
390
 
1634
1638
        return NO_EXIT;
1635
1639
    }
1636
1640
 
1637
 
    if (regno == 250) {
1638
 
        /* WALL_TIME */
 
1641
    /* Special help for VMTIME and WALLTIME.  */
 
1642
    if (regno == 250 || regno == 249) {
 
1643
        void (*helper)(TCGv) = gen_helper_get_walltime;
 
1644
        if (regno == 249) {
 
1645
                helper = gen_helper_get_vmtime;
 
1646
        }
1639
1647
        if (use_icount) {
1640
1648
            gen_io_start();
1641
 
            gen_helper_get_time(cpu_ir[ra]);
 
1649
            helper(cpu_ir[ra]);
1642
1650
            gen_io_end();
1643
1651
            return EXIT_PC_STALE;
1644
1652
        } else {
1645
 
            gen_helper_get_time(cpu_ir[ra]);
 
1653
            helper(cpu_ir[ra]);
1646
1654
            return NO_EXIT;
1647
1655
        }
1648
1656
    }
2244
2252
            break;
2245
2253
        case 0x6C:
2246
2254
            /* IMPLVER */
2247
 
            if (rc != 31)
2248
 
                tcg_gen_movi_i64(cpu_ir[rc], ctx->env->implver);
 
2255
            if (rc != 31) {
 
2256
                tcg_gen_movi_i64(cpu_ir[rc], ctx->implver);
 
2257
            }
2249
2258
            break;
2250
2259
        default:
2251
2260
            goto invalid_opc;
3375
3384
    return ret;
3376
3385
}
3377
3386
 
3378
 
static inline void gen_intermediate_code_internal(CPUAlphaState *env,
 
3387
static inline void gen_intermediate_code_internal(AlphaCPU *cpu,
3379
3388
                                                  TranslationBlock *tb,
3380
 
                                                  int search_pc)
 
3389
                                                  bool search_pc)
3381
3390
{
 
3391
    CPUState *cs = CPU(cpu);
 
3392
    CPUAlphaState *env = &cpu->env;
3382
3393
    DisasContext ctx, *ctxp = &ctx;
3383
3394
    target_ulong pc_start;
3384
3395
    uint32_t insn;
3393
3404
    gen_opc_end = tcg_ctx.gen_opc_buf + OPC_MAX_SIZE;
3394
3405
 
3395
3406
    ctx.tb = tb;
3396
 
    ctx.env = env;
3397
3407
    ctx.pc = pc_start;
3398
3408
    ctx.mem_idx = cpu_mmu_index(env);
 
3409
    ctx.implver = env->implver;
 
3410
    ctx.singlestep_enabled = cs->singlestep_enabled;
3399
3411
 
3400
3412
    /* ??? Every TB begins with unset rounding mode, to be initialized on
3401
3413
       the first fp insn of the TB.  Alternately we could define a proper
3452
3464
                || tcg_ctx.gen_opc_ptr >= gen_opc_end
3453
3465
                || num_insns >= max_insns
3454
3466
                || singlestep
3455
 
                || env->singlestep_enabled)) {
 
3467
                || ctx.singlestep_enabled)) {
3456
3468
            ret = EXIT_PC_STALE;
3457
3469
        }
3458
3470
    } while (ret == NO_EXIT);
3469
3481
        tcg_gen_movi_i64(cpu_pc, ctx.pc);
3470
3482
        /* FALLTHRU */
3471
3483
    case EXIT_PC_UPDATED:
3472
 
        if (env->singlestep_enabled) {
 
3484
        if (ctx.singlestep_enabled) {
3473
3485
            gen_excp_1(EXCP_DEBUG, 0);
3474
3486
        } else {
3475
3487
            tcg_gen_exit_tb(0);
3502
3514
 
3503
3515
void gen_intermediate_code (CPUAlphaState *env, struct TranslationBlock *tb)
3504
3516
{
3505
 
    gen_intermediate_code_internal(env, tb, 0);
 
3517
    gen_intermediate_code_internal(alpha_env_get_cpu(env), tb, false);
3506
3518
}
3507
3519
 
3508
3520
void gen_intermediate_code_pc (CPUAlphaState *env, struct TranslationBlock *tb)
3509
3521
{
3510
 
    gen_intermediate_code_internal(env, tb, 1);
 
3522
    gen_intermediate_code_internal(alpha_env_get_cpu(env), tb, true);
3511
3523
}
3512
3524
 
3513
3525
void restore_state_to_opc(CPUAlphaState *env, TranslationBlock *tb, int pc_pos)