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

Ping: [PATCH] VT-d: constrain IGD check


  • To: Kevin Tian <kevin.tian@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 13 Mar 2023 15:23:44 +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=xc8jSToByFxjPb8Ppsv3tXE55Pzuk5COE9TF1MPLe3g=; b=MKOpOLg+WYknri1lDV2SWMpE0vQtDI61h6OvhfsfiiltmoDTGdSQmYcpywhRAmwSNMJ9oSMPR5h2Pk9y2FXDq+2GcNaOF+0ee/RcPQkYi1J7/R3+cyQ/0uoO3wqDfVhtVOtrR3iTPs/QDDicjdiyXE7NXkjwoFjEW/qyTAtFqb+96mE/I8k7W2W+rW/ZVf4JllDjnMsr8rbgkI6JR8xeGEOhZ2IkRFt3/XDsXjQTPc0mUjTA7aV1ul7gWVIQHcI4hbaSIn5fxntLaRURiE0FvMQZKTyo2piAa9usZeUJcSC42W1tzEaeRDN8PBjmYt0pVxiuiE5e38GvZwQO/9YwFQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MA+nzixJQbPPK9gS+9hzcmhfXVGnaqdIuUwqpuVpOHX00WNbKY/P8zxc7/sNGp/cPpqb+WcpwKDtEudtzbvCUl9O6Z2uh9ZCEi4lwlGrEVDzXqXSAh3DH3jEEEvqtaaIp8O/WLEPuyo5amw1uriIUeK6X39yUYg/bonEViwOZsC1qmu9/1qxL7LocwCKkaKc855w7qebq68Bre1bmxG0F03YCvVjtO7kwyaggORpgMgVItlbIhiDwjGXpIS7lm/QJllQNZYoxL5eCExbNZniLl3tazRl95xP/30j0rojPTuhwToX7DvThCMNNh5qpmaJhQ+4yGf6e/VtBNn343ROmA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Marek Marczykowski <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 13 Mar 2023 14:24:10 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 28.02.2023 10:51, Jan Beulich wrote:
> Marking a DRHD as controlling an IGD isn't very sensible without
> checking that at the very least it's a graphics device that lives at
> 0000:00:02.0. Re-use the reading of the class-code to control both the
> clearing of "gfx_only" and the setting of "igd_drhd_address".
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Kevin?

Thanks, Jan

> ---
> This way we also read the class code when we don't really need it, but
> I think that's tolerable, and the simpler logic is preferable. The more
> that with Marek's proposed patch, adjusted as suggested, we'd read
> vendor and device IDs unconditionally for all devices (enumerated for a
> DRHD) anyway.
> 
> --- a/xen/drivers/passthrough/vtd/dmar.c
> +++ b/xen/drivers/passthrough/vtd/dmar.c
> @@ -391,15 +391,12 @@ static int __init acpi_parse_dev_scope(
>  
>              if ( drhd )
>              {
> -                if ( (seg == 0) && (bus == 0) && (path->dev == 2) &&
> -                     (path->fn == 0) )
> -                    igd_drhd_address = drhd->address;
> -
> -                if ( gfx_only &&
> -                     pci_conf_read8(PCI_SBDF(seg, bus, path->dev, path->fn),
> +                if ( pci_conf_read8(PCI_SBDF(seg, bus, path->dev, path->fn),
>                                      PCI_CLASS_DEVICE + 1) != 0x03
>                                      /* PCI_BASE_CLASS_DISPLAY */ )
>                      gfx_only = false;
> +                else if ( !seg && !bus && path->dev == 2 && !path->fn )
> +                    igd_drhd_address = drhd->address;
>              }
>  
>              break;




 


Rackspace

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