Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp254390pxb; Mon, 13 Sep 2021 18:29:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJxM5ejo2EILrDsEasWUhcKOsGqCSocyKA0uUty8paZIIAN/sP5JONWHYUoOUJ0jlwshlc X-Received: by 2002:a17:906:3f95:: with SMTP id b21mr15416632ejj.368.1631582956712; Mon, 13 Sep 2021 18:29:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631582956; cv=none; d=google.com; s=arc-20160816; b=HUacDDDj+RoGccY8XJfcjm8KhVMPbBWMqNgOsR6HCp+qC5QpkZHx4xLbOIXte1AQAc 5wf2lEiVtqOk4vlWIoguv/4DWY6VkP3lMA/rmyGiaxyGggHjWPrLGpeNCnVYvSrGjaB5 PdqamjwM20ir4qfsWe9oELfRikW6/5HiixmMn4wYApRiTVpTJqOLfFHkhyufPWs5kyGV cHEnLyqTrOzag4zORE44hb86a1s8tOj7Xyh6BotB317sGiYowbW8JtNDMbB2ZUnYc7TM i7riGSyefL8MhHyJYxKaHAst/egZfC/fZS7U700B0VCRo00JBaU7EWBgVKYMttXaa1jV 5Ozw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=HPlM28T/oJ4/6Xh6FGi+9sK76pxmz7U2+VXMGXF95EA=; b=iddrTrfe+Ig/amB11WimdR2yTKBKah8kmHuBtHsZBOqJeCoh9x8p1fA3+4IiBk0Enr cuElH9INw3ZICPHzw8lY+42QH5dlFcU/F+tXqs4bjAUuO2SOxxRnBQHj2+jT8ztBa/vt RtWi42MsFcZsJPKtaLw6gw0w2q2Rq27E8ovOiwhsC0SOVMmiD19kvMEqZOAngNFb3nZF hrt+8MouEQY7W+HlWQ3yXpuLUcKg2454LrqzD8SzXvxbhgYxSo5BJCKJbbTnDQxaR+sX N4mSAtGH0TxZdPz/EQvXrf9uvU3TI5ilZh2s2occSwzWNZuQM07TNClx9v2gjtP25dmz t/ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="DNkbp/sq"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h13si7145610eds.181.2021.09.13.18.28.52; Mon, 13 Sep 2021 18:29:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="DNkbp/sq"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349780AbhIMXMg (ORCPT + 99 others); Mon, 13 Sep 2021 19:12:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349329AbhIMXL4 (ORCPT ); Mon, 13 Sep 2021 19:11:56 -0400 Received: from mail-qk1-x749.google.com (mail-qk1-x749.google.com [IPv6:2607:f8b0:4864:20::749]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 203B0C0613E8 for ; Mon, 13 Sep 2021 16:10:20 -0700 (PDT) Received: by mail-qk1-x749.google.com with SMTP id x19-20020a05620a099300b003f64d79cbbaso43892167qkx.7 for ; Mon, 13 Sep 2021 16:10:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=HPlM28T/oJ4/6Xh6FGi+9sK76pxmz7U2+VXMGXF95EA=; b=DNkbp/sqJ7JxIvPqWv1ccqgt18UNr/1F5XiXnLeubqboraLkX5zaOi5Y9u+dmJkNxD 5Jx8B7jRUF8KPPuuLbDtxtU3wcNdxfelulEqIFT9UGvhK/RcZ0SmaE6MhFDsTdh432bu 1rmsvCUZ07vzLQpkhiW4MGccfZPXlQ/K3TK6KGTP7hexs1mQjzYIQeJMu65H10YvUID0 LB1gvoLPjtnO1R25IEC+6GXtKzS9NajXeNsAsGbMbEpDzFE6GT5IOyCPA5lH+CYBTzRb Jv1YRL4hzPZkCOi78vCwUYYYZ66OUXkW6k0450vgVMQjYDJ6DqSMiOhNJIfHtNhd5dGw GZTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=HPlM28T/oJ4/6Xh6FGi+9sK76pxmz7U2+VXMGXF95EA=; b=e6zPKnd5dB8AvdyoPskEw0s1RPp94HkktjSJ20lZUeQu9xf4Uczz/eYsgFdKrGYVBI qd2+JFN+41ROU30s6wLinwJOqwlgJUmi9zwr6wveFvUAj7BXlPVDNTptRfpI8zZX09d3 187xwyMKI4OJlhYR+WZd453ToHE2HnNI+kAvkebTqWhBQZOniw2dqnnATVh9bJmQ7x3e U0+0+cTueHbpoWLoDFRHWx6TMiwRLAwjtdycAFITOt4BENX+dXsSsWQzZmbamR316q9J LFy8uedkdq6K7UB00LmD3wtKxBMfle4VW4bUMSlb2vlGIR5TGwNhjiuEwZ8n3xG2k/DW yE2w== X-Gm-Message-State: AOAM532jInnfFnFfmSrRc70mpq4ZiHJEgyJtcOWOT6jt4ScrsO8O3svQ QwCPMR0pzDyfM3AH79J6JK2wAWlonwGB X-Received: from rananta-virt.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:1bcc]) (user=rananta job=sendgmr) by 2002:a0c:db0a:: with SMTP id d10mr2288345qvk.28.1631574619217; Mon, 13 Sep 2021 16:10:19 -0700 (PDT) Date: Mon, 13 Sep 2021 23:09:49 +0000 In-Reply-To: <20210913230955.156323-1-rananta@google.com> Message-Id: <20210913230955.156323-9-rananta@google.com> Mime-Version: 1.0 References: <20210913230955.156323-1-rananta@google.com> X-Mailer: git-send-email 2.33.0.309.g3052b89438-goog Subject: [PATCH v6 08/14] KVM: arm64: selftests: Add support to disable and enable local IRQs From: Raghavendra Rao Ananta To: Paolo Bonzini , Marc Zyngier , Andrew Jones , James Morse , Alexandru Elisei , Suzuki K Poulose Cc: Catalin Marinas , Will Deacon , Peter Shier , Ricardo Koller , Oliver Upton , Reiji Watanabe , Jing Zhang , Raghavendra Rao Anata , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Oliver Upton Reviewed-by: Andrew Jones --- .../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 265054c24481..515d04a3c27d 100644 --- a/tools/testing/selftests/kvm/include/aarch64/processor.h +++ b/tools/testing/selftests/kvm/include/aarch64/processor.h @@ -172,4 +172,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.309.g3052b89438-goog