Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5452531imu; Wed, 19 Dec 2018 11:24:43 -0800 (PST) X-Google-Smtp-Source: AFSGD/VsI0t7jh0WFQJ7GEpa85GsNVE7jeu+sfT6N1NSy+czooJjjB+S/8Lc2DNnNeOuhctFVljS X-Received: by 2002:a62:6c49:: with SMTP id h70mr2178078pfc.201.1545247483810; Wed, 19 Dec 2018 11:24:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545247483; cv=none; d=google.com; s=arc-20160816; b=hr9EenSimquIs3/BKLlI+J+rkRFyJLgzP/szyNRVQWzC0QfU6aM/qE9V9qflILTbNa SpHUH3aV32YDrm527pj8kGqzrU0o5gEz5YK+n6TWUrmALvGOZN4tluIveq3C7B2qhByz KRSZxgR3MXshPkoPXOat11GebCMU1dF5qVVakFWvA689XO7eXbOdMKGrbnKxPR7hmjWO Rc5CGjYjz/Tdv+aHgfbeJx2hzTaLFSl+dKSB+VCUM8cm+UyCTpINezsvpli72iYxn3Hd D4S22/oDTV7w38wQfMgtoPFc3KYyALnSzW5XmpVYu62h4loOIv3+uhvGJjsp68EN4WBh JI0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from; bh=D5uc+MlrvhtjxBpUmAvvhjAo07n8H81g8DLYCrjPWzA=; b=S/HINZv+8pKxG79JQtmDYPmXV2vWGWe5Qokfz1PedJ7gbAnbwOqVerDCJz18Rxppw4 rLDl0nnZcfaZ7JwMSZZHfSWDnBS72BmSZCGEr7aNxM5YJuEatJEomwicSBtl+kpZYbcx hxcaslHZQt35Q/VoWhNX8ppSkF29+ueGd0g1eemX7ZVoQIkVUyRfXZdvdDxa+RcQcZO6 JpHEcnN0IlXP5777EhHYWlCTsGgNsJSkSgxPe83wzWDPIKF5vC9n9E1OuxL9XQ4DipMg T38J/GWuVmQYeor6Quoe4QKy2Khjm36g3kEPhH9qyaoiRhPZlWzJMFNvf2bpZ8ELcQd0 3lEQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o32si16716158pld.407.2018.12.19.11.24.28; Wed, 19 Dec 2018 11:24:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729110AbeLSTSJ (ORCPT + 99 others); Wed, 19 Dec 2018 14:18:09 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:43940 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727852AbeLSTSI (ORCPT ); Wed, 19 Dec 2018 14:18:08 -0500 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wBJIwgAP078276 for ; Wed, 19 Dec 2018 14:18:07 -0500 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0b-001b2d01.pphosted.com with ESMTP id 2pftcmdeqe-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 19 Dec 2018 14:18:06 -0500 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 19 Dec 2018 19:18:05 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 19 Dec 2018 19:18:03 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wBJJI1ge5439836 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 19 Dec 2018 19:18:01 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2FFAF5204F; Wed, 19 Dec 2018 19:18:01 +0000 (GMT) Received: from s38lp84.lnxne.boe (unknown [9.152.108.100]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id C921F5204E; Wed, 19 Dec 2018 19:18:00 +0000 (GMT) From: Michael Mueller To: KVM Mailing List Cc: Linux-S390 Mailing List , linux-kernel@vger.kernel.org, kvm390-list@tuxmaker.boeblingen.de.ibm.com, Martin Schwidefsky , Heiko Carstens , Christian Borntraeger , Janosch Frank , David Hildenbrand , Cornelia Huck , Halil Pasic , Pierre Morel , Michael Mueller Subject: [PATCH v5 01/15] KVM: s390: unregister debug feature on failing arch init Date: Wed, 19 Dec 2018 20:17:42 +0100 X-Mailer: git-send-email 2.13.4 In-Reply-To: <20181219191756.57973-1-mimu@linux.ibm.com> References: <20181219191756.57973-1-mimu@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18121919-0028-0000-0000-0000032CDB59 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18121919-0029-0000-0000-000023E93E4C Message-Id: <20181219191756.57973-2-mimu@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-12-19_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812190150 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make sure the debug feature and its allocated resources get released upon unsuccessful architecture initialization. A related indication of the issue will be reported as kernel message. Signed-off-by: Michael Mueller Reviewed-by: Cornelia Huck Reviewed-by: Pierre Morel Reviewed-by: David Hildenbrand Message-Id: <20181130143215.69496-2-mimu@linux.ibm.com> Signed-off-by: Christian Borntraeger --- Documentation/kmsg/s390/kvm | 12 ++++++++++++ arch/s390/kvm/kvm-s390.c | 17 ++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 Documentation/kmsg/s390/kvm diff --git a/Documentation/kmsg/s390/kvm b/Documentation/kmsg/s390/kvm new file mode 100644 index 000000000000..76ffe2012254 --- /dev/null +++ b/Documentation/kmsg/s390/kvm @@ -0,0 +1,12 @@ +/*? + * Text: "Failed to register FLIC rc=%d\n" + * Severity: Error + * Parameter: + * @1: return code of the FLIC registration call + * Description: + * The registration of the FLIC (Floating Interrupt Controller Interface) + * was not successful. + * User action: + * If this problem persists after a reload of the kvm kernel module, gather + * Linux debug data and contact your support organization. + */ diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index fe24150ff666..d8d8e0788157 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -417,19 +417,30 @@ static void kvm_s390_cpu_feat_init(void) int kvm_arch_init(void *opaque) { + int rc; + kvm_s390_dbf = debug_register("kvm-trace", 32, 1, 7 * sizeof(long)); if (!kvm_s390_dbf) return -ENOMEM; if (debug_register_view(kvm_s390_dbf, &debug_sprintf_view)) { - debug_unregister(kvm_s390_dbf); - return -ENOMEM; + rc = -ENOMEM; + goto out_debug_unreg; } kvm_s390_cpu_feat_init(); /* Register floating interrupt controller interface. */ - return kvm_register_device_ops(&kvm_flic_ops, KVM_DEV_TYPE_FLIC); + rc = kvm_register_device_ops(&kvm_flic_ops, KVM_DEV_TYPE_FLIC); + if (rc) { + pr_err("Failed to register FLIC rc=%d\n", rc); + goto out_debug_unreg; + } + return 0; + +out_debug_unreg: + debug_unregister(kvm_s390_dbf); + return rc; } void kvm_arch_exit(void) -- 2.13.4