Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3229206pxj; Tue, 1 Jun 2021 00:05:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbCNyduaOmb7hOeb5JlWAZcdOCS+TyHYuX/u7+Ke3W4ot6xZ0jfIYBFNLT0qvMhum58bL9 X-Received: by 2002:a05:6e02:1d83:: with SMTP id h3mr19769312ila.54.1622531129026; Tue, 01 Jun 2021 00:05:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622531129; cv=none; d=google.com; s=arc-20160816; b=wLQCbYPPeHeXPEx7Er7s3UZPZ0No/quTMJyByEwY/kHJK4gZem7mYbd2MbMeDN1gt9 emaVoeUYsDvHmW3EkULeHd+1g6n4VR9aYjjlZdlKc/caYT3HITY523cZGkilsy6GsIA7 /6pTz6aHSc6nx4UPm4nnHJqYTL0itTxbe51SdKUyv0yTfjw6E+ePM82Xtq1i3WNX6Y20 bQ56RurD/C6+eIp90glZhltuNFXxBzqzVhdr+jdLmWGXJTnUqOl2uc8dbCbLopamL+LO e+N9agSlGdMTgAKMln2jGohm9oLjT/uptYq7oqRtY/w2KRtti3vlwprnYZOtyVngFz3G 2maQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=H5JN11aDqRTMwXJ8d1TfwJebVucEq15Zf6ekga7Gl8k=; b=yjuD4yIkccs7dpEfMd15YwNcjWAg20KYamD75WRbs8oOiyvLmgegk/hoh+5n3giaRn K7uShplql+yOyZb4EYggNcnVkTpn3HOY0d12Rxn9D11CUwDPv0+YnBgms7feRG6BLfB6 vX90lkpf/N+mm9LvqP1n3dJIQJQKAJq65tmLzUh57pLVDbTZOVxP96SSbjU/q+vbzVZj dFOU4B58qOO5WTa7RHMSgZukiUTJ2AcuTrF5dmI1jB9+3Ubcduyv2mTSXJtS9hr4imn4 s60tQNwDlal+2o45ZDGU3oRnsqpV8J97sA2df83JocHfThBXPYRIIP+dTSEIj8PGj/Vn P7rw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hisilicon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j1si15874415ila.134.2021.06.01.00.05.16; Tue, 01 Jun 2021 00:05:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hisilicon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233054AbhFAHGR convert rfc822-to-8bit (ORCPT + 99 others); Tue, 1 Jun 2021 03:06:17 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:3364 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231928AbhFAHGR (ORCPT ); Tue, 1 Jun 2021 03:06:17 -0400 Received: from dggeme710-chm.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4FvNNM0J2wz67Qq; Tue, 1 Jun 2021 15:00:51 +0800 (CST) Received: from dggemi761-chm.china.huawei.com (10.1.198.147) by dggeme710-chm.china.huawei.com (10.1.199.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Tue, 1 Jun 2021 15:04:34 +0800 Received: from dggemi761-chm.china.huawei.com ([10.9.49.202]) by dggemi761-chm.china.huawei.com ([10.9.49.202]) with mapi id 15.01.2176.012; Tue, 1 Jun 2021 15:04:33 +0800 From: "Song Bao Hua (Barry Song)" To: Greg KH , "tiantao (H)" CC: "linux-kernel@vger.kernel.org" , "akpm@linux-foundation.org" , Andy Shevchenko , "Rafael J. Wysocki" Subject: RE: [PATCH 1/2] topology: use bin_attribute to avoid buff overflow Thread-Topic: [PATCH 1/2] topology: use bin_attribute to avoid buff overflow Thread-Index: AQHXVpHLdxqqXqYHy0SNrz7+ZdO1FKr+ElmAgAClbEA= Date: Tue, 1 Jun 2021 07:04:33 +0000 Message-ID: References: <1622516210-10886-1-git-send-email-tiantao6@hisilicon.com> <1622516210-10886-2-git-send-email-tiantao6@hisilicon.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.126.201.217] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Greg KH [mailto:gregkh@linuxfoundation.org] > Sent: Tuesday, June 1, 2021 4:59 PM > To: tiantao (H) > Cc: linux-kernel@vger.kernel.org; akpm@linux-foundation.org; Song Bao Hua > (Barry Song) ; Andy Shevchenko > ; Rafael J. Wysocki > Subject: Re: [PATCH 1/2] topology: use bin_attribute to avoid buff overflow > > On Tue, Jun 01, 2021 at 10:56:49AM +0800, Tian Tao wrote: > > Reading sys/devices/system/cpu/cpuX/topology/ returns cpu topology. > > However, the size of this file is limited to PAGE_SIZE because of the > > limitation for sysfs attribute. so we use bin_attribute instead of > > attribute to avoid NR_CPUS too big to cause buff overflow. > > > > This patch is based on the following discussion. > > https://www.spinics.net/lists/linux-doc/msg95921.html > > Please use lore.kernel.org for links as we have no control over other > sites to ensure that they will work in the future. Use the message id > in the link as well, so that if something were to happen to lore, we can > figure it out. > > Also, you are modifying a bunch of different files here, do you mean to > do it for all of them? The plan is providing a common wrapper similar with cpumap_print_to_pagebuf so that all modules which have bitmap and list topology ABI can move to use it. Right now, drivers/base/topology.c and drivers/base/node.c are the first two examples involved. We are still having around 40 other places in the todo list. Thanks Barry