linux-next: build failure after merge of the random tree

Message ID 20221024132319.4b3910ad@canb.auug.org.au
State New
Headers
Series linux-next: build failure after merge of the random tree |

Commit Message

Stephen Rothwell Oct. 24, 2022, 2:23 a.m. UTC
  Hi all,

After merging the random tree, today's linux-next build (x86_64
allmodconfig) failed like this:

arch/x86/mm/cpu_entry_area.c: In function 'init_cea_offsets':
arch/x86/mm/cpu_entry_area.c:38:23: error: implicit declaration of function 'prandom_u32_max'; did you mean 'prandom_u32_state'? [-Werror=implicit-function-declaration]
   38 |                 cea = prandom_u32_max(max_cea);
      |                       ^~~~~~~~~~~~~~~
      |                       prandom_u32_state
cc1: all warnings being treated as errors

Caused by commit

  921b09c09fe7 ("prandom: remove prandom_u32_max()")

interacting with commit

  1248fb6a8201 ("x86/mm: Randomize per-cpu entry area")

from the tip tree.

I have applied the following fix up patch for today.

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 24 Oct 2022 12:37:28 +1100
Subject: [PATCH] fix up for "prandom: remove prandom_u32_max()"

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/x86/mm/cpu_entry_area.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Jason A. Donenfeld Oct. 24, 2022, 4:28 a.m. UTC | #1
I'll remove the removal commit for now and will plan on handling that
separately at the end of the 6.2 merge window.

Jason
  
Stephen Rothwell Oct. 24, 2022, 6:33 a.m. UTC | #2
Hi Jason,

On Mon, 24 Oct 2022 06:28:53 +0200 "Jason A. Donenfeld" <Jason@zx2c4.com> wrote:
>
> I'll remove the removal commit for now and will plan on handling that
> separately at the end of the 6.2 merge window.

OK, thanks.
  

Patch

diff --git a/arch/x86/mm/cpu_entry_area.c b/arch/x86/mm/cpu_entry_area.c
index ad1f750517a1..7a1b63fb80d3 100644
--- a/arch/x86/mm/cpu_entry_area.c
+++ b/arch/x86/mm/cpu_entry_area.c
@@ -35,7 +35,7 @@  static __init void init_cea_offsets(void)
 		unsigned int cea;
 
 again:
-		cea = prandom_u32_max(max_cea);
+		cea = get_random_u32_below(max_cea);
 
 		/* Make sure that no previous CPU shares the offset: */
 		for_each_possible_cpu(j) {