Lines Matching +full:guest +full:- +full:index +full:- +full:bits

1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2008-2011 Freescale Semiconductor, Inc. All rights reserved.
13 * Copyright IBM Corp. 2007-2008
20 #include <asm/nohash/mmu-e500.h>
39 /* bits [6-5] MAS2_X1 and MAS2_X0 and [4-0] bits for WIMGE */
62 /* Unmodified copy of the guest's TLB -- shared with host userspace. */
68 /* KVM internal information associated with each guest TLB entry */
108 /* This geometry is the legacy default -- can be overridden by userspace */
116 #define tlbsel_of(index) ((index) >> 16) argument
117 #define esel_of(index) ((index) & 0xFFFF) argument
155 return (tlbe->mas1 >> 7) & 0x1f; in get_tlb_size()
160 return tlbe->mas2 & MAS2_EPN; in get_tlb_eaddr()
172 return get_tlb_eaddr(tlbe) + bytes - 1; in get_tlb_end()
177 return tlbe->mas7_3 & ~0xfffULL; in get_tlb_raddr()
183 return (tlbe->mas1 >> 16) & 0xff; in get_tlb_tid()
189 return (tlbe->mas1 >> 12) & 0x1; in get_tlb_ts()
195 return (tlbe->mas1 >> 31) & 0x1; in get_tlb_v()
201 return (tlbe->mas1 >> 30) & 0x1; in get_tlb_iprot()
207 return (tlbe->mas1 & MAS1_TSIZE_MASK) >> MAS1_TSIZE_SHIFT; in get_tlb_tsize()
212 return vcpu->arch.pid & 0xff; in get_cur_pid()
217 return !!(vcpu->arch.shared->msr & (MSR_IS | MSR_DS)); in get_cur_as()
222 return !!(vcpu->arch.shared->msr & MSR_PR); in get_cur_pr()
227 return (vcpu->arch.shared->mas6 >> 16) & 0xff; in get_cur_spid()
232 return vcpu->arch.shared->mas6 & 0x1; in get_cur_sas()
238 * Manual says that tlbsel has 2 bits wide. in get_tlb_tlbsel()
241 return (vcpu->arch.shared->mas0 >> 28) & 0x1; in get_tlb_tlbsel()
246 return vcpu->arch.shared->mas0 & 0xfff; in get_tlb_nv_bit()
251 return (vcpu->arch.shared->mas0 >> 16) & 0xfff; in get_tlb_esel_bit()
263 /* Does it match current guest AS? */ in tlbe_is_host_safe()
265 if (get_tlb_ts(tlbe) != !!(vcpu->arch.shared->msr & MSR_IS)) in tlbe_is_host_safe()
270 if (!gfn_to_memslot(vcpu->kvm, gpa >> PAGE_SHIFT)) in tlbe_is_host_safe()
280 int offset = vcpu_e500->gtlb_offset[tlbsel]; in get_entry()
281 return &vcpu_e500->gtlb_arch[offset + entry]; in get_entry()
291 #define get_tlb_sts(gtlbe) (gtlbe->mas1 & MAS1_TS)
309 return get_thread_specific_lpid(vcpu->kvm->arch.lpid); in get_lpid()
318 unsigned int tidseld = (vcpu->arch.shared->mas4 >> 16) & 0xf; in get_tlbmiss_tid()
320 return vcpu_e500->pid[tidseld]; in get_tlbmiss_tid()
323 /* Force TS=1 for all guest mappings. */
333 has_ftr = ((vcpu->arch.mmucfg & MMUCFG_MAVN) == MMUCFG_MAVN_V2); in has_feature()