From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0806DC432BE for ; Wed, 1 Sep 2021 23:27:04 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 793B561053 for ; Wed, 1 Sep 2021 23:27:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 793B561053 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id E81134B0AC; Wed, 1 Sep 2021 19:27:02 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@google.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Zam1loBdTL3x; Wed, 1 Sep 2021 19:26:59 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 165134B192; Wed, 1 Sep 2021 19:26:59 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id DAACE4B0BE for ; Wed, 1 Sep 2021 19:26:57 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E9u3zrnDGHSA for ; Wed, 1 Sep 2021 19:26:57 -0400 (EDT) Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id EC0954B0AC for ; Wed, 1 Sep 2021 19:26:56 -0400 (EDT) Received: by mail-io1-f46.google.com with SMTP id b7so163543iob.4 for ; Wed, 01 Sep 2021 16:26:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=rOUt9lzL9h2nq8MizjgBr+LfkDuELuuwWbBlNJOQ814=; b=jR/4VwVeeFqV1reopTHZE859VRG+CTWfBgJ8xN+yYGIx367PJ9Bws70Zg1EV1ucG2W Y2lFJoMSCpZf0ZOBx+NjhIwk4yEFfXdTmKpLSNameuBcxm0f3b2xsZjDWWLkXQzioQzB rdiu2pi+dfj/LlK0SlnX6FXxRO6MlVrubO0LNbHQ1f2H+r49vZAn5pbFbLXLrAIpkyvv 0mbcwbkA1+xfcqzsopbM8IzOFTKlUOVzRZtTJtxfRnE1RlJMRGD/lXwDFs9D701+M4E3 2garEAvPOF6McbV+BoD72/uphVFvhiZwvjqcrhncYz9MizgjNlM4Tikc2xVWnh6P+yPf Hg+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=rOUt9lzL9h2nq8MizjgBr+LfkDuELuuwWbBlNJOQ814=; b=O2hvKz1zkIsWKbx09omYd28x18BjAUsZYpPm0Ypwjtu2nx7C7qzj/QccBe+5OR+GW8 HnOWKvhWcoe+S1/hZDMQEhybngt6Ap/NL++Pcdq0hX0ZAGHDA3lrY1r4hLNmasMYtkmC MT36pYuhvUP+yRKwAIw6oaXn7kDhyJeJ/Y71g/MeHosLJIj+fUJkQS47w5RRnGWVWUTr qLCEDRpR9S9MLpLJ3fCQHEM5QL0BL2w6p+IxDxHKVqMT5hovZgsxuZcTwST5VedShmz4 LGQhHo0BV6IDfOBEnMndAGN0dT9d+Pp9afikNd5MCIU+tB0mdzE4JqkdXDOXRDs5q/fc CQoQ== X-Gm-Message-State: AOAM531PULhWtF76+YbJ38gNS5S3e/5MmtOcHZY0wLpzW5itekE2fJ2U RNT9ZpXES1//cc6w4URudKn+xg== X-Google-Smtp-Source: ABdhPJzCa6eAMWUaKvrSDwb4bW983RzCXex8DdL6ys7hZpXkcFNe3o+vWqlq6lWO9U5Kc26/5lS5Gw== X-Received: by 2002:a5d:9b99:: with SMTP id r25mr279115iom.104.1630538816261; Wed, 01 Sep 2021 16:26:56 -0700 (PDT) Received: from google.com (194.225.68.34.bc.googleusercontent.com. [34.68.225.194]) by smtp.gmail.com with ESMTPSA id q12sm14251ioh.20.2021.09.01.16.26.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Sep 2021 16:26:55 -0700 (PDT) Date: Wed, 1 Sep 2021 23:26:52 +0000 From: Oliver Upton To: Raghavendra Rao Ananta Subject: Re: [PATCH v3 06/12] KVM: arm64: selftests: Add support to disable and enable local IRQs Message-ID: References: <20210901211412.4171835-1-rananta@google.com> <20210901211412.4171835-7-rananta@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210901211412.4171835-7-rananta@google.com> Cc: kvm@vger.kernel.org, Will Deacon , Catalin Marinas , Peter Shier , linux-kernel@vger.kernel.org, Marc Zyngier , Paolo Bonzini , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Wed, Sep 01, 2021 at 09:14:06PM +0000, Raghavendra Rao Ananta wrote: > 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 > --- > .../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 > _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16E5DC432BE for ; Wed, 1 Sep 2021 23:29:16 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BF54961075 for ; Wed, 1 Sep 2021 23:29:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BF54961075 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wqPjZMAZYxT06xUgr8ZfxezUx9ezXxCMS6vPf8OTUKE=; b=35apaDgdvbzrqd E11K18uz1HpbuBwx037YOOIrhZAP/iEud+fZqPuGBEMB3K2HyojsDnSeJCk0puTvHDeIRFZoCOLla GuaSDbo8oNf/dWqfL93UrfZTHphbzhONegBTtbis5Jp1Kmcu2Nj3HF7USEoRWbc8iPMlp7M0e9Zyr gN61l7rHdjlYWacmXkD6LO4KgNBDFoRra3WU8U4tB1lbrLK0MrGSuWAgxH2TuIUuVOPQ5ySo0lMND t3NNO5Vyl+iH5AtM6qLy5Mv9hemUyzI14R2KBF5qF/wtgRxx/8T0bK/I6Lx7uHsycagX/6fkVXlel satYgxuQCwmRLzkS00SA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mLZdF-007slQ-58; Wed, 01 Sep 2021 23:27:01 +0000 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mLZdB-007sl5-EE for linux-arm-kernel@lists.infradead.org; Wed, 01 Sep 2021 23:26:58 +0000 Received: by mail-io1-xd2c.google.com with SMTP id e186so132609iof.12 for ; Wed, 01 Sep 2021 16:26:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=rOUt9lzL9h2nq8MizjgBr+LfkDuELuuwWbBlNJOQ814=; b=jR/4VwVeeFqV1reopTHZE859VRG+CTWfBgJ8xN+yYGIx367PJ9Bws70Zg1EV1ucG2W Y2lFJoMSCpZf0ZOBx+NjhIwk4yEFfXdTmKpLSNameuBcxm0f3b2xsZjDWWLkXQzioQzB rdiu2pi+dfj/LlK0SlnX6FXxRO6MlVrubO0LNbHQ1f2H+r49vZAn5pbFbLXLrAIpkyvv 0mbcwbkA1+xfcqzsopbM8IzOFTKlUOVzRZtTJtxfRnE1RlJMRGD/lXwDFs9D701+M4E3 2garEAvPOF6McbV+BoD72/uphVFvhiZwvjqcrhncYz9MizgjNlM4Tikc2xVWnh6P+yPf Hg+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=rOUt9lzL9h2nq8MizjgBr+LfkDuELuuwWbBlNJOQ814=; b=Wk+KbITLzaB9SWxD1DH2OSdcOI5wilI2waeVhoasdwJD21DELoUOQSi/bWper7YvDi qsos+ha5Zj159eSdGQ9Bi8yQ1dKi5POTbioZ7qOlFlI0lEl1VlFn7skue2qFv9WNefjE b/lo4Wq++/Qd51RmDG/BxDeVofOB9wpFyvP7IetFigh7z0lcIsRvK8GF2z7Zgov2TGyD KLEcXMADTuf9ESWLC9e82aQRKjJFBpREDlyarYbgoNG19sI1TJvS1ihgz9MkW5b42jTU 22seSaa65yS5RAgpoxgk2FzKB8ILHHy7Flmr9oSvO+mIzqkuHapKIQ3xSyFFKBYFKYcK aKHA== X-Gm-Message-State: AOAM532OQLGeboA3YvogrKNwhO1dFEKcepIfqMzKb881DmOCeUKEbEcP kOh1bgrqMWRZSuedYuuAeOCR/Q== X-Google-Smtp-Source: ABdhPJzCa6eAMWUaKvrSDwb4bW983RzCXex8DdL6ys7hZpXkcFNe3o+vWqlq6lWO9U5Kc26/5lS5Gw== X-Received: by 2002:a5d:9b99:: with SMTP id r25mr279115iom.104.1630538816261; Wed, 01 Sep 2021 16:26:56 -0700 (PDT) Received: from google.com (194.225.68.34.bc.googleusercontent.com. [34.68.225.194]) by smtp.gmail.com with ESMTPSA id q12sm14251ioh.20.2021.09.01.16.26.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Sep 2021 16:26:55 -0700 (PDT) Date: Wed, 1 Sep 2021 23:26:52 +0000 From: Oliver Upton To: Raghavendra Rao Ananta Cc: Paolo Bonzini , Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Catalin Marinas , Will Deacon , Peter Shier , Ricardo Koller , Reiji Watanabe , Jing Zhang , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH v3 06/12] KVM: arm64: selftests: Add support to disable and enable local IRQs Message-ID: References: <20210901211412.4171835-1-rananta@google.com> <20210901211412.4171835-7-rananta@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210901211412.4171835-7-rananta@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210901_162657_544340_8A0117C9 X-CRM114-Status: GOOD ( 16.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Sep 01, 2021 at 09:14:06PM +0000, Raghavendra Rao Ananta wrote: > 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 > --- > .../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 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57A09C432BE for ; Wed, 1 Sep 2021 23:26:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2C6A461053 for ; Wed, 1 Sep 2021 23:26:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239001AbhIAX1z (ORCPT ); Wed, 1 Sep 2021 19:27:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235977AbhIAX1y (ORCPT ); Wed, 1 Sep 2021 19:27:54 -0400 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3D20C061757 for ; Wed, 1 Sep 2021 16:26:56 -0700 (PDT) Received: by mail-io1-xd2f.google.com with SMTP id b10so145366ioq.9 for ; Wed, 01 Sep 2021 16:26:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=rOUt9lzL9h2nq8MizjgBr+LfkDuELuuwWbBlNJOQ814=; b=jR/4VwVeeFqV1reopTHZE859VRG+CTWfBgJ8xN+yYGIx367PJ9Bws70Zg1EV1ucG2W Y2lFJoMSCpZf0ZOBx+NjhIwk4yEFfXdTmKpLSNameuBcxm0f3b2xsZjDWWLkXQzioQzB rdiu2pi+dfj/LlK0SlnX6FXxRO6MlVrubO0LNbHQ1f2H+r49vZAn5pbFbLXLrAIpkyvv 0mbcwbkA1+xfcqzsopbM8IzOFTKlUOVzRZtTJtxfRnE1RlJMRGD/lXwDFs9D701+M4E3 2garEAvPOF6McbV+BoD72/uphVFvhiZwvjqcrhncYz9MizgjNlM4Tikc2xVWnh6P+yPf Hg+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=rOUt9lzL9h2nq8MizjgBr+LfkDuELuuwWbBlNJOQ814=; b=NpvuPok3womh24et9Mm0Yh7o/CoEDENuyh5Nd30RC2iOuQ/EhosHgNtzVj26Jg0FIE 2rG63NPgJRO1MgXT7HzKPpLDc+phZXVWRre0RhkzTTmfmMZML/U5ULVKMkAc5g+YXVi9 GDsdKLOVf9XcK/cQx6m/JDP1y1KL/Y1Yk59oes1Ti0WRbJ5w5VpV+ufXA/ufZ1NGh8MU 10kQ4LL0gF67edJQMSCbYdfCaIXXoUKI5se00y77KOEXTZRxYx5sgG/7FYKyhKxGoS8x LWBJSUBZIaGIVI3mYUOtNDmWH7ckUCCUvHdZT90HizBoxN4Wehr1k4Ti1fEtfvB4BQ90 /pmA== X-Gm-Message-State: AOAM531g5r8cgjHYVjwRmdORSlF9sPN1KAiDTg90o71Nh7JpD+9N2Yai Qv15S4osxzarY9gGC/+f9M7l3Q== X-Google-Smtp-Source: ABdhPJzCa6eAMWUaKvrSDwb4bW983RzCXex8DdL6ys7hZpXkcFNe3o+vWqlq6lWO9U5Kc26/5lS5Gw== X-Received: by 2002:a5d:9b99:: with SMTP id r25mr279115iom.104.1630538816261; Wed, 01 Sep 2021 16:26:56 -0700 (PDT) Received: from google.com (194.225.68.34.bc.googleusercontent.com. [34.68.225.194]) by smtp.gmail.com with ESMTPSA id q12sm14251ioh.20.2021.09.01.16.26.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Sep 2021 16:26:55 -0700 (PDT) Date: Wed, 1 Sep 2021 23:26:52 +0000 From: Oliver Upton To: Raghavendra Rao Ananta Cc: Paolo Bonzini , Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Catalin Marinas , Will Deacon , Peter Shier , Ricardo Koller , Reiji Watanabe , Jing Zhang , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH v3 06/12] KVM: arm64: selftests: Add support to disable and enable local IRQs Message-ID: References: <20210901211412.4171835-1-rananta@google.com> <20210901211412.4171835-7-rananta@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210901211412.4171835-7-rananta@google.com> Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Wed, Sep 01, 2021 at 09:14:06PM +0000, Raghavendra Rao Ananta wrote: > 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 > --- > .../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 >