Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3358152imm; Thu, 17 May 2018 07:33:34 -0700 (PDT) X-Google-Smtp-Source: AB8JxZryDAussP9MS08AQzxNFXOzCJ1HD+omoHGcPasjafzbM3/xYE6vID56MohdDdupvA9iOp/o X-Received: by 2002:a62:f20d:: with SMTP id m13-v6mr5472450pfh.170.1526567614652; Thu, 17 May 2018 07:33:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526567614; cv=none; d=google.com; s=arc-20160816; b=DvInXPpX5XnJNAz1yp46G4TQq+X7i/baOh9ATvVRqHW2ubj1yVsv8UzZGhWFWWrjuk NSVC61Nm0De53MXyv5gBwPmLvCs1/LqpHtKzjlv6RQeXrMgce+B/ZkhxaTEiinJ9tONf 7jOdPoNhFqOZV9YImFvFnatx5RNmpUTGXjNxaQzOg1YuJPLfm7ROWYVVGewik8pYQKy1 I7EKDUh+ECCTbKuQbGJoFuGBz70T7f8i1wyLLllUaswU++W0qp5jbEh52Ur+BwdJDqX9 d8laQ2Op3dLLrHGk1E1rT9hcpolWK/IfuR23tBiaiB9Uf/uvxCO31e5Uy/tIgKfhQAvr niTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=BxrKrkwiT6TRWc4SmGF1B4BueldZSVHtPBmvHlc+JX0=; b=msr+GbA2maNJT6rxYOdZP/K7TkJa0sk+dqFStgAnX8+zSEabejIvPVf2IAgGGs+fJ/ KUqiUdm0uBzFywe8LdxjCkuOF6vbxD/Y2MNxNoDHNaAK3aaTg3vXffMrq4YFlIxRtgzA Nlp2EruSc1LsULsDyW++1JMrkcSfTnNJlXF48ZhcwLBVZQdcBm8RybpWArXXCRQCGQ+h OW/jHA9CEb0lP5jFODVkha+kEWTbdWhTsOO7r0U2jlxcGhqmT4Ow6Qw8HSrtgavEPQNZ UU4tbxBn+yRPWI+gSk1ojffGJtT+4lk/JNUjJE0EJ+6jVfbpfz2bBvH6qT1Fg7EvlFWn WFYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cpy4s+0g; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o3-v6si5148088pld.50.2018.05.17.07.33.20; Thu, 17 May 2018 07:33:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cpy4s+0g; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752356AbeEQOax (ORCPT + 99 others); Thu, 17 May 2018 10:30:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:46180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752163AbeEQOaw (ORCPT ); Thu, 17 May 2018 10:30:52 -0400 Received: from jamesdev (jahogan.plus.com [212.159.75.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D4D6A20652; Thu, 17 May 2018 14:30:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1526567452; bh=xpLrqBlANpm5lJwLgb1GU9cvAmjKF14GHcHEMP6GNQo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cpy4s+0gHwHoUkcBIGJCuu9lxVknuELfAeM7S9LDoFp0p+hzBciIumuMk5zovdo6r zeooSlvEeOZMShYU/JtFgfbzgglNkp6KTx3jjCw3IGcGOZkn9RL3XLCUnt2n2H81oB OQZJY5eWOwVSF90qSouUgjpj8pd1R3sYX6ROn0sc= Date: Thu, 17 May 2018 15:30:47 +0100 From: James Hogan To: Matt Redfearn Cc: Ralf Baechle , Thomas Gleixner , linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, Philippe Ombredanne , Kate Stewart , Greg Kroah-Hartman Subject: Re: [PATCH 1/6] MIPS: Move ehb() to barrier.h Message-ID: <20180517143046.GA24704@jamesdev> References: <1515148270-9391-1-git-send-email-matt.redfearn@mips.com> <1515148270-9391-2-git-send-email-matt.redfearn@mips.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fUYQa+Pmc3FrFX/N" Content-Disposition: inline In-Reply-To: <1515148270-9391-2-git-send-email-matt.redfearn@mips.com> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --fUYQa+Pmc3FrFX/N Content-Type: text/plain; charset=utf-8 Content-Disposition: inline On Fri, Jan 05, 2018 at 10:31:05AM +0000, Matt Redfearn wrote: > The current location of ehb() in mipsmtregs.h does not make sense, since > it is not strictly related to multi-threading, and may be used in code > which does not include mipsmtregs.h > arch/mips/include/asm/barrier.h | 13 +++++++++++++ > arch/mips/include/asm/mipsmtregs.h | 8 -------- But ehb isn't really a memory barrier like the other barriers in barrier.h, its an execution hazard barrier, as used when available by the hazard macros in hazards.h, and in fact there is already an _ehb() there. I suspect the intention was that most MIPS arch code using ehb would do so using the appropriate hazard abstractions, which would do the right number of NOPs on hardware without the EHB instruction. Code that is specific to certain arch revisions (like the MIPS MT code and MIPS KVM) can get away with using _ehb/ehb, but should use the abstractions where they exist to make intentions clear. None of the specific hazards in hazards.h really match the case in patch 2, I suppose you could have a new sync_mfc0_hazard() macro, but its so specific and EHB should be guaranteed to exist there, so perhaps _ehb() should just be used instead of ehb() there? (with a comment to describe what operations are being protected from what hazards). Cheers James --fUYQa+Pmc3FrFX/N Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQS7lRNBWUYtqfDOVL41zuSGKxAj8gUCWv2SFQAKCRA1zuSGKxAj 8g1NAQDbRoahEifuu6/yUogKV60Ye0OY1HPN5uhoF/Sps8q+6AD8DQ8sqzB6icvF yii4y7HzTo+e6WZ7o9i1Z1pm2g8YqgA= =6e5S -----END PGP SIGNATURE----- --fUYQa+Pmc3FrFX/N--