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=unavailable 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 BBA28C433F5 for ; Thu, 9 Sep 2021 05:19:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A3C286113A for ; Thu, 9 Sep 2021 05:19:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350644AbhIIFUR (ORCPT ); Thu, 9 Sep 2021 01:20:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350542AbhIIFUK (ORCPT ); Thu, 9 Sep 2021 01:20:10 -0400 Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EADBC061757 for ; Wed, 8 Sep 2021 22:18:58 -0700 (PDT) Received: by mail-io1-xd36.google.com with SMTP id b200so740031iof.13 for ; Wed, 08 Sep 2021 22:18:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+CYFnjvQGu3qEtGCtuJvH4Bp2b8Zt/XnVuPY3zDRm/4=; b=iASH6O9lWrdEVAkELUB1zBmanzld5X4HWNeQXJAqq4lnMka+pE0wihP0EZNLG+Dy+8 W6SPfpydSSrMwC1ldEnMQcQ2aAfiXV9pjugauT1C/yeoYYfo3z39B/61zOyQLd17GKJP 6Dv57E9J6sge/+PgOd3g6uDp+SypcWMPm2LBSXk9qCCHQr0UhKzxV4+t2+IISw3gLV/c 6a0a5VVclG8dgvz5n5ud8UQ/AjDjXL/wrCPHtQk0u5w0X/1JPM67/pV79+7NFP6DCyWT oEuKEMfPe7ohxC+nb3cByLN2hAZCwAPuUYSf90DB6qFu6yUErJA6M6iNesHjRNL6mZSs V4Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+CYFnjvQGu3qEtGCtuJvH4Bp2b8Zt/XnVuPY3zDRm/4=; b=Xh0HlQOxISzVZH1FYj6TsBBV47Y6yOrzik8fUfu22KOHWm79wQxN3UXaQmc9GgjUe3 syw5TImbV9THxX9Irm0QzigYLasJDjpk4JiZzmlxdN7WX0U7LrIchI8bzfSni77E+1vk k0A5hfVWUp03BL+S6aIUVP7t47AkRfqzlOcXOkzRrKiRZ0xbHUP/FNaK9V1/yjk4fhkI bLXATY3KoWfEdUO1Cl5H3uiohrUOYl3rQvk54LA+wL9Z7bUcd5CD5Pov0b9MKmK1ChSC L2iTdguQze1bqW8lL+xoLUCMOkm9MvLSdXde8GuwUpauOQX1jCXlzzEO6AOLivdTayEC W22Q== X-Gm-Message-State: AOAM532qISiUTgMNueJ3Na2We+h0Jncll8QIxGdS6/mNl7G3e7uT+Mo6 Z/trHUG/KaouYgc7ML/n4coYqQ== X-Google-Smtp-Source: ABdhPJzq92DTfukBJOnIWgAl3htCHd8+vLrGENISalBbgwBC7v97HZRdGs9hOdm2RvVO8uV/scNEeg== X-Received: by 2002:a6b:8f4e:: with SMTP id r75mr1131550iod.172.1631164737554; Wed, 08 Sep 2021 22:18:57 -0700 (PDT) Received: from google.com (194.225.68.34.bc.googleusercontent.com. [34.68.225.194]) by smtp.gmail.com with ESMTPSA id z26sm426323iol.6.2021.09.08.22.18.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 22:18:56 -0700 (PDT) Date: Thu, 9 Sep 2021 05:18:53 +0000 From: Oliver Upton To: Raghavendra Rao Ananta Cc: Paolo Bonzini , Marc Zyngier , Andrew Jones , 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 v4 11/18] KVM: arm64: selftests: Add basic GICv3 support Message-ID: References: <20210909013818.1191270-1-rananta@google.com> <20210909013818.1191270-12-rananta@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210909013818.1191270-12-rananta@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 09, 2021 at 01:38:11AM +0000, Raghavendra Rao Ananta wrote: > Add basic support for ARM Generic Interrupt Controller v3. > The support provides guests to setup interrupts. > > The work is inspired from kvm-unit-tests and the kernel's > GIC driver (drivers/irqchip/irq-gic-v3.c). > > Signed-off-by: Raghavendra Rao Ananta > Reviewed-by: Andrew Jones > --- > tools/testing/selftests/kvm/Makefile | 2 +- > .../selftests/kvm/include/aarch64/gic.h | 21 ++ > tools/testing/selftests/kvm/lib/aarch64/gic.c | 93 +++++++ > .../selftests/kvm/lib/aarch64/gic_private.h | 21 ++ > .../selftests/kvm/lib/aarch64/gic_v3.c | 240 ++++++++++++++++++ > .../selftests/kvm/lib/aarch64/gic_v3.h | 70 +++++ > 6 files changed, 446 insertions(+), 1 deletion(-) > create mode 100644 tools/testing/selftests/kvm/include/aarch64/gic.h > create mode 100644 tools/testing/selftests/kvm/lib/aarch64/gic.c > create mode 100644 tools/testing/selftests/kvm/lib/aarch64/gic_private.h > create mode 100644 tools/testing/selftests/kvm/lib/aarch64/gic_v3.c > create mode 100644 tools/testing/selftests/kvm/lib/aarch64/gic_v3.h > [...] > +static void > +gic_dist_init(enum gic_type type, unsigned int nr_cpus, void *dist_base) > +{ > + const struct gic_common_ops *gic_ops; does this need to be initialized? I haven't tried compiling, but it seems it should trigger a compiler warning as it is only initialized if type == GIC_V3. > + spin_lock(&gic_lock); > + > + /* Distributor initialization is needed only once per VM */ > + if (gic_common_ops) { > + spin_unlock(&gic_lock); > + return; > + } > + > + if (type == GIC_V3) > + gic_ops = &gicv3_ops; > + > + gic_ops->gic_init(nr_cpus, dist_base); > + gic_common_ops = gic_ops; > + > + /* Make sure that the initialized data is visible to all the vCPUs */ > + dsb(sy); > + > + spin_unlock(&gic_lock); > +}