e500_mmu.c
AI PyTorch or SafeTensors extensionAssigns a negative errno constant
SHA-2564918e23520ab736b2da3b1d3a4002e8aa93889cd51929748b15f4f647f005567
MaleculeO(Er)H(F)
Evidence
9:16… ander Graf, agraf@suse.de
10 *
11 * Description:
12 * This file is based on arch/powerpc/kvm/44x_tlb.c,
13 * by Hollis Blanchard <hollisb@us.ibm.com>.
14 */
15
16#include <linux/kernel.h>
17#include <linux/types.h>
18#include <linux/slab.h>
19#include <linux/string.h>
20#include <linux/kvm.h>
21#include <linux/kvm_host.h>
22#include <linux/highmem.h>
23#include <linux/log2.h>
24#include <linux/uaccess.h>
25#include <linux/sched.h>
26#include <linux/rwsem.h>
27#include <linux/vmalloc.h>
28#include <linux/hugetlb.h>
29#include <asm/kvm_ppc.h>
30
31#include "e500.h"
32#include "trace_booke.h"
33#include "timing.h"
34#include "e500_mmu_host.h"
35
36static inline unsigned int gtlb0_get_next_victim(
37 struct kvmppc_vcpu_e500 *vcpu_e500)
38{
39 u …
⋯4 lines
77}
78
79/* Search the guest TLB for a matching entry. */
80static int kvmppc_e500_tlb_index(struct kvmppc_vcpu_e500 *vcpu_e500,
81 gva …
640:3… *val = get_reg_val(id, vcpu->arch.tlbps[i]);
641 break;
642 default:
643 r = -EINVAL;
644 break;
645 }
⋯6 lines
742:10… pages, ret, i;
743
744 if (cfg->mmu_type != KVM_MMU_FSL_BOOKE_NOHV)
745 return -EINVAL;
746
747 if (copy_from_user(¶ms, (void __user *)(uintptr_t)cfg->params,
⋯4 lines
887:24… ~MMUCFG_LRAT;
888
889 /* Guest mmu emulation currently doesn't handle E.PT */
890 vcpu->arch.eptcfg = 0;
891 vcpu->arch.tlbcfg[0] &= ~TLBnCFG_PT;
⋯7 lines