From patchwork Thu Oct 20 05:41:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reiji Watanabe X-Patchwork-Id: 13012628 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 79C68C4332F for ; Thu, 20 Oct 2022 05:43:34 +0000 (UTC) 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:Cc:To:From:Subject:Message-ID: Mime-Version:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=k7YFOqQzGsme92LsMqQp4j7iNGf8alII8heWt6P8OH4=; b=P0T RpiPniMU0Pcj+m3P1ywGxAhq7R7fsourfySegwgIo7gQizzrixpgIboziZen/lTdG0GBy8KQVAIJ6 xE3czDHjX2gZTAL0hrbOHrrzN9e56KLxEVIQeamrI7joW6zzMj2bqnYsFRqDjs7QLoq/2r3xunwj2 WRXYOePsMjo2lZmr4YXU/AXfsevtJqPRqCtO7DVL62qt7h1v8QnJCl+cpvXhu5ExQl7Bw+VA61gd1 ktAf0Ei4LNnhTi9bAjpe3BeW7K8WDIjfGxoMqzSWiBRHcJ0tfkjO0eI5m8h0lNA9qvB7ngSfWzXuA iu/BqaxjbWojNX3HscewaR00IGBqqLA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1olOJy-00AU0b-GP; Thu, 20 Oct 2022 05:42:22 +0000 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1olOJv-00ATt7-84 for linux-arm-kernel@lists.infradead.org; Thu, 20 Oct 2022 05:42:20 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id t6-20020a25b706000000b006b38040b6f7so18097453ybj.6 for ; Wed, 19 Oct 2022 22:42:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=F1xEy2N0X8jXyctTALyEQ2NLmUaEeJbt2DbPDEOdM5U=; b=qtupEmU2u9RZ171OaNaBBrtCDFPwuHznyd/3vhQPoSFoPHGUbjnNyra7t2LPVYTZUU V4GCVvcoV1wvGWYVoohLHP+XiSJnLrNgy/Rzq0n0QLYOnAmESpGTKLnoVAMAJdHuaiID gvJuGJKt2/Taj6K3D62Ki5E+CaSOLLcx9KSwmUJ3TtEPuYinkpl1Frj62adRZUgO41BN wqE+Ox4SnxtN0qzVPM+ZkU8xrfqWxaPT3jC4KOIczdSpdX2MfYt6Ozz6+X27LykpWWBp CW/JOwdvtJANIJYWaljsOW9uZ/pbeE4eDZOyP9QDliMjnNFOfyYpqy6FTsrx6tQooBJu LOmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=F1xEy2N0X8jXyctTALyEQ2NLmUaEeJbt2DbPDEOdM5U=; b=uBOq25RPOtR28EIayFiNpIHBJVVT2pAeUQo7ksQoCK31/DTLhXqCvzql5UBM+9SFmf skbguY4izBrwxc5UhsUwfr7e7sWypfcHtBSqRnG0AsHIRL2GJcDhtVXXshubxnYQRmQ3 e+/lT2pqQ8ayPK7wuQxrra1et/EbVtJ0GsMtPv5p/ElNWpQnMdEFpFeY8fA7dTBqyfGr kdibdl/B2JFfRY06qq2RFsyKjY+fzSEcF5340staHl68sgsv7Pa+PGPM4fV8Vgh7efwN LZCsHh+JmvolRN7usvlr/ZDAxyv4sXs3tPtAdAaRLdeDa2n68bcg3bhXtkcWtcadKO0g avoA== X-Gm-Message-State: ACrzQf0fB73aFkgNNlFfTudyY6/9i/hHZKp/zM0E6LSJreHnCZjDdilH UCNi1MlaHQ9lASbi3pLL3htBbnYC1Tc= X-Google-Smtp-Source: AMsMyM7ssFcQRUTNFhxmazkE2SsVdFrFjqptAicWealf1kK7A/U7g3JYAWktNfywh02ITvG0hf7hTwi930A= X-Received: from reijiw-west4.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:aa1]) (user=reijiw job=sendgmr) by 2002:a81:1c53:0:b0:354:ce32:2d82 with SMTP id c80-20020a811c53000000b00354ce322d82mr9755582ywc.249.1666244532954; Wed, 19 Oct 2022 22:42:12 -0700 (PDT) Date: Wed, 19 Oct 2022 22:41:53 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.38.0.413.g74048e4d9e-goog Message-ID: <20221020054202.2119018-1-reijiw@google.com> Subject: [PATCH v2 0/9] KVM: arm64: selftests: Test linked {break,watch}points From: Reiji Watanabe To: Marc Zyngier , kvmarm@lists.cs.columbia.edu Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, James Morse , Alexandru Elisei , Suzuki K Poulose , Paolo Bonzini , Andrew Jones , Ricardo Koller , Oliver Upton , Jing Zhang , Raghavendra Rao Anata , Reiji Watanabe X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221019_224219_313151_144E2E3C X-CRM114-Status: UNSURE ( 9.85 ) X-CRM114-Notice: Please train this message. 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This series adds test cases for linked {break,watch}points to the debug-exceptions test, and expands {break,watch}point tests to use non-zero {break,watch}points (the current test always uses {break,watch}point#0). Patches 1-6 add some helpers or do minor refactoring for preparation of adding test cases in subsequent patches. Patches 7-8 add test cases for a linked {break,watch}point. Patch 9 expands {break,watch}point test cases to use non-zero {break,watch}points. The series is based on v6.1-rc1 with the patch [1] applied. v2: - Use FIELD_GET() to extract ID register fields (Oliver, Ricardo) - Try to make function/variable names more clear (Oliver, Ricardo) - Make the context number more unlikely to happen by mistake (Ricardo) - Remove unnecessary GUEST_SYNC for test stage tracking - Collect Reviewed-bys from Oliver and Ricardo (thanks!) v1: https://lore.kernel.org/all/20220825050846.3418868-1-reijiw@google.com/ [1] https://lore.kernel.org/all/20221017195834.2295901-6-ricarkol@google.com/ Reiji Watanabe (9): KVM: arm64: selftests: Use FIELD_GET() to extract ID register fields KVM: arm64: selftests: Add write_dbg{b,w}{c,v}r helpers in debug-exceptions KVM: arm64: selftests: Remove the hard-coded {b,w}pn#0 from debug-exceptions KVM: arm64: selftests: Add helpers to enable debug exceptions KVM: arm64: selftests: Stop unnecessary test stage tracking of debug-exceptions KVM: arm64: selftests: Change debug_version() to take ID_AA64DFR0_EL1 KVM: arm64: selftests: Add a test case for a linked breakpoint KVM: arm64: selftests: Add a test case for a linked watchpoint KVM: arm64: selftests: Test with every breakpoint/watchpoint .../selftests/kvm/aarch64/aarch32_id_regs.c | 3 +- .../selftests/kvm/aarch64/debug-exceptions.c | 311 ++++++++++++++---- .../selftests/kvm/lib/aarch64/processor.c | 7 +- 3 files changed, 245 insertions(+), 76 deletions(-) base-commit: 0ecb0791b2af9bde4389d5ee9ee2a64ddf55ea85