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

« back to all changes in this revision

Viewing changes to target-i386/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:
4677
4677
    }
4678
4678
    s->pc = pc_start;
4679
4679
    prefixes = 0;
4680
 
    aflag = s->code32;
4681
 
    dflag = s->code32;
4682
4680
    s->override = -1;
4683
4681
    rex_w = -1;
4684
4682
    rex_r = 0;
4801
4799
    }
4802
4800
 
4803
4801
    /* Post-process prefixes.  */
4804
 
    if (prefixes & PREFIX_DATA) {
4805
 
        dflag ^= 1;
4806
 
    }
4807
 
    if (prefixes & PREFIX_ADR) {
4808
 
        aflag ^= 1;
4809
 
    }
4810
 
#ifdef TARGET_X86_64
4811
4802
    if (CODE64(s)) {
4812
 
        if (rex_w == 1) {
4813
 
            /* 0x66 is ignored if rex.w is set */
4814
 
            dflag = 2;
 
4803
        /* In 64-bit mode, the default data size is 32-bit.  Select 64-bit
 
4804
           data with rex_w, and 16-bit data with 0x66; rex_w takes precedence
 
4805
           over 0x66 if both are present.  */
 
4806
        dflag = (rex_w > 0 ? 2 : prefixes & PREFIX_DATA ? 0 : 1);
 
4807
        /* In 64-bit mode, 0x67 selects 32-bit addressing.  */
 
4808
        aflag = (prefixes & PREFIX_ADR ? 1 : 2);
 
4809
    } else {
 
4810
        /* In 16/32-bit mode, 0x66 selects the opposite data size.  */
 
4811
        dflag = s->code32;
 
4812
        if (prefixes & PREFIX_DATA) {
 
4813
            dflag ^= 1;
4815
4814
        }
4816
 
        if (!(prefixes & PREFIX_ADR)) {
4817
 
            aflag = 2;
 
4815
        /* In 16/32-bit mode, 0x67 selects the opposite addressing.  */
 
4816
        aflag = s->code32;
 
4817
        if (prefixes & PREFIX_ADR) {
 
4818
            aflag ^= 1;
4818
4819
        }
4819
4820
    }
4820
 
#endif
4821
4821
 
4822
4822
    s->prefix = prefixes;
4823
4823
    s->aflag = aflag;
8251
8251
/* generate intermediate code in gen_opc_buf and gen_opparam_buf for
8252
8252
   basic block 'tb'. If search_pc is TRUE, also generate PC
8253
8253
   information for each intermediate instruction. */
8254
 
static inline void gen_intermediate_code_internal(CPUX86State *env,
 
8254
static inline void gen_intermediate_code_internal(X86CPU *cpu,
8255
8255
                                                  TranslationBlock *tb,
8256
 
                                                  int search_pc)
 
8256
                                                  bool search_pc)
8257
8257
{
 
8258
    CPUState *cs = CPU(cpu);
 
8259
    CPUX86State *env = &cpu->env;
8258
8260
    DisasContext dc1, *dc = &dc1;
8259
8261
    target_ulong pc_ptr;
8260
8262
    uint16_t *gen_opc_end;
8280
8282
    dc->cpl = (flags >> HF_CPL_SHIFT) & 3;
8281
8283
    dc->iopl = (flags >> IOPL_SHIFT) & 3;
8282
8284
    dc->tf = (flags >> TF_SHIFT) & 1;
8283
 
    dc->singlestep_enabled = env->singlestep_enabled;
 
8285
    dc->singlestep_enabled = cs->singlestep_enabled;
8284
8286
    dc->cc_op = CC_OP_DYNAMIC;
8285
8287
    dc->cc_op_dirty = false;
8286
8288
    dc->cs_base = cs_base;
8301
8303
    dc->code64 = (flags >> HF_CS64_SHIFT) & 1;
8302
8304
#endif
8303
8305
    dc->flags = flags;
8304
 
    dc->jmp_opt = !(dc->tf || env->singlestep_enabled ||
 
8306
    dc->jmp_opt = !(dc->tf || cs->singlestep_enabled ||
8305
8307
                    (flags & HF_INHIBIT_IRQ_MASK)
8306
8308
#ifndef CONFIG_SOFTMMU
8307
8309
                    || (flags & HF_SOFTMMU_MASK)
8428
8430
 
8429
8431
void gen_intermediate_code(CPUX86State *env, TranslationBlock *tb)
8430
8432
{
8431
 
    gen_intermediate_code_internal(env, tb, 0);
 
8433
    gen_intermediate_code_internal(x86_env_get_cpu(env), tb, false);
8432
8434
}
8433
8435
 
8434
8436
void gen_intermediate_code_pc(CPUX86State *env, TranslationBlock *tb)
8435
8437
{
8436
 
    gen_intermediate_code_internal(env, tb, 1);
 
8438
    gen_intermediate_code_internal(x86_env_get_cpu(env), tb, true);
8437
8439
}
8438
8440
 
8439
8441
void restore_state_to_opc(CPUX86State *env, TranslationBlock *tb, int pc_pos)