WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH][VTD][QUIRK] added quirks for Sandybridge errata

To: "Allen M Kay" <allen.m.kay@xxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH][VTD][QUIRK] added quirks for Sandybridge errata workaround, WLAN, VT-d fault escalation
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Tue, 18 Jan 2011 09:49:25 +0000
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Keir Fraser <keir@xxxxxxx>
Delivery-date: Tue, 18 Jan 2011 01:49:30 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <987664A83D2D224EAE907B061CE93D530194107F82@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <987664A83D2D224EAE907B061CE93D530194107F82@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
>>> On 14.01.11 at 00:40, "Kay, Allen M" <allen.m.kay@xxxxxxxxx> wrote:
>+static void snb_vtd_ops_preamble(struct iommu* iommu)
>+{
>+    struct intel_iommu *intel = iommu->intel;
>+    struct acpi_drhd_unit *drhd = intel ? intel->drhd : NULL;
>+    s_time_t start_time;
>+
>+    if ( !is_igd_drhd(drhd) || !is_snb_gfx )
>+        return;
>+
>+    if ( !map_igd_reg() )
>+        return;
>+
>+    *((volatile u32 *)(igd_reg_va + 0x54)) = 0x000FFFFF;
>+    *((volatile u32 *)(igd_reg_va + 0x700)) = 0;
>+
>+    start_time = NOW();
>+    while ( (*((volatile u32 *)(igd_reg_va + 0x2AC)) & 0xF) != 0 )
>+    {
>+        if ( NOW() > start_time + DMAR_OPERATION_TIMEOUT )
>+        {
>+            dprintk(XENLOG_INFO VTDPREFIX,
>+                    "snb_vtd_ops_preamble: failed to disable idle 
>handshake\n");
>+            break;
>+        }
>+        cpu_relax();
>+    }
>+
>+    *((volatile u32*)(igd_reg_va + 0x50)) = 0x10001;
>+}
>+
>+static void snb_vtd_ops_postamble(struct iommu* iommu)
>+{
>+    struct intel_iommu *intel = iommu->intel;
>+    struct acpi_drhd_unit *drhd = intel ? intel->drhd : NULL;
>+
>+    if ( !is_igd_drhd(drhd) || !is_snb_gfx )
>+        return;
>+
>+    if ( !map_igd_reg() )
>+        return;
>+
>+    *((volatile u32 *)(igd_reg_va + 0x54)) = 0xA;
>+    *((volatile u32 *)(igd_reg_va + 0x50)) = 0x10000;
>+}

Isn't there a risk that these MMIO writes interfere with the
operation of the actual driver running in a domain?

And even just in Xen itself, how do these writes get
synchronized? Callers of vtd_ops_preamble_quirk() don't
appear to be required to hold any particular lock.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel