mirror of
				https://gitlab.com/qemu-project/edk2.git
				synced 2025-10-30 07:56:39 +08:00 
			
		
		
		
	IntelFsp2WrapperPkg: Bootloader need to recover fs and gs
When enter FSP, bootloader need to save fs and gs, when back to bootloader, bootloader need to restore fs and gs, so it could avoid bootloader access wrong data segment when usging fs and gs. Signed-off-by: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Chasel Chiu <chasel.chiu@intel.com> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com> Cc: Duggapu Chinni B <chinni.b.duggapu@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Ted Kuo <ted.kuo@intel.com> Cc: Ashraf Ali S <ashraf.ali.s@intel.com> Cc: Ray Ni <ray.ni@intel.com>
This commit is contained in:
		 Hongbin1 Zhang
					Hongbin1 Zhang
				
			
				
					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
						
							b509393160
						
					
				
				
					commit
					786ae76884
				
			| @ -110,9 +110,11 @@ ASM_PFX(AsmExecute32BitCode): | |||||||
|     retf |     retf | ||||||
|  |  | ||||||
| Compatible: | Compatible: | ||||||
|     ; reload DS/ES/SS to make sure they are correct referred to current GDT |     ; reload DS/ES/FS/GS/SS to make sure they are correct referred to current GDT | ||||||
|     mov     ds, ax |     mov     ds, ax | ||||||
|     mov     es, ax |     mov     es, ax | ||||||
|  |     mov     fs, ax | ||||||
|  |     mov     gs, ax | ||||||
|     mov     ss, ax |     mov     ss, ax | ||||||
|  |  | ||||||
|     ; |     ; | ||||||
| @ -208,11 +210,13 @@ ReloadCS: | |||||||
|     retf |     retf | ||||||
| .0: | .0: | ||||||
|     ; |     ; | ||||||
|     ; Reload original DS/ES/SS |     ; Reload original DS/ES/FS/GS/SS | ||||||
|     ; |     ; | ||||||
|     pop     rcx |     pop     rcx | ||||||
|     mov     ds, rcx |     mov     ds, rcx | ||||||
|     mov     es, rcx |     mov     es, rcx | ||||||
|  |     mov     fs, rcx | ||||||
|  |     mov     gs, rcx | ||||||
|     mov     ss, rcx |     mov     ss, rcx | ||||||
|  |  | ||||||
|     ; |     ; | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user