Received: by 2002:ab2:68c1:0:b0:1fd:9a81:d0e4 with SMTP id e1csp559369lqp; Sun, 9 Jun 2024 08:30:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWABdBqOwmLfqGc2QSBhWrSETo+OwihiiSY1gJ+YlZOdgrP3q+mUDndq3ocNwimRWabFZzcK5fxFjsJkHXzNSR87HyO8mQHHm+2RViKEQ== X-Google-Smtp-Source: AGHT+IHws0GWMrT50XZJud4sJBsUJ3UfRl8JQGM2M2UAIthaRcPC7wQvXhYKj7St1qrl0hLowBb8 X-Received: by 2002:a17:90b:19c5:b0:2c2:e0f1:bb1 with SMTP id 98e67ed59e1d1-2c2e0f10e7dmr4443479a91.22.1717947014967; Sun, 09 Jun 2024 08:30:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717947014; cv=pass; d=google.com; s=arc-20160816; b=x+X7PBe0UTYeFs3Sdypem/1YjktCLlRj3dXVuwQTGVvqxxWMue2/FfbWhZ+6swsTNn NXdHiLLI3OfvA1StMr9ZXwGVBQgrwADdaladCloO/Ur27cFBJ4gWZA3lB8dHFGUV8h+J vQTs7YBZErC8yhRrQ3kpmRN50TnaA4qmcjy1PNlLhiXlAZbDN7JNJ6vCdpjWLqkFoqHA SVlfkB8ALw/26rN36vEW3E4SXdioogxBMiwOw3fvXfwMnwjNeOfBIPxjK2uIxj9DTknD Jr7aY5TV2xLzJf4kSWHlhgn/gVL5HFf9Ut2f+kGqb+Clp7u82nCcNAFEVdiC1xZzw1WC /2YA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:cc:to:from :date:dkim-signature; bh=+p7Dbyuweupea3JxyYctujxWv1vr+kMS3mFulUukLl4=; fh=KSqamL1ht0dEqJVpK/uLY0co6gnhnqqJEJN10ixaD/8=; b=pTolrPnOm2zrm84bBu2ChIF9mfnFX8BbOtAfhglVoIlX/tJMfcPgdukTgqshiqshOW sbTvB8zgoEY23DyculYsi2ly6BKXZwo82sDkjWkvogbV2nhpzDN7XKuh/n1jXkbsRrNW 5K9KmG3P8iPTVcg9Kp+0X1X7+Fk7qfQBNACcUKKog6Gfr8s/UmXvB6ysZ4gjhbETP/TM yL1F/rdX2Q6YQZ25bawoWkiSua+Kf2x6YliMWXqekr3ZK1Smcn8F5L/9WJ47EMugmDMG J1/46Unfqh+gOPoXuPs73OsznvDBUD6j/aoirVuFaP2SkgOKySTkEQ7ph+4PVFNmwlek sD7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e8Ovct9O; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-207395-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207395-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c2d1178803si3517404a91.171.2024.06.09.08.30.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 08:30:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207395-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e8Ovct9O; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-207395-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207395-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 31520B2102E for ; Sun, 9 Jun 2024 15:30:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9FFD746444; Sun, 9 Jun 2024 15:29:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="e8Ovct9O" Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (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 B230844C8F for ; Sun, 9 Jun 2024 15:29:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717946996; cv=none; b=XnrrNTcQGjf3ovBXkD6H/Nmi6YjYsk68l2lW9UzxRQ4qVPKDH0GCjohwFvUGUSdr+Qp905Z1y15Rz43/KYxykYcu24eytJcHw9PfnRwXlws5yayIMPtYnH1NJFmw9gBvsg3EaY5sTuSCvDf1juHWHKld4ZTswpeTLa4+cu60zvQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717946996; c=relaxed/simple; bh=LkPXGai8kaRoajhEuKD9q1QTp4VpWFHLrSWtfPGkqEk=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=lcofh6CohZv/OCPQBEgrL2x+nhIk2tibMeRarpp0lUcHcY7ov3vL+ZVvDw3coCyREZSBcLneRUCl95guRGXdYCx85AgALw7mgHyPQoyArgTLDhDS+4ri0rQNLxaZWRsUx7TSQDpkOomH9LXKihuLKoVfOonHshXlestlhV7TTl8= 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=e8Ovct9O; arc=none smtp.client-ip=209.85.167.54 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 Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-52c7f7fdd24so1217010e87.1 for ; Sun, 09 Jun 2024 08:29:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717946993; x=1718551793; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=+p7Dbyuweupea3JxyYctujxWv1vr+kMS3mFulUukLl4=; b=e8Ovct9OJM6L9gooMPF98nCD/TSJFi5sosivd7iXjZQ/1b4j/I7Fly9b84YAu7o3zG /zeN4ansGlsFvhJ3FlZ/RV3h3qNO5nRu2Fl5giDWSMUFw7Z4HByk7b5prLDFqStyMV5/ qXvQTfBeN7OMB8nsn1OnT6PooGPnrWYCE0Xnd9EqbotCW1y/45UczRkYv4zf9McTI9Af ulvZYw1x+KJliZ0xRtzT2iF7u9Xu0xYhoF67+RgbQ7EVmkn8wDv7P6sa5VzZfJYoEoZx 8SVTipcnsxM0Oetz9yMBNedp9bBB0bFoPYS+fGi9N/nO50N4vh8Wq+1xXXN8ZD06sYL0 yIcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717946993; x=1718551793; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+p7Dbyuweupea3JxyYctujxWv1vr+kMS3mFulUukLl4=; b=WrcEoQ3gbTzUD1TOGcBjZekW7C8qZwqZjsmyb4tk45Oqvyc7MRbYpnW8e7RWASesTg OF+GUQCT8fHTYEf+s1uIrBqNXunvgrb6skFWFZEYUKHefIcX5INJRQ7+cXQMup9OxiI9 tU3agJd37v+EOQrrq7o5AOLzdFqcb8aPTUUcE+YQ1hPvZXeAm1TAshv0BoP5XlXMRyB8 xqL+nGmTrd44SSAzS0NEXcarb/njPzugOrNPSoB18G6IBmuMXyreRxjMlzDG+BI9oUFD 8Zf9DNYCGfe71SzmbLizrW7YTWNeizqwM4y3A1bJPVv5EtpkQZf8jB3mpKHy06zy375n pBzQ== X-Forwarded-Encrypted: i=1; AJvYcCWcZ4vhgXUJLgilGkocco9oaHnMZt2BUfVphP8/c1C8BFOHgpJfNmAVRCsExYeOp65O9rU+SB7OdCblG8QuvE8aAJooSGoGuf3BV0UP X-Gm-Message-State: AOJu0YyqXUSw5d7MI5YUc004XcSWyV/3g81D8LLMwi2iw13oO4zmZ5A0 zt+pABP9P0VJCW/Ic/zWkIdIEiyJ+3U0YgntxfdnBoD9uqvmErB1+8kbLQZ8FFQ= X-Received: by 2002:a19:5f5b:0:b0:520:c2c1:153a with SMTP id 2adb3069b0e04-52bb9fd2521mr4380150e87.58.1717946992519; Sun, 09 Jun 2024 08:29:52 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35f2024b1c8sm1716363f8f.39.2024.06.09.08.29.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 08:29:52 -0700 (PDT) Date: Sun, 9 Jun 2024 18:29:48 +0300 From: Dan Carpenter To: oe-kbuild@lists.linux.dev, Fred Griffoul , griffoul@gmail.com Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev, Fred Griffoul , Catalin Marinas , Will Deacon , Alex Williamson , Waiman Long , Zefan Li , Tejun Heo , Johannes Weiner , Mark Rutland , Marc Zyngier , Oliver Upton , Mark Brown , Ard Biesheuvel , Joey Gouly , Ryan Roberts , Jeremy Linton , Jason Gunthorpe , Yi Liu , Kevin Tian , Eric Auger , Stefan Hajnoczi , Christian Brauner , Ankit Agrawal , Reinette Chatre , Ye Bin , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, cgroups@vger.kernel.org Subject: Re: [PATCH v4 2/2] vfio/pci: add msi interrupt affinity support Message-ID: <714268da-d199-4371-8360-500e7165119c@moroto.mountain> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240607190955.15376-3-fgriffo@amazon.co.uk> Hi Fred, kernel test robot noticed the following build warnings: url: https://github.com/intel-lab-lkp/linux/commits/Fred-Griffoul/cgroup-cpuset-export-cpuset_cpus_allowed/20240608-031332 base: cbb325e77fbe62a06184175aa98c9eb98736c3e8 patch link: https://lore.kernel.org/r/20240607190955.15376-3-fgriffo%40amazon.co.uk patch subject: [PATCH v4 2/2] vfio/pci: add msi interrupt affinity support config: mips-randconfig-r081-20240609 (https://download.01.org/0day-ci/archive/20240609/202406092245.Hgx6MqK9-lkp@intel.com/config) compiler: mips-linux-gcc (GCC) 13.2.0 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 | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202406092245.Hgx6MqK9-lkp@intel.com/ New smatch warnings: drivers/vfio/pci/vfio_pci_core.c:1241 vfio_pci_ioctl_set_irqs() warn: maybe return -EFAULT instead of the bytes remaining? vim +1241 drivers/vfio/pci/vfio_pci_core.c 2ecf3b58ed7bc5 drivers/vfio/pci/vfio_pci_core.c Jason Gunthorpe 2022-08-31 1190 static int vfio_pci_ioctl_set_irqs(struct vfio_pci_core_device *vdev, 663eab456e072b drivers/vfio/pci/vfio_pci_core.c Jason Gunthorpe 2022-08-31 1191 struct vfio_irq_set __user *arg) 2ecf3b58ed7bc5 drivers/vfio/pci/vfio_pci_core.c Jason Gunthorpe 2022-08-31 1192 { 2ecf3b58ed7bc5 drivers/vfio/pci/vfio_pci_core.c Jason Gunthorpe 2022-08-31 1193 unsigned long minsz = offsetofend(struct vfio_irq_set, count); 89e1f7d4c66d85 drivers/vfio/pci/vfio_pci.c Alex Williamson 2012-07-31 1194 struct vfio_irq_set hdr; 66c926fb7b2507 drivers/vfio/pci/vfio_pci_core.c Fred Griffoul 2024-06-07 1195 cpumask_var_t mask; 89e1f7d4c66d85 drivers/vfio/pci/vfio_pci.c Alex Williamson 2012-07-31 1196 u8 *data = NULL; 05692d7005a364 drivers/vfio/pci/vfio_pci.c Vlad Tsyrklevich 2016-10-12 1197 int max, ret = 0; ef198aaa169c61 drivers/vfio/pci/vfio_pci.c Kirti Wankhede 2016-11-17 1198 size_t data_size = 0; 89e1f7d4c66d85 drivers/vfio/pci/vfio_pci.c Alex Williamson 2012-07-31 1199 663eab456e072b drivers/vfio/pci/vfio_pci_core.c Jason Gunthorpe 2022-08-31 1200 if (copy_from_user(&hdr, arg, minsz)) 89e1f7d4c66d85 drivers/vfio/pci/vfio_pci.c Alex Williamson 2012-07-31 1201 return -EFAULT; 89e1f7d4c66d85 drivers/vfio/pci/vfio_pci.c Alex Williamson 2012-07-31 1202 05692d7005a364 drivers/vfio/pci/vfio_pci.c Vlad Tsyrklevich 2016-10-12 1203 max = vfio_pci_get_irq_count(vdev, hdr.index); 89e1f7d4c66d85 drivers/vfio/pci/vfio_pci.c Alex Williamson 2012-07-31 1204 ea3fc04d4fad2d drivers/vfio/pci/vfio_pci_core.c Jason Gunthorpe 2022-08-31 1205 ret = vfio_set_irqs_validate_and_prepare(&hdr, max, VFIO_PCI_NUM_IRQS, ea3fc04d4fad2d drivers/vfio/pci/vfio_pci_core.c Jason Gunthorpe 2022-08-31 1206 &data_size); ef198aaa169c61 drivers/vfio/pci/vfio_pci.c Kirti Wankhede 2016-11-17 1207 if (ret) ef198aaa169c61 drivers/vfio/pci/vfio_pci.c Kirti Wankhede 2016-11-17 1208 return ret; 89e1f7d4c66d85 drivers/vfio/pci/vfio_pci.c Alex Williamson 2012-07-31 1209 ef198aaa169c61 drivers/vfio/pci/vfio_pci.c Kirti Wankhede 2016-11-17 1210 if (data_size) { 66c926fb7b2507 drivers/vfio/pci/vfio_pci_core.c Fred Griffoul 2024-06-07 1211 if (hdr.flags & VFIO_IRQ_SET_DATA_AFFINITY) { 66c926fb7b2507 drivers/vfio/pci/vfio_pci_core.c Fred Griffoul 2024-06-07 1212 if (!zalloc_cpumask_var(&mask, GFP_KERNEL)) 66c926fb7b2507 drivers/vfio/pci/vfio_pci_core.c Fred Griffoul 2024-06-07 1213 return -ENOMEM; 66c926fb7b2507 drivers/vfio/pci/vfio_pci_core.c Fred Griffoul 2024-06-07 1214 66c926fb7b2507 drivers/vfio/pci/vfio_pci_core.c Fred Griffoul 2024-06-07 1215 ret = copy_from_user(mask, &arg->data, data_size); copy_from_user() returns the number of bytes remaining to be copied. This should be: if (copy_from_user(mask, &arg->data, data_size)) { ret = -EFAULT; goto out; } 66c926fb7b2507 drivers/vfio/pci/vfio_pci_core.c Fred Griffoul 2024-06-07 1216 if (ret) 66c926fb7b2507 drivers/vfio/pci/vfio_pci_core.c Fred Griffoul 2024-06-07 1217 goto out; 66c926fb7b2507 drivers/vfio/pci/vfio_pci_core.c Fred Griffoul 2024-06-07 1218 66c926fb7b2507 drivers/vfio/pci/vfio_pci_core.c Fred Griffoul 2024-06-07 1219 data = (u8 *)mask; 66c926fb7b2507 drivers/vfio/pci/vfio_pci_core.c Fred Griffoul 2024-06-07 1220 66c926fb7b2507 drivers/vfio/pci/vfio_pci_core.c Fred Griffoul 2024-06-07 1221 } else { 663eab456e072b drivers/vfio/pci/vfio_pci_core.c Jason Gunthorpe 2022-08-31 1222 data = memdup_user(&arg->data, data_size); 3a1f7041ddd59e drivers/vfio/pci/vfio_pci.c Fengguang Wu 2012-12-07 1223 if (IS_ERR(data)) 3a1f7041ddd59e drivers/vfio/pci/vfio_pci.c Fengguang Wu 2012-12-07 1224 return PTR_ERR(data); 89e1f7d4c66d85 drivers/vfio/pci/vfio_pci.c Alex Williamson 2012-07-31 1225 } 66c926fb7b2507 drivers/vfio/pci/vfio_pci_core.c Fred Griffoul 2024-06-07 1226 } 89e1f7d4c66d85 drivers/vfio/pci/vfio_pci.c Alex Williamson 2012-07-31 1227 89e1f7d4c66d85 drivers/vfio/pci/vfio_pci.c Alex Williamson 2012-07-31 1228 mutex_lock(&vdev->igate); 89e1f7d4c66d85 drivers/vfio/pci/vfio_pci.c Alex Williamson 2012-07-31 1229 ea3fc04d4fad2d drivers/vfio/pci/vfio_pci_core.c Jason Gunthorpe 2022-08-31 1230 ret = vfio_pci_set_irqs_ioctl(vdev, hdr.flags, hdr.index, hdr.start, ea3fc04d4fad2d drivers/vfio/pci/vfio_pci_core.c Jason Gunthorpe 2022-08-31 1231 hdr.count, data); 89e1f7d4c66d85 drivers/vfio/pci/vfio_pci.c Alex Williamson 2012-07-31 1232 89e1f7d4c66d85 drivers/vfio/pci/vfio_pci.c Alex Williamson 2012-07-31 1233 mutex_unlock(&vdev->igate); 66c926fb7b2507 drivers/vfio/pci/vfio_pci_core.c Fred Griffoul 2024-06-07 1234 66c926fb7b2507 drivers/vfio/pci/vfio_pci_core.c Fred Griffoul 2024-06-07 1235 out: 66c926fb7b2507 drivers/vfio/pci/vfio_pci_core.c Fred Griffoul 2024-06-07 1236 if (hdr.flags & VFIO_IRQ_SET_DATA_AFFINITY && data_size) 66c926fb7b2507 drivers/vfio/pci/vfio_pci_core.c Fred Griffoul 2024-06-07 1237 free_cpumask_var(mask); 66c926fb7b2507 drivers/vfio/pci/vfio_pci_core.c Fred Griffoul 2024-06-07 1238 else 89e1f7d4c66d85 drivers/vfio/pci/vfio_pci.c Alex Williamson 2012-07-31 1239 kfree(data); 89e1f7d4c66d85 drivers/vfio/pci/vfio_pci.c Alex Williamson 2012-07-31 1240 89e1f7d4c66d85 drivers/vfio/pci/vfio_pci.c Alex Williamson 2012-07-31 @1241 return ret; 2ecf3b58ed7bc5 drivers/vfio/pci/vfio_pci_core.c Jason Gunthorpe 2022-08-31 1242 } -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki