From patchwork Sat Jul 22 12:38:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Ghiti X-Patchwork-Id: 124322 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp822908vqg; Sat, 22 Jul 2023 07:07:42 -0700 (PDT) X-Google-Smtp-Source: APBJJlFzKhL/Q/1EDxX3TuyyP0Zz6ZIVTQ1oMrProrOoEZ1pd1kXKKTAD9PiukrUfsyEHCj5VssD X-Received: by 2002:a05:6a20:4f05:b0:12c:f685:87e2 with SMTP id gi5-20020a056a204f0500b0012cf68587e2mr3107781pzb.60.1690034861754; Sat, 22 Jul 2023 07:07:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690034861; cv=none; d=google.com; s=arc-20160816; b=UcSNKyONkTHA3Jdvy7SctoF+emvzI7ZbluVyjw2b7GoeCSs0Irf/52S112fW90j7g8 egpCECDfHvkUSYA70gDdtIsk6B25ORrtE610YRXGf+G0hR8KQxLiIdcF8+mDC4XdjNK5 sFHtIurAlW/oCDBaK8LYjGYduz1hS2cym2GkS8Ytc/NVKgyCqK9IXyN7XVSwlP4t+5+p eRsWtDlSLZFZV1hXtWHIa9uu1oOdymVeDqM/IBvr8NpQ4NVVE44/VvIBQJVkYXUn7qS5 AfzpcLxUdXu4IrWpzX542D/huV3PkyJ3xZxhDzxxmWY/gxd3HfJLRShjPIbkaq6kuw3L vALA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/der0KJlDJ6cwsQs4A7+tIRkxDY3MMfqGccPHIlX2cU=; fh=ftizTztA0Oz+jn5nCCiKoDD6oRw7mqIVVly9vFmvJ6M=; b=jOGghPI9r9A4zFjCAJpLvyqRz+NvmHcNixLvKwm8tbOJ/GKc10Z057+hXrzIyF7Xfj Jma1S9No0acBK2QNOoGwJTMoxclBFgzWeBTMf/bm1abBJaGsgwJlYW9GwHJX3aVaTVdV iK4wp1plgD5n774y+LPg9kTyYJPOI7Okn7tTtjauen3Z8UhfonRtwkFRzag98iWXfx0h b0Jgy45R+o8KjDHaYjm3xd2CUy0zGIFgJX4JYOHRy67dMfFDCzBuUQMuccfi0r5QiG4W Vr80w3a6JEZS6DWrizCnfY+RBdDrMzbcMh4ncKu1ro3YHkOmRHYjCGN0MNRRWThR+diu zlGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=gLMFot1B; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w1-20020a628201000000b00666669afe56si4915446pfd.250.2023.07.22.07.07.28; Sat, 22 Jul 2023 07:07:41 -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=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=gLMFot1B; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230239AbjGVMnF (ORCPT + 99 others); Sat, 22 Jul 2023 08:43:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230456AbjGVMnE (ORCPT ); Sat, 22 Jul 2023 08:43:04 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AAD010DE for ; Sat, 22 Jul 2023 05:43:02 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3159da54e95so2045988f8f.3 for ; Sat, 22 Jul 2023 05:43:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1690029781; x=1690634581; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/der0KJlDJ6cwsQs4A7+tIRkxDY3MMfqGccPHIlX2cU=; b=gLMFot1BkI0ANTW5TAy3Bb9fjvPkiUYnwOGIenuWohOLcknH0XGZ0PpcM+5zX60Z+m 6O4mMv39vxTp/o926alCtUzZc0ivcxXTWHFsLiwv6C4Q2uWPZiqQqH7ZRG7cAyIIDqdy Susq5+QUDRzIxDTk4TkHnxVhYEgD48ErFCEHctoPsAin4wdcl/dH0Zc/OtXYWM33syru Y7w3nuCizPPyraqKoDNUV/m3+Rheyc7jQn3KCBJ8/ZvNAsHAxzPaOmiORG74HLe+FOg4 lU9ZgkmtlURKG7U2HY6d77tMENB8qrjtfCa9/CDqOzOTj7KREym6sTWEMenKl303dxM2 TM1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690029781; x=1690634581; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/der0KJlDJ6cwsQs4A7+tIRkxDY3MMfqGccPHIlX2cU=; b=g+OE8hirMShLUYVu8uuTmyoiMk0WN/25EZcTJzLtTdDhClMcpCBaqEkHF48RMLdF8Q 1g2WM7XX3wlkH+PxBap3LqHM2dnpGv/RnDvnN6CMOQnyVQ8x9RWuhOrkg+CCsugr6kG9 FotAbeuHJnXHvRIopPqCg5pgRrzRygFjEdfW3ELbvC/cIDJnPmXJH+GLzp9kswNE8EjC M+2gFB0QQ0PNtg6aVNlny/DbHdCJYRM97koBkOL6Yfi9Gb/DxEEnwx0ArQtOr9Ui3ffN OyNvLnt0griMplBKw2NZ++uyjCEx4genaPaITnxeSnefYPJP2XXMtc1wJmGBGQ9FNcO4 1bAQ== X-Gm-Message-State: ABy/qLafRNDLCjeen3og2cp23pIuFJSuGf9hYVkxxUHTT4Q0Si2ZAuJW Qyt0X0PfIct8KIgIPYl3rOPS5oYcEVU+KwQr9so= X-Received: by 2002:adf:e6d0:0:b0:313:fff0:ff44 with SMTP id y16-20020adfe6d0000000b00313fff0ff44mr3603578wrm.38.1690029780939; Sat, 22 Jul 2023 05:43:00 -0700 (PDT) Received: from alex-rivos.ba.rivosinc.com (amontpellier-656-1-456-62.w92-145.abo.wanadoo.fr. [92.145.124.62]) by smtp.gmail.com with ESMTPSA id t10-20020a5d690a000000b00316fc844be7sm6834681wru.36.2023.07.22.05.43.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Jul 2023 05:43:00 -0700 (PDT) From: Alexandre Ghiti To: 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: Alexandre Ghiti Subject: [PATCH v6 4/5] libstub: Fix compilation warning for rv32 Date: Sat, 22 Jul 2023 14:38:49 +0200 Message-Id: <20230722123850.634544-5-alexghiti@rivosinc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230722123850.634544-1-alexghiti@rivosinc.com> References: <20230722123850.634544-1-alexghiti@rivosinc.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772129995383097954 X-GMAIL-MSGID: 1772129995383097954 Fix the following warning which appears when compiled for rv32 by using unsigned long type instead of u64. ../drivers/firmware/efi/libstub/efi-stub-helper.c: In function 'efi_kaslr_relocate_kernel': ../drivers/firmware/efi/libstub/efi-stub-helper.c:846:28: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 846 | (u64)_end < EFI_ALLOC_LIMIT) { Signed-off-by: Alexandre Ghiti Acked-by: Ard Biesheuvel --- drivers/firmware/efi/libstub/kaslr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/efi/libstub/kaslr.c b/drivers/firmware/efi/libstub/kaslr.c index be0c8ab0982a..afb857329799 100644 --- a/drivers/firmware/efi/libstub/kaslr.c +++ b/drivers/firmware/efi/libstub/kaslr.c @@ -130,7 +130,7 @@ efi_status_t efi_kaslr_relocate_kernel(unsigned long *image_addr, if (!check_image_region(*image_addr, kernel_memsize)) { efi_err("FIRMWARE BUG: Image BSS overlaps adjacent EFI memory region\n"); } else if (IS_ALIGNED(*image_addr, min_kimg_align) && - (u64)_end < EFI_ALLOC_LIMIT) { + (unsigned long)_end < EFI_ALLOC_LIMIT) { /* * Just execute from wherever we were loaded by the * UEFI PE/COFF loader if the placement is suitable.