#include <linux/cpu.h>
#include <linux/debugfs.h>
#include <linux/interrupt.h>
#include <linux/kvm_host.h>
#include <linux/seq_file.h>
#include <kvm/arm_vgic.h>
#include <asm/kvm_mmu.h>
#include "vgic.h"
Go to the source code of this file.
|
static void | iter_next (struct vgic_state_iter *iter) |
|
static void | iter_init (struct kvm *kvm, struct vgic_state_iter *iter, loff_t pos) |
|
static bool | end_of_vgic (struct vgic_state_iter *iter) |
|
static void * | vgic_debug_start (struct seq_file *s, loff_t *pos) |
|
static void * | vgic_debug_next (struct seq_file *s, void *v, loff_t *pos) |
|
static void | vgic_debug_stop (struct seq_file *s, void *v) |
|
static void | print_dist_state (struct seq_file *s, struct vgic_dist *dist) |
|
static void | print_header (struct seq_file *s, struct vgic_irq *irq, struct kvm_vcpu *vcpu) |
|
static void | print_irq_state (struct seq_file *s, struct vgic_irq *irq, struct kvm_vcpu *vcpu) |
|
static int | vgic_debug_show (struct seq_file *s, void *v) |
|
| DEFINE_SEQ_ATTRIBUTE (vgic_debug) |
|
void | vgic_debug_init (struct kvm *kvm) |
|
void | vgic_debug_destroy (struct kvm *kvm) |
|
◆ DEFINE_SEQ_ATTRIBUTE()
DEFINE_SEQ_ATTRIBUTE |
( |
vgic_debug |
| ) |
|
◆ end_of_vgic()
Definition at line 75 of file vgic-debug.c.
#define VGIC_NR_PRIVATE_IRQS
◆ iter_init()
static void iter_init |
( |
struct kvm * |
kvm, |
|
|
struct vgic_state_iter * |
iter, |
|
|
loff_t |
pos |
|
) |
| |
|
static |
Definition at line 55 of file vgic-debug.c.
58 int nr_cpus = atomic_read(&kvm->online_vcpus);
60 memset(iter, 0,
sizeof(*iter));
63 iter->
nr_spis = kvm->arch.vgic.nr_spis;
64 if (kvm->arch.vgic.vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3) {
static void iter_next(struct vgic_state_iter *iter)
int vgic_copy_lpi_list(struct kvm *kvm, struct kvm_vcpu *vcpu, u32 **intid_ptr)
◆ iter_next()
◆ print_dist_state()
static void print_dist_state |
( |
struct seq_file * |
s, |
|
|
struct vgic_dist * |
dist |
|
) |
| |
|
static |
Definition at line 143 of file vgic-debug.c.
145 bool v3 = dist->
vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3;
147 seq_printf(s,
"Distributor\n");
148 seq_printf(s,
"===========\n");
149 seq_printf(s,
"vgic_model:\t%s\n", v3 ?
"GICv3" :
"GICv2");
150 seq_printf(s,
"nr_spis:\t%d\n", dist->
nr_spis);
153 seq_printf(s,
"enabled:\t%d\n", dist->
enabled);
156 seq_printf(s,
"P=pending_latch, L=line_level, A=active\n");
157 seq_printf(s,
"E=enabled, H=hw, C=config (level=1, edge=0)\n");
158 seq_printf(s,
"G=group\n");
◆ print_header()
static void print_header |
( |
struct seq_file * |
s, |
|
|
struct vgic_irq * |
irq, |
|
|
struct kvm_vcpu * |
vcpu |
|
) |
| |
|
static |
Definition at line 161 of file vgic-debug.c.
173 seq_printf(s,
"%s%2d TYP ID TGT_ID PLAEHCG HWID TARGET SRC PRI VCPU_ID\n", hdr,
id);
174 seq_printf(s,
"----------------------------------------------------------------\n");
◆ print_irq_state()
static void print_irq_state |
( |
struct seq_file * |
s, |
|
|
struct vgic_irq * |
irq, |
|
|
struct kvm_vcpu * |
vcpu |
|
) |
| |
|
static |
Definition at line 177 of file vgic-debug.c.
199 err = irq_get_irqchip_state(irq->
host_irq,
200 IRQCHIP_STATE_PENDING,
205 seq_printf(s,
" %s %4d "
227 (irq->
vcpu) ? irq->
vcpu->vcpu_idx : -1);
struct kvm_vcpu * target_vcpu
enum vgic_irq_config config
static void print_header(struct seq_file *s, struct vgic_irq *irq, struct kvm_vcpu *vcpu)
#define vgic_irq_is_sgi(intid)
◆ vgic_debug_destroy()
void vgic_debug_destroy |
( |
struct kvm * |
kvm | ) |
|
◆ vgic_debug_init()
void vgic_debug_init |
( |
struct kvm * |
kvm | ) |
|
Definition at line 272 of file vgic-debug.c.
274 debugfs_create_file(
"vgic-state", 0444, kvm->debugfs_dentry, kvm,
◆ vgic_debug_next()
static void* vgic_debug_next |
( |
struct seq_file * |
s, |
|
|
void * |
v, |
|
|
loff_t * |
pos |
|
) |
| |
|
static |
Definition at line 111 of file vgic-debug.c.
113 struct kvm *kvm = s->private;
static bool end_of_vgic(struct vgic_state_iter *iter)
◆ vgic_debug_show()
static int vgic_debug_show |
( |
struct seq_file * |
s, |
|
|
void * |
v |
|
) |
| |
|
static |
Definition at line 230 of file vgic-debug.c.
232 struct kvm *kvm = s->private;
235 struct kvm_vcpu *vcpu = NULL;
243 if (!kvm->arch.vgic.initialized)
247 vcpu = kvm_get_vcpu(kvm, iter->
vcpu_id);
251 seq_printf(s,
" LPI %4d freed\n", iter->
intid);
255 raw_spin_lock_irqsave(&irq->
irq_lock, flags);
257 raw_spin_unlock_irqrestore(&irq->
irq_lock, flags);
static void print_irq_state(struct seq_file *s, struct vgic_irq *irq, struct kvm_vcpu *vcpu)
static void print_dist_state(struct seq_file *s, struct vgic_dist *dist)
struct vgic_irq * vgic_get_irq(struct kvm *kvm, struct kvm_vcpu *vcpu, u32 intid)
void vgic_put_irq(struct kvm *kvm, struct vgic_irq *irq)
◆ vgic_debug_start()
static void* vgic_debug_start |
( |
struct seq_file * |
s, |
|
|
loff_t * |
pos |
|
) |
| |
|
static |
Definition at line 83 of file vgic-debug.c.
85 struct kvm *kvm = s->private;
88 mutex_lock(&kvm->arch.config_lock);
89 iter = kvm->arch.vgic.iter;
91 iter = ERR_PTR(-EBUSY);
95 iter = kmalloc(
sizeof(*iter), GFP_KERNEL);
97 iter = ERR_PTR(-ENOMEM);
102 kvm->arch.vgic.iter = iter;
107 mutex_unlock(&kvm->arch.config_lock);
static void iter_init(struct kvm *kvm, struct vgic_state_iter *iter, loff_t pos)
◆ vgic_debug_stop()
static void vgic_debug_stop |
( |
struct seq_file * |
s, |
|
|
void * |
v |
|
) |
| |
|
static |
Definition at line 123 of file vgic-debug.c.
125 struct kvm *kvm = s->private;
135 mutex_lock(&kvm->arch.config_lock);
136 iter = kvm->arch.vgic.iter;
139 kvm->arch.vgic.iter = NULL;
140 mutex_unlock(&kvm->arch.config_lock);
◆ vgic_debug_sops
const struct seq_operations vgic_debug_sops |
|
static |
Initial value:= {
}
static void * vgic_debug_next(struct seq_file *s, void *v, loff_t *pos)
static void vgic_debug_stop(struct seq_file *s, void *v)
static void * vgic_debug_start(struct seq_file *s, loff_t *pos)
static int vgic_debug_show(struct seq_file *s, void *v)
Definition at line 230 of file vgic-debug.c.