From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 16EC51AAA2C for ; Mon, 30 Dec 2024 17:53:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735581186; cv=none; b=UiwYc4AWTl6cLtZGkJQQc0Pok2XV8NtHHkMVN9AGYk4rZE9kOd50aw6vTBf2F0wTV7SMvpEWe581tGDwbNE5Qj9phD8fJhpYvPxaCu2PS59w40P/wFNbWkgcgcqhvW81vqALgai+QCYm8xBbIkGz6l3370A5lTrMmdiQAH97Oa0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735581186; c=relaxed/simple; bh=OinC3bhugjWs81HQ/VUVqwQh9XcC/WrGz1Uup6D/m4k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=g3Fj9XpToi1zX0qBu99fNdcK5ZusK1JfVdwXPxN2eOVLnJvEP2ZrxCSQuRDHIB5DXIIPBPsSlYTlqeADbkeAWwlxuRhS2CVKsm8VvPcgvnjBNkxSzwSEFfyw6gqvUugVHqnY6N743hw1Gr9HRF8zc9t6KWrSGIADWfnrt2YoxAI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ni/X16Oz; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ni/X16Oz" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2163bd70069so20812215ad.0 for ; Mon, 30 Dec 2024 09:53:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735581184; x=1736185984; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=o3xI5DjH4HAYdB6G5OXMtCQ/yI27laowdH1Ku4WAUuU=; b=ni/X16OzrW3z/sHrJU46Lb3L2Sct2albf0LX20NodAVZY9VvHiUPNZnXRSf4G20xh8 ZRAe7A1bu7ZeaOgcCM+IkardlB7ZR7xyqi/CkHyGKSwQ7xNZi9MDLZqpt6ouxEZ4ipN8 1QQ/wb2m8+gEoIGME1T/n0BJPFufURAYUMvZhJszAQnNATGPpxXRwDkFPT/WQCoStXmM F7/jj4W3fGwA+e50DsRczqfAPBtHYbFTJu7IzSLsuU9rr5xTcYt4b0i9sVH9S7mK46f/ KPCtuTwZ3xCT+br7fnnZBbYKsCZ38/gvW9Q5qmCbUdfEDKX/cxsfXAjk2XC9W9JwZyhT yLbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735581184; x=1736185984; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=o3xI5DjH4HAYdB6G5OXMtCQ/yI27laowdH1Ku4WAUuU=; b=fPeuxLcacnKGSzdlGhHJAqYbS9eEI4VFTdUCaAnneujVmCODRVBLuEp75xCqLYnUiF gx2dDJybNvUiqa81ZnyRb03OySN2xOUP4plabxpbUpjno63Nl4SQzUWT8RI0AkwQYVns KnlVe2LiYwcda4t7GrQcwWZ8VAheq3PSrP41hrY7SFPRd/tb95uHTMYBoa93ZdHdZHiW Gs00buPROmibLvfLXiAPjWH4w6GwCQdDhk8JjjVRL+4V8GhzgoImsBDP9OBgXFbrwUtY KcF86/dVhYEzRbVf25PmVGztr8Pml/eeG+vJbuZFJZZ6gkpM484jVAdSr93KueKMXTFt 0wZQ== X-Forwarded-Encrypted: i=1; AJvYcCWl/9z0UTCuLS9uFXp9uJC0EW7AyyBPm7hU+6bTSOlGZgrLm6fZi4+ia/+IAosPSKsZDiYD4IcnKGV2ogA=@vger.kernel.org X-Gm-Message-State: AOJu0Yyt2O+t8Zg+wS1rO1Wu8jEUtMtfwjKmlkDmaehDf38LgAOo7mYV ELkaAr5TNrNoo88A0Sjuycv5lipqRHrfaQHDSqumI12c+uDT9JgmQe0JIz5rqw== X-Gm-Gg: ASbGncuEBTt6e0lBOKB1ivGPc/MLbbP0zuv/azBp0h8U8UfjxtDI3gUrEo6T+D65Qnv 3wS9Zy9KMc6a2xqQ9C2CfRPTUUpik/oJR3V+gjqw4EuEWO7ZNUNKF2/19z3iNwDem8hfnT14MPh 7jSSBxyzE6u6HgtVevMDaLiJWSkbpBJIRNtcBjbJFfGvv6KWwhulLu1ykspPpS9gz4zA3NmusTY sd6aXj47W04Sm89lBQqZ2WW3SMmOYi1LbLh89hiGeIAE4otVuid2whHzHnDK6kypWfA X-Google-Smtp-Source: AGHT+IHeD2wPRjHlfgF7pPwJpRkMuKUiK6/XjQte9rKjKeYvH/JFjbDy3YIRqFOuyyy1Rnljy5snSA== X-Received: by 2002:a17:902:ce88:b0:215:620f:8de4 with SMTP id d9443c01a7336-219e6e8baffmr468933345ad.2.1735581184321; Mon, 30 Dec 2024 09:53:04 -0800 (PST) Received: from thinkpad ([120.60.139.149]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc97181fsm180454425ad.108.2024.12.30.09.53.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Dec 2024 09:53:03 -0800 (PST) Date: Mon, 30 Dec 2024 23:22:49 +0530 From: Manivannan Sadhasivam To: Hans Zhang <18255117159@163.com> Cc: kw@linux.com, kishon@kernel.org, arnd@arndb.de, gregkh@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, rockswang7@gmail.com, Niklas Cassel Subject: Re: [v3] misc: pci_endpoint_test: Fix return resource_size_t from pci_resource_len Message-ID: <20241230175249.lx32nb2adsm54qh3@thinkpad> References: <20241221141009.27317-1-18255117159@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20241221141009.27317-1-18255117159@163.com> On Sat, Dec 21, 2024 at 10:10:09PM +0800, Hans Zhang wrote: Subject should be improved: misc: pci_endpoint_test: Fix overflow of bar_size > With 8GB BAR2, running pcitest -b 2 fails with "TEST FAILED". > > The return value of the `pci_resource_len` interface is not an integer. > Using `pcitest` with an 8GB BAR2, the bar_size of integer type will > overflow. > Change the data type of bar_size from integer to resource_size_t, to fix > the above issue. > > Signed-off-by: Hans Zhang <18255117159@163.com> With that, Reviewed-by: Manivannan Sadhasivam - Mani > Reviewed-by: Niklas Cassel > > --- > Changes since v2: > https://lore.kernel.org/linux-pci/20241220075253.16791-1-18255117159@163.com/ > > - Fix "changes" part goes below the --- line > - The patch commit message were modified. > > Changes since v1: > https://lore.kernel.org/linux-pci/20241217121220.19676-1-18255117159@163.com/ > > - The patch subject and commit message were modified. > --- > drivers/misc/pci_endpoint_test.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c > index 3aaaf47fa4ee..414c4e55fb0a 100644 > --- a/drivers/misc/pci_endpoint_test.c > +++ b/drivers/misc/pci_endpoint_test.c > @@ -280,10 +280,11 @@ static int pci_endpoint_test_bar_memcmp(struct pci_endpoint_test *test, > static bool pci_endpoint_test_bar(struct pci_endpoint_test *test, > enum pci_barno barno) > { > - int j, bar_size, buf_size, iters, remain; > void *write_buf __free(kfree) = NULL; > void *read_buf __free(kfree) = NULL; > struct pci_dev *pdev = test->pdev; > + int j, buf_size, iters, remain; > + resource_size_t bar_size; > > if (!test->bar[barno]) > return false; > -- > 2.25.1 > -- மணிவண்ணன் சதாசிவம்