Skip to content

Commit 5c636d5

Browse files
rananta468Marc Zyngier
authored andcommitted
KVM: arm64: selftests: Add support to disable and enable local IRQs
Add functions local_irq_enable() and local_irq_disable() to enable and disable the IRQs from the guest, respectively. Signed-off-by: Raghavendra Rao Ananta <[email protected]> Reviewed-by: Oliver Upton <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 8016690 commit 5c636d5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tools/testing/selftests/kvm/include/aarch64/processor.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,14 @@ static __always_inline u32 __raw_readl(const volatile void *addr)
172172
#define writel(v,c) ({ __iowmb(); writel_relaxed((v),(c));})
173173
#define readl(c) ({ u32 __v = readl_relaxed(c); __iormb(__v); __v; })
174174

175+
static inline void local_irq_enable(void)
176+
{
177+
asm volatile("msr daifclr, #3" : : : "memory");
178+
}
179+
180+
static inline void local_irq_disable(void)
181+
{
182+
asm volatile("msr daifset, #3" : : : "memory");
183+
}
184+
175185
#endif /* SELFTEST_KVM_PROCESSOR_H */

0 commit comments

Comments
 (0)