Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | arch/powerpc/kvm/book3s_xive.c |
int kvmppc_xive_get_xive(struct kvm *kvm, u32 irq, u32 *server, u32 *priority) {
struct kvmppc_xive *xive = kvm->arch.xive;
struct kvmppc_xive_src_block *sb;
struct kvmppc_xive_irq_state *state;
u16 idx;
if (!xive)
return -ENODEV;
sb = kvmppc_xive_find_source(xive, irq, &idx);
if (!sb)
return -... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/book3s_xive.c | int kvmppc_xive_int_on(struct kvm *kvm, u32 irq) {
struct kvmppc_xive *xive = kvm->arch.xive;
struct kvmppc_xive_src_block *sb;
struct kvmppc_xive_irq_state *state;
u16 idx;
if (!xive)
return -ENODEV;
sb = kvmppc_xive_find_source(xive, irq, &idx);
if (!sb)
return -EINVAL;
state = &sb->irq_stat... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/book3s_xive.c | int kvmppc_xive_int_off(struct kvm *kvm, u32 irq) {
struct kvmppc_xive *xive = kvm->arch.xive;
struct kvmppc_xive_src_block *sb;
struct kvmppc_xive_irq_state *state;
u16 idx;
if (!xive)
return -ENODEV;
sb = kvmppc_xive_find_source(xive, irq, &idx);
if (!sb)
return -EINVAL;
state = &sb->irq_sta... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/book3s_xive.c | u64 kvmppc_xive_get_icp(struct kvm_vcpu *vcpu) {
struct kvmppc_xive_vcpu *xc = vcpu->arch.xive_vcpu;
if (!xc)
return 0;
return (u64)xc->cppr << KVM_REG_PPC_ICP_CPPR_SHIFT |
(u64)xc->mfrr << KVM_REG_PPC_ICP_MFRR_SHIFT |
(u64)0xff << KVM_REG_PPC_ICP_PPRI_SHIFT;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/book3s_xive.c | static void xive_pre_save_set_queued(struct kvmppc_xive *xive, u32 irq) {
struct kvmppc_xive_src_block *sb;
struct kvmppc_xive_irq_state *state;
u16 idx;
sb = kvmppc_xive_find_source(xive, irq, &idx);
if (!sb)
return;
state = &sb->irq_state[idx];
if (!state->valid) {
pr_err("invalid irq 0x%x in... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/book3s_xive.c | struct kvmppc_xive_src_block *
kvmppc_xive_create_src_block(struct kvmppc_xive *xive, int irq) {
struct kvmppc_xive_src_block *sb;
int i, bid;
bid = irq >> KVMPPC_XICS_ICS_SHIFT;
mutex_lock(&xive->lock);
if (xive->src_blocks[bid])
goto out;
/* Create the ICS */
sb = kzalloc(sizeof(*sb), GFP_KERNEL... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/book3s_xive.c | int kvmppc_xive_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level,
bool line_status) {
struct kvmppc_xive *xive = kvm->arch.xive;
struct kvmppc_xive_src_block *sb;
struct kvmppc_xive_irq_state *state;
u16 idx;
if (!xive)
return -ENODEV;
sb = kvmppc_xive_find_source... | [
1,
0
] |
Linux Kernel | arch/powerpc/kvm/book3s_xive.c | void kvmppc_xive_free_sources(struct kvmppc_xive_src_block *sb) {
int i;
for (i = 0; i < KVMPPC_XICS_IRQ_PER_ICS; i++) {
struct kvmppc_xive_irq_state *state = &sb->irq_state[i];
if (!state->valid)
continue;
kvmppc_xive_cleanup_irq(state->ipi_number, &state->ipi_data);
xive_cleanup_irq_data(... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/book3s_xive.c | struct kvmppc_xive *kvmppc_xive_get_device(struct kvm *kvm, u32 type) {
struct kvmppc_xive **kvm_xive_device =
type == KVM_DEV_TYPE_XIVE ? &kvm->arch.xive_devices.native
: &kvm->arch.xive_devices.xics_on_xive;
struct kvmppc_xive *xive = *kvm_xive_device;
if (!xive) {
xiv... | [
1,
0
] |
Linux Kernel | arch/powerpc/kvm/book3s_xive.c | static int kvmppc_xive_create(struct kvm_device *dev, u32 type) {
struct kvmppc_xive *xive;
struct kvm *kvm = dev->kvm;
pr_devel("Creating xive for partition\n");
if (kvm->arch.xive)
return -EEXIST;
xive = kvmppc_xive_get_device(kvm, type);
if (!xive)
return -ENOMEM;
dev->private = xive;
xiv... | [
1,
0
] |
Linux Kernel | arch/powerpc/kvm/book3s_xive.c | int kvmppc_xive_xics_hcall(struct kvm_vcpu *vcpu, u32 req) {
struct kvmppc_vcore *vc = vcpu->arch.vcore;
if (!kvmppc_xics_enabled(vcpu))
return H_TOO_HARD;
switch (req) {
case H_XIRR:
return xive_vm_h_xirr(vcpu);
case H_CPPR:
return xive_vm_h_cppr(vcpu, kvmppc_get_gpr(vcpu, 4));
case H_EOI:
... | [
1,
0
] |
Linux Kernel | arch/powerpc/kvm/book3s_xive.h |
static inline struct kvmppc_xive_src_block *
kvmppc_xive_find_source(struct kvmppc_xive *xive, u32 irq, u16 *source) {
u32 bid = irq >> KVMPPC_XICS_ICS_SHIFT;
u16 src = irq & KVMPPC_XICS_SRC_MASK;
if (source)
*source = src;
if (bid > KVMPPC_XICS_MAX_ICS_ID)
return NULL;
return xive->src_blocks[bid];... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/book3s_xive.h |
static inline u8 xive_prio_to_guest(u8 prio) { return prio; } | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/book3s_xive_native.c | static vm_fault_t xive_native_tima_fault(struct vm_fault *vmf) {
struct vm_area_struct *vma = vmf->vma;
switch (vmf->pgoff - vma->vm_pgoff) {
case 0:
case 1: /* HV - forbid access */
return VM_FAULT_SIGBUS;
case 2: /* OS */
vmf_insert_pfn(vma, vmf->address, xive_tima_os >> PAGE_SHIFT);
return VM_... | [
0,
1
] |
Linux Kernel | arch/powerpc/kvm/book3s_xive_native.c |
static int kvmppc_xive_native_update_source_config(
struct kvmppc_xive *xive, struct kvmppc_xive_src_block *sb,
struct kvmppc_xive_irq_state *state, u32 server, u8 priority, bool masked,
u32 eisn) {
struct kvm *kvm = xive->kvm;
u32 hw_num;
int rc = 0;
arch_spin_lock(&sb->lock);
if (state->act_s... | [
1,
0
] |
Linux Kernel | arch/powerpc/kvm/book3s_xive_native.c | static int kvmppc_xive_native_vcpu_eq_sync(struct kvm_vcpu *vcpu) {
struct kvmppc_xive_vcpu *xc = vcpu->arch.xive_vcpu;
unsigned int prio;
int srcu_idx;
if (!xc)
return -ENOENT;
for (prio = 0; prio < KVMPPC_XIVE_Q_COUNT; prio++) {
struct xive_q *q = &xc->queues[prio];
if (!q->qpage)
conti... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/book3s_xive_native.c |
static int kvmppc_xive_native_get_attr(struct kvm_device *dev,
struct kvm_device_attr *attr) {
struct kvmppc_xive *xive = dev->private;
switch (attr->group) {
case KVM_DEV_XIVE_GRP_EQ_CONFIG:
return kvmppc_xive_native_get_queue_config(xive, attr->attr, attr->addr);
}... | [
1,
0
] |
Linux Kernel | arch/powerpc/kvm/book3s_xive_native.c |
static int kvmppc_xive_native_has_attr(struct kvm_device *dev,
struct kvm_device_attr *attr) {
switch (attr->group) {
case KVM_DEV_XIVE_GRP_CTRL:
switch (attr->attr) {
case KVM_DEV_XIVE_RESET:
case KVM_DEV_XIVE_EQ_SYNC:
case KVM_DEV_XIVE_NR_SERVERS:
retu... | [
1,
0
] |
Linux Kernel | arch/powerpc/kvm/booke.c |
static void kvmppc_vcpu_sync_spe(struct kvm_vcpu *vcpu) {
if (vcpu->arch.shared->msr & MSR_SPE) {
if (!(vcpu->arch.shadow_msr & MSR_SPE))
kvmppc_vcpu_enable_spe(vcpu);
} else if (vcpu->arch.shadow_msr & MSR_SPE) {
kvmppc_vcpu_disable_spe(vcpu);
}
}
#else | [
1,
0
] |
Linux Kernel | arch/powerpc/kvm/booke.c | static void kvmppc_vcpu_sync_spe(struct kvm_vcpu *vcpu) {}
#endif | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/booke.c | static inline void kvmppc_save_guest_altivec(struct kvm_vcpu *vcpu) {
#ifdef CONFIG_ALTIVEC
if (cpu_has_feature(CPU_FTR_ALTIVEC)) {
if (current->thread.regs->msr & MSR_VEC)
giveup_altivec(current);
current->thread.vr_save_area = NULL;
}
#endif
} | [
1,
0
] |
Linux Kernel | arch/powerpc/kvm/booke.c |
void kvmppc_core_queue_data_storage(struct kvm_vcpu *vcpu, ulong dear_flags,
ulong esr_flags) {
vcpu->arch.queued_dear = dear_flags;
vcpu->arch.queued_esr = esr_flags;
kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_DATA_STORAGE);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/booke.c |
void kvmppc_core_queue_itlb_miss(struct kvm_vcpu *vcpu) {
kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_ITLB_MISS);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/booke.c |
void kvmppc_core_queue_dec(struct kvm_vcpu *vcpu) {
kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_DECREMENTER);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/booke.c |
void kvmppc_core_dequeue_dec(struct kvm_vcpu *vcpu) {
clear_bit(BOOKE_IRQPRIO_DECREMENTER, &vcpu->arch.pending_exceptions);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/booke.c |
void kvmppc_core_queue_debug(struct kvm_vcpu *vcpu) {
kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_DEBUG);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/booke.c | static int kvmppc_resume_inst_load(struct kvm_vcpu *vcpu,
enum emulation_result emulated,
u32 last_inst) {
switch (emulated) {
case EMULATE_AGAIN:
return RESUME_GUEST;
case EMULATE_FAIL:
pr_debug("%s: load instruction from guest addres... | [
1,
0
] |
Linux Kernel | arch/powerpc/kvm/booke.c |
int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,
struct kvm_sregs *sregs) {
int ret;
vcpu_load(vcpu);
sregs->pvr = vcpu->arch.pvr;
get_sregs_base(vcpu, sregs);
get_sregs_arch206(vcpu, sregs);
ret = vcpu->kvm->arch.kvm_ops->get_sregs(vcpu, sregs);
vcpu_put(vcp... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/booke.c |
int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu,
struct kvm_translation *tr) {
int r;
vcpu_load(vcpu);
r = kvmppc_core_vcpu_translate(vcpu, tr);
vcpu_put(vcpu);
return r;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/booke.c |
int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, struct kvm_dirty_log *log) {
return -EOPNOTSUPP;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/booke.c | void kvmppc_clr_tsr_bits(struct kvm_vcpu *vcpu, u32 tsr_bits) {
clear_bits(tsr_bits, &vcpu->arch.tsr);
if (tsr_bits & (TSR_ENW | TSR_WIS))
arm_next_watchdog(vcpu);
update_timer_ints(vcpu);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/booke.c | int kvmppc_xlate(struct kvm_vcpu *vcpu, ulong eaddr, enum xlate_instdata xlid,
enum xlate_readwrite xlrw, struct kvmppc_pte *pte) {
int gtlb_index;
gpa_t gpaddr;
#ifdef CONFIG_KVM_E500V2
if (!(vcpu->arch.shared->msr & MSR_PR) &&
(eaddr & PAGE_MASK) == vcpu->arch.magic_page_ea) {
pte->e... | [
1,
1
] |
Linux Kernel | arch/powerpc/kvm/booke.c |
void kvmppc_booke_vcpu_load(struct kvm_vcpu *vcpu, int cpu) {
vcpu->cpu = smp_processor_id();
current->thread.kvm_vcpu = vcpu;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/booke.c | void kvmppc_booke_vcpu_put(struct kvm_vcpu *vcpu) {
current->thread.kvm_vcpu = NULL;
vcpu->cpu = -1;
kvmppc_clear_dbsr();
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/booke.c | int kvmppc_core_vcpu_create(struct kvm_vcpu *vcpu) {
int i;
int r;
r = vcpu->kvm->arch.kvm_ops->vcpu_create(vcpu);
if (r)
return r;
vcpu->arch.regs.nip = 0;
vcpu->arch.shared->pir = vcpu->vcpu_id;
kvmppc_set_gpr(vcpu, 1, (16 << 20) - 8); /* -8 for the callee-save LR slot */
kvmppc_set_msr(vcpu, 0)... | [
1,
0
] |
Linux Kernel | arch/powerpc/kvm/booke.c |
void kvmppc_core_vcpu_load(struct kvm_vcpu *vcpu, int cpu) {
vcpu->kvm->arch.kvm_ops->vcpu_load(vcpu, cpu);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500.c | static inline int local_sid_setup_one(struct id *entry) {
unsigned long sid;
int ret = -1;
sid = __this_cpu_inc_return(pcpu_last_used_sid);
if (sid < NUM_TIDS) {
__this_cpu_write(pcpu_sids.entry[sid], entry);
entry->val = sid;
entry->pentry = this_cpu_ptr(&pcpu_sids.entry[sid]);
ret = sid;
}
... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500.c | void kvmppc_mmu_msr_notify(struct kvm_vcpu *vcpu, u32 old_msr) {
kvmppc_e500_recalc_shadow_pid(to_e500(vcpu));
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500.c | int kvmppc_core_vcpu_setup(struct kvm_vcpu *vcpu) {
struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
kvmppc_e500_tlb_setup(vcpu_e500);
vcpu->arch.pvr = mfspr(SPRN_PVR);
vcpu_e500->svr = mfspr(SPRN_SVR);
vcpu->arch.cpu_type = KVM_CPU_E500V2;
return 0;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500.c |
static int kvmppc_core_get_sregs_e500(struct kvm_vcpu *vcpu,
struct kvm_sregs *sregs) {
struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
sregs->u.e.features |=
KVM_SREGS_E_ARCH206_MMU | KVM_SREGS_E_SPE | KVM_SREGS_E_PM;
sregs->u.e.impl_id = KVM_SREGS_E_IMPL_FSL;
... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500.c |
static int kvmppc_core_set_sregs_e500(struct kvm_vcpu *vcpu,
struct kvm_sregs *sregs) {
struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
int ret;
if (sregs->u.e.impl_id == KVM_SREGS_E_IMPL_FSL) {
vcpu_e500->svr = sregs->u.e.impl.fsl.svr;
vcpu_e500->hid0 = sregs->... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500.c |
static void kvmppc_core_vcpu_free_e500(struct kvm_vcpu *vcpu) {
struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
free_page((unsigned long)vcpu->arch.shared);
kvmppc_e500_tlb_uninit(vcpu_e500);
kvmppc_e500_id_table_free(vcpu_e500);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500.c |
static int kvmppc_core_init_vm_e500(struct kvm *kvm) { return 0; } | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500.h |
static inline u64 get_tlb_raddr(const struct kvm_book3e_206_tlb_entry *tlbe) {
return tlbe->mas7_3 & ~0xfffULL;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500.h |
static inline unsigned int
get_tlb_iprot(const struct kvm_book3e_206_tlb_entry *tlbe) {
return (tlbe->mas1 >> 30) & 0x1;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500.h |
static inline unsigned int get_cur_spid(const struct kvm_vcpu *vcpu) {
return (vcpu->arch.shared->mas6 >> 16) & 0xff;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500.h | static inline unsigned int get_tlb_tlbsel(const struct kvm_vcpu *vcpu) {
return (vcpu->arch.shared->mas0 >> 28) & 0x1;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500.h |
static inline unsigned int get_tlb_nv_bit(const struct kvm_vcpu *vcpu) {
return vcpu->arch.shared->mas0 & 0xfff;
} | [
1,
0
] |
Linux Kernel | arch/powerpc/kvm/e500.h |
static inline unsigned int get_tlb_esel_bit(const struct kvm_vcpu *vcpu) {
return (vcpu->arch.shared->mas0 >> 16) & 0xfff;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500.h | static inline int
tlbe_is_host_safe(const struct kvm_vcpu *vcpu,
const struct kvm_book3e_206_tlb_entry *tlbe) {
gpa_t gpa;
if (!get_tlb_v(tlbe))
return 0;
#ifndef CONFIG_KVM_BOOKE_HV
/* XXX what about IS != DS? */
if (get_tlb_ts(tlbe) != !!(vcpu->arch.shared->msr & MSR_IS))
return 0... | [
1,
1
] |
Linux Kernel | arch/powerpc/kvm/e500.h |
static inline int get_lpid(struct kvm_vcpu *vcpu) {
return get_thread_specific_lpid(vcpu->kvm->arch.lpid);
}
#else | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500.h | static inline unsigned int get_tlbmiss_tid(struct kvm_vcpu *vcpu) {
struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
unsigned int tidseld = (vcpu->arch.shared->mas4 >> 16) & 0xf;
return vcpu_e500->pid[tidseld];
}
#define get_tlb_sts(gtlbe) (MAS1_TS)
#endif /* !BOOKE_HV */ | [
1,
0
] |
Linux Kernel | arch/powerpc/kvm/e500.h |
static inline bool has_feature(const struct kvm_vcpu *vcpu, enum vcpu_ftr ftr) {
bool has_ftr;
switch (ftr) {
case VCPU_FTR_MMU_V2:
has_ftr = ((vcpu->arch.mmucfg & MMUCFG_MAVN) == MMUCFG_MAVN_V2);
break;
default:
return false;
}
return has_ftr;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500mc.c | int kvmppc_core_check_processor_compat(void) {
int r;
if (strcmp(cur_cpu_spec->cpu_name, "e500mc") == 0)
r = 0;
else if (strcmp(cur_cpu_spec->cpu_name, "e5500") == 0)
r = 0;
#ifdef CONFIG_ALTIVEC
else if (strcmp(cur_cpu_spec->cpu_name, "e6500") == 0)
r = 0;
#endif
else
r = -ENOTSUPP;
retu... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500mc.c |
int kvmppc_core_vcpu_setup(struct kvm_vcpu *vcpu) {
struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
vcpu->arch.shadow_epcr = SPRN_EPCR_DSIGS | SPRN_EPCR_DGTMI | SPRN_EPCR_DUVD;
#ifdef CONFIG_64BIT
vcpu->arch.shadow_epcr |= SPRN_EPCR_ICM;
#endif
vcpu->arch.shadow_msrp = MSRP_UCLEP | MSRP_PMMP;
vcpu->arc... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500mc.c |
static int kvmppc_core_get_sregs_e500mc(struct kvm_vcpu *vcpu,
struct kvm_sregs *sregs) {
struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
sregs->u.e.features |=
KVM_SREGS_E_ARCH206_MMU | KVM_SREGS_E_PM | KVM_SREGS_E_PC;
sregs->u.e.impl_id = KVM_SREGS_E_IMPL_FSL;... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500mc.c |
static int kvmppc_core_set_sregs_e500mc(struct kvm_vcpu *vcpu,
struct kvm_sregs *sregs) {
struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
int ret;
if (sregs->u.e.impl_id == KVM_SREGS_E_IMPL_FSL) {
vcpu_e500->svr = sregs->u.e.impl.fsl.svr;
vcpu_e500->hid0 = sre... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500mc.c |
static int kvmppc_set_one_reg_e500mc(struct kvm_vcpu *vcpu, u64 id,
union kvmppc_one_reg *val) {
int r = 0;
switch (id) {
case KVM_REG_PPC_SPRG9:
vcpu->arch.sprg9 = set_reg_val(id, *val);
break;
default:
r = kvmppc_set_one_reg_e500_tlb(vcpu, id, val);
}
re... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500mc.c |
static void kvmppc_core_vcpu_free_e500mc(struct kvm_vcpu *vcpu) {
struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
free_page((unsigned long)vcpu->arch.shared);
kvmppc_e500_tlb_uninit(vcpu_e500);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500mc.c |
static void kvmppc_core_destroy_vm_e500mc(struct kvm *kvm) {
int lpid = kvm->arch.lpid;
if (threads_per_core == 2)
lpid >>= 1;
kvmppc_free_lpid(lpid);
} | [
1,
0
] |
Linux Kernel | arch/powerpc/kvm/e500mc.c | static int __init kvmppc_e500mc_init(void) {
int r;
r = kvmppc_booke_init();
if (r)
goto err_out;
kvmppc_init_lpid(KVMPPC_NR_LPIDS / threads_per_core);
r = kvm_init(NULL, sizeof(struct kvmppc_vcpu_e500), 0, THIS_MODULE);
if (r)
goto err_out;
kvm_ops_e500mc.owner = THIS_MODULE;
kvmppc_pr_ops =... | [
1,
0
] |
Linux Kernel | arch/powerpc/kvm/e500_emulate.c |
static int kvmppc_e500_emul_msgclr(struct kvm_vcpu *vcpu, int rb) {
ulong param = vcpu->arch.regs.gpr[rb];
int prio = dbell2prio(param);
if (prio < 0)
return EMULATE_FAIL;
clear_bit(prio, &vcpu->arch.pending_exceptions);
return EMULATE_DONE;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500_emulate.c |
static int kvmppc_e500_emul_msgsnd(struct kvm_vcpu *vcpu, int rb) {
ulong param = vcpu->arch.regs.gpr[rb];
int prio = dbell2prio(rb);
int pir = param & PPC_DBELL_PIR_MASK;
unsigned long i;
struct kvm_vcpu *cvcpu;
if (prio < 0)
return EMULATE_FAIL;
kvm_for_each_vcpu(i, cvcpu, vcpu->kvm) {
int cp... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500_mmu.c |
static unsigned int get_tlb_esel(struct kvm_vcpu *vcpu, int tlbsel) {
struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
int esel = get_tlb_esel_bit(vcpu);
if (tlbsel == 0) {
esel &= vcpu_e500->gtlb_params[0].ways - 1;
esel += gtlb0_set_base(vcpu_e500, vcpu->arch.shared->mas2);
} else {
esel &= v... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500_mmu.c |
static void tlbilx_one(struct kvmppc_vcpu_e500 *vcpu_e500, int pid, gva_t ea) {
int tlbsel, esel;
for (tlbsel = 0; tlbsel < 2; tlbsel++) {
esel = kvmppc_e500_tlb_index(vcpu_e500, ea, tlbsel, pid, -1);
if (esel >= 0) {
inval_gtlbe_on_host(vcpu_e500, tlbsel, esel);
kvmppc_e500_gtlbe_invalidate(v... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500_mmu.c |
int kvmppc_e500_emul_tlbilx(struct kvm_vcpu *vcpu, int type, gva_t ea) {
struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
int pid = get_cur_spid(vcpu);
if (type == 0 || type == 1) {
tlbilx_all(vcpu_e500, 0, pid, type);
tlbilx_all(vcpu_e500, 1, pid, type);
} else if (type == 3) {
tlbilx_one(vcpu... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500_mmu.c |
int kvmppc_e500_emul_tlbre(struct kvm_vcpu *vcpu) {
struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
int tlbsel, esel;
struct kvm_book3e_206_tlb_entry *gtlbe;
tlbsel = get_tlb_tlbsel(vcpu);
esel = get_tlb_esel(vcpu, tlbsel);
gtlbe = get_entry(vcpu_e500, tlbsel, esel);
vcpu->arch.shared->mas0 &= ~MAS... | [
1,
0
] |
Linux Kernel | arch/powerpc/kvm/e500_mmu.c | int kvmppc_core_vcpu_translate(struct kvm_vcpu *vcpu,
struct kvm_translation *tr) {
int index;
gva_t eaddr;
u8 pid;
u8 as;
eaddr = tr->linear_address;
pid = (tr->linear_address >> 32) & 0xff;
as = (tr->linear_address >> 40) & 0x1;
index = kvmppc_e500_tlb_search(vcpu, ead... | [
1,
1
] |
Linux Kernel | arch/powerpc/kvm/e500_mmu.c |
gpa_t kvmppc_mmu_xlate(struct kvm_vcpu *vcpu, unsigned int index, gva_t eaddr) {
struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
struct kvm_book3e_206_tlb_entry *gtlbe;
u64 pgmask;
gtlbe = get_entry(vcpu_e500, tlbsel_of(index), esel_of(index));
pgmask = get_tlb_bytes(gtlbe) - 1;
return get_tlb_raddr(... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500_mmu.c |
void kvmppc_get_sregs_e500_tlb(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs) {
sregs->u.e.mas0 = vcpu->arch.shared->mas0;
sregs->u.e.mas1 = vcpu->arch.shared->mas1;
sregs->u.e.mas2 = vcpu->arch.shared->mas2;
sregs->u.e.mas7_3 = vcpu->arch.shared->mas7_3;
sregs->u.e.mas4 = vcpu->arch.shared->mas4;
sregs->... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500_mmu_host.c | static inline u32 e500_shadow_mas3_attrib(u32 mas3, int usermode) {
mas3 &= MAS3_ATTRIB_MASK;
#ifndef CONFIG_KVM_BOOKE_HV
if (!usermode) {
/* Guest is in supervisor mode,
* so we need to translate guest
* supervisor permissions into user permissions. */
mas3 &= ~E500_TLB_USER_PERM_MASK;
mas3... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500_mmu_host.c | static inline void __write_host_tlbe(struct kvm_book3e_206_tlb_entry *stlbe,
uint32_t mas0, uint32_t lpid) {
unsigned long flags;
local_irq_save(flags);
mtspr(SPRN_MAS0, mas0);
mtspr(SPRN_MAS1, stlbe->mas1);
mtspr(SPRN_MAS2, (unsigned long)stlbe->mas2);
mtspr(SPRN_MAS3,... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500_mmu_host.c | static inline void kvmppc_e500_ref_setup(struct tlbe_ref *ref,
struct kvm_book3e_206_tlb_entry *gtlbe,
kvm_pfn_t pfn, unsigned int wimg) {
ref->pfn = pfn;
ref->flags = E500_TLB_VALID;
ref->flags |= (gtlbe->mas2 & MAS2_ATTRIB_MASK) ... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500_mmu_host.c | static inline void kvmppc_e500_ref_release(struct tlbe_ref *ref) {
if (ref->flags & E500_TLB_VALID) {
/* FIXME: don't log bogus pfn for TLB1 */
trace_kvm_booke206_ref_release(ref->pfn, ref->flags);
ref->flags = 0;
}
} | [
0,
1
] |
Linux Kernel | arch/powerpc/kvm/e500_mmu_host.c |
static void clear_tlb1_bitmap(struct kvmppc_vcpu_e500 *vcpu_e500) {
if (vcpu_e500->g2h_tlb1_map)
memset(vcpu_e500->g2h_tlb1_map, 0,
sizeof(u64) * vcpu_e500->gtlb_params[1].entries);
if (vcpu_e500->h2g_tlb1_rmap)
memset(vcpu_e500->h2g_tlb1_rmap, 0,
sizeof(unsigned int) * host_tlb_param... | [
1,
0
] |
Linux Kernel | arch/powerpc/kvm/e500_mmu_host.c | static bool kvm_e500_mmu_unmap_gfn(struct kvm *kvm,
struct kvm_gfn_range *range) {
return true;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/e500_mmu_host.c | bool kvm_test_age_gfn(struct kvm *kvm, struct kvm_gfn_range *range) {
/* XXX could be more clever ;) */
return false;
} | [
0,
1
] |
Linux Kernel | arch/powerpc/kvm/e500_mmu_host.c | int e500_mmu_host_init(struct kvmppc_vcpu_e500 *vcpu_e500) {
host_tlb_params[0].entries = mfspr(SPRN_TLB0CFG) & TLBnCFG_N_ENTRY;
host_tlb_params[1].entries = mfspr(SPRN_TLB1CFG) & TLBnCFG_N_ENTRY;
if (host_tlb_params[0].entries == 0 || host_tlb_params[1].entries == 0) {
pr_err("%s: need to know host tlb size... | [
1,
0
] |
Linux Kernel | arch/powerpc/kvm/emulate_loadstore.c | static bool kvmppc_check_vsx_disabled(struct kvm_vcpu *vcpu) {
if (!(kvmppc_get_msr(vcpu) & MSR_VSX)) {
kvmppc_core_queue_vsx_unavail(vcpu);
return true;
}
return false;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/irq.h |
static inline int irqchip_in_kernel(struct kvm *kvm) {
int ret = 0;
#ifdef CONFIG_KVM_MPIC
ret = ret || (kvm->arch.mpic != NULL);
#endif
#ifdef CONFIG_KVM_XICS
ret = ret || (kvm->arch.xics != NULL);
ret = ret || (kvm->arch.xive != NULL);
#endif
smp_rmb();
return ret;
} | [
1,
0
] |
Linux Kernel | arch/powerpc/kvm/mpic.c | static int get_current_cpu(void) {
#if defined(CONFIG_KVM) && defined(CONFIG_BOOKE)
struct kvm_vcpu *vcpu = current->thread.kvm_vcpu;
return vcpu ? vcpu->arch.irq_cpu_id : -1;
#else
/* XXX */
return -1;
#endif
} | [
0,
1
] |
Linux Kernel | arch/powerpc/kvm/mpic.c | static void mpic_irq_raise(struct openpic *opp, struct irq_dest *dst,
int output) {
struct kvm_interrupt irq = {
.irq = KVM_INTERRUPT_SET_LEVEL,
};
if (!dst->vcpu) {
pr_debug("%s: destination cpu %d does not exist\n", __func__,
(int)(dst - &opp->dst[0]));
ret... | [
1,
1
] |
Linux Kernel | arch/powerpc/kvm/mpic.c | static void mpic_irq_lower(struct openpic *opp, struct irq_dest *dst,
int output) {
if (!dst->vcpu) {
pr_debug("%s: destination cpu %d does not exist\n", __func__,
(int)(dst - &opp->dst[0]));
return;
}
pr_debug("%s: cpu %d output %d\n", __func__, dst->vcpu->arch.ir... | [
1,
1
] |
Linux Kernel | arch/powerpc/kvm/mpic.c |
static inline void IRQ_setbit(struct irq_queue *q, int n_IRQ) {
set_bit(n_IRQ, q->queue);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/mpic.c |
static inline void IRQ_resetbit(struct irq_queue *q, int n_IRQ) {
clear_bit(n_IRQ, q->queue);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/mpic.c | static void openpic_update_irq(struct openpic *opp, int n_IRQ) {
struct irq_source *src;
bool active, was_active;
int i;
src = &opp->src[n_IRQ];
active = src->pending;
if ((src->ivpr & IVPR_MASK_MASK) && !src->nomask) {
pr_debug("%s: IRQ %d is disabled\n", __func__, n_IRQ);
active = false;
}
... | [
1,
0
] |
Linux Kernel | arch/powerpc/kvm/mpic.c | static void openpic_set_irq(void *opaque, int n_IRQ, int level) {
struct openpic *opp = opaque;
struct irq_source *src;
if (n_IRQ >= MAX_IRQ) {
WARN_ONCE(1, "%s: IRQ %d out of range\n", __func__, n_IRQ);
return;
}
src = &opp->src[n_IRQ];
pr_debug("openpic: set irq %d = %d ivpr=0x%08x\n", n_IRQ, le... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/mpic.c | static void openpic_reset(struct openpic *opp) {
int i;
opp->gcr = GCR_RESET;
opp->frr =
((opp->nb_irqs - 1) << FRR_NIRQ_SHIFT) | (opp->vid << FRR_VID_SHIFT);
opp->pir = 0;
opp->spve = -1 & opp->vector_mask;
opp->tfrr = opp->tfrr_reset;
/* Initialise IRQ sources */
for (i = 0; i < opp->max_irq;... | [
1,
0
] |
Linux Kernel | arch/powerpc/kvm/mpic.c |
static inline uint32_t read_IRQreg_idr(struct openpic *opp, int n_IRQ) {
return opp->src[n_IRQ].idr;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/mpic.c | static int openpic_tmr_write(void *opaque, gpa_t addr, u32 val) {
struct openpic *opp = opaque;
int idx;
addr += 0x10f0;
pr_debug("%s: addr %#llx <= %08x\n", __func__, addr, val);
if (addr & 0xF)
return 0;
if (addr == 0x10f0) {
opp->tfrr = val;
return 0;
}
idx = (addr >> 6) & 0x3;
add... | [
1,
0
] |
Linux Kernel | arch/powerpc/kvm/mpic.c |
static int openpic_src_read(void *opaque, gpa_t addr, u32 *ptr) {
struct openpic *opp = opaque;
uint32_t retval;
int idx;
pr_debug("%s: addr %#llx\n", __func__, addr);
retval = 0xFFFFFFFF;
addr = addr & 0xffff;
idx = addr >> 5;
switch (addr & 0x1f) {
case 0x00:
retval = read_IRQreg_ivpr(opp, i... | [
1,
0
] |
Linux Kernel | arch/powerpc/kvm/mpic.c | static int openpic_summary_read(void *opaque, gpa_t addr, u32 *ptr) {
uint32_t r = 0;
pr_debug("%s: addr %#llx\n", __func__, addr);
/* TODO: EISR/EIMR */
*ptr = r;
return 0;
} | [
0,
1
] |
Linux Kernel | arch/powerpc/kvm/mpic.c | static int openpic_summary_write(void *opaque, gpa_t addr, u32 val) {
pr_debug("%s: addr %#llx <= 0x%08x\n", __func__, addr, val);
/* TODO: EISR/EIMR */
return 0;
} | [
1,
1
] |
Linux Kernel | arch/powerpc/kvm/mpic.c |
void kvmppc_mpic_set_epr(struct kvm_vcpu *vcpu) {
struct openpic *opp = vcpu->arch.mpic;
int cpu = vcpu->arch.irq_cpu_id;
unsigned long flags;
spin_lock_irqsave(&opp->lock, flags);
if ((opp->gcr & opp->mpic_mode_mask) == GCR_MODE_PROXY)
kvmppc_set_epr(vcpu, openpic_iack(opp, &opp->dst[cpu], cpu));
s... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/mpic.c |
static int openpic_cpu_read(void *opaque, gpa_t addr, u32 *ptr) {
struct openpic *opp = opaque;
return openpic_cpu_read_internal(opp, addr, ptr, (addr & 0x1f000) >> 12);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/mpic.c | static int kvm_mpic_read(struct kvm_vcpu *vcpu, struct kvm_io_device *this,
gpa_t addr, int len, void *ptr) {
struct openpic *opp = container_of(this, struct openpic, mmio);
int ret;
union {
u32 val;
u8 bytes[4];
} u;
if (addr & (len - 1)) {
pr_debug("%s: bad alignment %l... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/mpic.c |
static int kvm_mpic_write(struct kvm_vcpu *vcpu, struct kvm_io_device *this,
gpa_t addr, int len, const void *ptr) {
struct openpic *opp = container_of(this, struct openpic, mmio);
int ret;
if (len != 4) {
pr_debug("%s: bad length %d\n", __func__, len);
return -EOPNOTSUPP;
}
... | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/mpic.c |
static void map_mmio(struct openpic *opp) {
kvm_iodevice_init(&opp->mmio, &mpic_mmio_ops);
kvm_io_bus_register_dev(opp->kvm, KVM_MMIO_BUS, opp->reg_base,
OPENPIC_REG_SIZE, &opp->mmio);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/mpic.c |
static void mpic_destroy(struct kvm_device *dev) {
struct openpic *opp = dev->private;
dev->kvm->arch.mpic = NULL;
kfree(opp);
kfree(dev);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kvm/mpic.c | static int mpic_set_default_irq_routing(struct openpic *opp) {
struct kvm_irq_routing_entry *routing;
routing = kzalloc((sizeof(*routing)), GFP_KERNEL);
if (!routing)
return -ENOMEM;
kvm_set_irq_routing(opp->kvm, routing, 0, 0);
kfree(routing);
return 0;
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.