linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "tip-bot2 for Atish Patra" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Atish Patra <atish.patra@wdc.com>,
	Ard Biesheuvel <ardb@kernel.org>, x86 <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [tip: efi/urgent] efi/libstub: Fix gcc error around __umoddi3 for 32 bit builds
Date: Wed, 22 Jul 2020 22:48:41 -0000	[thread overview]
Message-ID: <159545812117.4006.8365184793527804218.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20200625234516.31406-2-atish.patra@wdc.com>

The following commit has been merged into the efi/urgent branch of tip:

Commit-ID:     950accbabd4cfa83519fa920f99428bcc131c3c9
Gitweb:        https://git.kernel.org/tip/950accbabd4cfa83519fa920f99428bcc131c3c9
Author:        Atish Patra <atish.patra@wdc.com>
AuthorDate:    Thu, 25 Jun 2020 16:45:06 -07:00
Committer:     Ard Biesheuvel <ardb@kernel.org>
CommitterDate: Thu, 09 Jul 2020 09:45:09 +03:00

efi/libstub: Fix gcc error around __umoddi3 for 32 bit builds

32bit gcc doesn't support modulo operation on 64 bit data. It results in
a __umoddi3 error while building EFI for 32 bit.

Use bitwise operations instead of modulo operations to fix the issue.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
Link: https://lore.kernel.org/r/20200625234516.31406-2-atish.patra@wdc.com
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 drivers/firmware/efi/libstub/alignedmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/efi/libstub/alignedmem.c b/drivers/firmware/efi/libstub/alignedmem.c
index cc89c4d..1de9878 100644
--- a/drivers/firmware/efi/libstub/alignedmem.c
+++ b/drivers/firmware/efi/libstub/alignedmem.c
@@ -44,7 +44,7 @@ efi_status_t efi_allocate_pages_aligned(unsigned long size, unsigned long *addr,
 	*addr = ALIGN((unsigned long)alloc_addr, align);
 
 	if (slack > 0) {
-		int l = (alloc_addr % align) / EFI_PAGE_SIZE;
+		int l = (alloc_addr & (align - 1)) / EFI_PAGE_SIZE;
 
 		if (l) {
 			efi_bs_call(free_pages, alloc_addr, slack - l + 1);

  parent reply	other threads:[~2020-07-22 22:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-25 23:45 [RFC PATCH 00/11] Add UEFI support for RISC-V Atish Patra
2020-06-25 23:45 ` [RFC PATCH 01/11] efi: Fix gcc error around __umoddi3 for 32 bit builds Atish Patra
2020-06-26  2:42   ` Heinrich Schuchardt
2020-06-26 21:56     ` Atish Patra
2020-06-26 22:03       ` Ard Biesheuvel
2020-06-27  9:22         ` Ard Biesheuvel
2020-06-29 20:09           ` Atish Patra
2020-07-22 22:48   ` tip-bot2 for Atish Patra [this message]
2020-06-25 23:45 ` [RFC PATCH 02/11] RISC-V: Move DT mapping outof fixmap Atish Patra
2020-06-25 23:45 ` [RFC PATCH 03/11] RISC-V: Setup exception vector early Atish Patra
2020-06-25 23:45 ` [RFC PATCH 04/11] RISC-V: Add early ioremap support Atish Patra
2020-06-25 23:45 ` [RFC PATCH 05/11] RISC-V: Set maximum number of mapped pages correctly Atish Patra
2020-06-25 23:45 ` [RFC PATCH 06/11] riscv: Parse all memory blocks to remove unusable memory Atish Patra
2020-06-25 23:45 ` [RFC PATCH 07/11] include: pe.h: Add RISC-V related PE definition Atish Patra
2020-06-25 23:45 ` [RFC PATCH 08/11] RISC-V: Add PE/COFF header for EFI stub Atish Patra
2020-06-25 23:45 ` [RFC PATCH 09/11] RISC-V: Add EFI stub support Atish Patra
2020-06-25 23:45 ` [RFC PATCH 10/11] efi: Rename arm-init to efi-init common for all arch Atish Patra
2020-06-26  3:00   ` Heinrich Schuchardt
2020-06-26 21:57     ` Atish Patra
2020-06-25 23:45 ` [RFC PATCH 11/11] RISC-V: Add EFI runtime services Atish Patra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=159545812117.4006.8365184793527804218.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=ardb@kernel.org \
    --cc=atish.patra@wdc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).