lkml.org 
[lkml]   [2021]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    Subject[PATCH v4 08/18] KVM: arm64: selftests: Add support to disable and enable local IRQs
    From
    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 <rananta@google.com>
    Reviewed-by: Oliver Upton <oupton@google.com>
    Reviewed-by: Andrew Jones <drjones@redhat.com>
    ---
    .../testing/selftests/kvm/include/aarch64/processor.h | 10 ++++++++++
    1 file changed, 10 insertions(+)

    diff --git a/tools/testing/selftests/kvm/include/aarch64/processor.h b/tools/testing/selftests/kvm/include/aarch64/processor.h
    index 166d273ad715..b6088c3c67a3 100644
    --- a/tools/testing/selftests/kvm/include/aarch64/processor.h
    +++ b/tools/testing/selftests/kvm/include/aarch64/processor.h
    @@ -184,4 +184,14 @@ static __always_inline u32 __raw_readl(const volatile void *addr)
    #define writel(v,c) ({ __iowmb(); writel_relaxed((v),(c));})
    #define readl(c) ({ u32 __v = readl_relaxed(c); __iormb(__v); __v; })

    +static inline void local_irq_enable(void)
    +{
    + asm volatile("msr daifclr, #3" : : : "memory");
    +}
    +
    +static inline void local_irq_disable(void)
    +{
    + asm volatile("msr daifset, #3" : : : "memory");
    +}
    +
    #endif /* SELFTEST_KVM_PROCESSOR_H */
    --
    2.33.0.153.gba50c8fa24-goog
    \
     
     \ /
      Last update: 2021-09-09 03:39    [W:4.605 / U:0.000 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site