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

« back to all changes in this revision

Viewing changes to cpu-exec.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:
59
59
         * counter hit zero); we must restore the guest PC to the address
60
60
         * of the start of the TB.
61
61
         */
 
62
        CPUClass *cc = CPU_GET_CLASS(cpu);
62
63
        TranslationBlock *tb = (TranslationBlock *)(next_tb & ~TB_EXIT_MASK);
63
 
        cpu_pc_from_tb(env, tb);
 
64
        if (cc->synchronize_from_tb) {
 
65
            cc->synchronize_from_tb(cpu, tb);
 
66
        } else {
 
67
            assert(cc->set_pc);
 
68
            cc->set_pc(cpu, tb->pc);
 
69
        }
64
70
    }
65
71
    if ((next_tb & TB_EXIT_MASK) == TB_EXIT_REQUESTED) {
66
72
        /* We were asked to stop executing TBs (probably a pending
213
219
        cpu->halted = 0;
214
220
    }
215
221
 
216
 
    cpu_single_env = env;
 
222
    current_cpu = cpu;
217
223
 
218
 
    /* As long as cpu_single_env is null, up to the assignment just above,
 
224
    /* As long as current_cpu is null, up to the assignment just above,
219
225
     * requests by other threads to exit the execution loop are expected to
220
226
     * be issued using the exit_request global. We must make sure that our
221
 
     * evaluation of the global value is performed past the cpu_single_env
 
227
     * evaluation of the global value is performed past the current_cpu
222
228
     * value transition point, which requires a memory barrier as well as
223
229
     * an instruction scheduling constraint on modern architectures.  */
224
230
    smp_mb();
230
236
#if defined(TARGET_I386)
231
237
    /* put eflags in CPU temporary format */
232
238
    CC_SRC = env->eflags & (CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C);
233
 
    DF = 1 - (2 * ((env->eflags >> 10) & 1));
 
239
    env->df = 1 - (2 * ((env->eflags >> 10) & 1));
234
240
    CC_OP = CC_OP_EFLAGS;
235
241
    env->eflags &= ~(DF_MASK | CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C);
236
242
#elif defined(TARGET_SPARC)
291
297
            for(;;) {
292
298
                interrupt_request = cpu->interrupt_request;
293
299
                if (unlikely(interrupt_request)) {
294
 
                    if (unlikely(env->singlestep_enabled & SSTEP_NOIRQ)) {
 
300
                    if (unlikely(cpu->singlestep_enabled & SSTEP_NOIRQ)) {
295
301
                        /* Mask out external interrupts for this step. */
296
302
                        interrupt_request &= ~CPU_INTERRUPT_SSTEP_MASK;
297
303
                    }
331
337
                            cpu_svm_check_intercept_param(env, SVM_EXIT_SMI,
332
338
                                                          0);
333
339
                            cpu->interrupt_request &= ~CPU_INTERRUPT_SMI;
334
 
                            do_smm_enter(env);
 
340
                            do_smm_enter(x86_env_get_cpu(env));
335
341
                            next_tb = 0;
336
342
                        } else if ((interrupt_request & CPU_INTERRUPT_NMI) &&
337
343
                                   !(env->hflags2 & HF2_NMI_MASK)) {
577
583
                if (qemu_loglevel_mask(CPU_LOG_TB_CPU)) {
578
584
                    /* restore flags in standard format */
579
585
#if defined(TARGET_I386)
580
 
                    log_cpu_state(env, CPU_DUMP_CCOP);
 
586
                    log_cpu_state(cpu, CPU_DUMP_CCOP);
581
587
#elif defined(TARGET_M68K)
582
588
                    cpu_m68k_flush_flags(env, env->cc_op);
583
589
                    env->cc_op = CC_OP_FLAGS;
584
590
                    env->sr = (env->sr & 0xffe0)
585
591
                              | env->cc_dest | (env->cc_x << 4);
586
 
                    log_cpu_state(env, 0);
 
592
                    log_cpu_state(cpu, 0);
587
593
#else
588
 
                    log_cpu_state(env, 0);
 
594
                    log_cpu_state(cpu, 0);
589
595
#endif
590
596
                }
591
597
#endif /* DEBUG_DISAS */
673
679
        } else {
674
680
            /* Reload env after longjmp - the compiler may have smashed all
675
681
             * local variables as longjmp is marked 'noreturn'. */
676
 
            env = cpu_single_env;
 
682
            cpu = current_cpu;
 
683
            env = cpu->env_ptr;
677
684
        }
678
685
    } /* for(;;) */
679
686
 
681
688
#if defined(TARGET_I386)
682
689
    /* restore flags in standard format */
683
690
    env->eflags = env->eflags | cpu_cc_compute_all(env, CC_OP)
684
 
        | (DF & DF_MASK);
 
691
        | (env->df & DF_MASK);
685
692
#elif defined(TARGET_ARM)
686
693
    /* XXX: Save/restore host fpu exception state?.  */
687
694
#elif defined(TARGET_UNICORE32)
707
714
#error unsupported target CPU
708
715
#endif
709
716
 
710
 
    /* fail safe : never use cpu_single_env outside cpu_exec() */
711
 
    cpu_single_env = NULL;
 
717
    /* fail safe : never use current_cpu outside cpu_exec() */
 
718
    current_cpu = NULL;
712
719
    return ret;
713
720
}