Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp977992pxb; Wed, 1 Sep 2021 14:16:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDpVWgR93wYb+3sd1TYCJRNXdZUxTcOTc5GX7lXDRI1SisZyugCf074Ex4a8Vi3OklDM65 X-Received: by 2002:a17:907:9602:: with SMTP id gb2mr1639886ejc.119.1630531017686; Wed, 01 Sep 2021 14:16:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630531017; cv=none; d=google.com; s=arc-20160816; b=pND8/dikoCvQDO8GMgh/zl+sSD7yHG1R3avCntww21StBzA3ZIAeYkRiuXF/ZmSNMF eVE0aFW+zZMRN58t9o4ecYguw81JkCA7e+5fCtBDqraKisD1o9DrTTS0bIwBD0w0E2te r2Ut6Cxc2DpUx1cC2eG4LQS+IF2Hd4qsgn9w/MkYdeY5fYu3wsGBtXa4Ak9QvCSUeNA4 qCp1+blpSDkwq7WMxaJM6qDihPWfOdFOmEKqGrk3umrl7nuHn/UPU9mj4YAus9rp4N/B KlBcfjscvHati64gj/MRWG3RvIlEisuquWoYosOdvymIsHYmnmHN7MAJSPY0JtquAQ9G BLPg== 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=yth3I1/Bzi0ikfWfrqGMTpl+hA4YL1ynlKPMvmODV/s=; b=KhW8NrY7Bt5f6tqIC02vy0BPbGiqpUpp1CGPXUzuk+HK7N/gUzo2ccKQBaAsWiQOr8 XFOkFHN20QDuLVyLOrt6hfN3zJ/0iOAW2cqUqEmvw94uNoqrf1mJ5tWOu4QCPHrFA2De W758yaiQvtY5vEOxh/FYYqYBjCuAbLcXsAEQnYs+z04MOQZa5FLDsZ+o/YG0c3luPFM+ IXWKlkjBh5fcrJTlMn35AQcmHqhD+1F2D1vUflnNGP0O0XAeAcEEaLjnYyTQ51pf4JHF IMyy/L5P+RbL3MltzM/xH1zoHugUSuN92u12gEJ/QO8AGX0juC4uCvTEU7H5/17pKXBP mfxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=n+Mx5PnD; 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 m9si583476edc.501.2021.09.01.14.16.33; Wed, 01 Sep 2021 14:16:57 -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=20161025 header.b=n+Mx5PnD; 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 S1344726AbhIAVPm (ORCPT + 99 others); Wed, 1 Sep 2021 17:15:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344427AbhIAVPd (ORCPT ); Wed, 1 Sep 2021 17:15:33 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C91FBC0613CF for ; Wed, 1 Sep 2021 14:14:35 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id f8-20020a2585480000b02905937897e3daso910560ybn.2 for ; Wed, 01 Sep 2021 14:14:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=yth3I1/Bzi0ikfWfrqGMTpl+hA4YL1ynlKPMvmODV/s=; b=n+Mx5PnDMeXxTqhyx09Lxlu6aOsb0KQ/uyjPoe28ripI+2Ygdz2N3UndU2pED2GvKh L5Pu0q87yxjRhcfWRTRdqCXBHeLJfjJdU/MxvpDVmpYrA1KsFv9DEyy6GXeA7DCFEYTR 775EpFel2mtm1UUP6GB8R4NlDQaEInR3n8US/9dTv5bltIYL9J3FJyesrvONIvCVlNOi 1rdkU0Po7mNSxxZMaDFzJGjU7S/lsJNQ+HZEkNtuSPkjCfhDoOiPWfrSUWl2pL7T9sDg gJ7U1aqZ3OsAYAGIn5lbBtPyBNAn3/NdeU4t4RO0EFzppBJ+zT++m6/Awu/y7BXwc0Z6 ItWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=yth3I1/Bzi0ikfWfrqGMTpl+hA4YL1ynlKPMvmODV/s=; b=VjNNx/eEMWZfA2kEHAtScD3sZOP6tVv8kA2cYalvvFk35FyDS36cC/l2WglbZNORoh zYq0Skft66bQh2AB0b8ByIjAKVIi/3hfBq5ZLFywg6v+Tl/F6MPf56gbfXSYTi8HpnAh HF9m03mk/Bxt04cs/r7xu5hYx+t8dq+nBC6quPRCtKHPQKm1MKgiowIlktrCCchODgPB wE5RROKNU55v2pNJ81PCYPAZqnDTog4lre3T9i8fEFcL9Et+nGtGkichMfe1bbJiDNJx bDGnRit0+vzVZMh/cISYwtc2BBxYhCdvI1BVS10kTY86VuXU/Dydq7NIRjw7nCgrwF1W fXXw== X-Gm-Message-State: AOAM530UhwcPjgH5l+maATNSahTyl9o143dKig4u7N2U6GU0b4Zq0VVi C7anGUNp4zmCu7XeolWXYKbCV75KO2y5 X-Received: from rananta-virt.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:1bcc]) (user=rananta job=sendgmr) by 2002:a25:c647:: with SMTP id k68mr2013806ybf.349.1630530875111; Wed, 01 Sep 2021 14:14:35 -0700 (PDT) Date: Wed, 1 Sep 2021 21:14:06 +0000 In-Reply-To: <20210901211412.4171835-1-rananta@google.com> Message-Id: <20210901211412.4171835-7-rananta@google.com> Mime-Version: 1.0 References: <20210901211412.4171835-1-rananta@google.com> X-Mailer: git-send-email 2.33.0.153.gba50c8fa24-goog Subject: [PATCH v3 06/12] KVM: arm64: selftests: Add support to disable and enable local IRQs From: Raghavendra Rao Ananta To: Paolo Bonzini , Marc Zyngier , 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 --- .../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 78df059dc974..c35bb7b8e870 100644 --- a/tools/testing/selftests/kvm/include/aarch64/processor.h +++ b/tools/testing/selftests/kvm/include/aarch64/processor.h @@ -241,4 +241,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