diff options
| author | Radim Krčmář <rkrcmar@redhat.com> | 2018-02-01 15:04:17 +0100 | 
|---|---|---|
| committer | Radim Krčmář <rkrcmar@redhat.com> | 2018-02-01 15:04:17 +0100 | 
| commit | 7bf14c28ee776be567855bd39ed8ff795ea19f55 (patch) | |
| tree | 6113748c673e85fccc2c56c050697789c00c6bc2 /arch/powerpc/include/asm/exception-64s.h | |
| parent | 87cedc6be55954c6efd6eca2e694132513f65a2a (diff) | |
| parent | 5fa4ec9cb2e6679e2f828033726f758ea314b9c5 (diff) | |
Merge branch 'x86/hyperv' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Topic branch for stable KVM clockource under Hyper-V.
Thanks to Christoffer Dall for resolving the ARM conflict.
Diffstat (limited to 'arch/powerpc/include/asm/exception-64s.h')
| -rw-r--r-- | arch/powerpc/include/asm/exception-64s.h | 57 | 
1 files changed, 55 insertions, 2 deletions
diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h index b27205297e1d..7197b179c1b1 100644 --- a/arch/powerpc/include/asm/exception-64s.h +++ b/arch/powerpc/include/asm/exception-64s.h @@ -74,6 +74,59 @@   */  #define EX_R3		EX_DAR +/* + * Macros for annotating the expected destination of (h)rfid + * + * The nop instructions allow us to insert one or more instructions to flush the + * L1-D cache when returning to userspace or a guest. + */ +#define RFI_FLUSH_SLOT							\ +	RFI_FLUSH_FIXUP_SECTION;					\ +	nop;								\ +	nop;								\ +	nop + +#define RFI_TO_KERNEL							\ +	rfid + +#define RFI_TO_USER							\ +	RFI_FLUSH_SLOT;							\ +	rfid;								\ +	b	rfi_flush_fallback + +#define RFI_TO_USER_OR_KERNEL						\ +	RFI_FLUSH_SLOT;							\ +	rfid;								\ +	b	rfi_flush_fallback + +#define RFI_TO_GUEST							\ +	RFI_FLUSH_SLOT;							\ +	rfid;								\ +	b	rfi_flush_fallback + +#define HRFI_TO_KERNEL							\ +	hrfid + +#define HRFI_TO_USER							\ +	RFI_FLUSH_SLOT;							\ +	hrfid;								\ +	b	hrfi_flush_fallback + +#define HRFI_TO_USER_OR_KERNEL						\ +	RFI_FLUSH_SLOT;							\ +	hrfid;								\ +	b	hrfi_flush_fallback + +#define HRFI_TO_GUEST							\ +	RFI_FLUSH_SLOT;							\ +	hrfid;								\ +	b	hrfi_flush_fallback + +#define HRFI_TO_UNKNOWN							\ +	RFI_FLUSH_SLOT;							\ +	hrfid;								\ +	b	hrfi_flush_fallback +  #ifdef CONFIG_RELOCATABLE  #define __EXCEPTION_RELON_PROLOG_PSERIES_1(label, h)			\  	mfspr	r11,SPRN_##h##SRR0;	/* save SRR0 */			\ @@ -218,7 +271,7 @@ END_FTR_SECTION_NESTED(ftr,ftr,943)  	mtspr	SPRN_##h##SRR0,r12;					\  	mfspr	r12,SPRN_##h##SRR1;	/* and SRR1 */			\  	mtspr	SPRN_##h##SRR1,r10;					\ -	h##rfid;							\ +	h##RFI_TO_KERNEL;						\  	b	.	/* prevent speculative execution */  #define EXCEPTION_PROLOG_PSERIES_1(label, h)				\  	__EXCEPTION_PROLOG_PSERIES_1(label, h) @@ -232,7 +285,7 @@ END_FTR_SECTION_NESTED(ftr,ftr,943)  	mtspr	SPRN_##h##SRR0,r12;					\  	mfspr	r12,SPRN_##h##SRR1;	/* and SRR1 */			\  	mtspr	SPRN_##h##SRR1,r10;					\ -	h##rfid;							\ +	h##RFI_TO_KERNEL;						\  	b	.	/* prevent speculative execution */  #define EXCEPTION_PROLOG_PSERIES_1_NORI(label, h)			\  | 
