From patchwork Sun Sep 17 19:28:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 9955005 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 8CAD260352 for ; Sun, 17 Sep 2017 19:28:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 743B128780 for ; Sun, 17 Sep 2017 19:28:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 56A6328A17; Sun, 17 Sep 2017 19:28:28 +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,FREEMAIL_FROM, 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 52AB128780 for ; Sun, 17 Sep 2017 19:28:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751270AbdIQT2X (ORCPT ); Sun, 17 Sep 2017 15:28:23 -0400 Received: from mout.gmx.net ([212.227.17.21]:49760 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751254AbdIQT2W (ORCPT ); Sun, 17 Sep 2017 15:28:22 -0400 Received: from p100.box ([193.159.28.181]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0M3R1g-1dbrGp1ZHU-00qyyk; Sun, 17 Sep 2017 21:28:15 +0200 Date: Sun, 17 Sep 2017 21:28:11 +0200 From: Helge Deller To: linux-parisc@vger.kernel.org, James Bottomley , John David Anglin Subject: [PATCH] parisc: Add PDCE_CHECK instruction to HPMC handler Message-ID: <20170917192811.GA8688@p100.box> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Provags-ID: V03:K0:6apzbUoYZnzalfXKiB/xUH9HgDk1e9wIVDMS4q8fAdtm0NwyAPG EQpr/im4HiLXU13QJ1d0ztAkqVKmRWPIa2C3oUVt5B3kiWKYWrRl7hlIVCDjiflKdZqskJe QUgCl3bGT68U36mIHMljeoZ2xoCioonzI8JhnC4KlIMWtEFjzimuuFE/ZIdsBHFLDDmVTpj bOPSkAiCOHqnf8C5XAvug== X-UI-Out-Filterresults: notjunk:1; V01:K0:Vnp6plGmDhw=:6v1nFona9pbusrj6SyLd/D p4pOLx5j3cnC2rs0Cc8NmrfOOtmbpROzqcKi/gJd61X36dxPZcV8KcncSXTl+39dKDWAJkbyM Ae46TleivpFIPKXCbs0DUu05I5ZvJe8wCtJKQJUfJZ+O+Tg96wVyW2n/YoecqAxNfc1MoTSo5 gwe4Wt4Z9FcqBTcpxQ+Zz888N/Bo9zsJlaSkDVBi8JlKz4gyfsmopUhw1BVki4BWUkqVws4en 5ZaD3gufW066dGbPoEOih4Ad7iwxmRp2+sl8Y2Cjo6aHUc4Q26fQjaEbenwCHXO3GkjxiFZHy rlP2VozblMvrqTkQtfAFuBryMZ6uoysIt1sadIumcOa+XvrxSLIDd1rn1/Iy7aPcXGnCcp5xL 0QyRxGLBOyw1QikNjaxZK+GETMBULCnGZnl9WK0G/3nBw97YelLfraWPyLmwiVx61RqEMWz7S JkRWVvBi/HKcXH9AvssDVElY3T8jwcNhiw97KkyE7dvvWZkfQGMsh9HCkgLxSUlRhJtY+jODp p1G8kJMFKd8BIEf8YuBKw0DU0wk75k22VMzNBYPCh9/bTh8DeOvig/9U5Ig/vtn0dRx3ZlBIX hqv0MArHSjw4I1VMtWR/cUtNQ03syZVGdX0hqLQP7SLhPBf1t/E1/hY6qJeFWVuE7oHOSSKNN p6Ul1rbg8iNDofrp4dLzIAdEwbZbYjw01ZicB4yVxl8+SYDf6bjAzWfmh29NyO6vN1jYbFcLO ge9DF84ew+fIuMDMyCSJtKM247a7MCs3cpzaOPfBOb/pp/rYkcqOnN0xxT82XpH+NeaBL5LLi UyqtRFXIJ3zTRVug+9rSrC/4aoovQ== Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP According to the programming note at page 1-31 of the PA 1.1 Firmware Architecture document, one should use the PDC_INSTR firmware function to get the instruction that invokes a PDCE_CHECK in the HPMC handler. This patch follows this note and sets the instruction which has been a nop up until now. Testing on a C3000 and C8000 showed that this firmware call isn't implemented on those machines, so maybe it's only needed on older ones. Signed-off-by: Helge Deller --- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c index 991654c..23033315 100644 --- a/arch/parisc/kernel/traps.c +++ b/arch/parisc/kernel/traps.c @@ -817,7 +817,7 @@ void __init initialize_ivt(const void *iva) u32 check = 0; u32 *ivap; u32 *hpmcp; - u32 length; + u32 length, instr; if (strcmp((const char *)iva, "cows can fly")) panic("IVT invalid"); @@ -827,6 +827,14 @@ void __init initialize_ivt(const void *iva) for (i = 0; i < 8; i++) *ivap++ = 0; + /* + * Use PDC_INSTR firmware function to get instruction that invokes + * PDCE_CHECK in HPMC handler. See programming note at page 1-31 of + * the PA 1.1 Firmware Architecture document. + */ + if (pdc_instr(&instr) == PDC_OK) + ivap[0] = instr; + /* Compute Checksum for HPMC handler */ length = os_hpmc_size; ivap[7] = length;