Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751869AbbHECAK (ORCPT ); Tue, 4 Aug 2015 22:00:10 -0400 Received: from ozlabs.org ([103.22.144.67]:33094 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751382AbbHECAI (ORCPT ); Tue, 4 Aug 2015 22:00:08 -0400 Message-ID: <1438740007.2304.4.camel@ellerman.id.au> Subject: Re: powerpc: Add an inline function to update HID0 From: Michael Ellerman To: Madhavan Srinivasan Cc: "Gautham R. Shenoy" , Paul Mackerras , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, mikey@neuling.org Date: Wed, 05 Aug 2015 12:00:07 +1000 In-Reply-To: <55C0C6C8.3030403@linux.vnet.ibm.com> References: <20150804100858.1F272140306@ozlabs.org> <55C0C6C8.3030403@linux.vnet.ibm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1515 Lines: 39 On Tue, 2015-08-04 at 19:36 +0530, Madhavan Srinivasan wrote: > > On Tuesday 04 August 2015 03:38 PM, Michael Ellerman wrote: > > On Tue, 2015-04-08 at 08:30:58 UTC, "Gautham R. Shenoy" wrote: > >> Section 3.7 of Version 1.2 of the Power8 Processor User's Manual > >> prescribes that updates to HID0 be preceded by a SYNC instruction and > >> followed by an ISYNC instruction (Page 91). > >> > >> Create a function name update_hid0() which follows this recipe and > >> invoke it from the static split core path. > >> > >> Signed-off-by: Gautham R. Shenoy > >> --- > >> arch/powerpc/include/asm/kvm_ppc.h | 11 +++++++++++ > > Why is it in there? It's not KVM related per se. > > > > Where should it go? I think reg.h would be best, ideally near the definition > > for HID0, though that's probably not possible because of ASSEMBLY requirements. > > So at the bottom of reg.h ? > > just to understand, Something like this will not do? > > #define update_hid0(x) __asm__ __volatile__( "sync\n"\ > "mtspr " __stringify(SPRN_HID0)", %0\n"\ > "isync"::"r"(x)); > Yeah we could do that also. The static inline is less ugly though. cheers -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/