Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp379142rwo; Fri, 21 Jul 2023 13:25:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlH8ST87dp/5siwTjbx9Cvhncf838y66Tw3UxgWkhfmotTmWsyViBhPRJYFqsZ8XmUwwk34c X-Received: by 2002:a17:907:270e:b0:988:bb33:53b7 with SMTP id w14-20020a170907270e00b00988bb3353b7mr2448023ejk.60.1689971111773; Fri, 21 Jul 2023 13:25:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689971111; cv=none; d=google.com; s=arc-20160816; b=GsrS9YNf7qMh9PiDhbncXAgxXC8CR8VVnjURG2iofsqPSdHvZMFQSB0QGJow/xUpgu JMLqR0BsEEYpcwj9ux9XNtumIkUgTy0x38Qtg6mytfRwKKlNPguHQQItZ9Jck312geRT spLu7eMb1y3PyGMJNNZpmaVw11HISP8NFq2q3+6IzEU+/2oVErhzo7R0GsAu3foFeHus rLGNOySOLytDbmYMQ32p12cyQOR7akaXK+g9yHv0tmunPBfQ/KM892nHZ4Z1yc1pcOtC fLSPzCBeVkm1NmEvmkwU/T6OqB08FtSviMIB2ZjP4IpLyRr1hAv/+OAJZeMD6Cym2diH y9Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=EpT2VGL/vykB8FqlJQIlSyLB7uwV4XVuIS3Xm3iONkg=; fh=sG4Q/sFp8ZiEZuPor2UReVqedVbFKF+sKiPuIb0va4U=; b=lJJbOjntWzEcxp3xt1MIZKPLvca5GJTKixPWKQTPImuQyQpwzfyy33vN8krfBXI8K6 POsLSIjB5WgAdN1jTpzdxPg55jlFS9QGw/oW+hIybb5v1pLkAW/QZYLDi4VFn0MoOY0O LsZoXtVY4761IyQE1KRLgrgt4WVbLcVeNFoYvcupR7FcWtZuSBe1ZImb+XWfnR5xNZag v0wUMk1XJ7vNABK6vqUgIHi/9ZZ59DEMwDMNcfqathXRFm/mnd8i7fXfvWLEzK9s0ma4 gsIYTMARWGxysjqgrC/oLqb4UlAjBo7gyyxTXWKBRCrA3Z6ieSM1yqXfni/kwBo9Vgn0 kVlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RjhsabJz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v27-20020a1709063bdb00b00992efdbb3b6si2573001ejf.160.2023.07.21.13.24.45; Fri, 21 Jul 2023 13:25:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RjhsabJz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230208AbjGUUA2 (ORCPT + 99 others); Fri, 21 Jul 2023 16:00:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229907AbjGUUA1 (ORCPT ); Fri, 21 Jul 2023 16:00:27 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E5092D7F; Fri, 21 Jul 2023 13:00:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689969625; x=1721505625; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=UTAejJQPSuliS6ZdTpleNGEHMmmHZFob/eKQc45LiNc=; b=RjhsabJzD76jvmxBDkMhLolZCk/mpPBhwAZvSBjPTq7zVeZcF2u6siMk lTaL2JM45dXe/UHwwzjj8MIF2FdNMqMRk7aEM1o0DDe4dz8FeDeTb3f6N KSusooy6yiUQTexTD9kMontdrvCl7KtDWsz6CgaSqeo/sAoAjKHyWGhXC w8BFIaV1vhf/0vWE/Phe0tMCHQ4PQo5/atEgjTBYCHTJyq+K++IfJAoB1 +YWpgOLp0ZYXJYM8zrUHI5SOEgypsSbtkZ2h6DwjVYg3lLHSQVzFLQue3 NIhaT99DhB6eoBdeL9BSjUDNk2nRRUkN98G0r74tbxzapwcN4T1fSgHKP w==; X-IronPort-AV: E=McAfee;i="6600,9927,10778"; a="347400020" X-IronPort-AV: E=Sophos;i="6.01,222,1684825200"; d="scan'208";a="347400020" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jul 2023 13:00:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10778"; a="795071770" X-IronPort-AV: E=Sophos;i="6.01,222,1684825200"; d="scan'208";a="795071770" Received: from lkp-server02.sh.intel.com (HELO 36946fcf73d7) ([10.239.97.151]) by fmsmga004.fm.intel.com with ESMTP; 21 Jul 2023 13:00:15 -0700 Received: from kbuild by 36946fcf73d7 with local (Exim 4.96) (envelope-from ) id 1qMwIQ-0007bh-3D; Fri, 21 Jul 2023 20:00:14 +0000 Date: Sat, 22 Jul 2023 03:59:50 +0800 From: kernel test robot To: Alexandre Ghiti , Paul Walmsley , Palmer Dabbelt , Albert Ou , Ard Biesheuvel , Kees Cook , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: oe-kbuild-all@lists.linux.dev, Alexandre Ghiti Subject: Re: [PATCH v5 3/5] arm64: libstub: Move KASLR handling functions to kaslr.c Message-ID: <202307220314.ZZIxEjW2-lkp@intel.com> References: <20230721074850.310644-4-alexghiti@rivosinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230721074850.310644-4-alexghiti@rivosinc.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alexandre, kernel test robot noticed the following build errors: [auto build test ERROR on linus/master] [also build test ERROR on v6.5-rc2 next-20230721] [cannot apply to efi/next] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Alexandre-Ghiti/riscv-Introduce-virtual-kernel-mapping-KASLR/20230721-155554 base: linus/master patch link: https://lore.kernel.org/r/20230721074850.310644-4-alexghiti%40rivosinc.com patch subject: [PATCH v5 3/5] arm64: libstub: Move KASLR handling functions to kaslr.c config: loongarch-defconfig (https://download.01.org/0day-ci/archive/20230722/202307220314.ZZIxEjW2-lkp@intel.com/config) compiler: loongarch64-linux-gcc (GCC) 12.3.0 reproduce: (https://download.01.org/0day-ci/archive/20230722/202307220314.ZZIxEjW2-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202307220314.ZZIxEjW2-lkp@intel.com/ All errors (new ones prefixed by >>): drivers/firmware/efi/libstub/kaslr.c: In function 'efi_kaslr_relocate_kernel': >> drivers/firmware/efi/libstub/kaslr.c:155:9: error: implicit declaration of function 'efi_icache_sync'; did you mean 'efi_cache_sync_image'? [-Werror=implicit-function-declaration] 155 | efi_icache_sync(*image_addr, *image_addr + kernel_codesize); | ^~~~~~~~~~~~~~~ | efi_cache_sync_image cc1: some warnings being treated as errors vim +155 drivers/firmware/efi/libstub/kaslr.c 87 88 /** 89 * efi_kaslr_relocate_kernel() - Relocate the kernel (random if KASLR enabled) 90 * @image_addr: Pointer to the current kernel location 91 * @reserve_addr: Pointer to the relocated kernel location 92 * @reserve_size: Size of the relocated kernel 93 * @kernel_size: Size of the text + data 94 * @kernel_codesize: Size of the text 95 * @kernel_memsize: Size of the text + data + bss 96 * @phys_seed: Random seed used for the relocation 97 * 98 * If KASLR is not enabled, this function relocates the kernel to a fixed 99 * address (or leave it as its current location). If KASLR is enabled, the 100 * kernel physical location is randomized using the seed in parameter. 101 * 102 * Return: status code, EFI_SUCCESS if relocation is successful 103 */ 104 efi_status_t efi_kaslr_relocate_kernel(unsigned long *image_addr, 105 unsigned long *reserve_addr, 106 unsigned long *reserve_size, 107 unsigned long kernel_size, 108 unsigned long kernel_codesize, 109 unsigned long kernel_memsize, 110 u32 phys_seed) 111 { 112 efi_status_t status; 113 u64 min_kimg_align = efi_get_kimg_min_align(); 114 115 if (IS_ENABLED(CONFIG_RANDOMIZE_BASE) && phys_seed != 0) { 116 /* 117 * If KASLR is enabled, and we have some randomness available, 118 * locate the kernel at a randomized offset in physical memory. 119 */ 120 status = efi_random_alloc(*reserve_size, min_kimg_align, 121 reserve_addr, phys_seed, 122 EFI_LOADER_CODE); 123 if (status != EFI_SUCCESS) 124 efi_warn("efi_random_alloc() failed: 0x%lx\n", status); 125 } else { 126 status = EFI_OUT_OF_RESOURCES; 127 } 128 129 if (status != EFI_SUCCESS) { 130 if (!check_image_region(*image_addr, kernel_memsize)) { 131 efi_err("FIRMWARE BUG: Image BSS overlaps adjacent EFI memory region\n"); 132 } else if (IS_ALIGNED(*image_addr, min_kimg_align) && 133 (u64)_end < EFI_ALLOC_LIMIT) { 134 /* 135 * Just execute from wherever we were loaded by the 136 * UEFI PE/COFF loader if the placement is suitable. 137 */ 138 *reserve_size = 0; 139 return EFI_SUCCESS; 140 } 141 142 status = efi_allocate_pages_aligned(*reserve_size, reserve_addr, 143 ULONG_MAX, min_kimg_align, 144 EFI_LOADER_CODE); 145 146 if (status != EFI_SUCCESS) { 147 efi_err("Failed to relocate kernel\n"); 148 *reserve_size = 0; 149 return status; 150 } 151 } 152 153 memcpy((void *)*reserve_addr, (void *)*image_addr, kernel_size); 154 *image_addr = *reserve_addr; > 155 efi_icache_sync(*image_addr, *image_addr + kernel_codesize); -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki