1. 18 6月, 2014 7 次提交
    • J
      kvm: Allow arch to set sigmask length · aed6efb9
      James Hogan 提交于
      MIPS/Linux is unusual in having 128 signals rather than just 64 like
      most other architectures. This means its sigmask is 16 bytes instead of
      8, so allow arches to override the sigmask->len value passed to the
      KVM_SET_SIGNAL_MASK ioctl in kvm_set_signal_mask() by calling
      kvm_set_sigmask_len() from kvm_arch_init(). Otherwise default to 8
      bytes.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Cc: Gleb Natapov <gleb@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      aed6efb9
    • J
      target-mips: get_physical_address: Add KVM awareness · 4ef37e69
      James Hogan 提交于
      MIPS KVM trap & emulate mode (which is currently the only supported
      mode) has to add an extra kseg0/kseg1 at 0x40000000 and an extra
      kseg2/kseg3 at 0x60000000. Take this into account in
      get_physical_address() so that debug memory access works.
      
      This is done by translating the address to a standard kseg0 or kseg2
      address before doing the normal address translation. The real virtual
      address is still used for TLB lookups.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      4ef37e69
    • J
      target-mips: get_physical_address: Add defines for segment bases · 22010ce7
      James Hogan 提交于
      Add preprocessor definitions for 32bit segment bases for use in
      get_physical_address(). These will also be taken advantage of in the
      next patch which adds KVM awareness.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Reviewed-by: NAurelien Jarno <aurelien@aurel32.net>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      22010ce7
    • S
      hw/mips: Add API to convert KVM guest KSEG0 <-> GPA · 253fffe7
      Sanjay Lal 提交于
      Add API for converting physical addresses to KVM guest KSEG0 addresses,
      and fix the existing API for converting KSEG0 addresses to physical
      addresses to work in the KVM case. Both have the same sized KSEG0, so
      it's just a case of fixing the mask.
      
      In KVM trap and emulate mode both the guest kernel and guest userspace
      execute in useg:
          Guest User address space:   0x00000000..0x3fffffff
          Guest Kernel Unmapped:      0x40000000..0x5fffffff
          Guest Kernel Mapped:        0x60000000..0x7fffffff
      Signed-off-by: NSanjay Lal <sanjayl@kymasys.com>
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      253fffe7
    • S
      hw/mips/cputimer: Don't start periodic timer in KVM mode · 353a243e
      Sanjay Lal 提交于
      Compare/Count timer interrupts are handled in-kernel for KVM. Therefore
      don't bother creating the timer at init time if KVM is enabled. This
      will conveniently avoid attempts to set the timeout when
      cpu_mips_store_count() is called at reset with KVM enabled, treating the
      timer as stopped so that CP0_Count is modified directly.
      Signed-off-by: NSanjay Lal <sanjayl@kymasys.com>
      [james.hogan@imgtec.com: Update after "target-mips: Reset CPU timer
      consistently" which moves timer start to reset time]
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      353a243e
    • J
      target-mips: Reset CPU timer consistently · 4b69c7e2
      James Hogan 提交于
      The MIPS CPU timer (CP0 Count/Compare registers & QEMU timer) is
      reset at machine initialisation, including starting the timeout. Both
      registers however are placed before mvp in CPUMIPSState so they will
      both be zeroed on reset by the memset in mips_cpu_reset() including soon
      after init. This doesn't take into account that the timer may be
      running, in which case env->CP0_Count will represent the delta against
      the VM clock and the timeout will need updating.
      
      At init time (cpu_mips_clock_init()), lets only create the timer.
      Setting Count = 1 and starting the timer (cpu_mips_store_count()) can be
      done at reset time from cpu_state_reset(), which is after the memset.
      There is also no need to set CP0_Compare = 0 as that is already handled
      by the memset.
      
      Note that a reset occurs from mips_cpu_realizefn() which is before the
      machine init callback has had a chance to set up the CPU interrupts and
      the CPU timer, so env->timer will be NULL. This case is handled
      explicitly in cpu_mips_store_count(), treating the timer as disabled
      (which will also be the right thing to do when KVM support is added).
      Reported-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      4b69c7e2
    • A
      KVM: Fix GSI number space limit · 00008418
      Alexander Graf 提交于
      KVM tells us the number of GSIs it can handle inside the kernel. That value is
      basically KVM_MAX_IRQ_ROUTES. However when we try to set the GSI mapping table,
      it checks for
      
          r = -EINVAL;
          if (routing.nr >= KVM_MAX_IRQ_ROUTES)
              goto out;
      
      erroring out even when we're only using all of the GSIs. To make sure we never
      hit that limit, let's reduce the number of GSIs we get from KVM by one.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      00008418
  2. 17 6月, 2014 1 次提交
    • P
      Merge remote-tracking branch 'remotes/agraf/tags/signed-ppc-for-upstream' into staging · af44da87
      Peter Maydell 提交于
      Patch queue for ppc - 2014-06-16
      
      This pull request brings a lot of fun things. Among others we have
      
        - e500: u-boot firmware support
        - sPAPR: magic page enablement
        - sPAPR: add "compat" CPU option to support older guests
        - sPAPR: refactorings in preparation for VFIO
        - POWER8 live migration
        - mac99: expose bus frequency
        - little endian core dump, gdb and disas support
        - new ppc64le-linux-user target
        - DFP emulation
        - bug fixes
      
      # gpg: Signature made Mon 16 Jun 2014 12:28:32 BST using RSA key ID 03FEDC60
      # gpg: Can't check signature: public key not found
      
      * remotes/agraf/tags/signed-ppc-for-upstream: (156 commits)
        spapr_pci: Advertise MSI quota
        PPC: KVM: Make pv hcall endian agnostic
        powerpc: use float64 for frsqrte
        spapr: Add kvm-type property
        spapr: Create SPAPRMachine struct
        linux-user: Tell guest about big host page sizes
        spapr_hcall: Add address-translation-mode-on-interrupt resource in H_SET_MODE
        spapr_hcall: Split h_set_mode()
        target-ppc: Enable DABRX SPR and limit it to <=POWER7
        target-ppc: Enable PPR and VRSAVE SPRs migration
        target-ppc: Add POWER8's Event Based Branch (EBB) control SPRs
        KVM: target-ppc: Enable TM state migration
        target-ppc: Add POWER8's TM SPRs
        target-ppc: Add POWER8's MMCR2/MMCRS SPRs
        target-ppc: Enable FSCR facility check for TAR
        target-ppc: Add POWER8's FSCR SPR
        target-ppc: Add POWER8's TIR SPR
        target-ppc: Refactor class init for POWER7/8
        target-ppc: Switch POWER7/8 classes to use correct PMU SPRs
        target-ppc: Make use of gen_spr_power5p_lpar() for POWER7/8
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      af44da87
  3. 16 6月, 2014 32 次提交