From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AFE35C38145 for ; Wed, 7 Sep 2022 14:07:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=sZNYlph689xXKS2lFfA0FoRUBYwJv4Jw0R79Ibp8IgI=; b=Mk8t8NAqJGerJL xIKiEzr+p8gQ4xQVtz75SDonUTM0JfAwXSv3EYzTsSO+uatOU6pR47SFnbCZ32PcHEkJEUCCtqCZC oMHLdzrdji8XfYYH4H0lOk02c9xYEFsdQSIQZm6eNPLY+ySu0CTQ5CFLvKSSaSK7PlvN+bmODyO0f aVWye7aVpY6Yf7RtdqYlq6aznNgCLKzn/VbIabwY0ZOfMy5EG+2NLPVkJiSYbKdS6qbfUuxn8hyqz zQ6pvoKRQGnT0M4xNSlBVbCETN+niuUmn9zDqh1IzBbaaTA7/upp9lIeYhLGmKfbaT1BU/2fv0j/p e4hzP5n2fBDvtp4MAGcQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVvhR-006iXQ-LF; Wed, 07 Sep 2022 14:06:41 +0000 Received: from mail.8bytes.org ([2a01:238:42d9:3f00:e505:6202:4f0c:f051]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVvhO-006iVW-8f for linux-arm-kernel@lists.infradead.org; Wed, 07 Sep 2022 14:06:39 +0000 Received: from 8bytes.org (p4ff2bb62.dip0.t-ipconnect.de [79.242.187.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.8bytes.org (Postfix) with ESMTPSA id 6118D2409A7; Wed, 7 Sep 2022 16:06:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=8bytes.org; s=default; t=1662559591; bh=sD6ntPJavoL+O3jZjBfdlyQKhK42Ee+ATtCC5qSKLek=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rnWXPfkRqiJXCBikZk6JRGP2BockRbTgJPogFW6R24YrO/UYOBdbDIQPctDN3LGpI 79/xXHT61Edm0n+vSGPYdlczsRRfdkacO6KmQgX/Kv6hNnOMuGvxYRlTiNeRqAdoGh 5eisSJGFeEPl9sdwLcPf/+l2Yyy8DviLlelMTM4i/bTvjcSo5ebNKYoIEDQy0YTBKO jt0uBK0fCmoSFWyU5uIRYNcijnnozfeA7oB/uWHePVQatjmPma4sWvhtPveFHkv/Zd 5qGfNEp1V9BqTtR+QMkc0IJeFW1j8U5UpZXX6b1OmgcnRAA8Xu95xNZgC6+l1xfUpO 7YogNayXEccUQ== Date: Wed, 7 Sep 2022 16:06:29 +0200 From: Joerg Roedel To: Jason Gunthorpe Subject: Re: [PATCH v6 1/5] iommu: Return -EMEDIUMTYPE for incompatible domain and device/group Message-ID: References: <20220815181437.28127-1-nicolinc@nvidia.com> <20220815181437.28127-2-nicolinc@nvidia.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220907_070638_464243_110BFBBB X-CRM114-Status: UNSURE ( 9.70 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-s390@vger.kernel.org, marcan@marcan.st, mjrosato@linux.ibm.com, linux-kernel@vger.kernel.org, thierry.reding@gmail.com, will@kernel.org, alyssa@rosenzweig.io, jean-philippe@linaro.org, kvm@vger.kernel.org, zhang.lyra@gmail.com, jon@solid-run.com, jonathanh@nvidia.com, iommu@lists.linux.dev, Nicolin Chen , yangyingliang@huawei.com, orsonzhai@gmail.com, gerald.schaefer@linux.ibm.com, kevin.tian@intel.com, sven@svenpeter.dev, linux-arm-msm@vger.kernel.org, christophe.jaillet@wanadoo.fr, baolin.wang@linux.alibaba.com, thunder.leizhen@huawei.com, linux-tegra@vger.kernel.org, tglx@linutronix.de, virtualization@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, dwmw2@infradead.org, cohuck@redhat.com, alex.williamson@redhat.com, shameerali.kolothum.thodi@huawei.com, robdclark@gmail.com, asahi@lists.linux.dev, suravee.suthikulpanit@amd.com, robin.murphy@arm.com, baolu.lu@linux.intel.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Sep 07, 2022 at 10:47:39AM -0300, Jason Gunthorpe wrote: > Would you be happier if we wrote it like > > #define IOMMU_EINCOMPATIBLE_DEVICE xx > > Which tells "which of the function parameters is actually invalid" ? Having done some Rust hacking in the last months, I have to say I like to concept of error handling with Result<> there. Ideally we have a way to emulate that in our C code without having to change all callers. What I am proposing is a way this could be emulated here, but I am open to other suggestions. Still better than re-using random error codes for special purposes. Regards, Joerg _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel