From patchwork Thu Jan 2 19:25:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 13924899 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 lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 04427E77199 for ; Thu, 2 Jan 2025 19:25:30 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.864430.1275649 (Exim 4.92) (envelope-from ) id 1tTQol-00034O-Tt; Thu, 02 Jan 2025 19:25:15 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 864430.1275649; Thu, 02 Jan 2025 19:25:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tTQol-00034E-Qf; Thu, 02 Jan 2025 19:25:15 +0000 Received: by outflank-mailman (input) for mailman id 864430; Thu, 02 Jan 2025 19:25:15 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tTQol-0002q0-0B for xen-devel@lists.xenproject.org; Thu, 02 Jan 2025 19:25:15 +0000 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [2a00:1450:4864:20::42f]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4a01602b-c93f-11ef-99a4-01e77a169b0f; Thu, 02 Jan 2025 20:25:13 +0100 (CET) Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-385ef8b64b3so9172202f8f.0 for ; Thu, 02 Jan 2025 11:25:13 -0800 (PST) Received: from andrewcoop.lan ([83.105.36.37]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c6ad3e3sm40212825f8f.0.2025.01.02.11.25.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jan 2025 11:25:10 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 4a01602b-c93f-11ef-99a4-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1735845912; x=1736450712; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sf4IwgriP6BBrdUD4Z6hthsNRYM6SLFzNyUPek/Qf+o=; b=TB2ewHkUfsUh1a0Q720toiTxnoRyPtAU6p1DZjNSs416GDH264j6y3umA/+v+tBHr5 XoKL5eL76bJBSYMMPbvhc6pXrmETNnZJCjQgwGc3G4yfzOEt1ZxIV3lgKfoGX1LsAw02 tSoRIHSexUTVPMJt7OZWqA5KG38b/wiuIZljQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735845912; x=1736450712; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sf4IwgriP6BBrdUD4Z6hthsNRYM6SLFzNyUPek/Qf+o=; b=AFu9ckD8w/trugSflzzjcftf5GLKplhJmek2vX9l+1YFA8k3BRzo8GQM78es2tH40J 5Dbr/oN8LrSALWHDCwugK/lfCwT5cSq9NkNoudgxCF0oM/sfXE2Ud24iWfGYlf62encA A4LIh5N9LCEUXstj8rUo5bKeS2S9rWUWAXH3GaiHTWJHiaerlPccckrQBo+szrdZTQdU +jpki8HsxrqIXsoWduIuHrmxT/omHiU7zVK6twe6t74kEI/XY2xRRDhXllRfiyrkyUyi ozvsuuzse0vekzFtCEZGLS79dMbskrkvrrxX4szEPR/+KBb7wHnDsKk/DrUwilVybHxV 8Lkw== X-Gm-Message-State: AOJu0YzH6L18CwLBc194qA/aabafoeMkiEb5jcbBuSJnjqkyxGeP/YOH jeTKkcesLOPChwKtoW7hQcdOerKLhVm/CJ83sP6pAuZwyZS3IhaZi9Gy/GGvnTjnyDYghWdbyjZ csRulGQ== X-Gm-Gg: ASbGncuqFAa6p4mfYc4LsiAg4d6QA+1ydZ7BxTvfd555Tn9PcSakfswUU6kc4EVfmPg N1H+E4eIrQlF5WSBrGFFGR8ManxfRa4WSlzQI/5IXPlyjuvrsQs2f7hiIw5lJ12RzVsZ/dpkmyA EI93pK+6FEQFXitcJ60HkA2xde0yOVkmLnUcRnHWl6YrwMFgIqizjWJXh3nWGL8otygsdy6j4O3 pRgOZfW5DEZiv5eIjvyMGQrTf/5qzT/R4HOLOEMlXd/W4pqZTUxCZMRCKhAmotihw== X-Google-Smtp-Source: AGHT+IHZhaE5JRGQspuEbLzfCClbF7B1+c9HuqyKBXGcb8aEPjkff/W0gZNFUTorLh2/u8rhtbfKhw== X-Received: by 2002:a5d:598f:0:b0:385:ed20:3be6 with SMTP id ffacd0b85a97d-38a221fa7f9mr40602449f8f.22.1735845912190; Thu, 02 Jan 2025 11:25:12 -0800 (PST) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Julien Grall , Volodymyr Babchuk , Bertrand Marquis , Michal Orzel , Oleksii Kurochko , Shawn Anastasio Subject: [PATCH 1/5] xen/perfc: Drop arch_perfc_{gather,reset}() Date: Thu, 2 Jan 2025 19:25:04 +0000 Message-Id: <20250102192508.2405687-2-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250102192508.2405687-1-andrew.cooper3@citrix.com> References: <20250102192508.2405687-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 These were only ever used by the IA64 port, which was droped in commit 570c311ca2c7 ("remove ia64"). Remove them, and clean up the arm/x86 stub headers. Signed-off-by: Andrew Cooper Reviewed-by: Stefano Stabellini --- CC: Jan Beulich CC: Roger Pau Monné CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Michal Orzel CC: Oleksii Kurochko CC: Shawn Anastasio --- xen/arch/arm/include/asm/perfc.h | 21 --------------------- xen/arch/x86/include/asm/perfc.h | 12 ------------ xen/common/perfc.c | 6 ------ 3 files changed, 39 deletions(-) delete mode 100644 xen/arch/arm/include/asm/perfc.h delete mode 100644 xen/arch/x86/include/asm/perfc.h diff --git a/xen/arch/arm/include/asm/perfc.h b/xen/arch/arm/include/asm/perfc.h deleted file mode 100644 index 95c4b2b6b7bf..000000000000 --- a/xen/arch/arm/include/asm/perfc.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef __ASM_PERFC_H__ -#define __ASM_PERFC_H__ - -static inline void arch_perfc_reset(void) -{ -} - -static inline void arch_perfc_gather(void) -{ -} - -#endif - -/* - * Local variables: - * mode: C - * c-file-style: "BSD" - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - */ diff --git a/xen/arch/x86/include/asm/perfc.h b/xen/arch/x86/include/asm/perfc.h deleted file mode 100644 index a1a591e803a6..000000000000 --- a/xen/arch/x86/include/asm/perfc.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef __ASM_PERFC_H__ -#define __ASM_PERFC_H__ - -static inline void arch_perfc_reset(void) -{ -} - -static inline void arch_perfc_gather(void) -{ -} - -#endif diff --git a/xen/common/perfc.c b/xen/common/perfc.c index 80480aa7766d..ed4dba36f1bc 100644 --- a/xen/common/perfc.c +++ b/xen/common/perfc.c @@ -8,7 +8,6 @@ #include #include #include -#include #define PERFCOUNTER( var, name ) { name, TYPE_SINGLE, 0 }, #define PERFCOUNTER_ARRAY( var, name, size ) { name, TYPE_ARRAY, size }, @@ -148,8 +147,6 @@ void cf_check perfc_reset(unsigned char key) break; } } - - arch_perfc_reset(); } static struct xen_sysctl_perfc_desc perfc_d[NR_PERFCTRS]; @@ -199,9 +196,6 @@ static int perfc_copy_info(XEN_GUEST_HANDLE_64(xen_sysctl_perfc_desc_t) desc, if ( perfc_vals == NULL ) return -ENOMEM; - /* Architecture may fill counters from hardware. */ - arch_perfc_gather(); - /* We gather the counts together every time. */ for ( i = j = v = 0; i < NR_PERFCTRS; i++ ) { From patchwork Thu Jan 2 19:25:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 13924895 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 lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 3A04FE77188 for ; Thu, 2 Jan 2025 19:25:26 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.864431.1275659 (Exim 4.92) (envelope-from ) id 1tTQon-0003JA-4t; Thu, 02 Jan 2025 19:25:17 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 864431.1275659; Thu, 02 Jan 2025 19:25:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tTQon-0003Iz-1Z; Thu, 02 Jan 2025 19:25:17 +0000 Received: by outflank-mailman (input) for mailman id 864431; Thu, 02 Jan 2025 19:25:15 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tTQol-00030j-L2 for xen-devel@lists.xenproject.org; Thu, 02 Jan 2025 19:25:15 +0000 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [2a00:1450:4864:20::429]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 4abc98d2-c93f-11ef-a0dc-8be0dac302b0; Thu, 02 Jan 2025 20:25:14 +0100 (CET) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3863494591bso6151745f8f.1 for ; Thu, 02 Jan 2025 11:25:14 -0800 (PST) Received: from andrewcoop.lan ([83.105.36.37]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c6ad3e3sm40212825f8f.0.2025.01.02.11.25.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jan 2025 11:25:12 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 4abc98d2-c93f-11ef-a0dc-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1735845914; x=1736450714; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gNg/xL5jgFrtg8KGSp8+PUC646w5vHXUt7CvxvruBYw=; b=rupzvsGwV4T7VztuA5Fdvu9Ta8kQbO5qUMTpWHE5p5lDU+NTaLKWERUkqZBuCNlkEI hPHHSSEwxkUsfamWRL5ZtgiptdWLEsYh0NyKQeb/cEi67jNEhsu3CXTarg9+EeqJGmqU QTs5hL9Mn9eTxBfnxlE8ejVRpiQS7Aeo05oJA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735845914; x=1736450714; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gNg/xL5jgFrtg8KGSp8+PUC646w5vHXUt7CvxvruBYw=; b=VUBYIRoB6n1gGrc/+tbxu83WiH+ENxO4hspAPZKD0b9SsVTKDacw+H+roA85eYC0nU E5Ct7DgqDWTuep6C9urfsJGuSaxvh9OhZqZCPGIRagW8ostD9jhOuSsdhoI6tcoOvRMg c76OhPIlFdsqymRNW5Lu5gbknb+OtAUKKKVgOTcvAfmRCNa0zaeCvX72AYouUl0MQoFw PIEyw2Pr3q+d1R85vStDG7nvDd6F12h2jaaeWxDgNO77hJwTr3MeO4sqyjk2y3JrX45P 0XxVHU6184f3g9Qr99qkm9qbL6Kb4JnmgpLGjQ8Q35hjR8MDx6I+7x/50qvjSoOZL6AV d4BQ== X-Gm-Message-State: AOJu0YxqHECluwZlmCyQ6nw3cdPUiNQfgiNE4kQxxKr3q44lJSJYy6+e liMnSB3YqIame/Jv2yWC/XSeLeb5J6zSfu3picI2fpY5nMmq6xOm4Y+68CfXTaAGpT0jpk412Bj I/gKvDg== X-Gm-Gg: ASbGnctx3uPO0BwGxuFB3BRIHcm9SEMZakZR61FRhygDaTxax4OZPiXPokPC1CSGSlT yuiCzGFcbni/WBj5jrFrl4rZc/SWdUjmIL6tj+FzmHt9TpQjtkdbf3UW548WETfsv6XQ/ooNk9k ZAJy7x3a6V/XanbFMeiStDTVwUXIEAJJNcETJjPolbOgEyFvDcK8FyHZyiof7biDNx7QGc5jLB0 iiO+VGGTs6UdAf8CgUg3ljBKSfUNDAl3f1ihrblzR5icWvv0GXgMo1aoNy0oLAgWw== X-Google-Smtp-Source: AGHT+IEO0jFa1wsTom2pBAvfDBImQ+92OtAvCK8OHQn98ont8h1Zd3voDTpF+kkLcK3kGKcB23SwrQ== X-Received: by 2002:a05:6000:18ae:b0:385:e5d6:130c with SMTP id ffacd0b85a97d-38a22408dcfmr33328269f8f.51.1735845913749; Thu, 02 Jan 2025 11:25:13 -0800 (PST) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Julien Grall , Volodymyr Babchuk , Bertrand Marquis , Michal Orzel , Oleksii Kurochko , Shawn Anastasio Subject: [PATCH 2/5] xen/perfc: Add perfc_defn.h to asm-generic Date: Thu, 2 Jan 2025 19:25:05 +0000 Message-Id: <20250102192508.2405687-3-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250102192508.2405687-1-andrew.cooper3@citrix.com> References: <20250102192508.2405687-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 ... and hook it up for RISC-V and PPC. On RISC-V at least, no combination of headers pulls in errno.h, so include it explicitly. Guard the hypercalls array declaration based on NR_hypercalls existing. This is sufficient to get PERF_COUNTERS fully working on RISC-V and PPC, so drop the randconfig override. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich Reviewed-by: Stefano Stabellini --- CC: Jan Beulich CC: Roger Pau Monné CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Michal Orzel CC: Oleksii Kurochko CC: Shawn Anastasio --- automation/gitlab-ci/build.yaml | 1 - xen/arch/ppc/include/asm/Makefile | 1 + xen/arch/riscv/include/asm/Makefile | 1 + xen/common/perfc.c | 1 + xen/include/asm-generic/perfc_defn.h | 5 +++++ xen/include/xen/perfc_defn.h | 2 ++ 6 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 xen/include/asm-generic/perfc_defn.h diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml index 1b884cc81cdb..41f17ed45641 100644 --- a/automation/gitlab-ci/build.yaml +++ b/automation/gitlab-ci/build.yaml @@ -734,7 +734,6 @@ debian-12-riscv64-gcc: CONFIG_GRANT_TABLE=n CONFIG_LIVEPATCH=n CONFIG_MEM_ACCESS=n - CONFIG_PERF_COUNTERS=n CONFIG_QEMU_PLATFORM=y CONFIG_XSM=n diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/Makefile index ced02e26ed13..c989a7f89b34 100644 --- a/xen/arch/ppc/include/asm/Makefile +++ b/xen/arch/ppc/include/asm/Makefile @@ -7,6 +7,7 @@ generic-y += hypercall.h generic-y += iocap.h generic-y += paging.h generic-y += percpu.h +generic-y += perfc_defn.h generic-y += random.h generic-y += softirq.h generic-y += vm_event.h diff --git a/xen/arch/riscv/include/asm/Makefile b/xen/arch/riscv/include/asm/Makefile index ced02e26ed13..c989a7f89b34 100644 --- a/xen/arch/riscv/include/asm/Makefile +++ b/xen/arch/riscv/include/asm/Makefile @@ -7,6 +7,7 @@ generic-y += hypercall.h generic-y += iocap.h generic-y += paging.h generic-y += percpu.h +generic-y += perfc_defn.h generic-y += random.h generic-y += softirq.h generic-y += vm_event.h diff --git a/xen/common/perfc.c b/xen/common/perfc.c index ed4dba36f1bc..8c967ab900f9 100644 --- a/xen/common/perfc.c +++ b/xen/common/perfc.c @@ -1,4 +1,5 @@ +#include #include #include #include diff --git a/xen/include/asm-generic/perfc_defn.h b/xen/include/asm-generic/perfc_defn.h new file mode 100644 index 000000000000..8237636d83fb --- /dev/null +++ b/xen/include/asm-generic/perfc_defn.h @@ -0,0 +1,5 @@ +/* This file is legitimately included multiple times. */ +/* #ifndef ASM_GENERIC_PERFC_DEFN_H */ +/* #define ASM_GENERIC_PERFC_DEFN_H */ + +/* #endif ASM_GENERIC_PERFC_DEFN_H */ diff --git a/xen/include/xen/perfc_defn.h b/xen/include/xen/perfc_defn.h index 0027d95a60bc..a987d80dd6f1 100644 --- a/xen/include/xen/perfc_defn.h +++ b/xen/include/xen/perfc_defn.h @@ -4,7 +4,9 @@ #include +#ifdef NR_hypercalls PERFCOUNTER_ARRAY(hypercalls, "hypercalls", NR_hypercalls) +#endif PERFCOUNTER(calls_from_multicall, "calls from multicall") From patchwork Thu Jan 2 19:25:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 13924897 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 lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 6BBAFE77197 for ; Thu, 2 Jan 2025 19:25:27 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.864432.1275668 (Exim 4.92) (envelope-from ) id 1tTQop-0003aG-Bc; Thu, 02 Jan 2025 19:25:19 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 864432.1275668; Thu, 02 Jan 2025 19:25:19 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tTQop-0003a9-8E; Thu, 02 Jan 2025 19:25:19 +0000 Received: by outflank-mailman (input) for mailman id 864432; Thu, 02 Jan 2025 19:25:17 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tTQon-0002q0-Ej for xen-devel@lists.xenproject.org; Thu, 02 Jan 2025 19:25:17 +0000 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [2a00:1450:4864:20::42e]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4b766a05-c93f-11ef-99a4-01e77a169b0f; Thu, 02 Jan 2025 20:25:16 +0100 (CET) Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-385e3621518so5505301f8f.1 for ; Thu, 02 Jan 2025 11:25:15 -0800 (PST) Received: from andrewcoop.lan ([83.105.36.37]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c6ad3e3sm40212825f8f.0.2025.01.02.11.25.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jan 2025 11:25:14 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 4b766a05-c93f-11ef-99a4-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1735845915; x=1736450715; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QOJMLCrP3OxQrYrq1pK05nXAC3sNtvIsyQUyYuMkfEc=; b=JIj0LDUqMpjzd5mfR1ADoZ8pU+SIIkbuw0S5ASNS4acjsvZyLa7XaJlcjdyq3Mm1Zu 5J0xeblIPYuDdYgr15lbhIPYgdPYBf0tjG3zqOgcW27sv57ZyesUucGoQyBGti+nUFZn zl+1BmrkHJyAGfl69n5eFtqgHq8lXwUy3Z+Mw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735845915; x=1736450715; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QOJMLCrP3OxQrYrq1pK05nXAC3sNtvIsyQUyYuMkfEc=; b=xTFbZ7DgOUL6TzS8pQi2RJlwgFLEncDyX28aCiyVjpctcx3FcqzWE6x72WXjfj5bNM FfQ6UY2qyzS6cjyRVfBDHF6unbjij7HIghb3c2cP6JOVQ8Sy0Z+PIqwYHNuArVIBBpHe GxDK4Vca61Pa9aD53GJeYge0YTw2sCs/FATRtgjtft6hnIu7Rc5L/vtbW8SYdQR4WxfH cbQNZmNpI0EzP+6aNpjKR/UXFVIk+2s9WrX/+OlP67bWCdxiuzfIgz/EFYAobZ/VvZdu Kp1VjC1xjeaDz1+SK5NuMkyQ61LofjtfUPrxnRBsAn/0fOJO3pC9/J2rjXVYkzSxaM6O 3B8A== X-Gm-Message-State: AOJu0YypTTAjPTnQzOpStHtDdNf3FZ3T4l27gmE6G3LlPY+nUiUjVaFs YKYTVkloM9qPea1hL/btWSGqv6UBi2yT3Ya9TraxR28sZ7x8JizdnGYaqbFiHAPE0lxL1jRgF+U Y1CedDg== X-Gm-Gg: ASbGnctbWnswGHpVXV6CsPvBViyMOGlAVfyvryyjAfIxmkmSPMYAB0RvVmhQivbOCZ2 EAoC/BMZL42FQ489OwYQ5DglD/6VrzcMHSgJu0fBNYXeptEjPYdDz+LsBrYs8FGcNAnNkuTuHjS laaZqhPpt5UfNox7VhZ6aW2w10mIOYAzXZWR4DcCd/bbLdBmIWUHZtkY2vtAlS4UEbYw7zHz5dp yTo1srzJAyfuFK8GFV8ko0c2pblY+tKeWw8kPoLVk5rWUGQ9lH4h7h8G1emg824OQ== X-Google-Smtp-Source: AGHT+IHT9RzM80xIxWi0z1qXFPQzXCeUKPAus090TwvbQSXMA9JxibnloWnNEkPsjtqGXIRtz1evYg== X-Received: by 2002:a5d:6da1:0:b0:385:f631:612 with SMTP id ffacd0b85a97d-38a221ea944mr37003027f8f.17.1735845914949; Thu, 02 Jan 2025 11:25:14 -0800 (PST) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Julien Grall , Volodymyr Babchuk , Bertrand Marquis , Michal Orzel , Oleksii Kurochko , Shawn Anastasio Subject: [PATCH 3/5] xen/perfc: Trim includes Date: Thu, 2 Jan 2025 19:25:06 +0000 Message-Id: <20250102192508.2405687-4-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250102192508.2405687-1-andrew.cooper3@citrix.com> References: <20250102192508.2405687-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 This is mostly for the removal of xen/lib.h and xen/smp.h from perfc.h. All that is needed is xen/macros.h. Trim and sort the includes for perfc.c too. There's no need for smp.h, keyhandler.h or mm.h, but cpumask.h is needed. Signed-off-by: Andrew Cooper Reviewed-by: Stefano Stabellini --- CC: Jan Beulich CC: Roger Pau Monné CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Michal Orzel CC: Oleksii Kurochko CC: Shawn Anastasio --- xen/common/perfc.c | 9 ++++----- xen/include/xen/perfc.h | 3 +-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/xen/common/perfc.c b/xen/common/perfc.c index 8c967ab900f9..b748c8af855b 100644 --- a/xen/common/perfc.c +++ b/xen/common/perfc.c @@ -1,13 +1,12 @@ +#include #include +#include #include -#include -#include #include -#include #include -#include -#include +#include + #include #define PERFCOUNTER( var, name ) { name, TYPE_SINGLE, 0 }, diff --git a/xen/include/xen/perfc.h b/xen/include/xen/perfc.h index f9009dc388de..324b47665573 100644 --- a/xen/include/xen/perfc.h +++ b/xen/include/xen/perfc.h @@ -3,8 +3,7 @@ #ifdef CONFIG_PERF_COUNTERS -#include -#include +#include #include /* From patchwork Thu Jan 2 19:25:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 13924900 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 lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 0937FE7719A for ; Thu, 2 Jan 2025 19:25:29 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.864433.1275675 (Exim 4.92) (envelope-from ) id 1tTQop-0003dn-Ny; Thu, 02 Jan 2025 19:25:19 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 864433.1275675; Thu, 02 Jan 2025 19:25:19 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tTQop-0003d5-Gj; Thu, 02 Jan 2025 19:25:19 +0000 Received: by outflank-mailman (input) for mailman id 864433; Thu, 02 Jan 2025 19:25:18 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tTQoo-0002q0-RD for xen-devel@lists.xenproject.org; Thu, 02 Jan 2025 19:25:18 +0000 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [2a00:1450:4864:20::335]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4c3f7cac-c93f-11ef-99a4-01e77a169b0f; Thu, 02 Jan 2025 20:25:17 +0100 (CET) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-436a39e4891so28728715e9.1 for ; Thu, 02 Jan 2025 11:25:17 -0800 (PST) Received: from andrewcoop.lan ([83.105.36.37]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c6ad3e3sm40212825f8f.0.2025.01.02.11.25.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jan 2025 11:25:15 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 4c3f7cac-c93f-11ef-99a4-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1735845916; x=1736450716; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=edPTs5r2WJDCVGRT6f4/sc4UPJKROdeZIxE7m/aVPP0=; b=r4WSOnwTnXrykGyuCZynr4fY7npndJUt8wv+OjTcQ+k7zS2eOc64atuMRk/+lX6sks yxHRqXDIsVfmWw5qdf63/vvj4ql7C31X48bJ0qn9pAm8ACkYrjcz6eE83u11C9/qXlup 07Gqx6sY+TXGv1bUYo7EsOq21BRZ8F4/SKp3w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735845916; x=1736450716; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=edPTs5r2WJDCVGRT6f4/sc4UPJKROdeZIxE7m/aVPP0=; b=UOawGydv+CJKp9lnBVgFlvce2TKHQgprLDY1CmnRLQrykgtNEAkTCeRovi07sSnV6G k1Dk50ZNT1QF5vaCrOuOLGMLcLUIcBwgqusdAQDznysNl6hruvpryDvOYsbcRMmBbBxt S5cy2KMS10k8JQ2jXa5b4jZPpPyjy0gkog/XpNQ+DydFyLiDPO8tdP5Dhb0scmrqoSJM R+2TP8DpXfQRuNPWcvBiyFe5BqxigFiV5EF6S1Yni0lfnPcatqKIeCs9QBT465g2m8ve jlUSxFWSr+7IvspLLnAKdygOojTVS6cnzOnqlNYrCm2srBsmApMcR8c9viN9LEzmp57k trug== X-Gm-Message-State: AOJu0YzwVpXBM2xl7Et8/H6xYEm1oqV/RB3CJeMMiIslxxmCS71gXyaK pKtQ78xv/tjnkxK/I/98svRUw5Ae56La9CRLYqQnmMPEOTUZgFGEcwngpWvOIuV8y03S6hrde2n oDKM8Tw== X-Gm-Gg: ASbGnctWEJUacmgPhQPbnM10iQc65/PP+WYeX3vUVf4tE7CSRSaQyfki3w1mWst7wRa o/QsJaoQv6sxJiraOkoGZE3AOrzaLJ5poo/rZbmL3wjKnEDpzjb4pyW+J1MlR+tYoC6VgSJxk3x /kGxTvI58orqhyQeotOed3NslQkViktCPReaFPv3xsViA8djaqeEr6B197kTU6z8hvpcQfqwcLd vHTbwN+074AOu6VNzyDaV7N7Bu58G1jgDBbtGk1oiaybl6mZAapeE5HQnXpAi5T0w== X-Google-Smtp-Source: AGHT+IHmGwLlaLgCcyaeWZID5RvfAd2XbtkcpcMbIkQLTV2v/kVVGKNpAQ/U5CkC4f4tvIrMym4x1g== X-Received: by 2002:a05:600c:35cc:b0:434:f925:f5c9 with SMTP id 5b1f17b1804b1-43668547fd1mr365041085e9.6.1735845916238; Thu, 02 Jan 2025 11:25:16 -0800 (PST) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Julien Grall , Volodymyr Babchuk , Bertrand Marquis , Michal Orzel , Oleksii Kurochko , Shawn Anastasio Subject: [PATCH 4/5] xen/perfc: Cleanup Date: Thu, 2 Jan 2025 19:25:07 +0000 Message-Id: <20250102192508.2405687-5-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250102192508.2405687-1-andrew.cooper3@citrix.com> References: <20250102192508.2405687-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 * Strip trailing whitspace. * Remove PRIperfc. It has never been used and isn't useful. Signed-off-by: Andrew Cooper Reviewed-by: Stefano Stabellini --- CC: Jan Beulich CC: Roger Pau Monné CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Michal Orzel CC: Oleksii Kurochko CC: Shawn Anastasio --- xen/common/perfc.c | 10 +++++----- xen/include/xen/perfc.h | 23 +++++++++++------------ 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/xen/common/perfc.c b/xen/common/perfc.c index b748c8af855b..8302b7cf6db1 100644 --- a/xen/common/perfc.c +++ b/xen/common/perfc.c @@ -46,7 +46,7 @@ void cf_check perfc_printall(unsigned char key) case TYPE_S_SINGLE: for_each_online_cpu ( cpu ) sum += per_cpu(perfcounters, cpu)[j]; - if ( perfc_info[i].type == TYPE_S_SINGLE ) + if ( perfc_info[i].type == TYPE_S_SINGLE ) sum = (perfc_t) sum; printk("TOTAL[%12Lu]", sum); if ( sum ) @@ -56,7 +56,7 @@ void cf_check perfc_printall(unsigned char key) { if ( k > 0 && (k % 4) == 0 ) printk("\n%53s", ""); - printk(" CPU%02u[%10"PRIperfc"u]", cpu, per_cpu(perfcounters, cpu)[j]); + printk(" CPU%02u[%10u]", cpu, per_cpu(perfcounters, cpu)[j]); ++k; } } @@ -71,7 +71,7 @@ void cf_check perfc_printall(unsigned char key) for ( k = 0; k < perfc_info[i].nr_elements; k++ ) sum += counters[k]; } - if ( perfc_info[i].type == TYPE_S_ARRAY ) + if ( perfc_info[i].type == TYPE_S_ARRAY ) sum = (perfc_t) sum; printk("TOTAL[%12Lu]", sum); if (sum) @@ -82,7 +82,7 @@ void cf_check perfc_printall(unsigned char key) sum = 0; for_each_online_cpu ( cpu ) sum += per_cpu(perfcounters, cpu)[j + k]; - if ( perfc_info[i].type == TYPE_S_ARRAY ) + if ( perfc_info[i].type == TYPE_S_ARRAY ) sum = (perfc_t) sum; if ( (k % 4) == 0 ) printk("\n%16s", ""); @@ -98,7 +98,7 @@ void cf_check perfc_printall(unsigned char key) sum = 0; for ( n = 0; n < perfc_info[i].nr_elements; n++ ) sum += counters[n]; - if ( perfc_info[i].type == TYPE_S_ARRAY ) + if ( perfc_info[i].type == TYPE_S_ARRAY ) sum = (perfc_t) sum; if ( k > 0 && (k % 4) == 0 ) printk("\n%53s", ""); diff --git a/xen/include/xen/perfc.h b/xen/include/xen/perfc.h index 324b47665573..bf0eb032f7a9 100644 --- a/xen/include/xen/perfc.h +++ b/xen/include/xen/perfc.h @@ -8,24 +8,24 @@ /* * NOTE: new counters must be defined in perfc_defn.h - * + * * Counter declarations: * PERFCOUNTER (counter, string) define a new performance counter * PERFCOUNTER_ARRAY (counter, string, size) define an array of counters - * + * * Unlike counters, status variables do not reset: * PERFSTATUS (counter, string) define a new performance stauts * PERFSTATUS_ARRAY (counter, string, size) define an array of status vars - * - * unsigned long perfc_value (counter) get value of a counter + * + * unsigned long perfc_value (counter) get value of a counter * unsigned long perfc_valuea (counter, index) get value of an array counter - * unsigned long perfc_set (counter, val) set value of a counter + * unsigned long perfc_set (counter, val) set value of a counter * unsigned long perfc_seta (counter, index, val) set value of an array counter - * void perfc_incr (counter) increment a counter + * void perfc_incr (counter) increment a counter * void perfc_decr (counter) decrement a status - * void perfc_incra (counter, index) increment an array counter - * void perfc_add (counter, value) add a value to a counter - * void perfc_adda (counter, index, value) add a value to array counter + * void perfc_incra (counter, index) increment an array counter + * void perfc_add (counter, value) add a value to a counter + * void perfc_adda (counter, index, value) add a value to array counter * void perfc_print (counter) print out the counter */ @@ -49,7 +49,6 @@ enum { #undef PERFSTATUS_ARRAY typedef unsigned int perfc_t; -#define PRIperfc "" DECLARE_PER_CPU(perfc_t[NUM_PERFCOUNTERS], perfcounters); @@ -72,7 +71,7 @@ DECLARE_PER_CPU(perfc_t[NUM_PERFCOUNTERS], perfcounters); this_cpu(perfcounters)[PERFC_ ## x + (y)] = (v) : (v) ) /* - * Histogram: special treatment for 0 and 1 count. After that equally spaced + * Histogram: special treatment for 0 and 1 count. After that equally spaced * with last bucket taking the rest. */ #ifdef CONFIG_PERF_ARRAYS @@ -98,7 +97,7 @@ int perfc_control(struct xen_sysctl_perfc_op *pc); extern void cf_check perfc_printall(unsigned char key); extern void cf_check perfc_reset(unsigned char key); - + #else /* CONFIG_PERF_COUNTERS */ #define perfc_value(x) (0) From patchwork Thu Jan 2 19:25:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 13924898 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 lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 5D8CAE77188 for ; Thu, 2 Jan 2025 19:25:29 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.864434.1275689 (Exim 4.92) (envelope-from ) id 1tTQor-00045e-2X; Thu, 02 Jan 2025 19:25:21 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 864434.1275689; Thu, 02 Jan 2025 19:25:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tTQoq-00045N-UC; Thu, 02 Jan 2025 19:25:20 +0000 Received: by outflank-mailman (input) for mailman id 864434; Thu, 02 Jan 2025 19:25:20 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tTQoq-0002q0-7z for xen-devel@lists.xenproject.org; Thu, 02 Jan 2025 19:25:20 +0000 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [2a00:1450:4864:20::431]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4d1df72f-c93f-11ef-99a4-01e77a169b0f; Thu, 02 Jan 2025 20:25:18 +0100 (CET) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-385e27c75f4so8304170f8f.2 for ; Thu, 02 Jan 2025 11:25:18 -0800 (PST) Received: from andrewcoop.lan ([83.105.36.37]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c6ad3e3sm40212825f8f.0.2025.01.02.11.25.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jan 2025 11:25:16 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 4d1df72f-c93f-11ef-99a4-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1735845917; x=1736450717; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oZLrD2169y0WiqxGQqlgUiS8PafeeieTdE5/BAHflvs=; b=TZXc16wvXbyRAA4Yv4freQfdq27uDadvylYsP22S34kH9CTtRBJivst7gO2iSUYiG/ 7P6FVXDUVwU9iMKqcGXRAsOMFgaI2A6bZYxF23iSSEQ88Ot5/s35IscD2o1sUUJD8yvu SufsVL9Cj4m2EQ5tQ+VzBIyRSwlylfkHT4QYs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735845917; x=1736450717; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oZLrD2169y0WiqxGQqlgUiS8PafeeieTdE5/BAHflvs=; b=L5RflT07VZsqJPkwWcmy61MvZV4KlC2COu5p9giokZmDY8GKTugPo6CfryjDPFSgx0 TLMxjSNHBi/Dt83HLa/yEJgvHqKp0hU8GabrWIAtfV/AcCSwxYLlGqyAOjJf7/ut5UgM tlPZlFEVlox2beK+avGuEsCwtioxGn+JOXeVmZjs4qWQGWy0asIfnMSMQMz8VOqrNDKG 4Xh73qRmD10mLr7NaZ0lqryGjiDV4iAk66myymc032F186MJcX+PPIvLyj2Kc/y6NolV SF3ZIEd1xyNceC5qJ8l+8cj2NXjdipA2Q+Pb6bl56eBMpD5HpNDWHX20qq0mVlnClg70 yEIw== X-Gm-Message-State: AOJu0Yy1n7LCpPfA/5XLTH8yquKv4dxkT3fkMAFsBoLy+O3fODm2jr0w fCeXW6XDqEtLzyCwOM9T/h21u+my0TPxexq1QiU6YQv4i1IA1MCjQOqs5byw0mlIef0d3jmA7F7 LRNYFIw== X-Gm-Gg: ASbGncsFzwLktojJGTKrFXg379rjKvpeR9nBBXs8eo8A9ZOAxwy2yBLI2clKEHCF6MG vZzGSNM+Q6dk1F9tA3wIUvpOHULZIloih07UyUF95ScRb/jTwBMo4x+7F/ZzPSsPFw1bIvgZnS5 /c5BbiuCAhe+KUStUyz69Ap2xgQOqOKi0JQeACle/a7226N8y9QrTcUJef/akUIrmEpKMxe/RcT lVoxK+Rb0U6FPWBWRSXdPoFdaiJHp2wHLQdHAro8Wj6eGUiJZb8hWAZkAdolXN5qQ== X-Google-Smtp-Source: AGHT+IGtGn+pb2aQvViqmRl5HdkbgQA0Wu/uDMVIbBVk/klXZ0Ms+zL+XT5rY3cwHrsVqMdi45a+ag== X-Received: by 2002:a5d:6da3:0:b0:388:c61d:43e0 with SMTP id ffacd0b85a97d-38a223feb92mr34043638f8f.48.1735845917637; Thu, 02 Jan 2025 11:25:17 -0800 (PST) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper Subject: [PATCH 5/5] xen/perfc: COMPILE TEST Date: Thu, 2 Jan 2025 19:25:08 +0000 Message-Id: <20250102192508.2405687-6-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250102192508.2405687-1-andrew.cooper3@citrix.com> References: <20250102192508.2405687-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 --- xen/Kconfig.debug | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug index c4a8d86912e0..9bc4eb2df353 100644 --- a/xen/Kconfig.debug +++ b/xen/Kconfig.debug @@ -60,18 +60,12 @@ config DEBUG_LOCKS checks will be performed when acquiring and releasing locks. config PERF_COUNTERS - bool "Performance Counters" - help - Enables software performance counters that allows you to analyze - bottlenecks in the system. To access this data you can use serial - console to print (and reset) using 'p' and 'P' respectively, or - the 'xenperf' tool. + bool + default y config PERF_ARRAYS - bool "Performance Counter Array Histograms" - depends on PERF_COUNTERS - help - Enables software performance counter array histograms. + bool + default y config VERBOSE_DEBUG From patchwork Thu Jan 2 19:55:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 13924917 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 lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 0C864E77188 for ; Thu, 2 Jan 2025 19:55:31 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.864502.1275732 (Exim 4.92) (envelope-from ) id 1tTRHp-0004XW-QD; Thu, 02 Jan 2025 19:55:17 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 864502.1275732; Thu, 02 Jan 2025 19:55:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tTRHp-0004XP-Nl; Thu, 02 Jan 2025 19:55:17 +0000 Received: by outflank-mailman (input) for mailman id 864502; Thu, 02 Jan 2025 19:55:16 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tTRHo-0004XJ-My for xen-devel@lists.xenproject.org; Thu, 02 Jan 2025 19:55:16 +0000 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [2a00:1450:4864:20::332]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 7bfeb9d1-c943-11ef-a0dc-8be0dac302b0; Thu, 02 Jan 2025 20:55:15 +0100 (CET) Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4361b6f9faeso70825855e9.1 for ; Thu, 02 Jan 2025 11:55:15 -0800 (PST) Received: from andrewcoop.lan ([83.105.36.37]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43661218f43sm464573605e9.19.2025.01.02.11.55.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jan 2025 11:55:13 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 7bfeb9d1-c943-11ef-a0dc-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1735847714; x=1736452514; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=c5n8WWdcErArPqimG8AinQbYQjSFsYmY7A9DbyTjRXI=; b=OEo5c32YEwIfbOexo+d5gAZlkjw99sjNw0yWX/83b2qojulpzJuD2cW0Zrxc3DJ+FP bCl8IDvuLouE+ZrOb5Zrg7wpIPmORhrgnHfZ7xMEY6DI7+3KSnLAVRdPvuR16fj0HaOA CGqraygo6Y1A62h0mLM091DttOYWoUkWdOsp8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735847714; x=1736452514; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c5n8WWdcErArPqimG8AinQbYQjSFsYmY7A9DbyTjRXI=; b=YHDYUNJ+IIOnHKcqODUU09iQBYhdo6A7CCLkMB/gooPaIIZUQONGPFd4YzXt0H6ADx LLdj4bVGw9z5jssWfCJ1rPYdKs9Ut6XAdiDv0J+3bnJRMgNH8uCYu5+WhGgDduIiKEZW Wn2rWLSmQMjYG1SldA7FjiHCgVFoo6zwYTEdLigRQZ3uIQ/0s/rI+9oYKH/gnSUdIo7g uDOtIzNsf2g4uLm6JiDxFOS6WGI+mUZl4mMpPHNHGQe5mVSJeWUJ8cXc5zNtIwGni/zv LnDQO36h7DcH63erB24Sa0q6l5Ni2FlWAv/K+ub1IQ19RWvERzM7/OiVbCYVhqsJtqHZ JkVg== X-Gm-Message-State: AOJu0Yxxae7GHJvLv9lggKI6fDXfAaSzo/CWoFGths6QXGPFP+13+ZYF AxHg92nmTl196QosbPN6sBgaLRVIIYyL6las4X3YHp8VLCqiS2mHt+YSiQEy9YCV7lun7iG5aYM cSvqLGQ== X-Gm-Gg: ASbGncsiVcLtgrAQXE5dFkQDDTxcBGfAWSFYyxa4v5Ssp+IqfqY2gcaoZh5k7nVcdQX yEArbG8NkOnxnmWzNW6pJMoOw37cVpKRqt+YV5lZSd0xHr6J7GxYYPdTixqOjpqBhEQDxwTAIod Fhk3f2IPOtarA7MDfZ5tlIxcoWFDtyuORtNMHZpuxPq7Mg3zUwVYqY38VoLd9l+9T0pqd6Q01WQ wb0T3Ya+24c7EKpb19vr7IzCZRFXvTm7qsXD4EtIxjUjf/DkywdeajFAVjnEFG7kg== X-Google-Smtp-Source: AGHT+IGr9aynI0zhfp6KT+M7K4PloFwF5SoM95V/wrrXsOI2+JT1UJZiJWIn9qDjYAkJtiCxRMj3Ew== X-Received: by 2002:a05:600c:6d3:b0:436:199e:8458 with SMTP id 5b1f17b1804b1-4365c79ad57mr418822375e9.14.1735847714411; Thu, 02 Jan 2025 11:55:14 -0800 (PST) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Subject: [PATCH 6/4] x86/pv: Fix build with Clang and CONFIG_PERF_COUNTERS Date: Thu, 2 Jan 2025 19:55:12 +0000 Message-Id: <20250102195512.2406928-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250102192508.2405687-1-andrew.cooper3@citrix.com> References: <20250102192508.2405687-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Clang, of at least verion 17 complains: arch/x86/pv/hypercall.c:30:10: error: variable 'eax' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] 30 | if ( !compat ) | ^~~~~~~ arch/x86/pv/hypercall.c:87:29: note: uninitialized use occurs here 87 | perfc_incra(hypercalls, eax); | ^~~ This function is forced always_inline to cause compat to be constant-propagated through, but that is only a heuristic to try and get the compiler to do what we want, not a gurantee that it does. Clang doesn't appear to be able to see that the only case where compat is true (and therefore the if() is false) is when there's an else clause on the end which sets eax too. Initialise eax to -1, which ought to be optimised out, but if for whatever reason it happens not to be, then perfc_incra() will fail it's bounds check and do nothing. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Jan Beulich CC: Roger Pau Monné --- xen/arch/x86/pv/hypercall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: a1746cd4434dd27ca2da8430dfb10edc76264bb3 prerequisite-patch-id: c0c647c3d465fc11e039b5de751da060f2599fff prerequisite-patch-id: 675a622887bb1721684e574fc7755af79463f67b prerequisite-patch-id: 4bc07a7aa6e0f769ed7c89dc56db25091d810760 prerequisite-patch-id: b23c07e16495387ee6cb70edcbcb13f6b42246ac prerequisite-patch-id: fe09857284f3a17ff116de1f0a20d3916e8dda90 diff --git a/xen/arch/x86/pv/hypercall.c b/xen/arch/x86/pv/hypercall.c index 2febade44b73..17581d232e19 100644 --- a/xen/arch/x86/pv/hypercall.c +++ b/xen/arch/x86/pv/hypercall.c @@ -21,7 +21,7 @@ static void always_inline _pv_hypercall(struct cpu_user_regs *regs, bool compat) { struct vcpu *curr = current; - unsigned long eax; + unsigned long eax = -1; /* Clang -Wsometimes-uninitialized */ ASSERT(guest_kernel_mode(curr, regs));