From patchwork Mon Apr 2 09:53:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikunj A Dadhania X-Patchwork-Id: 894147 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 40F6xG5hJxz9s28 for ; Mon, 2 Apr 2018 19:53:38 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40F6xG3hw6zF241 for ; Mon, 2 Apr 2018 19:53:38 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=prvs=06304d7d22=nikunj@linux.vnet.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com 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 40F6x91lKpzF22y for ; Mon, 2 Apr 2018 19:53:26 +1000 (AEST) Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w329nLcW062590 for ; Mon, 2 Apr 2018 05:53:24 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 2h3fjpnu0m-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Mon, 02 Apr 2018 05:53:23 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 2 Apr 2018 10:53:22 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 2 Apr 2018 10:53:20 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w329rJmt57671800; Mon, 2 Apr 2018 09:53:19 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 39EBB52047; Mon, 2 Apr 2018 09:44:30 +0100 (BST) Received: from abhimanyu.in.ibm.com (unknown [9.109.206.50]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 14DF652043; Mon, 2 Apr 2018 09:44:28 +0100 (BST) From: Nikunj A Dadhania To: slof@lists.ozlabs.org Date: Mon, 2 Apr 2018 15:23:12 +0530 X-Mailer: git-send-email 2.14.3 X-TM-AS-GCONF: 00 x-cbid: 18040209-0040-0000-0000-000004296664 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18040209-0041-0000-0000-0000262C8F55 Message-Id: <20180402095312.16343-1-nikunj@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-04-02_03:, , 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-1804020112 Subject: [SLOF] [PATCH] broken_sc1: handle H_UNSUPPORTED as well X-BeenThere: slof@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "Patches for https://github.com/aik/SLOF" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Ellerman , "Aneesh Kumar K . V" MIME-Version: 1.0 Errors-To: slof-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "SLOF" Recently, found that when DAWR was disabled by linux kernel, the hcall started returning H_UNSUPPORTED, and VM did not boot up as broken_sc1 patched up SC calls falsely. Make sure we handle H_UNSUPPORTED as well. CC: Michael Ellerman CC: Aneesh Kumar K.V Signed-off-by: Nikunj A Dadhania --- lib/libhvcall/brokensc1.c | 2 +- lib/libhvcall/libhvcall.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libhvcall/brokensc1.c b/lib/libhvcall/brokensc1.c index e6387e0..163ee30 100644 --- a/lib/libhvcall/brokensc1.c +++ b/lib/libhvcall/brokensc1.c @@ -47,7 +47,7 @@ static int check_broken_sc1(void) * supervisor mode. */ r = hcall(INS_SC1, H_SET_DABR, 0); - if (r == H_SUCCESS || r == H_HARDWARE) { + if (r == H_SUCCESS || r == H_HARDWARE || r == H_UNSUPPORTED) { /* All is fine */ return 0; } diff --git a/lib/libhvcall/libhvcall.h b/lib/libhvcall/libhvcall.h index 3fa4398..1ef320e 100644 --- a/lib/libhvcall/libhvcall.h +++ b/lib/libhvcall/libhvcall.h @@ -3,6 +3,7 @@ #define H_SUCCESS 0 #define H_HARDWARE -1 +#define H_UNSUPPORTED -67 #define H_GET_TCE 0x1C #define H_PUT_TCE 0x20