Skip to contentSkip to conversation

bpf: fix UML x86_64 compile failure

PATCH Superseded Maciej Żenczykowski 3 participants 3 messages Jun 13, 2024

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bpf: fix UML x86_64 compile failure

Cc Andrii Nakryiko <[email protected]>
Cc John Fastabend <[email protected]>
Cc Alexei Starovoitov <[email protected]>
Fixes 1ae6921009e5 ("bpf: inline bpf_get_smp_processor_id() helper")
---
 kernel/bpf/verifier.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/bpf/verifier.c +1 -1
index 36ef8e96787e..7a354b1e6197 100644
@@ -20313,7 +20313,7 @@ static int do_misc_fixups(struct bpf_verifier_env *env)
 			goto next_insn;
 		}
 
-#ifdef CONFIG_X86_64
+#if defined(CONFIG_X86_64) && !defined(CONFIG_UML)
 		/* Implement bpf_get_smp_processor_id() inline. */
 		if (insn->imm == BPF_FUNC_get_smp_processor_id &&
 		    prog->jit_requested && bpf_jit_supports_percpu_insn()) {
Signature · 1 line
2.45.2.505.gda0bf45e8d-goog
#1 lore raw
Quoted 14 lines · Maciej Żenczykowski
Cc Andrii Nakryiko <[email protected]>
Cc John Fastabend <[email protected]>
Cc Alexei Starovoitov <[email protected]>
Fixes 1ae6921009e5 ("bpf: inline bpf_get_smp_processor_id() helper")
---
 kernel/bpf/verifier.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/bpf/verifier.c +0 -0
index 36ef8e96787e..7a354b1e6197 100644

kernel/bpf/verifier.c static int do_misc_fixups(struct bpf_verifier_env *env) · line 20319

Quoted 8 lines
kernel/bpf/verifier.c +1 -1
@@ -20313,7 +20313,7 @@ static int do_misc_fixups(struct bpf_verifier_env *env)
 			goto next_insn;
 		}
 
-#ifdef CONFIG_X86_64
+#if defined(CONFIG_X86_64) && !defined(CONFIG_UML)
 		/* Implement bpf_get_smp_processor_id() inline. */
 		if (insn->imm == BPF_FUNC_get_smp_processor_id &&
 		    prog->jit_requested && bpf_jit_supports_percpu_insn()) {

The patch needs a change description[1].

Maybe something along the line of why pcpu_hot.cpu_number not accessible in User-mode Linux? (I don't know bpf_get_smp_processor_id() or UML that well, just suggesting possible change description)

1: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes

#2 lore raw
Quoted 27 lines · Shung-Hsi Yu
Quoted 14 lines · Maciej Żenczykowski
Cc Andrii Nakryiko <[email protected]>
Cc John Fastabend <[email protected]>
Cc Alexei Starovoitov <[email protected]>
Fixes 1ae6921009e5 ("bpf: inline bpf_get_smp_processor_id() helper")
---
 kernel/bpf/verifier.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/bpf/verifier.c +0 -0
index 36ef8e96787e..7a354b1e6197 100644

kernel/bpf/verifier.c static int do_misc_fixups(struct bpf_verifier_env *env) · line 20319

Quoted 8 lines
kernel/bpf/verifier.c +1 -1
@@ -20313,7 +20313,7 @@ static int do_misc_fixups(struct bpf_verifier_env *env)
                      goto next_insn;
              }
 
-#ifdef CONFIG_X86_64
+#if defined(CONFIG_X86_64) && !defined(CONFIG_UML)
              /* Implement bpf_get_smp_processor_id() inline. */
              if (insn->imm == BPF_FUNC_get_smp_processor_id &&
                  prog->jit_requested && bpf_jit_supports_percpu_insn()) {

The patch needs a change description[1].

Quoted 3 lines

Maybe something along the line of why pcpu_hot.cpu_number not accessible in User-mode Linux? (I don't know bpf_get_smp_processor_id() or UML that well, just suggesting possible change description)

+1

pw-bot: cr