mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-09-04 20:19:47 +08:00 
			
		
		
		
	 22945688ac
			
		
	
	
		22945688ac
		
	
	
	
	
		
			
			Add support for reset of secure guest via a new ioctl KVM_PPC_SVM_OFF. This ioctl will be issued by QEMU during reset and includes the the following steps: - Release all device pages of the secure guest. - Ask UV to terminate the guest via UV_SVM_TERMINATE ucall - Unpin the VPA pages so that they can be migrated back to secure side when guest becomes secure again. This is required because pinned pages can't be migrated. - Reinit the partition scoped page tables After these steps, guest is ready to issue UV_ESM call once again to switch to secure mode. Signed-off-by: Bharata B Rao <bharata@linux.ibm.com> Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> [Implementation of uv_svm_terminate() and its call from guest shutdown path] Signed-off-by: Ram Pai <linuxram@us.ibm.com> [Unpinning of VPA pages] Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
		
			
				
	
	
		
			40 lines
		
	
	
		
			941 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			941 B
		
	
	
	
		
			C
		
	
	
	
	
	
| /* SPDX-License-Identifier: GPL-2.0 */
 | |
| /*
 | |
|  * Ultravisor API.
 | |
|  *
 | |
|  * Copyright 2019, IBM Corporation.
 | |
|  *
 | |
|  */
 | |
| #ifndef _ASM_POWERPC_ULTRAVISOR_API_H
 | |
| #define _ASM_POWERPC_ULTRAVISOR_API_H
 | |
| 
 | |
| #include <asm/hvcall.h>
 | |
| 
 | |
| /* Return codes */
 | |
| #define U_BUSY			H_BUSY
 | |
| #define U_FUNCTION		H_FUNCTION
 | |
| #define U_NOT_AVAILABLE		H_NOT_AVAILABLE
 | |
| #define U_P2			H_P2
 | |
| #define U_P3			H_P3
 | |
| #define U_P4			H_P4
 | |
| #define U_P5			H_P5
 | |
| #define U_PARAMETER		H_PARAMETER
 | |
| #define U_PERMISSION		H_PERMISSION
 | |
| #define U_SUCCESS		H_SUCCESS
 | |
| 
 | |
| /* opcodes */
 | |
| #define UV_WRITE_PATE			0xF104
 | |
| #define UV_RETURN			0xF11C
 | |
| #define UV_ESM				0xF110
 | |
| #define UV_REGISTER_MEM_SLOT		0xF120
 | |
| #define UV_UNREGISTER_MEM_SLOT		0xF124
 | |
| #define UV_PAGE_IN			0xF128
 | |
| #define UV_PAGE_OUT			0xF12C
 | |
| #define UV_SHARE_PAGE			0xF130
 | |
| #define UV_UNSHARE_PAGE			0xF134
 | |
| #define UV_UNSHARE_ALL_PAGES		0xF140
 | |
| #define UV_PAGE_INVAL			0xF138
 | |
| #define UV_SVM_TERMINATE		0xF13C
 | |
| 
 | |
| #endif /* _ASM_POWERPC_ULTRAVISOR_API_H */
 |