You need to sign in or sign up before continuing.
  1. 26 4月, 2015 1 次提交
  2. 11 3月, 2015 1 次提交
    • E
      cpu: Make cpu_init() return QOM CPUState object · 2994fd96
      Eduardo Habkost 提交于
      Instead of making cpu_init() return CPUArchState, return CPUState.
      
      Changes were made using the Coccinelle semantic patch below.
      
        @@
        typedef CPUState;
        identifier e;
        expression args;
        type CPUArchState;
        @@
        -   e =
        +   cpu =
                cpu_init(args);
        -   if (!e) {
        +   if (!cpu) {
                ...
            }
        -   cpu = ENV_GET_CPU(env);
        +   e = cpu->env_ptr;
      
        @@
        identifier new_env, new_cpu, env, cpu;
        type CPUArchState;
        expression args;
        @@
        -{
        -   CPUState *cpu = ENV_GET_CPU(env);
        -   CPUArchState *new_env = cpu_init(args);
        -   CPUState *new_cpu = ENV_GET_CPU(new_env);
        +{
        +   CPUState *cpu = ENV_GET_CPU(env);
        +   CPUState *new_cpu = cpu_init(args);
        +   CPUArchState *new_env = new_cpu->env_ptr;
            ...
        }
      
        @@
        identifier c, cpu_init_func, cpu_model;
        type StateType, CPUType;
        @@
        -static inline StateType* cpu_init(const char *cpu_model)
        -{
        -   CPUType *c = cpu_init_func(cpu_model);
        (
        -   if (c == NULL) {
        -       return NULL;
        -   }
        -   return &c->env;
        |
        -   if (c) {
        -       return &c->env;
        -   }
        -   return NULL;
        )
        -}
        +#define cpu_init(cpu_model) CPU(cpu_init_func(cpu_model))
      
        @@
        identifier cpu_init_func;
        identifier model;
        @@
        -#define cpu_init(model) (&cpu_init_func(model)->env)
        +#define cpu_init(model) CPU(cpu_init_func(model))
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Cc: Blue Swirl <blauwirbel@gmail.com>
      Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
      Cc: Riku Voipio <riku.voipio@iki.fi>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Michael Walle <michael@walle.cc>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: Leon Alrae <leon.alrae@imgtec.com>
      Cc: Anthony Green <green@moxielogic.com>
      Cc: Jia Liu <proljc@gmail.com>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      [AF: Fixed up cpu_copy() manually]
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      2994fd96
  3. 13 2月, 2015 1 次提交
  4. 05 2月, 2015 5 次提交
    • P
      target-arm: Guest cpu endianness determination for virtio KVM ARM/ARM64 · 84f2bed3
      Pranavkumar Sawargaonkar 提交于
      This patch implements a fucntion pointer "virtio_is_big_endian"
      from "CPUClass" structure for arm/arm64.
      Function arm_cpu_is_big_endian() is added to determine and
      return the guest cpu endianness to virtio.
      This is required for running cross endian guests with virtio on ARM/ARM64.
      Signed-off-by: NPranavkumar Sawargaonkar <pranavkumar@linaro.org>
      Message-id: 1423130382-18640-3-git-send-email-pranavkumar@linaro.org
      [PMM: check CPSR_E in env->cpsr_uncached, not env->pstate.]
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      84f2bed3
    • P
      target-arm: Don't define any MMU_MODE*_SUFFIXes · 0dfef7b5
      Peter Maydell 提交于
      target-arm doesn't use any of the MMU-mode specific cpu ldst
      accessor functions. Suppress their generation by not defining
      any of the MMU_MODE*_SUFFIX macros. ("user" and "kernel" are
      too simplistic as descriptions of indexes 0 and 1 anyway.)
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NGreg Bellows <greg.bellows@linaro.org>
      Reviewed-by: NEdgar E. Iglesias <edgar.iglesias@xilinx.com>
      0dfef7b5
    • P
      target-arm: Define correct mmu_idx values and pass them in TB flags · c1e37810
      Peter Maydell 提交于
      We currently claim that for ARM the mmu_idx should simply be the current
      exception level. However this isn't actually correct -- secure EL0 and EL1
      should have separate indexes from non-secure EL0 and EL1 since their
      VA->PA mappings may differ. We also will want an index for stage 2
      translations when we properly support EL2.
      
      Define and document all seven mmu index values that we require, and
      pass the mmu index in the TB flags rather than exception level or
      priv/user bit.
      
      This change doesn't update the get_phys_addr() code, so our page
      table walking still assumes a simplistic "user or priv?" model for
      the moment.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NGreg Bellows <greg.bellows@linaro.org>
      ---
      This leaves some odd gaps in the TB flags usage. I will circle
      back and clean this up later (including moving the other common
      flags like the singlestep ones to the top of the flags word),
      but I didn't want to bloat this patchseries further.
      c1e37810
    • P
      target-arm: Make arm_current_el() return sensible values for M profile · 6d54ed3c
      Peter Maydell 提交于
      Although M profile doesn't have the same concept of exception level
      as A profile, it does have a notion of privileged versus not, which
      we currently track in the privmode TB flag. Support returning this
      information if arm_current_el() is called on an M profile core, so
      that we can identify the correct MMU index to use (and put the MMU
      index in the TB flags) without having to special-case M profile.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NGreg Bellows <greg.bellows@linaro.org>
      6d54ed3c
    • P
      target-arm: Split NO_MIGRATE into ALIAS and NO_RAW · 7a0e58fa
      Peter Maydell 提交于
      We currently mark ARM coprocessor/system register definitions with
      the flag ARM_CP_NO_MIGRATE for two different reasons:
      1) register is an alias on to state that's also visible via
         some other register, and that other register is the one
         responsible for migrating the state
      2) register is not actually state at all (for instance the TLB
         or cache maintenance operation "registers") and it makes no
         sense to attempt to migrate it or otherwise access the raw state
      
      This works fine for identifying which registers should be ignored
      when performing migration, but we also use the same functions for
      synchronizing system register state between QEMU and the kernel
      when using KVM. In this case we don't want to try to sync state
      into registers in category 2, but we do want to sync into registers
      in category 1, because the kernel might have picked a different
      one of the aliases as its choice for which one to expose for
      migration. (In particular, on 32 bit hosts the kernel will
      expose the state in the AArch32 version of the register, but
      TCG's convention is to mark the AArch64 version as the version
      to migrate, even if the CPU being emulated happens to be 32 bit,
      so almost all system registers will hit this issue now that we've
      added AArch64 system emulation.)
      
      Fix this by splitting the NO_MIGRATE flag in two (ALIAS and NO_RAW)
      corresponding to the two different reasons we might not want to
      migrate a register. When setting up the TCG list of registers to
      migrate we honour both flags; when populating the list from KVM,
      only ignore registers which are NO_RAW.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NGreg Bellows <greg.bellows@linaro.org>
      Message-id: 1422282372-13735-2-git-send-email-peter.maydell@linaro.org
      [PMM: changed ARM_CP_NO_MIGRATE to ARM_CP_ALIAS on new SP_EL1 and
       SP_EL2 reginfo stanzas since there was a (semantic) merge conflict
       with the patchset that added those]
      7a0e58fa
  5. 20 1月, 2015 1 次提交
    • P
      exec.c: Drop TARGET_HAS_ICE define and checks · ec53b45b
      Peter Maydell 提交于
      The TARGET_HAS_ICE #define is intended to indicate whether a target-*
      guest CPU implementation supports the breakpoint handling. However,
      all our guest CPUs have that support (the only two which do not
      define TARGET_HAS_ICE are unicore32 and openrisc, and in both those
      cases the bp support is present and the lack of the #define is just
      a bug). So remove the #define entirely: all new guest CPU support
      should include breakpoint handling as part of the basic implementation.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <rth@twiddle.net>
      Message-id: 1420484960-32365-1-git-send-email-peter.maydell@linaro.org
      ec53b45b
  6. 11 12月, 2014 20 次提交
  7. 04 11月, 2014 2 次提交
  8. 24 10月, 2014 5 次提交
  9. 30 9月, 2014 4 次提交