Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1q1Tiq-0003Wd-JU for mharc-grub-devel@gnu.org; Tue, 23 May 2023 11:14:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1Tih-0003Ru-6z for grub-devel@gnu.org; Tue, 23 May 2023 11:14:40 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1Tie-0006Rt-L1 for grub-devel@gnu.org; Tue, 23 May 2023 11:14:38 -0400 Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34NEn8ga007054; Tue, 23 May 2023 15:14:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : mime-version; s=corp-2023-03-30; bh=iTajhmAna56YPzs0I/AGbANv3/8xo4//m3aRu8T3ElI=; b=RJ+9LjIwihIauBrME1T650NfiGgNGxpjZkXvfOE9Mq5tY4SHzhXapPmO1kWNGF85p//8 h3EYFv8pg7WC99XHzyBKFU1t0WnPLQPZ2Xt+e5J7b4UkmCidEU+KA3g06Xrr6ehllyXC T8IGwtHnlBkRl7v53NAYMvd/YMq2fFRjJva+N47YAl1n8m+pO+nOGFWqX3TJLlh/d71F Um5xyHrby8lHArhV+O6QbR3bAKfpcIVV+xS0OzOYdVP5JASlJ12XZEXJuJT9E9zjRyBC R8ZqJTWwjKjv/8YVN0b6Pg7VDx1XiymU8MIoJfj5Lavqr8PEWhF/ZB9rB3vRNc/Swues XQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qpp8cdfa6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 23 May 2023 15:14:30 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 34NEMPNN029085; Tue, 23 May 2023 15:14:29 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2101.outbound.protection.outlook.com [104.47.70.101]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qqk2ayqgw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 23 May 2023 15:14:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FKv7bXf+GwfOpvg0cT5wMN1xA/JqfCArXPgdoNkt1PMvOfQKPzLrD7qCVR857hV55YQaIWGYHCeD/LQeV5T4HCVquub2No+6p+jPyl62fnIpUAfLGCj32/bujMWSaBSlvmyrohobRNWEdUaJQANy0NSlFOXwOuKWb6rHB6HGBdba1a5hIo4EUaS9z2Xw1rd1uk279SwSYom+DmZ215gV/fnObdkOQE7WURH9QBzM3aB1JOxLbhpWI3q9xR/jHD92jTsnldHtELxxyad+FafySoRYU+VFJz4UpBLl+wQ8yF49kZKy+caBQyZ8uhdbAEz00wULol7Wo0GlZ80L6jOjQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iTajhmAna56YPzs0I/AGbANv3/8xo4//m3aRu8T3ElI=; b=QMiLQ+ZWGrV0CBbKM0H5HoKojjDBOllgT63T5mnR8aLbi+ENQpwsHa0Jiq1ZdHDR7XtkzoQXV9VpJNOsxPcp8dERskGa0nPsSLxf6/WE739F8pcjumy0ZCVeOc9rI3g80tSzXJekR3paWXpP9kGpZwmd4fT7O+gnA9BnCYLakxUFiS/GWneHSQO/UsFCGyeiWuJtFB8PI8epcBXsTzbmdzhvGXY7wpikPI2Uuan5bitv0Eo4Ohoxp2E5ER2eJyNqga5+MBNsQVWJSNHzB4NBzVTP4zLMcLPb3Hv6lmFEG1LMiNp5Q3bGu3eG7SmV+BD65PbNqw1i9KXC7p7k1DJj4Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iTajhmAna56YPzs0I/AGbANv3/8xo4//m3aRu8T3ElI=; b=L2mK39Wp5P51vIMgf/8ast6Bh0zE+ONrVAimJvvmPpvE821RjRc/Th/teZ9rbjY/AZFLg+Kdvm290djrlHIJwsckM+TLWE7Tf55uSlwAfSG1Dg5TaklSfu6gOsqwTWfKE6cFCZYPO7K+opy5efeXLLdK/7IFaD++UYBJS7rH00k= Received: from BN0PR10MB4822.namprd10.prod.outlook.com (2603:10b6:408:124::13) by PH0PR10MB4662.namprd10.prod.outlook.com (2603:10b6:510:38::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Tue, 23 May 2023 15:14:22 +0000 Received: from BN0PR10MB4822.namprd10.prod.outlook.com ([fe80::4204:ec15:178:b2f9]) by BN0PR10MB4822.namprd10.prod.outlook.com ([fe80::4204:ec15:178:b2f9%5]) with mapi id 15.20.6411.029; Tue, 23 May 2023 15:14:22 +0000 Date: Tue, 23 May 2023 17:14:16 +0200 From: Daniel Kiper To: Ard Biesheuvel Cc: grub-devel@gnu.org, Glenn Washburn Subject: Re: [PATCH v3 0/5] efi: Implement generic EFI boot for x86 Message-ID: References: <20230523082355.690271-1-ardb@kernel.org> Content-Type: multipart/mixed; boundary="1occZB2He+pdv5Sx" Content-Disposition: inline In-Reply-To: <20230523082355.690271-1-ardb@kernel.org> X-ClientProxiedBy: BE1P281CA0019.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:15::12) To BN0PR10MB4822.namprd10.prod.outlook.com (2603:10b6:408:124::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN0PR10MB4822:EE_|PH0PR10MB4662:EE_ X-MS-Office365-Filtering-Correlation-Id: f57e2ef0-0ff5-4d5f-f1e2-08db5ba06389 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hQKbXb7NFGBQ4vlo04DYhSEnDL4K/ytw1/n65uhkTxFUXYbihNZavJdCyl4/h3ikEdWEID+vvO2RXE3/TKQfvVjyVWWxS/UmyeAfgMcea8rup1LubOFJvgz2/V/nN+kf1Cgy0xTYbw6JMeWZeyAl44DDV4DSOrYLne20lcv8RZ5xF4jHlPWDG4mo0MMQDYOHHbgsFpEy5+o+unKXCzOt+nYxBL+bSf0GSFMus54q71DVIB6Gq4uczaeXrtb8JLhauX+pTkaNsIuGHqYWFgttcvcrDnrl6dVyIg6LAAmB8Gnp+aQaRRAIKT1Tz6515qjLsicjgkus+rasFZ6U+YmAalLaTSIEJn3+rQN+gw5aa8NLjPLxqfMH9atjpEzKJ8Dz2cM7dmpHWdJ0XZc7X1QEEMU5SYw7ekwtTA0vEL0q9O963MEVHUkwoQo3abmxOFs2/YX+1+3nyPT4d3sp9xRhjyCJM71BtH+QCg+KnEGSj3ftEcNIjeetXNSi650MCyoZXz+txRriRNboUjf/Z23Lg+8Q4QjBgUHo9VSsIVRPe3DeS4DOWS7dmfjtBeWVrr9HSeS/bQcUXGDb7szKHYk38e1Lz5V8ioLH7qYFRdkuycoTMnQ30skm97HpB/1RqUthK6t6MuSoxeA/1EJh58Rlbg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN0PR10MB4822.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(366004)(136003)(396003)(346002)(39860400002)(376002)(451199021)(83380400001)(44832011)(478600001)(5660300002)(316002)(8676002)(41300700001)(8936002)(86362001)(66946007)(235185007)(66476007)(66556008)(4326008)(6916009)(38100700002)(44144004)(2906002)(6666004)(6486002)(21480400003)(26005)(6506007)(6512007)(9686003)(186003)(41533002)(2700100001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?3m22u9kL4SjP4yUkhdM0spPMEYYLdg76gxbPuK740uQPHCBTT6RsBME/LPuA?= =?us-ascii?Q?AnwGzV2SY2byiWhP1MkH+mFmw3JkSTl4v0YvpqKbMcce6DifWlBvu3MBkV5u?= =?us-ascii?Q?+Trt5wTbLLdmmbsF7qDnTxGv0jCGbVEi9irmUJEqKw+DeSgi+AxkLRQTAvqT?= =?us-ascii?Q?evUayjB1oj9aqxfXwMTn0RQuPH5xb3trgVAg29lY3FZWrXa7SeaISmpjnYwB?= =?us-ascii?Q?fEUlBa5mLnMYR6R9eDREqR/llf/BkgUWwoIdG6miHfb6t02Z1wSEJHb0lh1r?= =?us-ascii?Q?mnc9mp1msYRCe35j9s/ew7m/DOeW0LmuEgrpIEaG4oNT4K0RlAnQlRegdfp8?= =?us-ascii?Q?xPgWYCLVddj4WaNBo+RMKzgxmaKta50gQuHPDozQhhb3EgpLBero6tc4IACo?= =?us-ascii?Q?h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Y+JOe+fKKD/fKiaI0F4T0eHnp4MOU+yrdhKeIyiKYOXLHFP13AI75D8t+18Eg23dTMrQg6vJm1eZWVu4yvjGSl6aZVW18/bmp20G+tZ9XUfi2lMCrDjnw9zK/i8QkYH48Ibk/aG8DKK6c7WLmJdAHnTYA/F0CuM5xse56O2eImRiC2MVU9fAtLuq5bjJdktO1Pds+jA40rYYU5e X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f57e2ef0-0ff5-4d5f-f1e2-08db5ba06389 X-MS-Exchange-CrossTenant-AuthSource: BN0PR10MB4822.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2023 15:14:22.8283 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xLkU3SEuOnKr7KqTiTgvT2Z0rdXeDS0/EuDv9vixW9Vy137IhlfZVXdwxusD1CnZXLf9pmSgIJv9hCDFC/15iA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4662 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-05-23_10,2023-05-23_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 suspectscore=0 adultscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305230120 X-Proofpoint-ORIG-GUID: wB_tgcPL82jlB_COQiz9_abzIqUDQHgX X-Proofpoint-GUID: wB_tgcPL82jlB_COQiz9_abzIqUDQHgX Received-SPF: pass client-ip=205.220.177.32; envelope-from=daniel.kiper@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 May 2023 15:14:45 -0000 --1occZB2He+pdv5Sx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, May 23, 2023 at 10:23:50AM +0200, Ard Biesheuvel wrote: > Switch the i386-efi and x86_64-efi builds to the generic EFI loader, > which enters the Linux kernel via the EFI stub and provides the initrd > via the LoadFile2 protocol. This unifies x86 with other EFI > architectures, and removes the dependency on the setup header and struct > bootparams. > > Do some preparatory cleanup first, so we no longer need to rely on the > MS to SysV calling convention translation code. > > Changes since v2: > - rebase onto latest master, which has the Loongarch changes > - retain Itanium support for now > - simplify the fallback logic - attempt to load the image as usual, and > fallback on failure or if the image does not implement LoadFile2 > > Changes since v1: > - drop Itanium support, which is a maintenance burden as it shares the > EFI code with other architectures, but does not have a EFI stub in > Linux, and there is no way to test whether our changes break the boot > for it or not; > - enable generic EFI for i386 as well > - wire up the existing x86 code as a fallback for kernels that lack EFI > stub or LoadFile2 support. This removes the need for additional > changes to support v5.8 or older kernels. > > Cc: Daniel Kiper > Cc: Glenn Washburn > > Ard Biesheuvel (5): > efi: Make EFI PXE protocol methods non-callable > efi: Add calling convention annotation to all prototypes > efi: Drop all uses of efi_call_XX wrappers > efi: Remove x86_64 call wrappers > efi: Use generic EFI loader for x86_64 and i386 I run test and Coverity builds and they reported some problems. You can find in attachments a fix for the build problems and a Coverity report. Please take a look... Otherwise patches LGTM... Thanks, Daniel --1occZB2He+pdv5Sx Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="x86-efi-loadfile2-fix.patch" diff --git a/grub-core/efiemu/runtime/efiemu.c b/grub-core/efiemu/runtime/efiemu.c index 5db1f347b..53b3cce7b 100644 --- a/grub-core/efiemu/runtime/efiemu.c +++ b/grub-core/efiemu/runtime/efiemu.c @@ -32,17 +32,17 @@ #include #include -grub_efi_status_t +grub_efi_status_t __grub_efi_api efiemu_get_time (grub_efi_time_t *time, grub_efi_time_capabilities_t *capabilities); -grub_efi_status_t +grub_efi_status_t __grub_efi_api efiemu_set_time (grub_efi_time_t *time); -grub_efi_status_t +grub_efi_status_t __grub_efi_api efiemu_get_wakeup_time (grub_efi_boolean_t *enabled, grub_efi_boolean_t *pending, grub_efi_time_t *time); -grub_efi_status_t +grub_efi_status_t __grub_efi_api efiemu_set_wakeup_time (grub_efi_boolean_t enabled, grub_efi_time_t *time); @@ -52,51 +52,51 @@ efiemu_set_wakeup_time (grub_efi_boolean_t enabled, #define PHYSICAL_ATTRIBUTE __attribute__ ((section(".text-physical"))); #endif -grub_efi_status_t +grub_efi_status_t __grub_efi_api efiemu_set_virtual_address_map (grub_efi_uintn_t memory_map_size, grub_efi_uintn_t descriptor_size, grub_efi_uint32_t descriptor_version, grub_efi_memory_descriptor_t *virtual_map) PHYSICAL_ATTRIBUTE; -grub_efi_status_t +grub_efi_status_t __grub_efi_api efiemu_convert_pointer (grub_efi_uintn_t debug_disposition, void **address) PHYSICAL_ATTRIBUTE; -grub_efi_status_t +grub_efi_status_t __grub_efi_api efiemu_get_variable (grub_efi_char16_t *variable_name, const grub_efi_guid_t *vendor_guid, grub_efi_uint32_t *attributes, grub_efi_uintn_t *data_size, void *data); -grub_efi_status_t +grub_efi_status_t __grub_efi_api efiemu_get_next_variable_name (grub_efi_uintn_t *variable_name_size, grub_efi_char16_t *variable_name, grub_efi_guid_t *vendor_guid); -grub_efi_status_t +grub_efi_status_t __grub_efi_api efiemu_set_variable (grub_efi_char16_t *variable_name, const grub_efi_guid_t *vendor_guid, grub_efi_uint32_t attributes, grub_efi_uintn_t data_size, void *data); -grub_efi_status_t +grub_efi_status_t __grub_efi_api efiemu_get_next_high_monotonic_count (grub_efi_uint32_t *high_count); -void +void __grub_efi_api efiemu_reset_system (grub_efi_reset_type_t reset_type, grub_efi_status_t reset_status, grub_efi_uintn_t data_size, grub_efi_char16_t *reset_data); -grub_efi_status_t +grub_efi_status_t __grub_efi_api EFI_FUNC (efiemu_set_virtual_address_map) (grub_efi_uintn_t, grub_efi_uintn_t, grub_efi_uint32_t, grub_efi_memory_descriptor_t *) PHYSICAL_ATTRIBUTE; -grub_efi_status_t +grub_efi_status_t __grub_efi_api EFI_FUNC (efiemu_convert_pointer) (grub_efi_uintn_t debug_disposition, void **address) PHYSICAL_ATTRIBUTE; @@ -202,7 +202,7 @@ bcd_to_hex (grub_uint8_t in) return 10 * ((in & 0xf0) >> 4) + (in & 0x0f); } -grub_efi_status_t +grub_efi_status_t __grub_efi_api EFI_FUNC (efiemu_get_time) (grub_efi_time_t *time, grub_efi_time_capabilities_t *capabilities) { @@ -246,7 +246,7 @@ EFI_FUNC (efiemu_get_time) (grub_efi_time_t *time, return GRUB_EFI_SUCCESS; } -grub_efi_status_t +grub_efi_status_t __grub_efi_api EFI_FUNC (efiemu_set_time) (grub_efi_time_t *time) { LOG ('b'); @@ -265,7 +265,7 @@ EFI_FUNC (efiemu_set_time) (grub_efi_time_t *time) } /* Following 2 functions are vendor specific. So announce it as unsupported */ -grub_efi_status_t +grub_efi_status_t __grub_efi_api EFI_FUNC (efiemu_get_wakeup_time) (grub_efi_boolean_t *enabled, grub_efi_boolean_t *pending, grub_efi_time_t *time) @@ -274,7 +274,7 @@ EFI_FUNC (efiemu_get_wakeup_time) (grub_efi_boolean_t *enabled, return GRUB_EFI_UNSUPPORTED; } -grub_efi_status_t +grub_efi_status_t __grub_efi_api EFI_FUNC (efiemu_set_wakeup_time) (grub_efi_boolean_t enabled, grub_efi_time_t *time) { @@ -337,7 +337,7 @@ efiemu_getcrc32 (grub_uint32_t crc, void *buf, int size) } -grub_efi_status_t EFI_FUNC +grub_efi_status_t __grub_efi_api EFI_FUNC (efiemu_set_virtual_address_map) (grub_efi_uintn_t memory_map_size, grub_efi_uintn_t descriptor_size, grub_efi_uint32_t descriptor_version, @@ -403,7 +403,7 @@ grub_efi_status_t EFI_FUNC /* since efiemu_set_virtual_address_map corrects all the pointers we don't need efiemu_convert_pointer */ -grub_efi_status_t +grub_efi_status_t __grub_efi_api EFI_FUNC (efiemu_convert_pointer) (grub_efi_uintn_t debug_disposition, void **address) { @@ -436,7 +436,7 @@ find_variable (const grub_efi_guid_t *vendor_guid, return 0; } -grub_efi_status_t +grub_efi_status_t __grub_efi_api EFI_FUNC (efiemu_get_variable) (grub_efi_char16_t *variable_name, const grub_efi_guid_t *vendor_guid, grub_efi_uint32_t *attributes, @@ -461,7 +461,7 @@ EFI_FUNC (efiemu_get_variable) (grub_efi_char16_t *variable_name, return GRUB_EFI_SUCCESS; } -grub_efi_status_t EFI_FUNC +grub_efi_status_t __grub_efi_api EFI_FUNC (efiemu_get_next_variable_name) (grub_efi_uintn_t *variable_name_size, grub_efi_char16_t *variable_name, grub_efi_guid_t *vendor_guid) @@ -501,7 +501,7 @@ grub_efi_status_t EFI_FUNC return GRUB_EFI_SUCCESS; } -grub_efi_status_t +grub_efi_status_t __grub_efi_api EFI_FUNC (efiemu_set_variable) (grub_efi_char16_t *variable_name, const grub_efi_guid_t *vendor_guid, grub_efi_uint32_t attributes, @@ -556,7 +556,7 @@ EFI_FUNC (efiemu_set_variable) (grub_efi_char16_t *variable_name, return GRUB_EFI_SUCCESS; } -grub_efi_status_t EFI_FUNC +grub_efi_status_t __grub_efi_api EFI_FUNC (efiemu_get_next_high_monotonic_count) (grub_efi_uint32_t *high_count) { LOG ('j'); @@ -570,7 +570,7 @@ grub_efi_status_t EFI_FUNC Besides EFI specification says that this function shouldn't be used on systems supporting ACPI */ -void +void __grub_efi_api EFI_FUNC (efiemu_reset_system) (grub_efi_reset_type_t reset_type, grub_efi_status_t reset_status, grub_efi_uintn_t data_size, --1occZB2He+pdv5Sx Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="x86-efi-loadfile2-coverity.txt" Hi, Please find the latest report on new defect(s) introduced to GRUB found with Coverity Scan. 2 new defect(s) introduced to GRUB found with Coverity Scan. New defect(s) Reported-by: Coverity Scan Showing 2 of 2 defect(s) ** CID 407976: Null pointer dereferences (NULL_RETURNS) /grub-core/loader/efi/linux.c: 217 in grub_arch_efi_linux_boot_image() ________________________________________________________________________________________________________ *** CID 407976: Null pointer dereferences (NULL_RETURNS) /grub-core/loader/efi/linux.c: 217 in grub_arch_efi_linux_boot_image() 211 return grub_error (GRUB_ERR_BAD_OS, "cannot load image"); 212 213 grub_dprintf ("linux", "linux command line: '%s'\n", args); 214 215 /* Convert command line to UCS-2 */ 216 loaded_image = grub_efi_get_loaded_image (image_handle); >>> CID 407976: Null pointer dereferences (NULL_RETURNS) >>> Dereferencing "loaded_image", which is known to be "NULL". 217 loaded_image->load_options_size = len = 218 (grub_strlen (args) + 1) * sizeof (grub_efi_char16_t); 219 loaded_image->load_options = 220 grub_efi_allocate_any_pages (GRUB_EFI_BYTES_TO_PAGES (loaded_image->load_options_size)); 221 if (!loaded_image->load_options) 222 return grub_errno; ** CID 407975: Possible Control flow issues (DEADCODE) /grub-core/loader/efi/linux.c: 437 in grub_cmd_initrd() ________________________________________________________________________________________________________ *** CID 407975: Possible Control flow issues (DEADCODE) /grub-core/loader/efi/linux.c: 437 in grub_cmd_initrd() 431 grub_dprintf ("linux", "[addr=%p, size=0x%x]\n", 432 (void *) initrd_start, initrd_size); 433 #endif 434 435 fail: 436 grub_initrd_close (&initrd_ctx); >>> CID 407975: Possible Control flow issues (DEADCODE) >>> Execution cannot reach the expression "initrd_start" inside this statement: "if (initrd_mem && !initrd_s...". 437 if (initrd_mem && !initrd_start) 438 grub_efi_free_pages ((grub_addr_t) initrd_mem, initrd_pages); 439 440 return grub_errno; 441 } 442 ________________________________________________________________________________________________________ --1occZB2He+pdv5Sx--