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] [RFC][PATCH][VTD][v2] consolidate VT-d quirks into a single

To: Jan Beulich <JBeulich@xxxxxxxxxx>
Subject: [Xen-devel] [RFC][PATCH][VTD][v2] consolidate VT-d quirks into a single file quirks.c
From: "Kay, Allen M" <allen.m.kay@xxxxxxxxx>
Date: Thu, 14 Oct 2010 17:25:49 -0700
Accept-language: en-US
Acceptlanguage: en-US
Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 14 Oct 2010 17:26:40 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4CB6E3BC020000780001D1B6@xxxxxxxxxxxxxxxxxx>
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: <987664A83D2D224EAE907B061CE93D5301643A8DC7@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <4CB6E3BC020000780001D1B6@xxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: ActrftDrMXzF6WYLQ4C8o7D/5qk+twAfJPAw
Thread-topic: [RFC][PATCH][VTD][v2] consolidate VT-d quirks into a single file quirks.c
>>+static int map_igd_reg(void)
>>+{
>>+    u64 igd_mmio, igd_reg;
>>+    int status;
>>+
>>+    if ( igd_reg_va != NULL )
>>+        return 0;
>>+
>>+    igd_mmio = ((u64)pci_conf_read32(0, INTEL_IGD_DEV, 0, 0x14) << 32) +
>>+                     pci_conf_read32(0, INTEL_IGD_DEV, 0, 0x10);
>>+    igd_reg = (igd_mmio & IGD_BAR_MASK) + 0x2000;
>>+    status = map_pages_to_xen(igd_reg, igd_reg >> PAGE_SHIFT, 1,
>>+                           __PAGE_HYPERVISOR);
>
> You're mapping to *virtual* address igd_reg here? Even if this was
> done only at boot time it would seem wrong, but as I understand it
> this is done so even at run time, which is an absolute no-go.

I don't quite understand this comment.  This mapping is only done once, 
subsequent calls will just return since igd_reg_va will no longer be NULL.  Can 
you elaborate on the reason mapping cannot be done here?  Any suggestion for 
alternatives?

Other than that, I have incorporated you other feedbacks.  See attached patch 
for the changes:

1) backed out new parameter in acpi_parse_dev_scope().  Changed code as you 
suggested.
2) added "volatile" qualifier to mmio read operation in 
cantiga_vtd_ops_preamble()
3) consolidated code for ME phantom function map/unmap.
4) moved initial call to map_igd_reg() to platform_quirks_setup() - not sure if 
this alleviates your concern above...
5) added more comments

Allen

Attachment: quirks10142.patch
Description: quirks10142.patch

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