mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	x86/bugs: Add attack vector controls for GDS
Use attack vector controls to determine if GDS mitigation is required. Signed-off-by: David Kaplan <david.kaplan@amd.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/20250707183316.1349127-11-david.kaplan@amd.com
This commit is contained in:
		
							parent
							
								
									71dc301c26
								
							
						
					
					
						commit
						8c7261abcb
					
				
					 1 changed files with 8 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -1030,12 +1030,15 @@ static void __init gds_select_mitigation(void)
 | 
			
		|||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (cpu_mitigations_off())
 | 
			
		||||
		gds_mitigation = GDS_MITIGATION_OFF;
 | 
			
		||||
	/* Will verify below that mitigation _can_ be disabled */
 | 
			
		||||
 | 
			
		||||
	if (gds_mitigation == GDS_MITIGATION_AUTO)
 | 
			
		||||
		gds_mitigation = GDS_MITIGATION_FULL;
 | 
			
		||||
	if (gds_mitigation == GDS_MITIGATION_AUTO) {
 | 
			
		||||
		if (should_mitigate_vuln(X86_BUG_GDS))
 | 
			
		||||
			gds_mitigation = GDS_MITIGATION_FULL;
 | 
			
		||||
		else {
 | 
			
		||||
			gds_mitigation = GDS_MITIGATION_OFF;
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* No microcode */
 | 
			
		||||
	if (!(x86_arch_cap_msr & ARCH_CAP_GDS_CTRL)) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue