Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 373142
b: refs/heads/master
c: 210552c
h: refs/heads/master
v: v3
  • Loading branch information
Marc Zyngier authored and Christoffer Dall committed Apr 29, 2013
1 parent e8d9def commit 404fb28
Show file tree
Hide file tree
Showing 23 changed files with 145 additions and 358 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 03b28f8133165dbe4cd922054d599e26b8119508
refs/heads/master: 210552c1bfe83122a480673660d5ca9821c944ae
8 changes: 0 additions & 8 deletions trunk/Documentation/virtual/kvm/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2772,11 +2772,3 @@ Parameters: args[0] is the MPIC device fd
args[1] is the MPIC CPU number for this vcpu

This capability connects the vcpu to an in-kernel MPIC device.

6.7 KVM_CAP_IRQ_XICS

Architectures: ppc
Parameters: args[0] is the XICS device fd
args[1] is the XICS CPU number (server ID) for this vcpu

This capability connects the vcpu to an in-kernel XICS device.
3 changes: 3 additions & 0 deletions trunk/Documentation/virtual/kvm/devices/mpic.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,7 @@ IRQ Routing:
regard to any subdivisions in chip documentation such as "internal"
or "external" interrupts.

Default routes are established for these pins, with the GSI being equal
to the pin number.

Access to non-SRC interrupts is not implemented through IRQ routing mechanisms.
66 changes: 0 additions & 66 deletions trunk/Documentation/virtual/kvm/devices/xics.txt

This file was deleted.

3 changes: 3 additions & 0 deletions trunk/arch/arm/include/asm/kvm_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,7 @@ static inline void __cpu_init_hyp_mode(unsigned long long pgd_ptr,
kvm_call_hyp((void *)pgd_low, pgd_high, hyp_stack_ptr, vector_ptr);
}

int kvm_perf_init(void);
int kvm_perf_teardown(void);

#endif /* __ARM_KVM_HOST_H__ */
2 changes: 1 addition & 1 deletion trunk/arch/arm/kvm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ kvm-arm-y = $(addprefix ../../../virt/kvm/, kvm_main.o coalesced_mmio.o)

obj-y += kvm-arm.o init.o interrupts.o
obj-y += arm.o handle_exit.o guest.o mmu.o emulate.o reset.o
obj-y += coproc.o coproc_a15.o mmio.o psci.o
obj-y += coproc.o coproc_a15.o mmio.o psci.o perf.o
obj-$(CONFIG_KVM_ARM_VGIC) += vgic.o
obj-$(CONFIG_KVM_ARM_TIMER) += arch_timer.o
4 changes: 4 additions & 0 deletions trunk/arch/arm/kvm/arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,10 @@ static int init_hyp_mode(void)
if (err)
goto out_free_mappings;

kvm_perf_init();

kvm_info("Hyp mode initialized successfully\n");

return 0;
out_free_vfp:
free_percpu(kvm_host_vfp_state);
Expand Down Expand Up @@ -964,6 +967,7 @@ int kvm_arch_init(void *opaque)
/* NOP: Compiling as a module not supported */
void kvm_arch_exit(void)
{
kvm_perf_teardown();
}

static int arm_init(void)
Expand Down
68 changes: 68 additions & 0 deletions trunk/arch/arm/kvm/perf.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Based on the x86 implementation.
*
* Copyright (C) 2012 ARM Ltd.
* Author: Marc Zyngier <marc.zyngier@arm.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <linux/perf_event.h>
#include <linux/kvm_host.h>

#include <asm/kvm_emulate.h>

static int kvm_is_in_guest(void)
{
return kvm_arm_get_running_vcpu() != NULL;
}

static int kvm_is_user_mode(void)
{
struct kvm_vcpu *vcpu;

vcpu = kvm_arm_get_running_vcpu();

if (vcpu)
return !vcpu_mode_priv(vcpu);

return 0;
}

static unsigned long kvm_get_guest_ip(void)
{
struct kvm_vcpu *vcpu;

vcpu = kvm_arm_get_running_vcpu();

if (vcpu)
return *vcpu_pc(vcpu);

return 0;
}

static struct perf_guest_info_callbacks kvm_guest_cbs = {
.is_in_guest = kvm_is_in_guest,
.is_user_mode = kvm_is_user_mode,
.get_guest_ip = kvm_get_guest_ip,
};

int kvm_perf_init(void)
{
return perf_register_guest_info_callbacks(&kvm_guest_cbs);
}

int kvm_perf_teardown(void)
{
return perf_unregister_guest_info_callbacks(&kvm_guest_cbs);
}
2 changes: 0 additions & 2 deletions trunk/arch/ia64/kvm/kvm-ia64.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,9 @@ int kvm_dev_ioctl_check_extension(long ext)
case KVM_CAP_COALESCED_MMIO:
r = KVM_COALESCED_MMIO_PAGE_OFFSET;
break;
#ifdef CONFIG_KVM_DEVICE_ASSIGNMENT
case KVM_CAP_IOMMU:
r = iommu_present(&pci_bus_type);
break;
#endif
default:
r = 0;
}
Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/powerpc/include/asm/kvm_ppc.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,6 @@ extern int kvm_vm_ioctl_xics_irq(struct kvm *kvm, struct kvm_irq_level *args);
extern int kvmppc_xics_hcall(struct kvm_vcpu *vcpu, u32 cmd);
extern u64 kvmppc_xics_get_icp(struct kvm_vcpu *vcpu);
extern int kvmppc_xics_set_icp(struct kvm_vcpu *vcpu, u64 icpval);
extern int kvmppc_xics_connect_vcpu(struct kvm_device *dev,
struct kvm_vcpu *vcpu, u32 cpu);
#else
static inline int kvmppc_xics_enabled(struct kvm_vcpu *vcpu)
{ return 0; }
Expand Down
12 changes: 0 additions & 12 deletions trunk/arch/powerpc/include/uapi/asm/kvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -499,16 +499,4 @@ struct kvm_get_htab_header {
#define KVM_REG_PPC_TLB3PS (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x9a)
#define KVM_REG_PPC_EPTCFG (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x9b)

/* PPC64 eXternal Interrupt Controller Specification */
#define KVM_DEV_XICS_GRP_SOURCES 1 /* 64-bit source attributes */

/* Layout of 64-bit source attribute values */
#define KVM_XICS_DESTINATION_SHIFT 0
#define KVM_XICS_DESTINATION_MASK 0xffffffffULL
#define KVM_XICS_PRIORITY_SHIFT 32
#define KVM_XICS_PRIORITY_MASK 0xff
#define KVM_XICS_LEVEL_SENSITIVE (1ULL << 40)
#define KVM_XICS_MASKED (1ULL << 41)
#define KVM_XICS_PENDING (1ULL << 42)

#endif /* __LINUX_KVM_POWERPC_H */
Loading

0 comments on commit 404fb28

Please sign in to comment.