Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp101037pxb; Wed, 8 Sep 2021 18:42:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVA0lvNfe/5tGfp8xxqioF2a1/mz3HW3G/1KP7JoM9AA1p2c8/orvbZE9xyWLS2uRq+AVk X-Received: by 2002:a05:6e02:f44:: with SMTP id y4mr356678ilj.257.1631151724926; Wed, 08 Sep 2021 18:42:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631151724; cv=none; d=google.com; s=arc-20160816; b=0dnQOl2bb4U7Pe50jQrj2fk5WMVxpxdv2FkZuXVTLwM6+L7/sj4CFPpca7CK63XJhF tcwmF5zad4JnLoVlZ/ezovQ6prZ510M8zz60sON45srwf14TWAwTiTdkHgbJOviRX1z/ e0dUnVe7hWDpx8Bp5wEcxvWSqUSTCJxvj5tpYcD+lyS+By3ZHXtm9PkDe0Sunp//rj5C 6uhJM0QRttGgxKE2Bw3MEXhFtuPbP2O01Pu4DRL/UckGgLN0Ny/TYnex0Imtkkaf56/n H2k81nYjvaKulde+fhdPlbCgT2jSaqpKga0vBa9P9nxGlpn2dQfzZqSXPQkplmok+sSz kEwQ== 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=joYYrt7hpuPfUeQcd44dEnmpKJRkC3m+olCPcRklPKY=; b=xN38MByxV6bSRi/NyGZ5pG9/2+FIufc+2TiuJ3CTm7V3qmIzBbYUASG674Kem3G8NQ ULtcU1MnHxOIkwi6xEaaYUFXh2f0mRSmBwwOoEuw2WcMQ4HHdfBE4KPz0Fv+wyNlfpik 8AnrpalnlBuo4YRXABpV1EbhbRDwQQIbnRQTpeQrK+XzQmw0UYq0nyF1AEq8AiaonUWf JREPBNzteId13dVlm/qHngxbGgJG8eqtJ4plT+898cBK6Rx896SsNuZpypvnG0MNZNZL O99tQEe441xDdLKGFCKnofv3YXAK434tPLiacUeWibCseZsslJ2NMBdlONU9FWM4pT2e VZwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=FmT4tXPe; 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 t195si219511iof.69.2021.09.08.18.41.54; Wed, 08 Sep 2021 18:42:04 -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=FmT4tXPe; 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 S1349878AbhIIBkX (ORCPT + 99 others); Wed, 8 Sep 2021 21:40:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349963AbhIIBkE (ORCPT ); Wed, 8 Sep 2021 21:40:04 -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 3D7B1C0613A4 for ; Wed, 8 Sep 2021 18:38:45 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id i189-20020a256dc6000000b005a04d42ebf2so353897ybc.22 for ; Wed, 08 Sep 2021 18:38:45 -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=joYYrt7hpuPfUeQcd44dEnmpKJRkC3m+olCPcRklPKY=; b=FmT4tXPeRDgw2DsrBZpZGU6PcjTlqMTB9wZqCZm9tFBuL4YGumdgIw8m9nJpGy7K2o QYsOw8LRgRYm95W4lSQlPjO7sHUsJHvmCf//Z9HkzC5WFE0ltOxtgtruZBHWU5+lyW8d tyISweHmsA2pL8jnZ1XopsISmcAGv1TGUh3i1sOmjVR+89zSpnjVbubTD5YxqU6axujR iC5Bo6uEchxMhU7sTZonLg1PKJy5nk4TN+T3O3lRQY+zvf8akm5MfKalvVWOHQh+ZZZh xa6NDR8lw9UzwQzVVyNZ4oE7mAM9CccSUMU4oq2kLeew6YO2bKG9NmIZqb2LZBM5sUaT cSog== 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=joYYrt7hpuPfUeQcd44dEnmpKJRkC3m+olCPcRklPKY=; b=3e9k5Inq49xNCSIuWh2z/JHg2aiTybVroQuWOa+bajKl4leSIjgUY4jVsKvLpt0Q7O pDb1rHCuAjwRAcoHYp2JCWxLAY1nHqI8Rea/e+4PMEVas46nq8q0ST7A0Mg+2nhrexKG /uDe67M6/yi+ospqheYhsi43bZVW/NcgA5CXJZvdBZ9RnTHIvgiOQtCRI33BmqJOjktf WZ3YkfdwTrgOq3aPRR5ISnbuP/TeyweP1opgBxPejvACZSggsy0wH5GCiglZnQqwBfow /29bGbRWyZwh+4/NLf6nWi9yvBzHqUfsKNLFBuaeXsMlzHuVC5PJ/SbOvj+ko8dYRmSw J5TA== X-Gm-Message-State: AOAM533atntnKsKGHASSaX7zFkREEHWYnBPfb97DejEts6PmGp048vx4 71iiRFvAEYL3o/W1xkRXjyLs4RrjE9qZ X-Received: from rananta-virt.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:1bcc]) (user=rananta job=sendgmr) by 2002:a25:3894:: with SMTP id f142mr565481yba.464.1631151524424; Wed, 08 Sep 2021 18:38:44 -0700 (PDT) Date: Thu, 9 Sep 2021 01:38:08 +0000 In-Reply-To: <20210909013818.1191270-1-rananta@google.com> Message-Id: <20210909013818.1191270-9-rananta@google.com> Mime-Version: 1.0 References: <20210909013818.1191270-1-rananta@google.com> X-Mailer: git-send-email 2.33.0.153.gba50c8fa24-goog Subject: [PATCH v4 08/18] 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 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