From: Ross Philipson Date: Fri, 13 Feb 2009 20:14:36 +0000 (-0500) Subject: Patch to revert parts of the tboot patches from Wed Feb 4 10:47:48. X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=c28df2ebeea7101b98ebe6a9c46b7d7adbf4044d;p=xenclient%2Fxen.git Patch to revert parts of the tboot patches from Wed Feb 4 10:47:48. This addresses the hang on the Lenovo laptops. More investigation needs to be done as to why the hang occurs since the original changes are not really incorrect. For not this will prevent the hang. Changes to be committed: modified: xen/arch/x86/setup.c modified: xen/arch/x86/tboot.c modified: xen/drivers/passthrough/vtd/iommu.c --- diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index b8694e8..e0a510b 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -1120,16 +1120,10 @@ void arch_get_xen_caps(xen_capabilities_info_t *info) int xen_in_range(paddr_t start, paddr_t end) { - /* CS 19060 removed xenheap_phys_start, CS 19081 fixed 64b range */ -#if defined(CONFIG_X86_32) - paddr_t xs = 0; - paddr_t xe = xenheap_phys_end; -#else - paddr_t xs = __pa(&_stext); - paddr_t xe = __pa(&_etext); -#endif - - return (start < xe) && (end > xs); + start = max_t(paddr_t, start, xenheap_phys_start); + end = min_t(paddr_t, end, xenheap_phys_end); + + return start < end; } /* diff --git a/xen/arch/x86/tboot.c b/xen/arch/x86/tboot.c index 608d34d..6b51bc3 100644 --- a/xen/arch/x86/tboot.c +++ b/xen/arch/x86/tboot.c @@ -251,6 +251,18 @@ int __init tboot_parse_dmar_table(acpi_table_handler dmar_handler) return rc; } +int tboot_in_range(paddr_t start, paddr_t end) +{ + if ( g_tboot_shared == NULL || g_tboot_shared->version < 0x02 ) + return 0; + + start = max_t(paddr_t, start, g_tboot_shared->tboot_base); + end = min_t(paddr_t, end, + g_tboot_shared->tboot_base + g_tboot_shared->tboot_size); + + return start < end; +} + /* * Local variables: * mode: C diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index 48ba038..905104d 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -1034,7 +1034,8 @@ static int intel_iommu_domain_init(struct domain *d) if ( d->domain_id == 0 ) { - extern int xen_in_range(paddr_t start, paddr_t end); + extern int xen_in_range(paddr_t start, paddr_t end); + extern int tboot_in_range(paddr_t start, paddr_t end); /* * Set up 1:1 page table for dom0 except the critical segments @@ -1043,8 +1044,11 @@ static int intel_iommu_domain_init(struct domain *d) for ( i = 0; i < max_page; i++ ) { /* CS 19084 remove tboot_in_range, CS 19085 use page_is_conventional_ram */ - if ( !page_is_conventional_ram(i) || + /*if ( !page_is_conventional_ram(i) || xen_in_range(i << PAGE_SHIFT, (i + 1) << PAGE_SHIFT) ) + continue;*/ + if ( xen_in_range(i << PAGE_SHIFT_4K, (i + 1) << PAGE_SHIFT_4K) || + tboot_in_range(i << PAGE_SHIFT_4K, (i + 1) << PAGE_SHIFT_4K) ) continue; iommu_map_page(d, i, i);