mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-09-04 20:19:47 +08:00 
			
		
		
		
	 f5ed777586
			
		
	
	
		f5ed777586
		
	
	
	
	
		
			
			Make sure the machine supports RDRAND, otherwise there is no trusted source of randomness in the system. To also check this in the pre-decompression stage, make has_cpuflag() not depend on CONFIG_RANDOMIZE_BASE anymore. Signed-off-by: Martin Radev <martin.b.radev@gmail.com> Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Kees Cook <keescook@chromium.org> Link: https://lkml.kernel.org/r/20200907131613.12703-73-joro@8bytes.org
		
			
				
	
	
		
			10 lines
		
	
	
		
			146 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			10 lines
		
	
	
		
			146 B
		
	
	
	
		
			C
		
	
	
	
	
	
| // SPDX-License-Identifier: GPL-2.0
 | |
| #include "../cpuflags.c"
 | |
| 
 | |
| bool has_cpuflag(int flag)
 | |
| {
 | |
| 	get_cpuflags();
 | |
| 
 | |
| 	return test_bit(flag, cpu.flags);
 | |
| }
 |