From mboxrd@z Thu Jan 1 00:00:00 1970 From: ehrhardt@linux.vnet.ibm.com Date: Tue, 19 Aug 2008 10:36:44 +0000 Subject: [PATCH 4/4] kvmppc: convert wrteei to wrtee as kvm guest optimization Message-Id: <1219142204-12044-5-git-send-email-ehrhardt@linux.vnet.ibm.com> List-Id: References: <1219142204-12044-1-git-send-email-ehrhardt@linux.vnet.ibm.com> In-Reply-To: <1219142204-12044-1-git-send-email-ehrhardt@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linuxppc-dev@ozlabs.org, kvm-ppc@vger.kernel.org Cc: hollisb@us.ibm.com From: Christian Ehrhardt Dependent on the already existing CONFIG_KVM_GUEST config option this patch changes wrteei to wrtee allowing the hypervisor to rewrite those to nontrapping instructions. Maybe we should split the kvm guest otpimizations in two parts one for the overhead free optimizations and on for the rest that might add some complexity for non virtualized execution (like this one). Signed-off-by: Christian Ehrhardt --- [diffstat] hw_irq.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) [diff] diff --git a/include/asm-powerpc/hw_irq.h b/include/asm-powerpc/hw_irq.h --- a/include/asm-powerpc/hw_irq.h +++ b/include/asm-powerpc/hw_irq.h @@ -72,7 +72,11 @@ static inline void local_irq_disable(void) { #ifdef CONFIG_BOOKE +#ifdef CONFIG_KVM_GUEST + __asm__ __volatile__("wrtee %0": : "r"(0) :"memory"); +#else __asm__ __volatile__("wrteei 0": : :"memory"); +#endif #else unsigned long msr; __asm__ __volatile__("": : :"memory"); @@ -84,7 +88,11 @@ static inline void local_irq_enable(void) { #ifdef CONFIG_BOOKE +#ifdef CONFIG_KVM_GUEST + __asm__ __volatile__("wrtee %0": : "r"(MSR_EE) :"memory"); +#else __asm__ __volatile__("wrteei 1": : :"memory"); +#endif #else unsigned long msr; __asm__ __volatile__("": : :"memory"); @@ -99,7 +107,11 @@ msr = mfmsr(); *flags = msr; #ifdef CONFIG_BOOKE +#ifdef CONFIG_KVM_GUEST + __asm__ __volatile__("wrtee %0": : "r"(0) :"memory"); +#else __asm__ __volatile__("wrteei 0": : :"memory"); +#endif #else SET_MSR_EE(msr & ~MSR_EE); #endif