From patchwork Mon Nov 6 11:03:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 741343 Delivered-To: patch@linaro.org Received: by 2002:adf:fd90:0:b0:32d:baff:b0ca with SMTP id d16csp1027596wrr; Mon, 6 Nov 2023 03:19:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IHxgFVEKA6Z31ZuzgduMuEAiRQriX9YuIUyUF+qnvVzwRMpJ5msJG+jPctXCGw2CZSk4SOI X-Received: by 2002:a25:bf8c:0:b0:d9a:3c58:6ba9 with SMTP id l12-20020a25bf8c000000b00d9a3c586ba9mr25158509ybk.44.1699269540730; Mon, 06 Nov 2023 03:19:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699269540; cv=none; d=google.com; s=arc-20160816; b=GwM5Ymx1S1C1JFln3y1/hjy4x89GQtsESBPTmnM7nJCd9sCFFDooCK5AHXKQu7mbCG dXW2yGHsb3L5nHLaVfMCdHe2LpEOCQjMIFB2Qxi3QgFk6NM/+OFZzJEwiS2PlJj/crMe W0AiTugjryhJZxmXuE/d3UKb+GRwQnTSvaWANv60wJTpCzolGiJ8wxNGuzby9sAJKvOb gfTcsz/hnHciHaXXyne8dRoa4N5o8pnzRll0mOQrhCkPqfr0PVu3+zh4rcXGwl3X3ao7 kQABE7iDQ/1QX/C2LKiBnhXV069ccNR1hM4OEiXh3eEl8cNJuSqChYWMj3InUX5O/ZGK Mv1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pKMRzxqRYnKl/hVlIV0E2OCjWVD0Ib40S0FzpaLqDMw=; fh=L/qhuroVb3tR3NWg0+vDnGF1gMzkfjqMVSG/Df3vR+k=; b=egrUpBHrJj6whhplTYyt0NUB2tNx9DqPQlOvpaq3aKf/s/EAKArAIwHqFiJh5edHya 5vZkX8qPga+XCWK1tPGJPQQIaEb1jF8vrhzh81fBBmE9o1Z5N3iurt2AGPcT9VNYqYvF yBZ8mwhD6X/kp1UPXv40WXUPRiMvQZjwfTnSKTirZ2PobCP9Z2Z5sear6UEU484sSO2q LdMyw9P8c0vGL05lErwlvUM790Ad7dofEdeetqFsS9m5mI7neQ+fGF+RV0vOhEquB+x7 JmlYViygE0tSM2X0YIRF+IzHhLKcG76SvfNw4zaFP1ZTfaQr1KEFiTA1WcQLPq9/2eEy 5UCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NKSYDOvu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id du3-20020a05621409a300b0067089696291si5401741qvb.425.2023.11.06.03.19.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Nov 2023 03:19:00 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NKSYDOvu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxTK-0006lW-Nl; Mon, 06 Nov 2023 06:08:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qzxTB-0006Y8-GC for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:08:37 -0500 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxT9-0005CT-Dc for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:08:37 -0500 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-507962561adso5645149e87.0 for ; Mon, 06 Nov 2023 03:08:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268913; x=1699873713; darn=nongnu.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=pKMRzxqRYnKl/hVlIV0E2OCjWVD0Ib40S0FzpaLqDMw=; b=NKSYDOvuhkJsddQPlbYAg46fie7ZY7IY5Ht9U/fAf10ILiDj/rBGdwnxqJ+xTGdY3L oA5YZUrKsTEfFCzewum3zugwX7+BujAHKPuZHNDvpSbR1eYrQpxMv3/L8MzY3Jiej9MW tzlsN+BmMUYWjnPeJXDqklmLQq3XgCH4dtqzku8tYhAcucRYv8KhbISavJwuOgID4kyz 1kCWBo3kT4NRdP0uxFxnhyEQtiVpxee/vGYAJwFwVqBTjx/RxQSFVexM1qiLGAH6aiKd apP2Da7X0FQleXSp88WP7pSIn7Fb9zu/VlnqL3EPKiboBVXR6DrfYNUlHN7Ny8i6PnnG v1EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268913; x=1699873713; 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=pKMRzxqRYnKl/hVlIV0E2OCjWVD0Ib40S0FzpaLqDMw=; b=TX38Wh4AnD1Fjkh97+cSO3PHxhYiSdTh1Zw+1jqA7KXfc42xTKbSy2H0LbWQjApX7D s9ZYJsCu/JsfB5yXkmelaa3ybmW3frZcOQu2oVE96nZGnWulImueIhhzrjGU3XXRU1od BSgRGhuUp+kM58oQjXz2HZDciKR0Vf6OPLU2Qdg2AndMeOeOMMNJCI315vgp0OtOW9V7 cPYh56bHZdFYyzHbBM7yVG6VwRPTr1QwJzje92c0AUnFq67UE2adi6REizOqgrhAa/C+ HfsD6kRTYYQhn0YQvlkV7ywMBWZaA5C/JxCCIdXqghSdXdcSD8sgRaYNE2nF0TUn/6r1 1NWw== X-Gm-Message-State: AOJu0YwqZFMBJsxPn1XULcPyiL+eMMZs1tCcL48sNrZfQs5UVs+bu1VM g2k9C6fXw+0eplWNGLPR92Iteg88hNtY2Vi3R1Q= X-Received: by 2002:ac2:5e6d:0:b0:504:4165:54ab with SMTP id a13-20020ac25e6d000000b00504416554abmr19292506lfr.56.1699268913486; Mon, 06 Nov 2023 03:08:33 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id k8-20020a05600c1c8800b004081a011c0esm11883242wms.12.2023.11.06.03.08.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:08:33 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Yanan Wang , Xiaoyao Li , Babu Moger , Yongwei Ma , "Michael S . Tsirkin" , Marcel Apfelbaum Subject: [PULL 43/60] hw/i386: Fix comment style in topology.h Date: Mon, 6 Nov 2023 12:03:15 +0100 Message-ID: <20231106110336.358-44-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=philmd@linaro.org; helo=mail-lf1-x133.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Zhao Liu For function comments in this file, keep the comment style consistent with other files in the directory. Signed-off-by: Zhao Liu Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Yanan Wang Reviewed-by: Xiaoyao Li Reviewed-by: Babu Moger Tested-by: Babu Moger Tested-by: Yongwei Ma Acked-by: Michael S. Tsirkin Message-ID: <20231024090323.1859210-2-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/i386/topology.h | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/include/hw/i386/topology.h b/include/hw/i386/topology.h index 380cb27ded..d4eeb7ab82 100644 --- a/include/hw/i386/topology.h +++ b/include/hw/i386/topology.h @@ -24,7 +24,8 @@ #ifndef HW_I386_TOPOLOGY_H #define HW_I386_TOPOLOGY_H -/* This file implements the APIC-ID-based CPU topology enumeration logic, +/* + * This file implements the APIC-ID-based CPU topology enumeration logic, * documented at the following document: * Intel® 64 Architecture Processor Topology Enumeration * http://software.intel.com/en-us/articles/intel-64-architecture-processor-topology-enumeration/ @@ -41,7 +42,8 @@ #include "qemu/bitops.h" -/* APIC IDs can be 32-bit, but beware: APIC IDs > 255 require x2APIC support +/* + * APIC IDs can be 32-bit, but beware: APIC IDs > 255 require x2APIC support */ typedef uint32_t apic_id_t; @@ -58,8 +60,7 @@ typedef struct X86CPUTopoInfo { unsigned threads_per_core; } X86CPUTopoInfo; -/* Return the bit width needed for 'count' IDs - */ +/* Return the bit width needed for 'count' IDs */ static unsigned apicid_bitwidth_for_count(unsigned count) { g_assert(count >= 1); @@ -67,15 +68,13 @@ static unsigned apicid_bitwidth_for_count(unsigned count) return count ? 32 - clz32(count) : 0; } -/* Bit width of the SMT_ID (thread ID) field on the APIC ID - */ +/* Bit width of the SMT_ID (thread ID) field on the APIC ID */ static inline unsigned apicid_smt_width(X86CPUTopoInfo *topo_info) { return apicid_bitwidth_for_count(topo_info->threads_per_core); } -/* Bit width of the Core_ID field - */ +/* Bit width of the Core_ID field */ static inline unsigned apicid_core_width(X86CPUTopoInfo *topo_info) { return apicid_bitwidth_for_count(topo_info->cores_per_die); @@ -87,8 +86,7 @@ static inline unsigned apicid_die_width(X86CPUTopoInfo *topo_info) return apicid_bitwidth_for_count(topo_info->dies_per_pkg); } -/* Bit offset of the Core_ID field - */ +/* Bit offset of the Core_ID field */ static inline unsigned apicid_core_offset(X86CPUTopoInfo *topo_info) { return apicid_smt_width(topo_info); @@ -100,14 +98,14 @@ static inline unsigned apicid_die_offset(X86CPUTopoInfo *topo_info) return apicid_core_offset(topo_info) + apicid_core_width(topo_info); } -/* Bit offset of the Pkg_ID (socket ID) field - */ +/* Bit offset of the Pkg_ID (socket ID) field */ static inline unsigned apicid_pkg_offset(X86CPUTopoInfo *topo_info) { return apicid_die_offset(topo_info) + apicid_die_width(topo_info); } -/* Make APIC ID for the CPU based on Pkg_ID, Core_ID, SMT_ID +/* + * Make APIC ID for the CPU based on Pkg_ID, Core_ID, SMT_ID * * The caller must make sure core_id < nr_cores and smt_id < nr_threads. */ @@ -120,7 +118,8 @@ static inline apic_id_t x86_apicid_from_topo_ids(X86CPUTopoInfo *topo_info, topo_ids->smt_id; } -/* Calculate thread/core/package IDs for a specific topology, +/* + * Calculate thread/core/package IDs for a specific topology, * based on (contiguous) CPU index */ static inline void x86_topo_ids_from_idx(X86CPUTopoInfo *topo_info, @@ -137,7 +136,8 @@ static inline void x86_topo_ids_from_idx(X86CPUTopoInfo *topo_info, topo_ids->smt_id = cpu_index % nr_threads; } -/* Calculate thread/core/package IDs for a specific topology, +/* + * Calculate thread/core/package IDs for a specific topology, * based on APIC ID */ static inline void x86_topo_ids_from_apicid(apic_id_t apicid, @@ -155,7 +155,8 @@ static inline void x86_topo_ids_from_apicid(apic_id_t apicid, topo_ids->pkg_id = apicid >> apicid_pkg_offset(topo_info); } -/* Make APIC ID for the CPU 'cpu_index' +/* + * Make APIC ID for the CPU 'cpu_index' * * 'cpu_index' is a sequential, contiguous ID for the CPU. */