Received: from list by lists.gnu.org with archive (Exim 4.71) id 1erbKI-00051K-FV for mharc-grub-devel@gnu.org; Thu, 01 Mar 2018 22:25:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erbKF-00050u-PR for grub-devel@gnu.org; Thu, 01 Mar 2018 22:25:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1erbKC-00013a-Kj for grub-devel@gnu.org; Thu, 01 Mar 2018 22:25:39 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:57996) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1erbKC-0000x2-7H for grub-devel@gnu.org; Thu, 01 Mar 2018 22:25:36 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w223MvDh061868; Fri, 2 Mar 2018 03:25:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2017-10-26; bh=BdgnzdzeBapurtY8GfDkEedBAv2eDboZ6pRbhokguU4=; b=K6xZaDgJ+WJ0/1smap9hTv0RFPG9XMKie1AIZXmb9xvFHywxrJ6ZoI9AyA0lOCg8xf04 p9D0rvgP33S3e6h7258jJyRWvNBzkK6BWWZRr59ODVmLFqJQ589fi7eW7t/F1iN/JgUv fQoCkm9C554EObavzpuGcELKSaswsH9THpRiDIADIsKWUTAmSVdONTVBWd4SzqjEjz2P EzlLEa2+qZsvG3QPf+jGvWlM2Onw/7odYtoLwjoIFrlhYoLkWNOclboXcMO9/6KzyX76 ytrBJilYi4uVzcLU7q9hWmzDDbYRNV4N9moJAL0xSY0yDnFO+vIxJoAbASa/7Z0mxykA eQ== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2gewgxg549-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 02 Mar 2018 03:25:31 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w223PUG4004412 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 2 Mar 2018 03:25:30 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w223PQ86014803; Fri, 2 Mar 2018 03:25:26 GMT Received: from ca-qasparc20.us.oracle.com (/10.147.24.73) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 01 Mar 2018 19:25:26 -0800 From: Eric Snowberg To: grub-devel@gnu.org Cc: daniel.kiper@oracle.com, glaubitz@physik.fu-berlin.de, Eric Snowberg Subject: [PATCH] sparc64: Limit nvme of_path_of_nvme to just SPARC Date: Thu, 1 Mar 2018 19:25:09 -0800 Message-Id: <1519961109-24917-1-git-send-email-eric.snowberg@oracle.com> X-Mailer: git-send-email 1.7.1 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8819 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=3 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=525 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803020035 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 156.151.31.85 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Mar 2018 03:25:40 -0000 Limit NVMe of_path_of_nvme to just SPARC hardware for now. It has been found that non-Open Firmware hardware platforms can some how access this function. Signed-off-by: Eric Snowberg --- Note: This patch should be applied after Adrian's "ieee1275: Fix crash in of_path_of_nvme when of_path is empty" patch --- grub-core/osdep/linux/ofpath.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/grub-core/osdep/linux/ofpath.c b/grub-core/osdep/linux/ofpath.c index 6180621..a6153d3 100644 --- a/grub-core/osdep/linux/ofpath.c +++ b/grub-core/osdep/linux/ofpath.c @@ -350,6 +350,7 @@ of_path_of_ide(const char *sys_devname __attribute__((unused)), const char *devi return ret; } +#ifdef __sparc__ static char * of_path_of_nvme(const char *sys_devname __attribute__((unused)), const char *device, @@ -396,6 +397,7 @@ of_path_of_nvme(const char *sys_devname __attribute__((unused)), free (sysfs_path); return of_path; } +#endif static int vendor_is_ATA(const char *path) @@ -728,9 +730,11 @@ grub_util_devname_to_ofpath (const char *sys_devname) /* All the models I've seen have a devalias "floppy". New models have no floppy at all. */ ofpath = xstrdup ("floppy"); +#ifdef __sparc__ else if (device[0] == 'n' && device[1] == 'v' && device[2] == 'm' && device[3] == 'e') ofpath = of_path_of_nvme (name_buf, device, devnode, devicenode); +#endif else { grub_util_warn (_("unknown device type %s"), device); -- 1.7.1