@@ -543,7 +543,7 @@ bpf_prog_ksym_set_addr(struct bpf_prog *prog)
543
543
WARN_ON_ONCE (!bpf_prog_ebpf_jited (prog ));
544
544
545
545
prog -> aux -> ksym .start = (unsigned long ) prog -> bpf_func ;
546
- prog -> aux -> ksym .end = addr + hdr -> pages * PAGE_SIZE ;
546
+ prog -> aux -> ksym .end = addr + hdr -> size ;
547
547
}
548
548
549
549
static void
@@ -866,7 +866,7 @@ bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr,
866
866
bpf_jit_fill_hole_t bpf_fill_ill_insns )
867
867
{
868
868
struct bpf_binary_header * hdr ;
869
- u32 size , hole , start , pages ;
869
+ u32 size , hole , start ;
870
870
871
871
WARN_ON_ONCE (!is_power_of_2 (alignment ) ||
872
872
alignment > BPF_IMAGE_ALIGNMENT );
@@ -876,7 +876,6 @@ bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr,
876
876
* random section of illegal instructions.
877
877
*/
878
878
size = round_up (proglen + sizeof (* hdr ) + 128 , PAGE_SIZE );
879
- pages = size / PAGE_SIZE ;
880
879
881
880
if (bpf_jit_charge_modmem (size ))
882
881
return NULL ;
@@ -889,7 +888,7 @@ bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr,
889
888
/* Fill space with illegal/arch-dep instructions. */
890
889
bpf_fill_ill_insns (hdr , size );
891
890
892
- hdr -> pages = pages ;
891
+ hdr -> size = size ;
893
892
hole = min_t (unsigned int , size - (proglen + sizeof (* hdr )),
894
893
PAGE_SIZE - sizeof (* hdr ));
895
894
start = (get_random_int () % hole ) & ~(alignment - 1 );
@@ -902,10 +901,10 @@ bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr,
902
901
903
902
void bpf_jit_binary_free (struct bpf_binary_header * hdr )
904
903
{
905
- u32 pages = hdr -> pages ;
904
+ u32 size = hdr -> size ;
906
905
907
906
bpf_jit_free_exec (hdr );
908
- bpf_jit_uncharge_modmem (pages << PAGE_SHIFT );
907
+ bpf_jit_uncharge_modmem (size );
909
908
}
910
909
911
910
/* This symbol is only overridden by archs that have different
0 commit comments