From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) (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 98A082EB5BA for ; Fri, 21 Nov 2025 23:35:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763768155; cv=none; b=I9XDVbEXViuZm/ZI8/11fppPzh0DA5loj5VrosWuQX149tNyIIAbWz/NJmrK4TThYsSyw8pIJbGxsfSWoZwvEBasU1cVR/rtIdWhtfGUlUyVtNjOK5CUxL4FY4SUi5y3gL2tvxAbkNYu7avRmTC4iqupgJjOcprvI09SmHUZasc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763768155; c=relaxed/simple; bh=ZIKkMjQ5byam2kBpHOWaWCeEfS0EnddLlBVtwgj/LaY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Z0G00SY4cmnJ7lgiSfCXJUzr5Y+nB3IX+RFAlQH7B4XMNJV1MDxpE9LPXYtylQtO5FAqTD91NJAXetv/OMgHnD0hC73gRe5lBZmNjT5W4hxX+rSCPhZ/Bcfadr2sCugLSLd91RW8+3UPQm3nuvtdOMNgsVePVtr4yeHugmHMZYI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=Sai/MltW; arc=none smtp.client-ip=209.85.222.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="Sai/MltW" Received: by mail-qk1-f175.google.com with SMTP id af79cd13be357-8b2a4b6876fso347437085a.3 for ; Fri, 21 Nov 2025 15:35:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1763768147; x=1764372947; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=JbW3/sONqxixSsA0BLfTyZim/TwfutVjhBk5sAO/3O4=; b=Sai/MltW/Zq8M0VqilmQpUzrmGZEG6bzryw37Kr1t2GLaB0SlHR/BcZKrht4UQ9WOE fX152ol1NB9VjU6TZHPjKIoELXzC88dFeygVO2qc2A/OhDondUP4JBWg0NXBmoTR9ZXa L7tuOGskOPJUGqHgKI3dYeAWUKzyjbKRIOT9uwpG9S2Cckzf1aSqLkuuz6NEbc7fFA96 Zc3/SXDINGCX8ce/pDKpYhGuczRYfpeaC4O0AiLZavk5P8b66rXs8rX+U3fyM2b3kk3D aEFhWokfNOzfY7fdUqHnGv2pqT3l4VPm7aLLL9iWso574nqvNUwhXJVL9BauLm76mcjx LA5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763768147; x=1764372947; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JbW3/sONqxixSsA0BLfTyZim/TwfutVjhBk5sAO/3O4=; b=mcwTT7mkKmbjNF5yqg9t9Sa/RCwqKASrpwLRN/4EyCA92F8OmXlWjgKfIYqGd84h2Q DP+MfOQn9dss0JMZ3PmSKROIVwtdz6VP7uzo8b0J/EgmpnfzofumuXVCQvTojsre4A5U 8AwtXuBwvGWukFRw591rCbJUvRmBNywteBx6Ei+yIs/z/37y38zHNKV+E5Ymwf9adZ4O 8YKZsa9ANDu6TJ2ggyP2A/SN/FpJ8nrhdfyDuuStPhNVQdoxYqHywPFjD327MGfxLZjn 3QvA17x9zwjCyz10PSCkdwIiosQau1M+99wPSWS/RZzOfbiJ8VkugtSdEO111k0aQw/b DOsg== X-Forwarded-Encrypted: i=1; AJvYcCWpMA5HkC7I7NvMDAd084/4MKb3uSOhNIdvMyhKkRYLeQfh5Aj/LByYoPJKMKr/SQrjSnkn+aO8ikKMd6U=@vger.kernel.org X-Gm-Message-State: AOJu0YwyopU8GHlq6qOU7Y16K3u05AUlyX77ZhLIEe1cvoWAkG/sGWF0 b0lQzbrQxq+xtC25XKgVSgmFJleGeOMigx/JEc/MlkE6v+l4+jpXaPMtwpgvreNqNoQ= X-Gm-Gg: ASbGnctPz/k1kL16EZmjdUqlcbPhVvJVBjFEMRyBzZRU/08eRx8Oemw4qv7y4MAaTig fOPM82QhStUG0w25VEHRIpsCPkuUQhcEZLebw4jXzrxiTH2Em9LcQLSRO6RWZ5bZz4mg8rLATud ZI6Hcp0g0nJ7TyqNvfNFBNDA0EreSCJwn/5vrjRAV2mONb+RmBzBvwrXh2mYrCG/xzKQ1yIdxFh cDb58oWMLi/djmqTQZH5v/empZa91Lk0iOPqPwsOfWQjd9jfZ9/ffW+nq7e+0NrI6U1QKby43gJ sNB4gyGVZn5ipguj+dV+sXkLz9ACJ/JIAn1K8+8KRmP6bouwV6VlWiY4VgiDEjg85R+bWSi6w8t j490xV3RF5nHP7O2og9wsC0/mN4C079ElKzqQ0NMVq5oouohn38PAwYLslS6amRZGkERRfuEagf l77IGrZmgBaPeYhcBvHGcJYu3CzWzFY6AJAtOrlN0noxxy5Xnj46wYFJB7 X-Google-Smtp-Source: AGHT+IHAgZb6cWOpFsRzOf05vRyMCQqUNUfh+Djg/nFpMJErQPOjCq7BzfzVrRR8QE9gGUyLmyT7qw== X-Received: by 2002:a05:622a:4d:b0:4ed:68b:c73b with SMTP id d75a77b69052e-4ee58a7f137mr62412831cf.20.1763768146814; Fri, 21 Nov 2025 15:35:46 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-47-55-120-4.dhcp-dynamic.fibreop.ns.bellaliant.net. [47.55.120.4]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8846e54c9d0sm47151386d6.26.2025.11.21.15.35.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Nov 2025 15:35:46 -0800 (PST) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1vMafJ-00000001bdi-3fWH; Fri, 21 Nov 2025 19:35:45 -0400 Date: Fri, 21 Nov 2025 19:35:45 -0400 From: Jason Gunthorpe To: Sairaj Kodilkar Cc: joro@8bytes.org, suravee.suthikulpanit@amd.com, will@kernel.org, robin.murphy@arm.com, kevin.tian@intel.com, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, vasant.hegde@amd.com Subject: Re: [RFC PATCH] iommu/amd: Add control register in `struct iommu_hw_info_amd` Message-ID: <20251121233545.GJ233636@ziepe.ca> References: <20251029095846.4486-1-sarunkod@amd.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=us-ascii Content-Disposition: inline In-Reply-To: <20251029095846.4486-1-sarunkod@amd.com> On Wed, Oct 29, 2025 at 03:28:46PM +0530, Sairaj Kodilkar wrote: > When user does IOMMU_GET_HW_INFO ioctl, read the IOMMU control > register (MMIO offset 0x0018) and return it as part of > `struct iommu_hw_info_amd`. > > Userspace can use this information to determine the features > supported by the underlying host kernel. > > Signed-off-by: Sairaj Kodilkar > --- > > The patch exposes the control register to the user space so that QEMU > can determine the list of features enabled by the host IOMMU driver > when there are passthrough devices. QEMU can use this information to > selectively enable the guest feature. One example of such feature is > enabling upto 2048 MSIs for passthrough devices. QEMU must not enable > this feature for passthrough devices when host IOMMU driver has not > enabled it. Please document in the uapi header what bits are meaningful and userspace can safely access.. You are OK that a 0 register means the kernel is old? Jason