Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72cb4256 authored by Isaku Yamahata's avatar Isaku Yamahata Committed by Tony Luck
Browse files

[IA64] pvops: preparation: introduce ia64_get_psr_i() to make kernel paravirtualization friendly.



__local_irq_save() and local_save_flags() are used to mask interruptions.
They read all psr bits that requres whole bit emulation.
On the other hand, reading only psr.i, the single bit, can be virtualized
cheaply.

Signed-off-by: default avatarIsaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent 0e1a77cc
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -18,6 +18,8 @@
# include <asm/gcc_intrin.h>
# include <asm/gcc_intrin.h>
#endif
#endif


#define ia64_get_psr_i()	(ia64_getreg(_IA64_REG_PSR) & IA64_PSR_I)

#define ia64_set_rr0_to_rr4(val0, val1, val2, val3, val4)	\
#define ia64_set_rr0_to_rr4(val0, val1, val2, val3, val4)	\
do {								\
do {								\
	ia64_set_rr(0x0000000000000000UL, (val0));		\
	ia64_set_rr(0x0000000000000000UL, (val0));		\
+8 −2
Original line number Original line Diff line number Diff line
@@ -123,10 +123,16 @@ extern struct ia64_boot_param {
 *   write a floating-point register right before reading the PSR
 *   write a floating-point register right before reading the PSR
 *   and that writes to PSR.mfl
 *   and that writes to PSR.mfl
 */
 */
#ifdef CONFIG_PARAVIRT
#define __local_save_flags()	ia64_get_psr_i()
#else
#define __local_save_flags()	ia64_getreg(_IA64_REG_PSR)
#endif

#define __local_irq_save(x)			\
#define __local_irq_save(x)			\
do {						\
do {						\
	ia64_stop();				\
	ia64_stop();				\
	(x) = ia64_getreg(_IA64_REG_PSR);	\
	(x) = __local_save_flags();		\
	ia64_stop();				\
	ia64_stop();				\
	ia64_rsm(IA64_PSR_I);			\
	ia64_rsm(IA64_PSR_I);			\
} while (0)
} while (0)
@@ -174,7 +180,7 @@ do { \
#endif /* !CONFIG_IA64_DEBUG_IRQ */
#endif /* !CONFIG_IA64_DEBUG_IRQ */


#define local_irq_enable()	({ ia64_stop(); ia64_ssm(IA64_PSR_I); ia64_srlz_d(); })
#define local_irq_enable()	({ ia64_stop(); ia64_ssm(IA64_PSR_I); ia64_srlz_d(); })
#define local_save_flags(flags)	({ ia64_stop(); (flags) = ia64_getreg(_IA64_REG_PSR); })
#define local_save_flags(flags)	({ ia64_stop(); (flags) = __local_save_flags(); })


#define irqs_disabled()				\
#define irqs_disabled()				\
({						\
({						\