[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 3/8] x86/iommu: iommu_igfx, iommu_qinval and iommu_snoop are VT-d specific


  • To: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 13 Jan 2023 09:39:23 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=n8StdBSUm+VmJk5Ih9218PPvQ1Hl08H3FHmwUGtF2OA=; b=g7xthdexPrAklO2dOerTqdZBDc/nGS5deAcSMuj3E1+wFp3zWaSJLbxGqeBt5UDz4Eo80OfoLhsoLHevG4b4kptw/rHKy1euAO9Pm7V8ABmLFJiofRKrNxjY7XF/dyZyAAYED2SW8FuMY4oZvclTtN/gxrkxSB3eU9fTUEWsKRE0p92GbVsLeNqAQPyWJo17ygtoszi7OqeyagQuhNf8tfs/6KY+TRl6B7au+YLVRXV8veXSuszlaHL8j4YIRzh+yy3aAbctJcxuQ0xKtu3GXLjXrvK9AW20DlRJvAemmS2YxF5PD9O5sDP5ohQ3hWUXG1X9eg/b0J6r8KRs5NxXAQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kr0Dy+a3QHf6kFJmMHkBA8xASRoY249CXrOGs6EIjnI7RBd6RrlDQp5KLWdoMwxMvZW8+knvFYk/qz5bm83h/XHp8o5B270AkuWfiDaW63VHLemxy7HpgAZRFsBTlNOQb6V5fg6ZT1kONM4TZHlCaU0HXUP2UXvl6izTqCefnzU3Obv/Mg/HMnR91RN+rFkObKgKNdCygwX6puoL5xsmNmKjNF2kS8CftwhaO62u2+CaenRugectNVOYnZzZlTB17iMqmxA4ZrrM0BUIlYvo29yTrzSd+MiC9/u16Dtfruo1joZAuAwFL1vK86zC9NrxhkImLf0wbgViVDMp/83L4w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Paul Durrant <paul@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 13 Jan 2023 08:39:45 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 13.01.2023 09:10, Xenia Ragiadakou wrote:
> 
> On 1/12/23 17:53, Jan Beulich wrote:
>> On 12.01.2023 16:43, Xenia Ragiadakou wrote:
>>> On 1/12/23 13:49, Xenia Ragiadakou wrote:
>>>> On 1/12/23 13:31, Jan Beulich wrote:
>>>>> On 04.01.2023 09:44, Xenia Ragiadakou wrote:
>>>>>> --- a/xen/include/xen/iommu.h
>>>>>> +++ b/xen/include/xen/iommu.h
>>>>>> @@ -74,9 +74,13 @@ extern enum __packed iommu_intremap {
>>>>>>       iommu_intremap_restricted,
>>>>>>       iommu_intremap_full,
>>>>>>    } iommu_intremap;
>>>>>> -extern bool iommu_igfx, iommu_qinval, iommu_snoop;
>>>>>>    #else
>>>>>>    # define iommu_intremap false
>>>>>> +#endif
>>>>>> +
>>>>>> +#ifdef CONFIG_INTEL_IOMMU
>>>>>> +extern bool iommu_igfx, iommu_qinval, iommu_snoop;
>>>>>> +#else
>>>>>>    # define iommu_snoop false
>>>>>>    #endif
>>>>>
>>>>> Do these declarations really need touching? In patch 2 you didn't move
>>>>> amd_iommu_perdev_intremap's either.
>>>>
>>>> Ok, I will revert this change (as I did in v2 of patch 2) since it is
>>>> not needed.
>>>
>>> Actually, my patch was altering the current behavior by defining
>>> iommu_snoop as false when !INTEL_IOMMU.
>>>
>>> IIUC, there is no control over snoop behavior when using the AMD iommu.
>>> Hence, iommu_snoop should evaluate to true for AMD iommu.
>>> However, when using the INTEL iommu the user can disable it via the
>>> "iommu" param, right?
>>
>> That's the intended behavior, yes, but right now we allow the option
>> to also affect behavior on AMD - perhaps wrongly so, as there's one
>> use outside of VT-x and VT-d code. But of course the option is
>> documented to be there for VT-d only, so one can view it as user
>> error if it's used on a non-VT-d system.
>>
>>> If that's the case then iommu_snoop needs to be moved from vtd/iommu.c
>>> to x86/iommu.c and iommu_snoop assignment via iommu param needs to be
>>> guarded by CONFIG_INTEL_IOMMU.
>>
>> Or #define to true when !INTEL_IOMMU and keep the variable where it
>> is.
> 
> Given the current implementation, if defined to true, it will be true 
> even when !iommu_enabled.

Which is supposed to be benign; I'm about to send a patch to actually
make it benign in shadow code as well (which is the one place where I
notice it isn't right now).

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.