Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp3990rdb; Fri, 5 Jan 2024 00:11:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IF7Odq+ke2CUo3PnlVwHF0AFm595YeUwEQBA1m55lGxM2aJay/46yrfyBNKzZjXre3ECPYv X-Received: by 2002:a05:622a:188f:b0:429:79ec:3805 with SMTP id v15-20020a05622a188f00b0042979ec3805mr218827qtc.27.1704442314104; Fri, 05 Jan 2024 00:11:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1704442314; cv=pass; d=google.com; s=arc-20160816; b=qFn5Hs66FgjW37qucY0K94AN7kpAwthUSDWFrg0LafA0o7qydOkxci4Pl0gf8BOKG0 EPOwxC2UJsPKcx8qtVdh0XD5OmDqHOKQO4Mq3A/LQRaFe7fGA43x39yu07HCnm4hox44 d3o8hycucqcmXydeIQa7qXLFYb+TGYPkvrtfzHLCqbua/Xzz8urg41foiCoxg1ORDpK9 pN3AKI5dhEiSoJkmvJonVb7SZyspvJcZs5k+q7UN2xrASfjRsNkZKFmXr96L46WkcgJ2 mXtsjCa1XSQvO49QX5k4ET/fp7K7pGhuWy1DudjvFnxhlGD0hAN9J4lE+5AFAXL+/JOo w48w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:date:message-id:dkim-signature; bh=7q7/fxCt7v5+44uSzIt82Al53/r2GxODBBASIP4y8wM=; fh=S1qif/qFEcIMPCGvLIy2c8mL3xyxE7sdhkuXmqzrqm8=; b=u23cGaBgeIL+KJlpG42CsflvCIMNOG2P6Jc8utSTvnxp36S5wzQTJ4ILMLLJakK5Qp DTNJTYbzb8/n/dsc68iXFaMvoItCvDdNlNBnNfhAYMNsqwUeYVsodgmGitAs7+XlD2T3 HC42FTbZB7yk8u2lTM/Z6FTfU94m5SJYmZYzJ4uzmUgzgeqLykTLI5Hx5hFwYWH1K1kF veIn6zQ8tpNp3fLtO2U1t4wEadEyQVlsyDrwp8k236YYczm25aW0+Vb6J7lmQmveA9My A2a3l9lXfoKHrolTH9QS9h5UU/Lh98zSPlvdUeum1BkyEpEmfdO4t6pzqJE/oHDqZoKs 6Rjg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=3ismFYYL; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel+bounces-17571-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17571-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id i9-20020ac85e49000000b0042582c72ef8si1285927qtx.626.2024.01.05.00.11.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 00:11:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17571-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=3ismFYYL; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel+bounces-17571-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17571-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id CAE851C22B25 for ; Fri, 5 Jan 2024 08:11:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5331820325; Fri, 5 Jan 2024 08:10:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="3ismFYYL" X-Original-To: linux-kernel@vger.kernel.org Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2045.outbound.protection.outlook.com [40.107.94.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8C6120310 for ; Fri, 5 Jan 2024 08:10:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f6JD+FOfaCnMyfNIq2VirXuxp4QSiYZW5P/xxOVetfFN5Nfx+uWNValeT009h/BZ2Sx+jsf5dviinDGVVAp+uiH3mqp5LovkxCuuRv0F3B/k395cW/VdmFQJ/+8ehrabDVYJ3pxG0UYPyV8OiLu33+wgBe0kQKzIa1a9PNFRlq3r4pHiqtj2VB9qtxkVzonBWEsIjRWIY4RusN+Mum/K2nAidw6Z94UnqPNliP3AuNzf8Cade5aX8R2Ut9TNbiYRq1iv2DzKf/X8svABq30TWgcuOAVGhzGpX423I49MeFPVUl7sabDAf4NpGoPSk1A5nvQ4+n2zhtWJvc4pLaVaRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7q7/fxCt7v5+44uSzIt82Al53/r2GxODBBASIP4y8wM=; b=I3ctnl5i9WCREBoKoxelT0uXL3q5+HfWTd3tTTPo3ZagRS3XsXaUyVo7meLod4eL4xccmHnBLhpaQx+yvpLfu+H4WA4iVGiHJAsObiMOXsw/jRU+eC9j6UgugPPRvkrwVqTT38wc8g3foj/6svzlE2Jr3ek/cfPUyjnGcrsSQULx7jvecvR51yfQyoymKCPruYDxvAXUJiGjKRpb+IraDVIPZ7d71to8f6OtAoQfrjySAqfYjwLQTbMDfAJ4sXSlV9gMBUBFAxqfsyGHq0uPiY7jlmI61J1QF3tbW9+13G5BjJvu9WjkwG9115u6IJiD7GT+jkUI/6Z1FDpwMUJf2w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7q7/fxCt7v5+44uSzIt82Al53/r2GxODBBASIP4y8wM=; b=3ismFYYL1Zsgr8BihngAUWAFvihBy3YL+ePtB8tyMU8pIUfolCYT4oZXih5YxDou5Kfkx0ZkURJ2zhZOj8KRd957P2bVvCqXa302pTgYD75Z5wi/t416n6eHWbWcaT3jKWmyRGMIyUeZ1ZEkvzTEWqtvZpIj0uleFPLVjehZMr4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from PH7PR12MB5712.namprd12.prod.outlook.com (2603:10b6:510:1e3::13) by BL1PR12MB5190.namprd12.prod.outlook.com (2603:10b6:208:31c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.16; Fri, 5 Jan 2024 08:10:51 +0000 Received: from PH7PR12MB5712.namprd12.prod.outlook.com ([fe80::f630:ed7b:bbd9:1d56]) by PH7PR12MB5712.namprd12.prod.outlook.com ([fe80::f630:ed7b:bbd9:1d56%3]) with mapi id 15.20.7159.013; Fri, 5 Jan 2024 08:10:51 +0000 Message-ID: Date: Fri, 5 Jan 2024 13:40:42 +0530 User-Agent: Mozilla Thunderbird Subject: Re: arch/x86/events/amd/uncore.c:941:52: error: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 8 To: kernel test robot Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, Peter Zijlstra References: <202401051554.teOdw8yt-lkp@intel.com> Content-Language: en-US From: Sandipan Das In-Reply-To: <202401051554.teOdw8yt-lkp@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PN3PR01CA0030.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:97::21) To PH7PR12MB5712.namprd12.prod.outlook.com (2603:10b6:510:1e3::13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR12MB5712:EE_|BL1PR12MB5190:EE_ X-MS-Office365-Filtering-Correlation-Id: 365215aa-7337-48a1-31ff-08dc0dc5d504 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vwVgZJ1P45LpifVQ+OvhsK2/Ky6lVucs0cCBJyO6XmKD5+X1V5TkLaA6FWjBXfNmv7gkJPUTKb1/WC/490jX2UY0aqIEAEsBsXqksfnl0XgIRhNjTzxepivMp5c54JyYDi3MGg0N4bGozmAWtWe9IYB8uPQwlc5AVq0AIb6IJFSK7CmQeM/UygWVdCxgZl4FrYRtG/5p7Y1n2CLZU/BeV7XpIxIvjFFsX3gpnbzLS+PToAEQFl0PuGEqstM599Vclw1rNfpJAosqIi03O0D9xnujW9Wq1IHaAv20wN1fy6m/VQIoSxM9/Sr956hh+Je5OGh+8S7JZA1vR7jRp5aiN1UHzcu0sz3rdYcUmxJfROzR38LiHyXNRdkYKiqnvRCsO+uKoY027fI4szVAYFlEvRmvbIUq4djfq/UeokxFCKzRwzC2YzdS29JnWWuHLImPNtHpx0byxpkGfElbaW9jT4j3hp522RyVQiE7wlmsl7b0OGe+RpVRAUOC3rhcvYPL3rM/ZwE3SuYRQ6Og0cWWLx7FUP8Vn8Ga+rB53+kI/M6sc8YnQC+leL6vVIXy5cq/mZcgH3y8eos/zW3D+KjKo2OUj3IyRmZE1Ztu3QBQvymv+/hH6gc/u82D5Aw6jBi9pRvs/kCXxiewyS1VX6etmOJh/UHRMvlyVMgbzQqOqtU= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR12MB5712.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(396003)(136003)(366004)(376002)(39860400002)(230273577357003)(230173577357003)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(83380400001)(31686004)(86362001)(478600001)(966005)(6512007)(53546011)(41300700001)(6666004)(6506007)(31696002)(44832011)(2616005)(5660300002)(2906002)(6486002)(316002)(6916009)(36756003)(66556008)(66476007)(66946007)(8676002)(8936002)(4326008)(38100700002)(26005)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?OC9DRU10cEJVNkFrSWd2SmV2M0kwU3lTNnBQdis5c0tSSzdPVVdkZVdMQmNT?= =?utf-8?B?NXRRYy9JZHA5QjdBZXBtazNDdFZydHdOM1lLZEZtSCtqVmsxaDRxcmo2dkk1?= =?utf-8?B?NXQvRzBUVGFLWlZvb2MxV0U2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cU0vdVJGemVMakN1YjgzcHJEclgvdUtkRzh2VFBQb1E3UHEyTDJSUTc5?= =?utf-8?B?WkJ1Qkx3UHlPOE0zdytZWkJ3SUdvak8vOUJXcDhnVGJLZHNWeW8vVE9KeTBD?= =?utf-8?B?OExDQzEzYzN4SE9RelRnT1hGck0rY0ltQit5M0Z0aEV1MFJWcll2K0pwcTNL?= =?utf-8?Q?+JSeGDJoDqkaeXd1Fr00iTr98?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 365215aa-7337-48a1-31ff-08dc0dc5d504 X-MS-Exchange-CrossTenant-AuthSource: PH7PR12MB5712.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2024 08:10:51.6791 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RywVsfptkGKgqn4EXbTsDKjKpD2nujw3qNGmrOhtaMubxXyVJW0S1DZaviruPX4N+ErOezr60Lw8UImJ6NF+Fw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5190 Hi, On 1/5/2024 1:20 PM, kernel test robot wrote: > Hi Sandipan, > > FYI, the error/warning still remains. > The active UMCs in a socket are represented by a 32 bit mask coming from CPUID 0x80000022 ECX. Since there are at most 2 sockets in a system, the maximum number of UMCs will not exceed 64. This fits in pmu->name. While there may be SKUs in the future having more UMCs, the number is not expected to be larger than a 7 digit integer. - Sandipan > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > head: 1f874787ed9a2d78ed59cb21d0d90ac0178eceb0 > commit: 25e56847821f7375bdee7dae1027c7917d07ce4b perf/x86/amd/uncore: Add memory controller support > date: 3 months ago > config: x86_64-sof-customedconfig-avs-defconfig (https://download.01.org/0day-ci/archive/20240105/202401051554.teOdw8yt-lkp@intel.com/config) > compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0 > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240105/202401051554.teOdw8yt-lkp@intel.com/reproduce) > > If you fix the issue in a separate patch/commit (i.e. not just a new version of > the same patch/commit), kindly add following tags > | Reported-by: kernel test robot > | Closes: https://lore.kernel.org/oe-kbuild-all/202401051554.teOdw8yt-lkp@intel.com/ > > All errors (new ones prefixed by >>): > > arch/x86/events/amd/uncore.c: In function 'amd_uncore_umc_ctx_init': >>> arch/x86/events/amd/uncore.c:941:52: error: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 8 [-Werror=format-truncation=] > snprintf(pmu->name, sizeof(pmu->name), "amd_umc_%d", index); > ^~ > arch/x86/events/amd/uncore.c:941:43: note: directive argument in the range [0, 2147483647] > snprintf(pmu->name, sizeof(pmu->name), "amd_umc_%d", index); > ^~~~~~~~~~~~ > arch/x86/events/amd/uncore.c:941:4: note: 'snprintf' output between 10 and 19 bytes into a destination of size 16 > snprintf(pmu->name, sizeof(pmu->name), "amd_umc_%d", index); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > cc1: all warnings being treated as errors > > > vim +941 arch/x86/events/amd/uncore.c > > 900 > 901 static > 902 int amd_uncore_umc_ctx_init(struct amd_uncore *uncore, unsigned int cpu) > 903 { > 904 DECLARE_BITMAP(gmask, UNCORE_GROUP_MAX) = { 0 }; > 905 u8 group_num_pmus[UNCORE_GROUP_MAX] = { 0 }; > 906 u8 group_num_pmcs[UNCORE_GROUP_MAX] = { 0 }; > 907 union amd_uncore_info info; > 908 struct amd_uncore_pmu *pmu; > 909 int index = 0, gid, i; > 910 > 911 if (pmu_version < 2) > 912 return 0; > 913 > 914 /* Run just once */ > 915 if (uncore->init_done) > 916 return amd_uncore_ctx_init(uncore, cpu); > 917 > 918 /* Find unique groups */ > 919 for_each_online_cpu(i) { > 920 info = *per_cpu_ptr(uncore->info, i); > 921 gid = info.split.gid; > 922 if (test_bit(gid, gmask)) > 923 continue; > 924 > 925 __set_bit(gid, gmask); > 926 group_num_pmus[gid] = hweight32(info.split.aux_data); > 927 group_num_pmcs[gid] = info.split.num_pmcs; > 928 uncore->num_pmus += group_num_pmus[gid]; > 929 } > 930 > 931 uncore->pmus = kzalloc(sizeof(*uncore->pmus) * uncore->num_pmus, > 932 GFP_KERNEL); > 933 if (!uncore->pmus) { > 934 uncore->num_pmus = 0; > 935 goto done; > 936 } > 937 > 938 for_each_set_bit(gid, gmask, UNCORE_GROUP_MAX) { > 939 for (i = 0; i < group_num_pmus[gid]; i++) { > 940 pmu = &uncore->pmus[index]; > > 941 snprintf(pmu->name, sizeof(pmu->name), "amd_umc_%d", index); > 942 pmu->num_counters = group_num_pmcs[gid] / group_num_pmus[gid]; > 943 pmu->msr_base = MSR_F19H_UMC_PERF_CTL + i * pmu->num_counters * 2; > 944 pmu->rdpmc_base = -1; > 945 pmu->group = gid; > 946 > 947 pmu->ctx = alloc_percpu(struct amd_uncore_ctx *); > 948 if (!pmu->ctx) > 949 goto done; > 950 > 951 pmu->pmu = (struct pmu) { > 952 .task_ctx_nr = perf_invalid_context, > 953 .attr_groups = amd_uncore_umc_attr_groups, > 954 .name = pmu->name, > 955 .event_init = amd_uncore_umc_event_init, > 956 .add = amd_uncore_add, > 957 .del = amd_uncore_del, > 958 .start = amd_uncore_umc_start, > 959 .stop = amd_uncore_stop, > 960 .read = amd_uncore_read, > 961 .capabilities = PERF_PMU_CAP_NO_EXCLUDE | PERF_PMU_CAP_NO_INTERRUPT, > 962 .module = THIS_MODULE, > 963 }; > 964 > 965 if (perf_pmu_register(&pmu->pmu, pmu->pmu.name, -1)) { > 966 free_percpu(pmu->ctx); > 967 pmu->ctx = NULL; > 968 goto done; > 969 } > 970 > 971 pr_info("%d %s counters detected\n", pmu->num_counters, > 972 pmu->pmu.name); > 973 > 974 index++; > 975 } > 976 } > 977 > 978 done: > 979 uncore->num_pmus = index; > 980 uncore->init_done = true; > 981 > 982 return amd_uncore_ctx_init(uncore, cpu); > 983 } > 984 >