mirror of
				https://gitlab.com/qemu-project/edk2.git
				synced 2025-10-30 07:56:39 +08:00 
			
		
		
		
	ArmPkg: ArmPsciResetSystemLib: PSCI warm reset fix
The current warm reset implementation attempts the PSCI SYSTEM_RESET2 command twice without clearing the local variable used for Arg1. This can result in passing a random value as the reset type, which may cause the PSCI call to behave unexpectedly and fall back to a cold reset. This change addresses the issue by: - Correcting the monitor call function ID. - Explicitly zeroing the reset type field before invoking the PSCI interface. The updated warm reset flow has been tested and confirmed to invoke SYSTEM_RESET2 as expected. Signed-off-by: Kun Qin <kun.qin@microsoft.com>
This commit is contained in:
		 John Schock
					John Schock
				
			
				
					committed by
					
						![mergify[bot]](/assets/img/avatar_default.png) mergify[bot]
						mergify[bot]
					
				
			
			
				
	
			
			
			![mergify[bot]](/assets/img/avatar_default.png) mergify[bot]
						mergify[bot]
					
				
			
						parent
						
							20cd31ea83
						
					
				
				
					commit
					748bea7171
				
			| @ -71,13 +71,16 @@ ResetWarm ( | ||||
| { | ||||
|   ARM_MONITOR_ARGS  Args; | ||||
|  | ||||
|   Args.Arg0 = ARM_SMC_ID_PSCI_SYSTEM_RESET2_AARCH64; | ||||
|   Args.Arg0 = ARM_SMC_ID_PSCI_FEATURES; | ||||
|   Args.Arg1 = ARM_SMC_ID_PSCI_SYSTEM_RESET2_AARCH64; | ||||
|  | ||||
|   // Is SYSTEM_RESET2 supported? | ||||
|   ArmMonitorCall (&Args); | ||||
|   if (Args.Arg0 == ARM_SMC_PSCI_RET_SUCCESS) { | ||||
|     // Send PSCI SYSTEM_RESET2 command | ||||
|     Args.Arg0 = ARM_SMC_ID_PSCI_SYSTEM_RESET2_AARCH64; | ||||
|     Args.Arg1 = 0; // Reset type | ||||
|     // cookie does not matter with reset type 0 | ||||
|  | ||||
|     ArmMonitorCall (&Args); | ||||
|   } else { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user