From patchwork Thu May 29 07:45:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Neuling X-Patchwork-Id: 353693 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 325121400D4 for ; Thu, 29 May 2014 17:46:00 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756055AbaE2Hpv (ORCPT ); Thu, 29 May 2014 03:45:51 -0400 Received: from ozlabs.org ([103.22.144.67]:54961 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756046AbaE2Hpu convert rfc822-to-8bit (ORCPT ); Thu, 29 May 2014 03:45:50 -0400 Received: from localhost.localdomain (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id E8E0D1400D4; Thu, 29 May 2014 17:45:48 +1000 (EST) Received: by localhost.localdomain (Postfix, from userid 1000) id D10DBD43D50; Thu, 29 May 2014 17:45:47 +1000 (EST) Message-ID: <1401349547.4116.19.camel@ale.ozlabs.ibm.com> Subject: powerpc/pseries: Use new defines when calling h_set_mode From: Michael Neuling To: Alexander Graf Cc: Paul Mackerras , "kvm-ppc@vger.kernel.org" , "kvm@vger.kernel.org" , linuxppc-dev , benh Date: Thu, 29 May 2014 17:45:47 +1000 In-Reply-To: References: <1401106626-13130-1-git-send-email-paulus@samba.org> <1401106626-13130-4-git-send-email-paulus@samba.org> <5385E620.5090703@suse.de> <1401342462.4116.4.camel@ale.ozlabs.ibm.com> <1401344549.4116.8.camel@ale.ozlabs.ibm.com> X-Mailer: Evolution 3.10.4-0ubuntu1 Mime-Version: 1.0 Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org > > +/* Values for 2nd argument to H_SET_MODE */ > > +#define H_SET_MODE_RESOURCE_SET_CIABR 1 > > +#define H_SET_MODE_RESOURCE_SET_DAWR 2 > > +#define H_SET_MODE_RESOURCE_ADDR_TRANS_MODE 3 > > +#define H_SET_MODE_RESOURCE_LE 4 > > > Much better, but I think you want to make use of these in non-kvm code too, > no? At least the LE one is definitely already implemented as call :) Sure but that's a different patch.... below. Mikey powerpc/pseries: Use new defines when calling h_set_mode Now that we define these in the KVM code, use these defines when we call h_set_mode. No functional change. Signed-off-by: Michael Neuling --- This depends on the KVM h_set_mode patches. -- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/powerpc/include/asm/plpar_wrappers.h b/arch/powerpc/include/asm/plpar_wrappers.h index 12c32c5..67859ed 100644 --- a/arch/powerpc/include/asm/plpar_wrappers.h +++ b/arch/powerpc/include/asm/plpar_wrappers.h @@ -273,7 +273,7 @@ static inline long plpar_set_mode(unsigned long mflags, unsigned long resource, static inline long enable_reloc_on_exceptions(void) { /* mflags = 3: Exceptions at 0xC000000000004000 */ - return plpar_set_mode(3, 3, 0, 0); + return plpar_set_mode(3, H_SET_MODE_RESOURCE_ADDR_TRANS_MODE, 0, 0); } /* @@ -284,7 +284,7 @@ static inline long enable_reloc_on_exceptions(void) * returns H_SUCCESS. */ static inline long disable_reloc_on_exceptions(void) { - return plpar_set_mode(0, 3, 0, 0); + return plpar_set_mode(0, H_SET_MODE_RESOURCE_ADDR_TRANS_MODE, 0, 0); } /* @@ -297,7 +297,7 @@ static inline long disable_reloc_on_exceptions(void) { static inline long enable_big_endian_exceptions(void) { /* mflags = 0: big endian exceptions */ - return plpar_set_mode(0, 4, 0, 0); + return plpar_set_mode(0, H_SET_MODE_RESOURCE_LE, 0, 0); } /* @@ -310,17 +310,17 @@ static inline long enable_big_endian_exceptions(void) static inline long enable_little_endian_exceptions(void) { /* mflags = 1: little endian exceptions */ - return plpar_set_mode(1, 4, 0, 0); + return plpar_set_mode(1, H_SET_MODE_RESOURCE_LE, 0, 0); } static inline long plapr_set_ciabr(unsigned long ciabr) { - return plpar_set_mode(0, 1, ciabr, 0); + return plpar_set_mode(0, H_SET_MODE_RESOURCE_SET_CIABR, ciabr, 0); } static inline long plapr_set_watchpoint0(unsigned long dawr0, unsigned long dawrx0) { - return plpar_set_mode(0, 2, dawr0, dawrx0); + return plpar_set_mode(0, H_SET_MODE_RESOURCE_SET_DAWR, dawr0, dawrx0); } #endif /* _ASM_POWERPC_PLPAR_WRAPPERS_H */