From patchwork Wed Apr 5 06:26:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Mackerras X-Patchwork-Id: 9663025 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B9201602B8 for ; Wed, 5 Apr 2017 06:26:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AAECB284CE for ; Wed, 5 Apr 2017 06:26:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9FF0E28500; Wed, 5 Apr 2017 06:26:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17C43284CE for ; Wed, 5 Apr 2017 06:26:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753656AbdDEG0W (ORCPT ); Wed, 5 Apr 2017 02:26:22 -0400 Received: from ozlabs.org ([103.22.144.67]:44975 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753646AbdDEG0V (ORCPT ); Wed, 5 Apr 2017 02:26:21 -0400 Received: by ozlabs.org (Postfix, from userid 1003) id 3vybT25Smwz9s89; Wed, 5 Apr 2017 16:26:14 +1000 (AEST) Date: Wed, 5 Apr 2017 16:26:11 +1000 From: Paul Mackerras To: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org Cc: Nicholas Piggin Subject: [PATCH] KVM: PPC: Book3S HV: Add workaround for msgsync erratum on POWER9 DD1 Message-ID: <20170405062611.GB26143@fergus.ozlabs.ibm.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On POWER9 DD1 the msgsync instruction doesn't work correctly, but the new 'darn' (deliver a random number) instruction happens to do an equivalent function as a side effect. Signed-off-by: Paul Mackerras --- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S index 6cadda5fa7d4..35d8d718e34b 100644 --- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S +++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S @@ -1240,7 +1240,11 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR) cmpwi r12, BOOK3S_INTERRUPT_H_DOORBELL bne 3f BEGIN_FTR_SECTION +BEGIN_FTR_SECTION_NESTED(98) PPC_MSGSYNC +FTR_SECTION_ELSE_NESTED(98) + .long (31<<26) + (755<<1) /* darn r0,0 */ +ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_POWER9_DD1, 98) lwsync END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300) lbz r0, HSTATE_HOST_IPI(r13)