From patchwork Wed Jan 24 23:28:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stewart Smith X-Patchwork-Id: 865573 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.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 3zRhFm3QzDz9t3V for ; Thu, 25 Jan 2018 10:29:16 +1100 (AEDT) Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3zRhFm2b1vzDrJX for ; Thu, 25 Jan 2018 10:29:16 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=stewart@linux.vnet.ibm.com; receiver=) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3zRhFN3ngTzDqvH for ; Thu, 25 Jan 2018 10:28:56 +1100 (AEDT) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0ONO7ZM062578 for ; Wed, 24 Jan 2018 18:28:54 -0500 Received: from e37.co.us.ibm.com (e37.co.us.ibm.com [32.97.110.158]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fq2cu2ww3-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 24 Jan 2018 18:28:53 -0500 Received: from localhost by e37.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 24 Jan 2018 16:28:53 -0700 Received: from b03cxnp08025.gho.boulder.ibm.com (9.17.130.17) by e37.co.us.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 24 Jan 2018 16:28:50 -0700 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0ONSnv511796838; Wed, 24 Jan 2018 16:28:49 -0700 Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BEDC3BE040; Wed, 24 Jan 2018 16:28:49 -0700 (MST) Received: from birb.localdomain (unknown [9.81.199.175]) by b03ledav005.gho.boulder.ibm.com (Postfix) with SMTP id 2C24ABE03B; Wed, 24 Jan 2018 16:28:48 -0700 (MST) Received: by birb.localdomain (Postfix, from userid 1000) id 491514F0DAB; Thu, 25 Jan 2018 10:28:46 +1100 (AEDT) From: Stewart Smith To: skiboot@lists.ozlabs.org Date: Thu, 25 Jan 2018 10:28:45 +1100 X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180124232846.32618-1-stewart@linux.vnet.ibm.com> References: <20180124232846.32618-1-stewart@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18012423-0024-0000-0000-000017D755A9 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008422; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000247; SDB=6.00979875; UDB=6.00496686; IPR=6.00759180; BA=6.00005794; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00019191; XFM=3.00000015; UTC=2018-01-24 23:28:51 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18012423-0025-0000-0000-00004E702F34 Message-Id: <20180124232846.32618-2-stewart@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-24_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801240304 Subject: [Skiboot] [PATCH 1/2] Revert "libpore: Fix incorrect mtspr instruction generation" X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: stable@birb.localdomain MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" This reverts commit 65f9abea8e8cfd7f711a5c54217b5505826ff497. Cc: stable Fixes: 65f9abea8e8cfd7f711a5c54217b5505826ff497. Signed-off-by: Stewart Smith Acked-by: Vaidyanathan Srinivasan --- libpore/p9_stop_api.C | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libpore/p9_stop_api.C b/libpore/p9_stop_api.C index cbbdfdd5de57..7242c423c652 100644 --- a/libpore/p9_stop_api.C +++ b/libpore/p9_stop_api.C @@ -255,10 +255,12 @@ static uint32_t getOrisInstruction( const uint16_t i_Rs, const uint16_t i_Ra, */ static uint32_t getMtsprInstruction( const uint16_t i_Rs, const uint16_t i_Spr ) { - uint32_t mtsprInstOpcode = MTSPR_BASE_OPCODE; - uint32_t temp = ((i_Spr & 0x1F) << 5) | ((i_Spr & 0x8F) >> 5); - - mtsprInstOpcode |= ((i_Rs & 0x1F) << 21) | ((temp & 0x03FF) << 11); + uint32_t mtsprInstOpcode = 0; + uint32_t temp = (( i_Spr & 0x03FF ) << 11); + mtsprInstOpcode = (uint8_t)i_Rs << 21; + mtsprInstOpcode = ( temp & 0x0000F800 ) << 5; + mtsprInstOpcode |= ( temp & 0x001F0000 ) >> 5; + mtsprInstOpcode |= MTSPR_BASE_OPCODE; return SWIZZLE_4_BYTE(mtsprInstOpcode); } From patchwork Wed Jan 24 23:28:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stewart Smith X-Patchwork-Id: 865574 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.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 3zRhFz1kNGz9t3V for ; Thu, 25 Jan 2018 10:29:27 +1100 (AEDT) Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3zRhFz0NYXzF0PT for ; Thu, 25 Jan 2018 10:29:27 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=stewart@linux.vnet.ibm.com; receiver=) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3zRhFP48Y3zDqvH for ; Thu, 25 Jan 2018 10:28:57 +1100 (AEDT) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0ONRTgF131061 for ; Wed, 24 Jan 2018 18:28:55 -0500 Received: from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fq14w5fug-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 24 Jan 2018 18:28:54 -0500 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 24 Jan 2018 18:28:52 -0500 Received: from b01cxnp22036.gho.pok.ibm.com (9.57.198.26) by e17.ny.us.ibm.com (146.89.104.204) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 24 Jan 2018 18:28:51 -0500 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0ONSo0t46268442; Wed, 24 Jan 2018 23:28:50 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1E98DAC03F; Wed, 24 Jan 2018 18:30:07 -0500 (EST) Received: from birb.localdomain (unknown [9.81.199.175]) by b01ledav006.gho.pok.ibm.com (Postfix) with SMTP id 2B32BAC040; Wed, 24 Jan 2018 18:30:05 -0500 (EST) Received: by birb.localdomain (Postfix, from userid 1000) id 4DCC14F0E2A; Thu, 25 Jan 2018 10:28:46 +1100 (AEDT) From: Stewart Smith To: skiboot@lists.ozlabs.org Date: Thu, 25 Jan 2018 10:28:46 +1100 X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180124232846.32618-1-stewart@linux.vnet.ibm.com> References: <20180124232846.32618-1-stewart@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18012423-0040-0000-0000-000003E8A748 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008422; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000247; SDB=6.00979875; UDB=6.00496686; IPR=6.00759179; BA=6.00005794; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00019191; XFM=3.00000015; UTC=2018-01-24 23:28:52 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18012423-0041-0000-0000-000007DE0E5D Message-Id: <20180124232846.32618-3-stewart@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-24_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801240304 Subject: [Skiboot] [PATCH 2/2] PM: Fixed generation of MTSPR instruction in STOP API. X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Prem Shanker Jha , stable@birb.localdomain MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" From: Prem Shanker Jha STOP API generates SPR restore instruction for a given SPR. Commit fixes the generation of mtspr instruction by API. Problem will show up only when API is changed to generate restore instruction using a GPR other than R0. Cc: stable CQ: SW407799 Change-Id: I2a841a9aae417b7bcd92a323197d9c6a1f3cb149 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/49525 Tested-by: FSP CI Jenkins Tested-by: Jenkins Server Tested-by: Hostboot CI Reviewed-by: RANGANATHPRASAD G. BRAHMASAMUDRA Reviewed-by: STEWART E. SMITH Dev-Ready: Gregory S. Still Reviewed-by: Gregory S. Still Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/49529 Reviewed-by: Hostboot Team Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: Christian R. Geddes [stewart: cherry-picked from hostboot] Signed-off-by: Stewart Smith Acked-by: Vaidyanathan Srinivasan --- libpore/p9_stop_api.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpore/p9_stop_api.C b/libpore/p9_stop_api.C index 7242c423c652..5c0f2e5e5641 100644 --- a/libpore/p9_stop_api.C +++ b/libpore/p9_stop_api.C @@ -258,7 +258,7 @@ static uint32_t getMtsprInstruction( const uint16_t i_Rs, const uint16_t i_Spr ) uint32_t mtsprInstOpcode = 0; uint32_t temp = (( i_Spr & 0x03FF ) << 11); mtsprInstOpcode = (uint8_t)i_Rs << 21; - mtsprInstOpcode = ( temp & 0x0000F800 ) << 5; + mtsprInstOpcode |= ( temp & 0x0000F800 ) << 5; mtsprInstOpcode |= ( temp & 0x001F0000 ) >> 5; mtsprInstOpcode |= MTSPR_BASE_OPCODE;