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 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 0AA62C74A5B for ; Fri, 17 Mar 2023 19:51:51 +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=pHhWF+y+XUaE1876aaKVm5ot/tp3Pm5WpjVDoPt9TrI=; b=kSv nR7qqLhh3QA207vizEQimKiiLIxbPHWePnpCl6oDlz+0XZsZwIkLzv3U3WV6ZSZjl1B1xf38ElaB1 B0bwCR2Qbzsv1p53QfkzvdQDhNP1phkOyaQbEOvVTpOc0IdgOmtxuCxxZwSi3dZufMBUl1kUOce0c zDtOSzIZVHJEp+Q8pxYrshK3m0YweTqDzJbv1cz9myHJcY20OvayjHXtqdX7emVqimcY56j0j1RdD wEHb6e8nxtibNFfQMvG84Y9yV5pMeWFWfeu5cepy+03c991SAMJcsWJ+TsgWUOhKfHHqtRMjJfRaf 4I7RYyDSdsuMZvCR/Zapd5wNJkfdDVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pdG6M-003DWC-34; Fri, 17 Mar 2023 19:50:58 +0000 Received: from mail-pj1-x104a.google.com ([2607:f8b0:4864:20::104a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pdG6A-003DNU-3A for linux-arm-kernel@lists.infradead.org; Fri, 17 Mar 2023 19:50:50 +0000 Received: by mail-pj1-x104a.google.com with SMTP id q30-20020a17090a17a100b0023d376ac2c5so2744494pja.5 for ; Fri, 17 Mar 2023 12:50:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1679082634; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=rAMNw7I/iPQBXA5776+hHO5jp6wGCvuivl6D7qCj+lg=; b=bkDvkAdeGenE8Nh+dNVYbOas9j+tbvuvSxVZ3KZ6+Bp1/ka2FLNL89Mybe9NZYX7dt GMU8OOsR4l62JzYYGVcxdjL/FhvKNqKUph7Wep4ysxQsQ4+zlnVygMiWznRQbvBterir Sc5HKVqhSk23DF3gaZ0JkHgXLoLomYTau8+SgyfFiWkyOC7iF0Xwnq8DAR4E9qLq5rr5 pbx4NRjR/m7tdJcDmIKTFw4osieL92c3ru5Y1UppsyXCXwXJ8ImOGQ3RphFl5W+++D4j iZltVWp/nHYfkz8YHLqDCymyLCUI9T494hD4X3z9W64iqLAqayU9pTw1zHxhzvU9tlX5 9NYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679082634; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=rAMNw7I/iPQBXA5776+hHO5jp6wGCvuivl6D7qCj+lg=; b=S1TonYolndUuI7MJqP6z/Rv/z4OB1PxqOvTRTkBdBs8uFQJ5xLYZqdmSDwjRmrqSTb tU/Hrk8xxeKzFzxYWVUlzDK6IG0OFLYJ0JkC71i4I/RCboxMVHU9x/6TluwBMSCIUzC5 Rg8MeI8f0f9OgFRzSjH71J6HGb2D4dp9T3YIzQupTmdJnV/lBfOFonhFJAcOSFAFpe7a AfV/zFmofw2WsIi/U0aQI+p7+8XNMEUQsEvw+hsvGJiM+Wv8hEN2pf1aS6xTUEKBcCom PyVSh+XNAvdnlH1IMLygB26YNRcTvFGw+Ymhzw+YOPRzZ+2+Cv18+R7U8nnmR3gIOUtI DiCg== X-Gm-Message-State: AO0yUKVt7MTMnR7JgH2Zmy34+WcozjwvNsKQA9axvGVPIVJ4WzJT6T1u jAUxRWoTJtz3ZvTKiAzvDuhr1N9VohAGk0A= X-Google-Smtp-Source: AK7set/gvArTV0vJudQh6stgruRNDqAenLkESzbpOZcMUYDbXQMRuvUxE1x49plm6rE743b7PqZM35p2AJ1snKs= X-Received: from zaidcloud.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5325]) (user=zalbassam job=sendgmr) by 2002:a05:6a00:4503:b0:5a8:aaa1:6c05 with SMTP id cw3-20020a056a00450300b005a8aaa16c05mr1896705pfb.2.1679082634554; Fri, 17 Mar 2023 12:50:34 -0700 (PDT) Date: Fri, 17 Mar 2023 15:50:19 -0400 Mime-Version: 1.0 X-Mailer: git-send-email 2.40.0.rc2.332.ga46443480c-goog Message-ID: <20230317195027.3746949-1-zalbassam@google.com> Subject: [PATCH v4 0/8] perf: arm: Make PMUv3 driver available for aarch32 From: Zaid Al-Bassam To: Jesus Sanchez-Palencia , Russell King , Catalin Marinas , Will Deacon , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Marc Zyngier , James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, f.fainelli@gmail.com Cc: Zaid Al-Bassam X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230317_125047_025963_73B9400E X-CRM114-Status: GOOD ( 18.03 ) 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 Currently, PMUv3 driver is only available for ARMv8 aarch64 platforms, ARMv8 platorms running in aarch32 mode dont have access to the driver. This is, especially, a problem for ARMv8 platforms that only have aarch32 support, like the Cortex-A32. Make the PMUv3 driver available to arm arch (ARMv8 aarch32) by moving the PMUv3 driver from arm64 to drivers, that makes the driver common to both arm and arm64 architectures, then add PMUv3 arm Support. The main work in this patchset was made a while back by Marc Zyngier in [1]. Patchset version 1 [v1] rebases Marc's patches to the latest kernel revision and adds additional patches to accommodate the changes in the kernel since Marc wrote the patches. version 2 [v2] of the patchset was created by Marc Zyngier and I picked it up from [2]. Changes in v2: - Flattened the nested switches in the arm_pmuv3.h for arm. - Removed wrappers and added stubs for the PMU KVM functions for arm. - Added PMU version abstractions. Changes in v3: - Removed the link tag from the commit messages. - Fixed the license header in the arm_pmuv3.h files. Changes in v4: - Rebased to 6.3.0-rc2 (Clean rebase) [1] https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/log/?h=kvm-arm/pmuv3-32bit [2] https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/log/?h=arm/pmuv3 [v1] https://lore.kernel.org/all/20230126204444.2204061-1-zalbassam@google.com/ [v2] https://lore.kernel.org/all/20230210165500.2292608-1-zalbassam@google.com/ [v3] https://lore.kernel.org/all/20230213210319.1075872-1-zalbassam@google.com/ Thank you, Zaid Al-Bassam Marc Zyngier (5): arm64: perf: Move PMUv3 driver to drivers/perf arm64: perf: Abstract system register accesses away ARM: Make CONFIG_CPU_V7 valid for 32bit ARMv8 implementations ARM: perf: Allow the use of the PMUv3 driver on 32bit ARM ARM: mach-virt: Select PMUv3 driver by default Zaid Al-Bassam (3): perf: pmuv3: Abstract PMU version checks perf: pmuv3: Move inclusion of kvm_host.h to the arch-specific helper perf: pmuv3: Change GENMASK to GENMASK_ULL arch/arm/Kconfig | 1 + arch/arm/include/asm/arm_pmuv3.h | 247 ++++++++++++++ arch/arm/mm/Kconfig | 2 +- arch/arm64/include/asm/arm_pmuv3.h | 155 +++++++++ arch/arm64/include/asm/perf_event.h | 249 -------------- arch/arm64/kernel/Makefile | 1 - drivers/perf/Kconfig | 10 + drivers/perf/Makefile | 1 + .../perf_event.c => drivers/perf/arm_pmuv3.c | 131 ++------ include/kvm/arm_pmu.h | 2 +- include/linux/perf/arm_pmuv3.h | 303 ++++++++++++++++++ 11 files changed, 751 insertions(+), 351 deletions(-) create mode 100644 arch/arm/include/asm/arm_pmuv3.h create mode 100644 arch/arm64/include/asm/arm_pmuv3.h rename arch/arm64/kernel/perf_event.c => drivers/perf/arm_pmuv3.c (93%) create mode 100644 include/linux/perf/arm_pmuv3.h -- 2.40.0.rc2.332.ga46443480c-goog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel