1. 15 10月, 2014 1 次提交
  2. 14 10月, 2014 2 次提交
    • C
      arm/arm64: KVM: Ensure memslots are within KVM_PHYS_SIZE · c3058d5d
      Christoffer Dall 提交于
      When creating or moving a memslot, make sure the IPA space is within the
      addressable range of the guest.  Otherwise, user space can create too
      large a memslot and KVM would try to access potentially unallocated page
      table entries when inserting entries in the Stage-2 page tables.
      Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
      Acked-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NChristoffer Dall <christoffer.dall@linaro.org>
      c3058d5d
    • C
      arm64: KVM: Implement 48 VA support for KVM EL2 and Stage-2 · 38f791a4
      Christoffer Dall 提交于
      This patch adds the necessary support for all host kernel PGSIZE and
      VA_SPACE configuration options for both EL2 and the Stage-2 page tables.
      
      However, for 40bit and 42bit PARange systems, the architecture mandates
      that VTCR_EL2.SL0 is maximum 1, resulting in fewer levels of stage-2
      pagge tables than levels of host kernel page tables.  At the same time,
      systems with a PARange > 42bit, we limit the IPA range by always setting
      VTCR_EL2.T0SZ to 24.
      
      To solve the situation with different levels of page tables for Stage-2
      translation than the host kernel page tables, we allocate a dummy PGD
      with pointers to our actual inital level Stage-2 page table, in order
      for us to reuse the kernel pgtable manipulation primitives.  Reproducing
      all these in KVM does not look pretty and unnecessarily complicates the
      32-bit side.
      
      Systems with a PARange < 40bits are not yet supported.
      
       [ I have reworked this patch from its original form submitted by
         Jungseok to take the architecture constraints into consideration.
         There were too many changes from the original patch for me to
         preserve the authorship.  Thanks to Catalin Marinas for his help in
         figuring out a good solution to this challenge.  I have also fixed
         various bugs and missing error code handling from the original
         patch. - Christoffer ]
      Reviewed-by: NCatalin Marinas <catalin.marinas@arm.com>
      Acked-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NJungseok Lee <jungseoklee85@gmail.com>
      Signed-off-by: NChristoffer Dall <christoffer.dall@linaro.org>
      38f791a4
  3. 13 10月, 2014 1 次提交
  4. 10 10月, 2014 5 次提交
  5. 07 10月, 2014 1 次提交
    • A
      ARM: KVM: fix vgic-disabled build · b5e7a955
      Arnd Bergmann 提交于
      The vgic code can be disabled in Kconfig and there are dummy implementations
      of most of the provided API functions for the disabled case.
      
      However, the newly introduced kvm_vgic_destroy/kvm_vgic_vcpu_destroy
      functions are lacking those dummies, resulting in this build error:
      
      arch/arm/kvm/arm.c: In function 'kvm_arch_destroy_vm':
      arch/arm/kvm/arm.c:165:2: error: implicit declaration of function 'kvm_vgic_destroy' [-Werror=implicit-function-declaration]
        kvm_vgic_destroy(kvm);
        ^
      arch/arm/kvm/arm.c: In function 'kvm_arch_vcpu_free':
      arch/arm/kvm/arm.c:248:2: error: implicit declaration of function 'kvm_vgic_vcpu_destroy' [-Werror=implicit-function-declaration]
        kvm_vgic_vcpu_destroy(vcpu);
        ^
      
      This adds two inline helpers to get it to build again in this configuration.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: c1bfb577 ("arm/arm64: KVM: vgic: switch to dynamic allocation")
      Signed-off-by: NChristoffer Dall <christoffer.dall@linaro.org>
      b5e7a955
  6. 29 9月, 2014 1 次提交
    • V
      arm: kvm: fix CPU hotplug · 37a34ac1
      Vladimir Murzin 提交于
      On some platforms with no power management capabilities, the hotplug
      implementation is allowed to return from a smp_ops.cpu_die() call as a
      function return. Upon a CPU onlining event, the KVM CPU notifier tries
      to reinstall the hyp stub, which fails on platform where no reset took
      place following a hotplug event, with the message:
      
      CPU1: smp_ops.cpu_die() returned, trying to resuscitate
      CPU1: Booted secondary processor
      Kernel panic - not syncing: unexpected prefetch abort in Hyp mode at: 0x80409540
      unexpected data abort in Hyp mode at: 0x80401fe8
      unexpected HVC/SVC trap in Hyp mode at: 0x805c6170
      
      since KVM code is trying to reinstall the stub on a system where it is
      already configured.
      
      To prevent this issue, this patch adds a check in the KVM hotplug
      notifier that detects if the HYP stub really needs re-installing when a
      CPU is onlined and skips the installation call if the stub is already in
      place, which means that the CPU has not been reset.
      Signed-off-by: NVladimir Murzin <vladimir.murzin@arm.com>
      Acked-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NChristoffer Dall <christoffer.dall@linaro.org>
      37a34ac1
  7. 26 9月, 2014 3 次提交
  8. 19 9月, 2014 15 次提交
  9. 17 9月, 2014 6 次提交
  10. 16 9月, 2014 2 次提交
    • Z
      kvm: ioapic: conditionally delay irq delivery duringeoi broadcast · 184564ef
      Zhang Haoyu 提交于
      Currently, we call ioapic_service() immediately when we find the irq is still
      active during eoi broadcast. But for real hardware, there's some delay between
      the EOI writing and irq delivery.  If we do not emulate this behavior, and
      re-inject the interrupt immediately after the guest sends an EOI and re-enables
      interrupts, a guest might spend all its time in the ISR if it has a broken
      handler for a level-triggered interrupt.
      
      Such livelock actually happens with Windows guests when resuming from
      hibernation.
      
      As there's no way to recognize the broken handle from new raised ones, this patch
      delays an interrupt if 10.000 consecutive EOIs found that the interrupt was
      still high.  The guest can then make a little forward progress, until a proper
      IRQ handler is set or until some detection routine in the guest (such as
      Linux's note_interrupt()) recognizes the situation.
      
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NZhang Haoyu <zhanghy@sangfor.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      184564ef
    • G
      KVM: x86: Use kvm_make_request when applicable · 105b21bb
      Guo Hui Liu 提交于
      This patch replace the set_bit method by kvm_make_request
      to make code more readable and consistent.
      Signed-off-by: NGuo Hui Liu <liuguohui@gmail.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      105b21bb
  11. 11 9月, 2014 3 次提交