From patchwork Mon May 1 12:01:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 757144 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wGjn16Sbyz9sN9 for ; Mon, 1 May 2017 22:05:57 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KZR6Pw7+"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3wGjn15MrVzDqG3 for ; Mon, 1 May 2017 22:05:57 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KZR6Pw7+"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com [IPv6:2607:f8b0:400e:c00::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3wGjgt2HfzzDqH7 for ; Mon, 1 May 2017 22:01:30 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KZR6Pw7+"; dkim-atps=neutral Received: by mail-pf0-x244.google.com with SMTP id v14so27486756pfd.3 for ; Mon, 01 May 2017 05:01:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zcfN44p1WftztzBhkNG4xxugeQ3cAOCp2/K54/owBl4=; b=KZR6Pw7+9VQ7bvA0DozqZoSVuQYQqRBU62INZ1wvMePI3SUZ0DnNTwzTOW+GnUwaZL Ci79g4WSD0nC7igbGKpXusQb+9BXBQiLDvomhWkJZgn8T6HPBf6teWWAFniO4GnnHnW3 YmN1RxiWgKofS8TwOSl9XPSZ08LwcFOo7qjytrdad2XLJhZbiKSQnxhnND6Pl2al4N6Z oo7MxRJLHP9hPd1b++HqEaMYSrdqUku00i+K6T1LOHBTBz0WpUUJAEiU2gZtGbhkNIW5 dfW+M9yH3qJS+njor72SAvgQxpiRLGHh/OFvNEte9bbTzGNR+FjD8T7dCEwL3y/rGd2N UDPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zcfN44p1WftztzBhkNG4xxugeQ3cAOCp2/K54/owBl4=; b=JPVR+CaoKSmnFOtUEfCLLHAInPLE6fxUCcCKV3MQ2NiiTwh//uKSJNiLnBO7UNRA8E OG6BA83tU4i0E9XaUxReK2DmhZttH24RW/p6yJdaBpUwo19nN4ZgafuVCXJopNlM+68B M0EmrdGc3idu0BlDm0edo4bRlcAXFkvsvOBRauG2b5l0gfmaKMdvwirHFUZrJyLJaidt MCvhBAou/cCi2ZpV+juUkmtiXP2uF28gVfWA8D70QclFVgv+rql0Qb753HgcRvir9cXr rjF1gnU0dIJ0NBk4nI43Ub6QnQXHVOd59ONRIqfMtxYgbRPumrpYgVbIFaU2XzcvGQoN QeFw== X-Gm-Message-State: AN3rC/7kRswTm1+CyE4tI2vP42YWsEByzQgZL4sibFTc8eJw+pUU3qgQ M8wXgBeouGWAfA== X-Received: by 10.99.181.65 with SMTP id u1mr11977167pgo.102.1493640088697; Mon, 01 May 2017 05:01:28 -0700 (PDT) Received: from roar.au.ibm.com (59-102-70-13.tpgi.com.au. [59.102.70.13]) by smtp.gmail.com with ESMTPSA id b4sm18364421pfj.122.2017.05.01.05.01.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 May 2017 05:01:27 -0700 (PDT) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 2/2] powerpc/64s: Fix OPAL_CALL non-maskable interrupt reentrancy Date: Mon, 1 May 2017 22:01:10 +1000 Message-Id: <20170501120110.21888-3-npiggin@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170501120110.21888-1-npiggin@gmail.com> References: <20170501120110.21888-1-npiggin@gmail.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicholas Piggin Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" OPAL_CALL uses SRR[01] with MSR_RI=1, which gets corrupted if there is an interleaving system reset or machine check interrupt. Use HSRR[01] instead, which does not require MSR_RI=0. Signed-off-by: Nicholas Piggin --- arch/powerpc/platforms/powernv/opal-wrappers.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/platforms/powernv/opal-wrappers.S b/arch/powerpc/platforms/powernv/opal-wrappers.S index f620572f891f..4ca6c26a56d5 100644 --- a/arch/powerpc/platforms/powernv/opal-wrappers.S +++ b/arch/powerpc/platforms/powernv/opal-wrappers.S @@ -99,10 +99,10 @@ opal_return: lwz r4,8(r1); ld r5,PPC_LR_STKOFF(r1); ld r6,PACASAVEDMSR(r13); - mtspr SPRN_SRR0,r5; - mtspr SPRN_SRR1,r6; mtcr r4; - rfid + mtspr SPRN_HSRR0,r5; + mtspr SPRN_HSRR1,r6; + hrfid opal_real_call: mfcr r11