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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 633B3C38142 for ; Sat, 28 Jan 2023 08:04:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233181AbjA1IEl (ORCPT ); Sat, 28 Jan 2023 03:04:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229811AbjA1IEj (ORCPT ); Sat, 28 Jan 2023 03:04:39 -0500 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC5508001A for ; Sat, 28 Jan 2023 00:04:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674893078; x=1706429078; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=PSAi4wQVJq8gb0ftJa1PBZZBA8rw8csOD0sJ4uctJ38=; b=RNvK38SGjyTJ5f+vAtO6BTJqUdbJYJqdpA9suakkQEBQdYZ5+wtbORKq 23+tViD5yMbrDcXMC8PXqsflEEgJ7rgn46MT5ROzVl+NEa7KaCAcs4h8V G6AViKDjlG6VQq6yPapvvpQr6zCahGyooHB8cmrdMU6PCN+DYSgzusCFj 6mWaa/TPI6ijSh2IYBZ5HJ/NNyhgwtJtTXbtf+MOmyHJenuv9DLHiprND nhNCrgEHOQS/3i9uB6yD6aAaepBoROsoST9tOdCl/FsMKarY9OanE40we FJgvBus7zLmApXJzouv6gcGr279P1RZFHUasAU94ZQXivCIz0QuCUWDPC w==; X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="327290273" X-IronPort-AV: E=Sophos;i="5.97,253,1669104000"; d="scan'208";a="327290273" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2023 00:04:38 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="732129387" X-IronPort-AV: E=Sophos;i="5.97,253,1669104000"; d="scan'208";a="732129387" Received: from blu2-mobl.ccr.corp.intel.com (HELO [10.252.186.212]) ([10.252.186.212]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2023 00:04:36 -0800 Message-ID: <0ff36f80-652a-655d-ba9c-222b5aa79f72@linux.intel.com> Date: Sat, 28 Jan 2023 16:04:32 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Cc: baolu.lu@linux.intel.com, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, hch@lst.de, jgg@nvidia.com Subject: Re: [PATCH v2 2/8] iommu: Validate that devices match domains Content-Language: en-US To: Robin Murphy , joro@8bytes.org, will@kernel.org References: <0f78ba36a7b31a0d534416e56ea0f1af0efc2659.1674753627.git.robin.murphy@arm.com> From: Baolu Lu In-Reply-To: <0f78ba36a7b31a0d534416e56ea0f1af0efc2659.1674753627.git.robin.murphy@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/1/27 2:26, Robin Murphy wrote: > Before we can allow drivers to coexist, we need to make sure that one > driver's domain ops can't misinterpret another driver's dev_iommu_priv > data. To that end, add a token to the domain so we can remember how it > was allocated - for now this may as well be the device ops, since they > still correlate 1:1 with drivers. We can trust ourselves for internal > default domain attachment, so add the check where it covers both the > external attach interfaces. > > Signed-off-by: Robin Murphy Reviewed-by: Lu Baolu Best regards, baolu