2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License, version 2, as
4 * published by the Free Software Foundation.
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
11 * You should have received a copy of the GNU General Public License
12 * along with this program; if not, write to the Free Software
13 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15 * Copyright IBM Corp. 2008
17 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
20 #ifndef __KVM_BOOKE_H__
21 #define __KVM_BOOKE_H__
23 #include <linux/types.h>
24 #include <linux/kvm_host.h>
26 /* Helper function for "full" MSR writes. No need to call this if only EE is
28 static inline void kvmppc_set_msr(struct kvm_vcpu *vcpu, u32 new_msr)
30 if ((new_msr & MSR_PR) != (vcpu->arch.msr & MSR_PR))
31 kvmppc_mmu_priv_switch(vcpu, new_msr & MSR_PR);
33 vcpu->arch.msr = new_msr;
35 if (vcpu->arch.msr & MSR_WE)
39 #endif /* __KVM_BOOKE_H__ */