Lines Matching full:bat
633 void kvmppc_set_bat(struct kvm_vcpu *vcpu, struct kvmppc_bat *bat, bool upper, in kvmppc_set_bat() argument
637 /* Upper BAT */ in kvmppc_set_bat()
639 bat->bepi_mask = (~bl << 17); in kvmppc_set_bat()
640 bat->bepi = val & 0xfffe0000; in kvmppc_set_bat()
641 bat->vs = (val & 2) ? 1 : 0; in kvmppc_set_bat()
642 bat->vp = (val & 1) ? 1 : 0; in kvmppc_set_bat()
643 bat->raw = (bat->raw & 0xffffffff00000000ULL) | val; in kvmppc_set_bat()
645 /* Lower BAT */ in kvmppc_set_bat()
646 bat->brpn = val & 0xfffe0000; in kvmppc_set_bat()
647 bat->wimg = (val >> 3) & 0xf; in kvmppc_set_bat()
648 bat->pp = val & 3; in kvmppc_set_bat()
649 bat->raw = (bat->raw & 0x00000000ffffffffULL) | ((u64)val << 32); in kvmppc_set_bat()
656 struct kvmppc_bat *bat; in kvmppc_find_bat() local
660 bat = &vcpu_book3s->ibat[(sprn - SPRN_IBAT0U) / 2]; in kvmppc_find_bat()
663 bat = &vcpu_book3s->ibat[4 + ((sprn - SPRN_IBAT4U) / 2)]; in kvmppc_find_bat()
666 bat = &vcpu_book3s->dbat[(sprn - SPRN_DBAT0U) / 2]; in kvmppc_find_bat()
669 bat = &vcpu_book3s->dbat[4 + ((sprn - SPRN_DBAT4U) / 2)]; in kvmppc_find_bat()
675 return bat; in kvmppc_find_bat()
702 struct kvmppc_bat *bat = kvmppc_find_bat(vcpu, sprn); in kvmppc_core_emulate_mtspr_pr() local
704 kvmppc_set_bat(vcpu, bat, !(sprn % 2), (u32)spr_val); in kvmppc_core_emulate_mtspr_pr()
705 /* BAT writes happen so rarely that we're ok to flush in kvmppc_core_emulate_mtspr_pr()
874 struct kvmppc_bat *bat = kvmppc_find_bat(vcpu, sprn); in kvmppc_core_emulate_mfspr_pr() local
877 *spr_val = bat->raw >> 32; in kvmppc_core_emulate_mfspr_pr()
879 *spr_val = bat->raw; in kvmppc_core_emulate_mfspr_pr()