Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2449170yba; Mon, 15 Apr 2019 11:52:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwGN5MKz5GzQGggRt37ORcmuzRlppWwEm4I/zb+baRLfh6TrjlhicPBh4Kjt8SL8DjyuW/u X-Received: by 2002:a17:902:8ecc:: with SMTP id x12mr77228119plo.0.1555354357324; Mon, 15 Apr 2019 11:52:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555354357; cv=none; d=google.com; s=arc-20160816; b=BmBHYvbVXxJNmAeP78lfducsz2D2VAPpsZQDY7UJrWDzU304Eqlcty8WJ7tRUy6TIX y8ct5Dh6zqImITzZexCfXmkebnw5QYU9r6i1VvIABvaPoYUSmPa4ohw6w08duNicoP5Z 9VgqLN9MySoG7AkPJaiSyox/Ck9MyK9xZcNtuDWxwPhVTAM69/3mScoY9tV8NLLCceUG H7K6WrHWGWUzWyQAeSghRIV4RjSBCZpvePAiC4uj5NOgJN9zvDZHCbd7CMM6mhNuKeCF mKLl0V91zbLHyiFad2tNxgvzDQ5rJS/iNX/1+eZDhv9LnAHeCb0GL6jv3OVSQbz/kwVq 93EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Q8qaFM3wcfQX9CBjuDLDD8vVhTbUaLmXijxF4i8TMCM=; b=sv6qxYWMnPIfpQ9buKnIQL0bxv2Z56uYPHRSDE1sUFwiAsidIeDuGyxM8WJJgOWaJs N1bbdCdz9ymkc9Qpo2oXlKNWk4LLAg8st+J9JPtgzSETC51mhAs6I8ZsOvDbQNFtO0+C Cj3+iTqae8XtB5CluLwK2rA9b44MaseEREvElh6eSSurwOLp70DWkLogjtAFDMotqZoo 1unRUccWCX0PxJeDQ+p8MV6JAVZAkWcIo0y/KKjvV5cDvF2J4D56ic8cwRuaF7jjK5jM OLCMI2kJyWZ9bJhosg7ttnurtCZ9StsOtH890BZpypF43bCW7101kx12EdCdO+nicTVX DMjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="PJbq/JGv"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l11si22396949plb.370.2019.04.15.11.52.20; Mon, 15 Apr 2019 11:52:37 -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="PJbq/JGv"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728678AbfDOSqn (ORCPT + 99 others); Mon, 15 Apr 2019 14:46:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:49402 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728662AbfDOSqi (ORCPT ); Mon, 15 Apr 2019 14:46:38 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 886172073F; Mon, 15 Apr 2019 18:46:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555353998; bh=SdZnkIgo4A0HaLXGSM4Nlg+ICex1cVEcKZmaTns+hMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PJbq/JGvkuMyxupj300uMLbZbx/vB/qg7ha+SjSGhHSy/mAjw3CF9a60S1SbZCF+Y igVYK5bT7vE4vGfvcNuc5Dn+Va7d5CmqFANKDI5utHp+eahka4arnMNceFstja3xvB OBKMeop5JAiYLUUS3frI6eoWa8RnIYAgdhblCfGA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Diana Craciun , Michael Ellerman , Sasha Levin Subject: [PATCH 4.9 33/76] powerpc/fsl: Add macro to flush the branch predictor Date: Mon, 15 Apr 2019 20:43:57 +0200 Message-Id: <20190415183716.189589453@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415183707.712011689@linuxfoundation.org> References: <20190415183707.712011689@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org commit 1cbf8990d79ff69da8ad09e8a3df014e1494462b upstream. The BUCSR register can be used to invalidate the entries in the branch prediction mechanisms. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/include/asm/ppc_asm.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h index 24e95be3bfaf..bbd35ba36a22 100644 --- a/arch/powerpc/include/asm/ppc_asm.h +++ b/arch/powerpc/include/asm/ppc_asm.h @@ -780,4 +780,25 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601) .long 0x2400004c /* rfid */ #endif /* !CONFIG_PPC_BOOK3E */ #endif /* __ASSEMBLY__ */ + +/* + * Helper macro for exception table entries + */ +#define EX_TABLE(_fault, _target) \ + stringify_in_c(.section __ex_table,"a";)\ + stringify_in_c(.balign 4;) \ + stringify_in_c(.long (_fault) - . ;) \ + stringify_in_c(.long (_target) - . ;) \ + stringify_in_c(.previous) + +#ifdef CONFIG_PPC_FSL_BOOK3E +#define BTB_FLUSH(reg) \ + lis reg,BUCSR_INIT@h; \ + ori reg,reg,BUCSR_INIT@l; \ + mtspr SPRN_BUCSR,reg; \ + isync; +#else +#define BTB_FLUSH(reg) +#endif /* CONFIG_PPC_FSL_BOOK3E */ + #endif /* _ASM_POWERPC_PPC_ASM_H */ -- 2.19.1