From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (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 9CE6726F449 for ; Tue, 27 May 2025 17:26:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748366814; cv=none; b=EGIo/Tok936DAOnsuLhPyP73m+Jh3lFhBc/DJVSiws1vum4fiHnpjFQKZFHdokI3a0CjsGAI19beXjRFBQEJXxt5zpKUWaEEKQj3u3RKXuP3/yZzHGk6IGwHw6YTwFk5S24wOayXmMyekrptOKdKxq4+zM3X/FYsl3whqdz5UgE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748366814; c=relaxed/simple; bh=OwFNtM5RYwIt2cO5YB7MinCYHeC0TqnuHl7oHp5frJc=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=eapBlJ4tX2b+UODJBeORC9TwfRkOO1jr0E9lvez6IIrFF3c8pymch1R68mrKLKb0vaTWrjq+07kJF64llfFDDjiStFbFMGP3wLyf2bQvZSqp5OAAXuKxEETqyKxj+x3oAIWVgFuyCtgfdlfh7MbsHQnj7UWZTNvZ68kga7jtJ8o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=uZ9EiBdn; arc=none smtp.client-ip=209.85.167.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="uZ9EiBdn" Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-54998f865b8so4220182e87.3 for ; Tue, 27 May 2025 10:26:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1748366811; x=1748971611; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ge83cQZDvnwGXmNV4VWDL33n4ztMUCoEodBwwkHhulY=; b=uZ9EiBdnz1wue5oxSdbWB+IOdlX5I/p5lLB7eY4O/+Gkvb1qv0UbNU5DaPAq9MrC1M DGfDh1Ap1hviEeuLAWExD/4OlaFexpcXw//jEmqqAiDg4GtfoFz4vCJJA9SNoAFIBO4/ Cog3cHmdpmYVulzq/cq4AnODFkICfg4htn12Xp9ePmTKuf05v2TByid/MP4Y7/IXOsfV CPXBh1cA9DgvVUExHhEUQJGtaAB3CeWhwX7ZH344CdCpLLvgFgUaW6rQkKnk6UpIBclV oyHMmHoVupjfD3132w1GUpxuyL1fGJWmAAfE5MXirq1XalcBkiSAlnhDIvftnL3itoDh b8Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748366811; x=1748971611; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ge83cQZDvnwGXmNV4VWDL33n4ztMUCoEodBwwkHhulY=; b=g9uMfDwvIOisiRildI4hSP9Pl3MRf0RH/xqbFfKRclECnal3IPHs8BA4I9A1N5vYaX uq4CbqtycQZUyiwzVBCoC/jKFBomGbHj/j6freU3bUla+rm0ZNWsDV6b1FQZKR6OHjNs 7koFnfGX+mdYeSeDxagTOSxzR0PGOTn4ATX4Z++TqZhCY/GZJa55WPQZIZCDX8rnG2HW oJukhrsgJHOD6B+qHAA9Fv0n2HeWjOGritf+TJpOFrcqZdLrM0CugaO+xp0AO/BBrmhb nq50AWu18CtZXB3h1uw3tGoc4wtrBntS/lzmfWEf/yGlmXKBV6eMRd9W+pM2E15c4RsH i/ng== X-Forwarded-Encrypted: i=1; AJvYcCVqXtALfqIM3FZgUaIJ4tt41/5rnQ/b6yV5UiRtc5Vi3BDcLB+OrX5oJqndfYTSisWxCqzrYwNSHMZ9pWrvGxE=@vger.kernel.org X-Gm-Message-State: AOJu0YzCIxylLAGXHX243VgIwz99FaMhxf0SCZAbljGviiigW2IOPGJ4 rvMU6gCoUWjNlJjS9AxIYVBKkAHu5fZ9GFdEE9iwuHIkuG9UERhNV/wIJU8gDruO8RdKjT0py0q 3tFe7XMAkZofQ7vu0/kL/wPvwH3AWYPJMw4Cd22dM X-Gm-Gg: ASbGnculqZViKjr2rVG2iOz53qlmZh1KByGmVfspXVepkh0iCyX5zikWCVLRcFyPe0F EGkp3PkrYXqM7ibUa9TaCjlOxwmaGK0OOcziEFaHdqC7i9W+kFdPSI+Hp/Sn/u5dqB08woqmyQ9 JOfrmfiQRBr90QOnn6A+VXqIrNYon9Ei8bQO4JKKBBYn4= X-Google-Smtp-Source: AGHT+IHQDkOSTVRIROJ+g7i1WPwyUVIKFbvtifpyRiMYJgBZVGOkUtWOB91Yxj7Taj/VjxKKSP5XcOpwZzb1xtZE/Xw= X-Received: by 2002:a05:6512:3d07:b0:550:e4a2:e0e0 with SMTP id 2adb3069b0e04-5521cbaec9cmr4595357e87.44.1748366810298; Tue, 27 May 2025 10:26:50 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20250523233018.1702151-1-dmatlack@google.com> In-Reply-To: From: David Matlack Date: Tue, 27 May 2025 10:26:23 -0700 X-Gm-Features: AX0GCFs7UkeAuRIPrTUv7pRJieaZK5xiuzysfdv4dchrDmafqztZf4XeVmWqJik Message-ID: Subject: Re: [RFC PATCH 00/33] vfio: Introduce selftests for VFIO To: Yi Liu Cc: Alex Williamson , Shuah Khan , Paolo Bonzini , Vinod Koul , Fenghua Yu , "Masami Hiramatsu (Google)" , Adhemerval Zanella , Jiri Olsa , Andrii Nakryiko , Wei Yang , Bjorn Helgaas , Takashi Iwai , Greg Kroah-Hartman , Pierre-Louis Bossart , Andy Shevchenko , FUJITA Tomonori , WangYuli , Sean Christopherson , Andrew Jones , Claudio Imbrenda , Eric Auger , Josh Hilke , linux-kselftest@vger.kernel.org, kvm@vger.kernel.org, Jason Gunthorpe , Kevin Tian , Vipin Sharma , Pasha Tatashin , Saeed Mahameed , Adithya Jayachandran , Parav Pandit , Leon Romanovsky , Vinicius Costa Gomes , Dave Jiang , Dan Williams Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, May 26, 2025 at 2:07=E2=80=AFAM Yi Liu wrote: > > On 2025/5/24 07:29, David Matlack wrote: > > This series introduces VFIO selftests, located in > > tools/testing/selftests/vfio/. > > > > VFIO selftests aim to enable kernel developers to write and run tests > > that take the form of userspace programs that interact with VFIO and > > IOMMUFD uAPIs. VFIO selftests can be used to write functional tests for > > new features, regression tests for bugs, and performance tests for > > optimizations. > > > > These tests are designed to interact with real PCI devices, i.e. they d= o > > not rely on mocking out or faking any behavior in the kernel. This > > allows the tests to exercise not only VFIO but also IOMMUFD, the IOMMU > > driver, interrupt remapping, IRQ handling, etc. > > > > We chose selftests to host these tests primarily to enable integration > > with the existing KVM selftests. As explained in the next section, > > enabling KVM developers to test the interaction between VFIO and KVM is > > one of the motivators of this series. > > interesting. Two quick questions: > 1) does this selftest support all the vfio iommu drivers (typ1 and > spapr_tce)? Maybe also the iommufd vfio_compat as well. This series supports the following IOMMU drivers [1]: - VFIO Type1 IOMMU - VFIO Type1v2 IOMMU - IOMMUFD compat-mode with Type1 - IOMMUFD compat-mode with Type1v2 - IOMMUFD I have not lookied at spapr_tce or any other modes, but I implemented the code in such a way that other modes could be added in the future. [1] https://github.com/dmatlack/linux/blob/9832935d7a44aab725ff627c6acf22b8= a17d407f/tools/testing/selftests/vfio/lib/vfio_pci_device.c#L409 > 2) I know Alex has a test suit as the below. Has this series referred > it? > > https://github.com/awilliam/tests/commits/for-clg/ I was not aware of these tests, thanks for sharing the link. If we think the approach taken in this series makes sense, we could presumably port those tests to tools/testing/selftests/vfio/. I would be happy to help with that.