summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * KVM: PPC: e500: Add support for EPTCFG registerMihai Caraman2013-04-265-0/+24
| | | | | | | | | | | | | | | | EPTCFG register defined by E.PT is accessed unconditionally by Linux guests in the presence of MAV 2.0. Emulate it now. Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
| * KVM: PPC: e500: Add support for TLBnPS registersMihai Caraman2013-04-266-0/+59
| | | | | | | | | | | | | | | | Add support for TLBnPS registers available in MMU Architecture Version (MAV) 2.0. Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
| * KVM: PPC: e500: Move vcpu's MMU configuration to dedicated functionsMihai Caraman2013-04-261-22/+38
| | | | | | | | | | | | | | | | Vcpu's MMU default configuration and geometry update logic was buried in a chunk of code. Move them to dedicated functions to add more clarity. Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
| * KVM: PPC: e500: Expose MMU registers via ONE_REGMihai Caraman2013-04-266-4/+134
| | | | | | | | | | | | | | | | | | MMU registers were exposed to user-space using sregs interface. Add them to ONE_REG interface using kvmppc_get_one_reg/kvmppc_set_one_reg delegation mechanism. Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
| * KVM: PPC: Book3E: Refactor ONE_REG ioctl implementationMihai Caraman2013-04-264-47/+91
| | | | | | | | | | | | | | | | | | | | | | Refactor Book3E ONE_REG ioctl implementation to use kvmppc_get_one_reg/ kvmppc_set_one_reg delegation interface introduced by Book3S. This is necessary for MMU SPRs which are platform specifics. Get rid of useless case braces in the process. Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
| * booke: exit to user space if emulator requestBharat Bhushan2013-04-261-0/+3
| | | | | | | | | | | | | | | | This allows the exit to user space if emulator request by returning EMULATE_EXIT_USER. This will be used in subsequent patches in list Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
| * KVM: extend EMULATE_EXIT_USER to support different exit reasonsBharat Bhushan2013-04-262-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently the instruction emulator code returns EMULATE_EXIT_USER and common code initializes the "run->exit_reason = .." and "vcpu->arch.hcall_needed = .." with one fixed reason. But there can be different reasons when emulator need to exit to user space. To support that the "run->exit_reason = .." and "vcpu->arch.hcall_needed = .." initialization is moved a level up to emulator. Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
| * Rename EMULATE_DO_PAPR to EMULATE_EXIT_USERBharat Bhushan2013-04-263-3/+3
| | | | | | | | | | | | | | | | | | | | Instruction emulation return EMULATE_DO_PAPR when it requires exit to userspace on book3s. Similar return is required for booke. EMULATE_DO_PAPR reads out to be confusing so it is renamed to EMULATE_EXIT_USER. Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
| * KVM: PPC: debug stub interface parameter definedBharat Bhushan2013-04-264-6/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch defines the interface parameter for KVM_SET_GUEST_DEBUG ioctl support. Follow up patches will use this for setting up hardware breakpoints, watchpoints and software breakpoints. Also kvm_arch_vcpu_ioctl_set_guest_debug() is brought one level below. This is because I am not sure what is required for book3s. So this ioctl behaviour will not change for book3s. Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
| * KVM: PPC: cache flush for kernel managed pagesBharat Bhushan2013-04-261-1/+8
| | | | | | | | | | | | | | | | Kernel can only access pages which maps as memory. So flush only the valid kernel pages. Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* | KVM: x86: Rework request for immediate exitJan Kiszka2013-04-285-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | The VMX implementation of enable_irq_window raised KVM_REQ_IMMEDIATE_EXIT after we checked it in vcpu_enter_guest. This caused infinite loops on vmentry. Fix it by letting enable_irq_window signal the need for an immediate exit via its return value and drop KVM_REQ_IMMEDIATE_EXIT. This issue only affects nested VMX scenarios. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
* | kvm, svm: Fix typo in printk messageBorislav Petkov2013-04-281-1/+1
| | | | | | | | | | | | | | | | It is "exit_int_info". It is actually EXITINTINFO in the official docs but we don't like screaming docs. Signed-off-by: Borislav Petkov <bp@suse.de> Signed-off-by: Gleb Natapov <gleb@redhat.com>
* | KVM: VMX: remove unprintable characters from commentJan Kiszka2013-04-281-1/+1
| | | | | | | | | | | | | | Slipped in while copy&pasting from the SDM. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
* | Merge branch 'kvm-arm-cleanup' from git://github.com/columbia/linux-kvm-arm.gitGleb Natapov2013-04-2519-387/+585
|\ \ | |/ |/|
| * ARM: KVM: Fix length of mmio accessMarc Zyngier2013-03-071-3/+4
| | | | | | | | | | | | | | | | | | | | | | Instead of hardcoding the maximum MMIO access to be 4 bytes, compare it to sizeof(unsigned long), which will do the right thing on both 32 and 64bit systems. Same thing for sign extention. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Christoffer Dall <cdall@cs.columbia.edu>
| * ARM: KVM: sanitize freeing of HYP page tablesMarc Zyngier2013-03-071-18/+26
| | | | | | | | | | | | | | | | | | | | | | | | Instead of trying to free everything from PAGE_OFFSET to the top of memory, use the virt_addr_valid macro to check the upper limit. Also do the same for the vmalloc region where the IO mappings are allocated. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Christoffer Dall <cdall@cs.columbia.edu>
| * ARM: KVM: move kvm_handle_wfi to handle_exit.cMarc Zyngier2013-03-073-17/+19
| | | | | | | | | | | | It has little to do in emulate.c these days... Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
| * ARM: KVM: change kvm_tlb_flush_vmid to kvm_tlb_flush_vmid_ipaMarc Zyngier2013-03-073-8/+11
| | | | | | | | | | | | | | | | | | | | | | v8 is capable of invalidating Stage-2 by IPA, but v7 is not. Change kvm_tlb_flush_vmid() to take an IPA parameter, which is then ignored by the invalidation code (and nuke the whole TLB as it always did). This allows v8 to implement a more optimized strategy. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
| * ARM: KVM: move include of asm/idmap.h to kvm_mmu.hMarc Zyngier2013-03-072-1/+1
| | | | | | | | | | | | | | Since the arm64 code doesn't have a global asm/idmap.h file, move the inclusion to asm/kvm_mmu.h. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
| * ARM: KVM: vgic: decouple alignment restriction from page sizeMarc Zyngier2013-03-071-1/+1
| | | | | | | | | | | | | | | | | | The virtual GIC is supposed to be 4kB aligned. On a 64kB page system, comparing the alignment to PAGE_SIZE is wrong. Use SZ_4K instead. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
| * ARM: KVM: fix fault_ipa computingMarc Zyngier2013-03-071-2/+7
| | | | | | | | | | | | | | | | | | | | | | The ARM ARM says that HPFAR reports bits [39:12] of the faulting IPA, and we need to complement it with the bottom 12 bits of the faulting VA. This is always 12 bits, irrespective of the page size. Makes it clearer in the code. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
| * ARM: KVM: move kvm_target_cpu to guest.cMarc Zyngier2013-03-072-17/+17
| | | | | | | | | | | | | | guest.c already contains some target-specific checks. Let's move kvm_target_cpu() over there so arm.c is mostly target agnostic. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
| * ARM: KVM: fix address validation for HYP mappingsMarc Zyngier2013-03-071-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | __create_hyp_mappings() performs some kind of address validation before creating the mapping, by verifying that the start address is above PAGE_OFFSET. This check is not completely correct for kernel memory (the upper boundary has to be checked as well so we do not end up with highmem pages), and wrong for IO mappings (the mapping must exist in the vmalloc region). Fix this by using the proper predicates (virt_addr_valid and is_vmalloc_addr), which also work correctly on ARM64 (where the vmalloc region is below PAGE_OFFSET). Also change the BUG_ON() into a less agressive error return. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
| * ARM: KVM: allow HYP mappings to be at an offset from kernel mappingsMarc Zyngier2013-03-072-16/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | arm64 cannot represent the kernel VAs in HYP mode, because of the lack of TTBR1 at EL2. A way to cope with this situation is to have HYP VAs to be an offset from the kernel VAs. Introduce macros to convert a kernel VA to a HYP VA, make the HYP mapping functions use these conversion macros. Also change the documentation to reflect the existence of the offset. On ARM, where we can have an identity mapping between kernel and HYP, the macros are without any effect. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
| * ARM: KVM: use kvm_kernel_vfp_t as an abstract type for VFP containersMarc Zyngier2013-03-072-5/+7
| | | | | | | | | | | | | | In order to keep the VFP allocation code common, use an abstract type for the VFP containers. Maps onto struct vfp_hard_struct on ARM. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
| * ARM: KVM: move hyp init to kvm_host.hMarc Zyngier2013-03-072-11/+20
| | | | | | | | | | | | | | Make the split of the pgd_ptr an implementation specific thing by moving the init call to an inline function. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
| * ARM: KVM: remove superfluous include from kvm_vgic.hMarc Zyngier2013-03-071-1/+0Star
| | | | | | | | Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
| * ARM: KVM: abstract most MMU operationsMarc Zyngier2013-03-072-46/+70
| | | | | | | | | | | | | | Move low level MMU-related operations to kvm_mmu.h. This makes the MMU code reusable by the arm64 port. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
| * KVM: ARM: Reintroduce trace_kvm_hvcChristoffer Dall2013-03-072-0/+10
| | | | | | | | | | | | | | This one got lost in the move to handle_exit, so let's reintroduce it using an accessor to the immediate value field like the other ones. Signed-off-by: Christoffer Dall <cdall@cs.columbia.edu>
| * ARM: KVM: move exit handler selection to a separate fileMarc Zyngier2013-03-074-114/+144
| | | | | | | | | | | | | | | | | | | | The exit handler selection code cannot be shared with arm64 (two different modes, more exception classes...). Move it to a separate file (handle_exit.c). Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Christoffer Dall <cdall@cs.columbia.edu>
| * ARM: KVM: move kvm_condition_valid to emulate.cMarc Zyngier2013-03-073-45/+46
| | | | | | | | | | | | | | This is really hardware emulation, and as such it better be with its little friends. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
| * ARM: KVM: abstract HSR_EC_IABT awayMarc Zyngier2013-03-072-5/+8
| | | | | | | | Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
| * ARM: KVM: abstract fault decoding awayMarc Zyngier2013-03-072-1/+6
| | | | | | | | Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
| * ARM: KVM: abstract exception class decoding awayMarc Zyngier2013-03-073-3/+8
| | | | | | | | Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
| * ARM: KVM: abstract IL decoding awayMarc Zyngier2013-03-074-4/+9
| | | | | | | | | | Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Christoffer Dall <cdall@cs.columbia.edu>
| * ARM: KVM: abstract SAS decoding awayMarc Zyngier2013-03-072-14/+19
| | | | | | | | | | Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Christoffer Dall <cdall@cs.columbia.edu>
| * ARM: KVM: abstract S1TW abort detection awayMarc Zyngier2013-03-073-1/+7
| | | | | | | | | | Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Christoffer Dall <cdall@cs.columbia.edu>
| * ARM: KVM: abstract (and fix) external abort detection awayMarc Zyngier2013-03-073-1/+9
| | | | | | | | | | | | | | Bit 8 is cache maintenance, bit 9 is external abort. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Christoffer Dall <cdall@cs.columbia.edu>
| * ARM: KVM: abstract HSR_SRT_{MASK,SHIFT} awayMarc Zyngier2013-03-072-1/+6
| | | | | | | | Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
| * ARM: KVM: abstract HSR_SSE awayMarc Zyngier2013-03-072-1/+6
| | | | | | | | | | Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Christoffer Dall <cdall@cs.columbia.edu>
| * ARM: KVM: abstract HSR_WNR awayMarc Zyngier2013-03-072-1/+6
| | | | | | | | | | Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Christoffer Dall <cdall@cs.columbia.edu>
| * ARM: KVM: abstract HSR_ISV awayMarc Zyngier2013-03-072-1/+6
| | | | | | | | | | Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Christoffer Dall <cdall@cs.columbia.edu>
| * ARM: KVM: abstract fault register accessesMarc Zyngier2013-03-077-55/+78
| | | | | | | | | | | | | | Instead of directly accessing the fault registers, use proper accessors so the core code can be shared. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
| * ARM: KVM: convert GP registers from u32 to unsigned longMarc Zyngier2013-03-076-28/+28
| | | | | | | | | | | | | | | | | | | | | | On 32bit ARM, unsigned long is guaranteed to be a 32bit quantity. On 64bit ARM, it is a 64bit quantity. In order to be able to share code between the two architectures, convert the registers to be unsigned long, so the core code can be oblivious of the change. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
| * KVM: ARM: Fix wrong address in commentJonghwan Choi2013-03-071-2/+2
| | | | | | | | | | | | | | hyp_hvc vector offset is 0x14 and hyp_svc vector offset is 0x8. Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com> Signed-off-by: Christoffer Dall <cdall@cs.columbia.edu>
* | KVM: X86 emulator: fix source operand decoding for 8bit mov[zs]x instructionsGleb Natapov2013-04-251-0/+4
| | | | | | | | | | | | | | | | Source operand for one byte mov[zs]x is decoded incorrectly if it is in high byte register. Fix that. Cc: stable@vger.kernel.org Signed-off-by: Gleb Natapov <gleb@redhat.com>
* | KVM: nVMX: VM_ENTRY/EXIT_LOAD_IA32_EFER overrides EFER.LMA settingsJan Kiszka2013-04-221-2/+2
| | | | | | | | | | | | | | | | | | | | If we load the complete EFER MSR on entry or exit, EFER.LMA (and LME) loading is skipped. Their consistency is already checked now before starting the transition. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
* | KVM: nVMX: Validate EFER values for VM_ENTRY/EXIT_LOAD_IA32_EFERJan Kiszka2013-04-223-10/+60
| | | | | | | | | | | | | | | | | | | | | | As we may emulate the loading of EFER on VM-entry and VM-exit, implement the checks that VMX performs on the guest and host values on vmlaunch/ vmresume. Factor out kvm_valid_efer for this purpose which checks for set reserved bits. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
* | KVM: nVMX: Fix conditions for NMI injectionJan Kiszka2013-04-221-0/+26
| | | | | | | | | | | | | | | | | | The logic for checking if interrupts can be injected has to be applied also on NMIs. The difference is that if NMI interception is on these events are consumed and blocked by the VM exit. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
* | KVM: VMX: Move vmx_nmi_allowed after vmx_set_nmi_maskJan Kiszka2013-04-221-10/+10
| | | | | | | | | | | | | | | | vmx_set_nmi_mask will soon be used by vmx_nmi_allowed. No functional changes. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>