mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	test_bpf: flag tests that cannot be jited on s390
Flag with FLAG_EXPECTED_FAIL the BPF_MAXINSNS tests that cannot be jited on s390 because they exceed BPF_SIZE_MAX and fail when CONFIG_BPF_JIT_ALWAYS_ON is set. Also set .expected_errcode to -ENOTSUPP so the tests pass in that case. Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com> Acked-by: Song Liu <songliubraving@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
This commit is contained in:
		
							parent
							
								
									dd349c3ffd
								
							
						
					
					
						commit
						3203c90100
					
				
					 1 changed files with 20 additions and 0 deletions
				
			
		| 
						 | 
					@ -5282,21 +5282,31 @@ static struct bpf_test tests[] = {
 | 
				
			||||||
	{	/* Mainly checking JIT here. */
 | 
						{	/* Mainly checking JIT here. */
 | 
				
			||||||
		"BPF_MAXINSNS: Ctx heavy transformations",
 | 
							"BPF_MAXINSNS: Ctx heavy transformations",
 | 
				
			||||||
		{ },
 | 
							{ },
 | 
				
			||||||
 | 
					#if defined(CONFIG_BPF_JIT_ALWAYS_ON) && defined(CONFIG_S390)
 | 
				
			||||||
 | 
							CLASSIC | FLAG_EXPECTED_FAIL,
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
		CLASSIC,
 | 
							CLASSIC,
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
		{ },
 | 
							{ },
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			{  1, !!(SKB_VLAN_TCI & VLAN_TAG_PRESENT) },
 | 
								{  1, !!(SKB_VLAN_TCI & VLAN_TAG_PRESENT) },
 | 
				
			||||||
			{ 10, !!(SKB_VLAN_TCI & VLAN_TAG_PRESENT) }
 | 
								{ 10, !!(SKB_VLAN_TCI & VLAN_TAG_PRESENT) }
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		.fill_helper = bpf_fill_maxinsns6,
 | 
							.fill_helper = bpf_fill_maxinsns6,
 | 
				
			||||||
 | 
							.expected_errcode = -ENOTSUPP,
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{	/* Mainly checking JIT here. */
 | 
						{	/* Mainly checking JIT here. */
 | 
				
			||||||
		"BPF_MAXINSNS: Call heavy transformations",
 | 
							"BPF_MAXINSNS: Call heavy transformations",
 | 
				
			||||||
		{ },
 | 
							{ },
 | 
				
			||||||
 | 
					#if defined(CONFIG_BPF_JIT_ALWAYS_ON) && defined(CONFIG_S390)
 | 
				
			||||||
 | 
							CLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
		CLASSIC | FLAG_NO_DATA,
 | 
							CLASSIC | FLAG_NO_DATA,
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
		{ },
 | 
							{ },
 | 
				
			||||||
		{ { 1, 0 }, { 10, 0 } },
 | 
							{ { 1, 0 }, { 10, 0 } },
 | 
				
			||||||
		.fill_helper = bpf_fill_maxinsns7,
 | 
							.fill_helper = bpf_fill_maxinsns7,
 | 
				
			||||||
 | 
							.expected_errcode = -ENOTSUPP,
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{	/* Mainly checking JIT here. */
 | 
						{	/* Mainly checking JIT here. */
 | 
				
			||||||
		"BPF_MAXINSNS: Jump heavy test",
 | 
							"BPF_MAXINSNS: Jump heavy test",
 | 
				
			||||||
| 
						 | 
					@ -5347,18 +5357,28 @@ static struct bpf_test tests[] = {
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		"BPF_MAXINSNS: exec all MSH",
 | 
							"BPF_MAXINSNS: exec all MSH",
 | 
				
			||||||
		{ },
 | 
							{ },
 | 
				
			||||||
 | 
					#if defined(CONFIG_BPF_JIT_ALWAYS_ON) && defined(CONFIG_S390)
 | 
				
			||||||
 | 
							CLASSIC | FLAG_EXPECTED_FAIL,
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
		CLASSIC,
 | 
							CLASSIC,
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
		{ 0xfa, 0xfb, 0xfc, 0xfd, },
 | 
							{ 0xfa, 0xfb, 0xfc, 0xfd, },
 | 
				
			||||||
		{ { 4, 0xababab83 } },
 | 
							{ { 4, 0xababab83 } },
 | 
				
			||||||
		.fill_helper = bpf_fill_maxinsns13,
 | 
							.fill_helper = bpf_fill_maxinsns13,
 | 
				
			||||||
 | 
							.expected_errcode = -ENOTSUPP,
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		"BPF_MAXINSNS: ld_abs+get_processor_id",
 | 
							"BPF_MAXINSNS: ld_abs+get_processor_id",
 | 
				
			||||||
		{ },
 | 
							{ },
 | 
				
			||||||
 | 
					#if defined(CONFIG_BPF_JIT_ALWAYS_ON) && defined(CONFIG_S390)
 | 
				
			||||||
 | 
							CLASSIC | FLAG_EXPECTED_FAIL,
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
		CLASSIC,
 | 
							CLASSIC,
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
		{ },
 | 
							{ },
 | 
				
			||||||
		{ { 1, 0xbee } },
 | 
							{ { 1, 0xbee } },
 | 
				
			||||||
		.fill_helper = bpf_fill_ld_abs_get_processor_id,
 | 
							.fill_helper = bpf_fill_ld_abs_get_processor_id,
 | 
				
			||||||
 | 
							.expected_errcode = -ENOTSUPP,
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	/*
 | 
						/*
 | 
				
			||||||
	 * LD_IND / LD_ABS on fragmented SKBs
 | 
						 * LD_IND / LD_ABS on fragmented SKBs
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue