-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'kvm-arm/timer' of git://git.kernel.org/pub/scm/linux/ke…
…rnel/git/maz/arm-platforms into next/virt From Marc Zyngier, this branch enables virtual GIC and timer for KVM/ARM. * 'kvm-arm/timer' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms: ARM: KVM: arch_timers: Wire the init code and config option ARM: KVM: arch_timers: Add timer world switch ARM: KVM: arch_timers: Add guest timer core support ARM: KVM: Add VGIC configuration option ARM: KVM: VGIC initialisation code ARM: KVM: VGIC control interface world switch ARM: KVM: VGIC interrupt injection ARM: KVM: vgic: retire queued, disabled interrupts ARM: KVM: VGIC virtual CPU interface management ARM: KVM: VGIC distributor handling ARM: KVM: VGIC accept vcpu and dist base addresses from user space ARM: KVM: Initial VGIC infrastructure code ARM: KVM: Keep track of currently running vcpus KVM: ARM: Introduce KVM_ARM_SET_DEVICE_ADDR ioctl ARM: gic: add __ASSEMBLY__ guard to C definitions ARM: gic: define GICH offsets for VGIC support ARM: gic: add missing distributor defintions
- Loading branch information
Showing
18 changed files
with
2,581 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/* | ||
* 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, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
*/ | ||
|
||
#ifndef __ASM_ARM_KVM_ARCH_TIMER_H | ||
#define __ASM_ARM_KVM_ARCH_TIMER_H | ||
|
||
#include <linux/clocksource.h> | ||
#include <linux/hrtimer.h> | ||
#include <linux/workqueue.h> | ||
|
||
struct arch_timer_kvm { | ||
#ifdef CONFIG_KVM_ARM_TIMER | ||
/* Is the timer enabled */ | ||
bool enabled; | ||
|
||
/* Virtual offset */ | ||
cycle_t cntvoff; | ||
#endif | ||
}; | ||
|
||
struct arch_timer_cpu { | ||
#ifdef CONFIG_KVM_ARM_TIMER | ||
/* Registers: control register, timer value */ | ||
u32 cntv_ctl; /* Saved/restored */ | ||
cycle_t cntv_cval; /* Saved/restored */ | ||
|
||
/* | ||
* Anything that is not used directly from assembly code goes | ||
* here. | ||
*/ | ||
|
||
/* Background timer used when the guest is not running */ | ||
struct hrtimer timer; | ||
|
||
/* Work queued with the above timer expires */ | ||
struct work_struct expired; | ||
|
||
/* Background timer active */ | ||
bool armed; | ||
|
||
/* Timer IRQ */ | ||
const struct kvm_irq_level *irq; | ||
#endif | ||
}; | ||
|
||
#ifdef CONFIG_KVM_ARM_TIMER | ||
int kvm_timer_hyp_init(void); | ||
int kvm_timer_init(struct kvm *kvm); | ||
void kvm_timer_vcpu_init(struct kvm_vcpu *vcpu); | ||
void kvm_timer_flush_hwstate(struct kvm_vcpu *vcpu); | ||
void kvm_timer_sync_hwstate(struct kvm_vcpu *vcpu); | ||
void kvm_timer_vcpu_terminate(struct kvm_vcpu *vcpu); | ||
#else | ||
static inline int kvm_timer_hyp_init(void) | ||
{ | ||
return 0; | ||
}; | ||
|
||
static inline int kvm_timer_init(struct kvm *kvm) | ||
{ | ||
return 0; | ||
} | ||
|
||
static inline void kvm_timer_vcpu_init(struct kvm_vcpu *vcpu) {} | ||
static inline void kvm_timer_flush_hwstate(struct kvm_vcpu *vcpu) {} | ||
static inline void kvm_timer_sync_hwstate(struct kvm_vcpu *vcpu) {} | ||
static inline void kvm_timer_vcpu_terminate(struct kvm_vcpu *vcpu) {} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.