mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-09-04 20:19:47 +08:00 
			
		
		
		
	 d5394c059d
			
		
	
	
		d5394c059d
		
	
	
	
	
		
			
			Secure guests need to share the DTL buffers with the hypervisor. To that end, use a kmem_cache constructor which converts the underlying buddy allocated SLUB cache pages into shared memory. Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20190820021326.6884-10-bauerman@linux.ibm.com
		
			
				
	
	
		
			32 lines
		
	
	
		
			569 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			569 B
		
	
	
	
		
			C
		
	
	
	
	
	
| /* SPDX-License-Identifier: GPL-2.0+ */
 | |
| /*
 | |
|  * SVM helper functions
 | |
|  *
 | |
|  * Copyright 2018 Anshuman Khandual, IBM Corporation.
 | |
|  */
 | |
| 
 | |
| #ifndef _ASM_POWERPC_SVM_H
 | |
| #define _ASM_POWERPC_SVM_H
 | |
| 
 | |
| #ifdef CONFIG_PPC_SVM
 | |
| 
 | |
| static inline bool is_secure_guest(void)
 | |
| {
 | |
| 	return mfmsr() & MSR_S;
 | |
| }
 | |
| 
 | |
| void dtl_cache_ctor(void *addr);
 | |
| #define get_dtl_cache_ctor()	(is_secure_guest() ? dtl_cache_ctor : NULL)
 | |
| 
 | |
| #else /* CONFIG_PPC_SVM */
 | |
| 
 | |
| static inline bool is_secure_guest(void)
 | |
| {
 | |
| 	return false;
 | |
| }
 | |
| 
 | |
| #define get_dtl_cache_ctor() NULL
 | |
| 
 | |
| #endif /* CONFIG_PPC_SVM */
 | |
| #endif /* _ASM_POWERPC_SVM_H */
 |