Skip to contentSkip to conversation

bpf: jit: s390 64/32 bits for index in tail call

DISCUSSION Yauheni Kaliuta 2 participants 2 messages Jun 25, 2019 – Jul 3, 2019 BPF

lore
Share & tools
lore
#0 lore raw

Hi!

I have a question about 6651ee070b3124fe9b9db383e3a895a0e4aded65

```
    With this patch a tail call generates the following code on s390x:
    
     if (index >= array->map.max_entries)
             goto out
     000003ff8001c7e4: e31030100016   llgf    %r1,16(%r3)
     000003ff8001c7ea: ec41001fa065   clgrj   %r4,%r1,10,3ff8001c828
```

Do I understand corretly, that it uses 64 bit index value?

"runtime/jit: pass > 32bit index to tail_call" test_verifier's test fails for me and I see, for example, /* mov edx, edx */ in the x86 implementation

Signature · 2 lines
WBR,
Yauheni Kaliuta
#1 lore raw
Quoted 9 lines
```
   With this patch a tail call generates the following code on s390x:

    if (index >= array->map.max_entries)
            goto out
    000003ff8001c7e4: e31030100016   llgf    %r1,16(%r3)
    000003ff8001c7ea: ec41001fa065   clgrj   %r4,%r1,10,3ff8001c828
```
Quoted 5 lines

Do I understand corretly, that it uses 64 bit index value?

"runtime/jit: pass > 32bit index to tail_call" test_verifier's test fails for me and I see, for example, /* mov edx, edx */ in the x86 implementation

Hi Yauheni,

llgf zero-extends a 32-bit value and puts it into a register, so I would expect index to be a 32-bit value here. This test passes for me:

#752/u runtime/jit: pass > 32bit index to tail_call OK #752/p runtime/jit: pass > 32bit index to tail_call OK

Which machine are you using for testing? I tried that on z14 (3906).

Best regards,
Ilya