Received: by 10.213.65.68 with SMTP id h4csp1846866imn; Thu, 29 Mar 2018 12:08:04 -0700 (PDT) X-Google-Smtp-Source: AIpwx49qi7K5qg2zfNLlrQf3rz/r/epEC7Nh87Gim1whCs8Wb0Hv3k5NKuOvTrMvla3Gnr8D0kR/ X-Received: by 2002:a17:902:9a81:: with SMTP id w1-v6mr3970108plp.148.1522350484868; Thu, 29 Mar 2018 12:08:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522350484; cv=none; d=google.com; s=arc-20160816; b=zeTXjXjS+8GlJMLpusVI545ACe+TIpfUg9kKr0Pq1iPgvPb5Fz5G4zu2deYp+5gaXB qAdd5iU39PieIp2C8cdJgsKpMacHETTNw6TwerQuTwx+n/0nBcGwP1fA3d/cc7GsL5Ra /o3+fQ0xHiH8PS2LUX/9Wq4cGT5JHoDYftxzcvCqaYC2kwOSxCl2Fdhr8s2lgjkV+eyg vSnIJxFwmB32NwaAZNgtW7f+1cigwJ2qkINUiMSXuJuUabHYWzBjQx/iCM7t38OIxfp4 5LI9bSmerC78xSSOUdLyeCUjbXoX7UoNJYfv/ASGPGCuPYpNKMM+Bsf+D+vRcbU1dhk1 UBUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=DNjp+x3Hc+Sa3fysqVjb2BB7RfO681WOHxEJzyI4oEA=; b=Ke+KF1Hvp7HxGB82V1vc13NbNymIEMfq/lRgU4M/8SVlJq+N9HCE/lW/cyR1EYjjf9 zuCxyVSaDqYJHYEZ7PIOs0eudBM7u5WmTbZsuG/jIXoiTUZ5FvFbSmbTkcktEznmgXWM k9y1mKeGxjtxvsDu1Nv4S+73tZkAIQdvqFW1B+cPxVWWlLQkrDxSO/qQNtRZc8E9PvHm OvXW6zcjojvbSywyLyuVtDy163hu9WwF6vCxiXLozwbmz6rrJ3wGKn7v4xR2g3KROYW1 PukQfovFH7+/hHxNr+TAx/M9R6b2OeyqVuDUXHGzzqyx/sDBj2mXZ/jE4LNZPUq0vfwE MD5A== 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 t9-v6si6556800plz.161.2018.03.29.12.07.50; Thu, 29 Mar 2018 12:08:04 -0700 (PDT) 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 S1751513AbeC2TGk (ORCPT + 99 others); Thu, 29 Mar 2018 15:06:40 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:34712 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750866AbeC2TGj (ORCPT ); Thu, 29 Mar 2018 15:06:39 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2TJ5Nld067509 for ; Thu, 29 Mar 2018 15:06:39 -0400 Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149]) by mx0a-001b2d01.pphosted.com with ESMTP id 2h12mkgu2c-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Thu, 29 Mar 2018 15:06:39 -0400 Received: from localhost by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 29 Mar 2018 13:06:38 -0600 Received: from b03cxnp08026.gho.boulder.ibm.com (9.17.130.18) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 29 Mar 2018 13:06:36 -0600 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2TJ6Zdh6684930; Thu, 29 Mar 2018 12:06:35 -0700 Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D0C2378047; Thu, 29 Mar 2018 13:06:35 -0600 (MDT) Received: from morokweng.localdomain.com (unknown [9.85.223.156]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP id C536478041; Thu, 29 Mar 2018 13:06:33 -0600 (MDT) From: Thiago Jung Bauermann To: linuxppc-dev@lists.ozlabs.org Cc: Michael Ellerman , Dave Young , =?UTF-8?q?Michal=20Such=C3=A1nek?= , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, Thiago Jung Bauermann Subject: [PATCH] powerpc: kexec_file: Fix error code when trying to load kdump kernel Date: Thu, 29 Mar 2018 16:05:43 -0300 X-Mailer: git-send-email 2.16.2 X-TM-AS-GCONF: 00 x-cbid: 18032919-8235-0000-0000-00000D3C92F5 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008766; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000255; SDB=6.01010231; UDB=6.00514696; IPR=6.00789509; MB=3.00020316; MTD=3.00000008; XFM=3.00000015; UTC=2018-03-29 19:06:38 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18032919-8236-0000-0000-00004043DF85 Message-Id: <20180329190543.25118-1-bauerman@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-29_11:,, 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-1803290197 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kexec_file_load() on powerpc doesn't support kdump kernels yet, so it returns -ENOTSUPP in that case. I've recently learned that this errno is internal to the kernel and isn't supposed to be exposed to userspace. Therefore, change to -EOPNOTSUPP which is defined in an uapi header. This does indeed make kexec-tools happier. Before the patch, on ppc64le: # ~bauermann/src/kexec-tools/build/sbin/kexec -s -p /boot/vmlinuz kexec_file_load failed: Unknown error 524 After the patch: # ~bauermann/src/kexec-tools/build/sbin/kexec -s -p /boot/vmlinuz kexec_file_load failed: Operation not supported Fixes: a0458284f062 ("powerpc: Add support code for kexec_file_load()") Reported-by: Dave Young Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/kernel/machine_kexec_file_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) This is a minor issue, but since it's a simple patch it might be worth applying it to stable branches. This is the kexec-tools thread where this problem was brought up: https://lists.infradead.org/pipermail/kexec/2018-March/020346.html And this is an instance of a similar fix being applied elsewhere in the kernel, for the same reasons: https://patchwork.kernel.org/patch/8490791/ The test shown in the commit log was made using Hari Bathini's patch adding kexec_file_load() support to kexec-tools in ppc64. diff --git a/arch/powerpc/kernel/machine_kexec_file_64.c b/arch/powerpc/kernel/machine_kexec_file_64.c index e4395f937d63..45e0b7d5f200 100644 --- a/arch/powerpc/kernel/machine_kexec_file_64.c +++ b/arch/powerpc/kernel/machine_kexec_file_64.c @@ -43,7 +43,7 @@ int arch_kexec_kernel_image_probe(struct kimage *image, void *buf, /* We don't support crash kernels yet. */ if (image->type == KEXEC_TYPE_CRASH) - return -ENOTSUPP; + return -EOPNOTSUPP; for (i = 0; i < ARRAY_SIZE(kexec_file_loaders); i++) { fops = kexec_file_loaders[i];