Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1031455pxb; Wed, 1 Sep 2021 15:47:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaB+1A/wnJgsw6eaR6RpwNQZu1Kzs80Xis1yVheRKE9YLAgy+VNPxwjOu0txTwqitLS4yq X-Received: by 2002:a05:6402:1057:: with SMTP id e23mr264586edu.352.1630536471810; Wed, 01 Sep 2021 15:47:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630536471; cv=none; d=google.com; s=arc-20160816; b=U8bhyYl4NaKiHKcJWNMUw/HKspcmF43Jy0QzOE5NX6S8xc17YMLd9UZqxcKjGBp4Au 7J/hL+8hrY4XMUJl+VMFFJTfIC2fLpoGfAxvb9t/pAMjgfnBQ/PpI1cTi3iro7JWcXhu BK+hZX9S9Zzr1GoQTL9Bc1wSgZecyqm5TwWKZ584BACfzeNE3bHiBwPRAVuLx2HUzwZS NTL0ugxhcCPShzr2TvIX5w9Gc0BdSUhu+ia1c5TFQ7aOTK41ogVDxALbfhPhqS7GyOzb wab5oNf0HHSAfL/nayPRAbAAOVa/XhYuA5fpnqP1ocKm/7Q+G1XCzXBWlkZIS7/cHK3j kClA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+DuLck7trE3/jeuLJyQqFOD4gSDy3mwIoW3d+ThIoWc=; b=aL1BITuU5LhIpmehzt2yrDFGeUJA5ohI9Pw5TGhD+1WYRLlzGP89vLM2UNMSuc+9pw L4fLuSN88+l7bCQcxeAd7LRuIHltF+vKlDLoBjeXLh8F38Wq7yLTxbQhBYxFaaFyed2G emriojjhSI9/TuU7uZNty/m9GgLuv2vd6CZnYQN4ecTkxZCTGT3qSf3NhBu1Wm+eZgEG m+pre3CWgp9r2YtQkkHM8HnY0ZvUUZ+rDYozYEZHXdT5HPZypah9rhIe6zG92fHU71Eg zD+v6+WWorRrlCAt7MW3zxFrQIY9DqS9itcO/wUnXe3omHaDURN5n1CEjkL1gPu9INO7 YEWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ue60hZ70; 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 dd5si1143528ejc.375.2021.09.01.15.47.28; Wed, 01 Sep 2021 15:47:51 -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=ue60hZ70; 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 S232025AbhIAWGJ (ORCPT + 99 others); Wed, 1 Sep 2021 18:06:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243208AbhIAWGI (ORCPT ); Wed, 1 Sep 2021 18:06:08 -0400 Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 929A5C061757 for ; Wed, 1 Sep 2021 15:05:11 -0700 (PDT) Received: by mail-il1-x130.google.com with SMTP id h29so836484ila.2 for ; Wed, 01 Sep 2021 15:05:11 -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=+DuLck7trE3/jeuLJyQqFOD4gSDy3mwIoW3d+ThIoWc=; b=ue60hZ708cIr7G42kkYJi/pAO26l3GQIlDpRhHkRx9vrX7fkrGwcxv381hWQHI/80W u697z+xufWYfztWIL9kzUPbDj+ybhEp3ZG4QiSDxRsFBVYWZhhiadTaAty6AcHC1yd9s +RtPFgqGxGPHaBXwIGpGCa/G0bn8zAC5+mwkup6bTH+Ybsz7vXo5hFvzG7kxwf5kJnQX mCOcBpbHGFnARtedqKBlXB95AWHySM3o4dW9WeC4PFn7tLnsDhQQFB0XSPli72Glti9S 5PNsiN0EZfP0B1y9voI1vv+Wx7UuCoYBBbTI5YMtJ9ZqNUut17oqsZ4+Y1pvn+g+sG9N NP2w== 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=+DuLck7trE3/jeuLJyQqFOD4gSDy3mwIoW3d+ThIoWc=; b=juts0q5Ge8QJMGTqO0VNzsH5tRUwfF4NrQWcV2TvOBJe88maoWRYdb+Mawt/rb5YW8 DmwbuyGP6GlQBuuu+TKH4jFmc8HjPEJNBUy3CuDnARgh9u/PUO66BIdZovJSIjwY0lFw tmkWANmedGmnnL2Mt4cHA7WHi7Htdnxs8AibfUsbjnerluk/OyPq9LVQBvn5UqAISGtq 1t17G60WRmZlGVhawBMkBteTBNp6H2ycIBlU5z3J+KTNvhjCDJuobOL0u0bGPXbI16A4 c2Zr6RQNsafMMnocPqCWOp2DQyy8g7QrLgiqEyYDhn89SBesr/T9iEU3zTu3R3fH581i Enww== X-Gm-Message-State: AOAM532wDg6HsGo5EzJ5K4NkASRaf6V/tsKXYGBcLmK01IggGFYIArqd mKLv9P0oKsS67UXRpCq6Wn3kaA== X-Received: by 2002:a92:c609:: with SMTP id p9mr1138171ilm.135.1630533910160; Wed, 01 Sep 2021 15:05:10 -0700 (PDT) Received: from google.com (194.225.68.34.bc.googleusercontent.com. [34.68.225.194]) by smtp.gmail.com with ESMTPSA id h9sm518789ioz.30.2021.09.01.15.05.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Sep 2021 15:05:09 -0700 (PDT) Date: Wed, 1 Sep 2021 22:05:06 +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, drjones@redhat.com Subject: Re: [PATCH v3 00/12] KVM: arm64: selftests: Introduce arch_timer selftest Message-ID: References: <20210901211412.4171835-1-rananta@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210901211412.4171835-1-rananta@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +cc Andrew Jones On Wed, Sep 01, 2021 at 09:14:00PM +0000, Raghavendra Rao Ananta wrote: > Hello, > > The patch series adds a KVM selftest to validate the behavior of > ARM's generic timer (patch-11). The test programs the timer IRQs > periodically, and for each interrupt, it validates the behaviour > against the architecture specifications. The test further provides > a command-line interface to configure the number of vCPUs, the > period of the timer, and the number of iterations that the test > has to run for. > > Patch-12 adds an option to randomly migrate the vCPUs to different > physical CPUs across the system. The bug for the fix provided by > Marc with commit 3134cc8beb69d0d ("KVM: arm64: vgic: Resample HW > pending state on deactivation") was discovered using arch_timer > test with vCPU migrations. > > Since the test heavily depends on interrupts, patch-10 adds a host > library to setup ARM Generic Interrupt Controller v3 (GICv3). This > includes creating a vGIC device, setting up distributor and > redistributor attributes, and mapping the guest physical addresses. > Symmetrical to this, patch-9 adds a guest library to talk to the vGIC, > which includes initializing the controller, enabling/disabling the > interrupts, and so on. > > Furthermore, additional processor utilities such as accessing the MMIO > (via readl/writel), read/write to assembler unsupported registers, > basic delay generation, enable/disable local IRQs, and so on, are also > introduced that the test/GICv3 takes advantage of (patches 1 through 8). > > The patch series, specifically the library support, is derived from the > kvm-unit-tests and the kernel itself. > > Regards, > Raghavendra > > v2 -> v3: > > - Addressed the comments from Ricardo regarding moving the vGIC host > support for selftests to its own library. > - Added an option (-m) to migrate the guest vCPUs to physical CPUs > in the system. > > v1 -> v2: > > Addressed comments from Zenghui in include/aarch64/arch_timer.h: > - Correct the header description > - Remove unnecessary inclusion of linux/sizes.h > - Re-arrange CTL_ defines in ascending order > - Remove inappropriate 'return' from timer_set_* functions, which > returns 'void'. > > Raghavendra Rao Ananta (12): > KVM: arm64: selftests: Add MMIO readl/writel support > KVM: arm64: selftests: Add write_sysreg_s and read_sysreg_s > KVM: arm64: selftests: Add support for cpu_relax > KVM: arm64: selftests: Add basic support for arch_timers > KVM: arm64: selftests: Add basic support to generate delays > KVM: arm64: selftests: Add support to disable and enable local IRQs > KVM: arm64: selftests: Add support to get the vcpuid from MPIDR_EL1 > KVM: arm64: selftests: Add light-weight spinlock support > KVM: arm64: selftests: Add basic GICv3 support > KVM: arm64: selftests: Add host support for vGIC > KVM: arm64: selftests: Add arch_timer test > KVM: arm64: selftests: arch_timer: Support vCPU migration > > tools/testing/selftests/kvm/.gitignore | 1 + > tools/testing/selftests/kvm/Makefile | 3 +- > .../selftests/kvm/aarch64/arch_timer.c | 457 ++++++++++++++++++ > .../kvm/include/aarch64/arch_timer.h | 142 ++++++ > .../selftests/kvm/include/aarch64/delay.h | 25 + > .../selftests/kvm/include/aarch64/gic.h | 21 + > .../selftests/kvm/include/aarch64/processor.h | 140 +++++- > .../selftests/kvm/include/aarch64/spinlock.h | 13 + > .../selftests/kvm/include/aarch64/vgic.h | 14 + > 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 +++ > .../selftests/kvm/lib/aarch64/spinlock.c | 27 ++ > .../testing/selftests/kvm/lib/aarch64/vgic.c | 67 +++ > 15 files changed, 1332 insertions(+), 2 deletions(-) > create mode 100644 tools/testing/selftests/kvm/aarch64/arch_timer.c > create mode 100644 tools/testing/selftests/kvm/include/aarch64/arch_timer.h > create mode 100644 tools/testing/selftests/kvm/include/aarch64/delay.h > create mode 100644 tools/testing/selftests/kvm/include/aarch64/gic.h > create mode 100644 tools/testing/selftests/kvm/include/aarch64/spinlock.h > create mode 100644 tools/testing/selftests/kvm/include/aarch64/vgic.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 > create mode 100644 tools/testing/selftests/kvm/lib/aarch64/spinlock.c > create mode 100644 tools/testing/selftests/kvm/lib/aarch64/vgic.c > > -- > 2.33.0.153.gba50c8fa24-goog >