* [PATCH] Included reserved memory regions in dom0 iommu mappings
@ 2009-02-23 20:00 Ross Philipson
2009-02-26 9:20 ` Cui, Dexuan
0 siblings, 1 reply; 9+ messages in thread
From: Ross Philipson @ 2009-02-23 20:00 UTC (permalink / raw)
To: xen-devel@lists.xensource.com
[-- Attachment #1.1: Type: text/plain, Size: 765 bytes --]
This adds a boolean boot parameter to xen to allow reserved memory
regions to be added to the iommu mappings for dom0. The parameter
is "iommu_include_reserved" and is off by default. A warning is
also traced when incorrect RMRR to system memory map values are
detected. This is being added to address some incorrect BIOS's that
do not report correctly the requied reserved memory ranges in
the RMRRs. When this occurs it currently can cause early boot hangs
and crashes.
Signed-off-by: Ross Philipson <ross.philipson@citrix.com>
Based on changeset 19238
Thanks
Ross
Ross Philipson
Senior Software Engineer
Citrix Systems, Inc
14 Crosby Drive
Bedford, MA 01730
781-301-7949
ross.philipson@citrix.com<mailto:ross.philipson@citrix.com>
[-- Attachment #1.2: Type: text/html, Size: 7004 bytes --]
[-- Attachment #2: iommu_include_reserved.patch --]
[-- Type: application/octet-stream, Size: 6972 bytes --]
diff -r f8187a343ad2 xen/arch/ia64/xen/mm.c
--- a/xen/arch/ia64/xen/mm.c Fri Feb 20 17:02:36 2009 +0000
+++ b/xen/arch/ia64/xen/mm.c Mon Feb 23 14:35:20 2009 -0500
@@ -3236,8 +3236,13 @@ int get_page_type(struct page_info *page
return 1;
}
-int page_is_conventional_ram(unsigned long mfn)
+int page_is_ram_type(unsigned long mfn, unsigned long type)
{
+ /**
+ * N.B. This function could be enhanced to return what is more in line with the e820
+ * semantics for usable and reservered RAM. Since it is only used once in vga.c in
+ * the IA64 case it is ok to ignore the type parameter.
+ */
return (efi_mem_type(pfn_to_paddr(mfn)) == EFI_CONVENTIONAL_MEMORY);
}
diff -r f8187a343ad2 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Fri Feb 20 17:02:36 2009 +0000
+++ b/xen/arch/x86/mm.c Mon Feb 23 14:35:20 2009 -0500
@@ -279,15 +279,30 @@ void __init arch_init_memory(void)
subarch_init_memory();
}
-int page_is_conventional_ram(unsigned long mfn)
+int page_is_ram_type(unsigned long mfn, unsigned long mem_type)
{
uint64_t maddr = pfn_to_paddr(mfn);
int i;
for ( i = 0; i < e820.nr_map; i++ )
{
- if ( (e820.map[i].type == E820_RAM) &&
- (e820.map[i].addr <= maddr) &&
+ switch (e820.map[i].type)
+ {
+ case E820_RAM:
+ if (mem_type & RAM_TYPE_CONVENTIONAL)
+ break;
+ continue;
+ case E820_RESERVED:
+ if (mem_type & RAM_TYPE_RESERVED)
+ break;
+ continue;
+ default:
+ /* unknown */
+ continue;
+ }
+
+ /* test the range */
+ if ( (e820.map[i].addr <= maddr) &&
((e820.map[i].addr + e820.map[i].size) >= (maddr + PAGE_SIZE)) )
return 1;
}
diff -r f8187a343ad2 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c Fri Feb 20 17:02:36 2009 +0000
+++ b/xen/arch/x86/setup.c Mon Feb 23 14:35:20 2009 -0500
@@ -986,6 +986,9 @@ void __init __start_xen(unsigned long mb
if ( opt_watchdog )
watchdog_enable();
+ if ( !tboot_protect_mem_regions() )
+ panic("Could not protect TXT memory regions\n");
+
/* Create initial domain 0. */
dom0 = domain_create(0, 0, DOM0_SSIDREF);
if ( (dom0 == NULL) || (alloc_vcpu(dom0, 0, 0) == NULL) )
@@ -1036,9 +1039,6 @@ void __init __start_xen(unsigned long mb
if ( xen_cpuidle )
xen_processor_pmbits |= XEN_PROCESSOR_PM_CX;
-
- if ( !tboot_protect_mem_regions() )
- panic("Could not protect TXT memory regions\n");
/*
* We're going to setup domain0 using the module(s) that we stashed safely
diff -r f8187a343ad2 xen/drivers/passthrough/vtd/dmar.c
--- a/xen/drivers/passthrough/vtd/dmar.c Fri Feb 20 17:02:36 2009 +0000
+++ b/xen/drivers/passthrough/vtd/dmar.c Mon Feb 23 14:35:20 2009 -0500
@@ -377,6 +377,19 @@ acpi_parse_one_rmrr(struct acpi_dmar_ent
return -EFAULT;
}
+#ifdef CONFIG_X86
+ /* This check is here simply to detect when RMRR values are not properly represented in the
+ system memory map and inform the user */
+ if ( (!page_is_ram_type(paddr_to_pfn(rmrr->base_address), RAM_TYPE_RESERVED))||
+ (!page_is_ram_type(paddr_to_pfn(rmrr->end_address) - 1, RAM_TYPE_RESERVED)) )
+ {
+ dprintk(XENLOG_WARNING VTDPREFIX,
+ "RMRR address range not in reserved memory base = %"PRIx64" end = %"PRIx64"; " \
+ "iommu_include_reserved=1 parameter may be needed.\n",
+ rmrr->base_address, rmrr->end_address);
+ }
+#endif
+
rmrru = xmalloc(struct acpi_rmrr_unit);
if ( !rmrru )
return -ENOMEM;
diff -r f8187a343ad2 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c Fri Feb 20 17:02:36 2009 +0000
+++ b/xen/drivers/passthrough/vtd/iommu.c Mon Feb 23 14:35:20 2009 -0500
@@ -992,8 +992,6 @@ static int intel_iommu_domain_init(struc
if ( d->domain_id == 0 )
{
- extern int xen_in_range(paddr_t start, paddr_t end);
-
/* Set up 1:1 page table for dom0 */
iommu_set_dom0_mapping(d);
diff -r f8187a343ad2 xen/drivers/passthrough/vtd/x86/vtd.c
--- a/xen/drivers/passthrough/vtd/x86/vtd.c Fri Feb 20 17:02:36 2009 +0000
+++ b/xen/drivers/passthrough/vtd/x86/vtd.c Mon Feb 23 14:35:20 2009 -0500
@@ -26,6 +26,10 @@
#include "../iommu.h"
#include "../dmar.h"
#include "../vtd.h"
+
+/* iommu_include_reserved: include reserved memory ranges in dom0 1-1 iommu mappings if set */
+static int iommu_include_reserved = 0;
+boolean_param("iommu_include_reserved", iommu_include_reserved);
void *map_vtd_domain_page(u64 maddr)
{
@@ -147,15 +151,22 @@ void iommu_set_dom0_mapping(struct domai
void iommu_set_dom0_mapping(struct domain *d)
{
u64 i, j, tmp;
+ u32 mem_type;
extern int xen_in_range(paddr_t start, paddr_t end);
BUG_ON(d->domain_id != 0);
+ /* input param overrides default memory mapping */
+ mem_type = RAM_TYPE_CONVENTIONAL;
+ if (iommu_include_reserved)
+ mem_type |= RAM_TYPE_RESERVED;
+
for ( i = 0; i < max_page; i++ )
{
- /* Set up 1:1 mapping for dom0 for all RAM except Xen bits. */
- if ( !page_is_conventional_ram(i) ||
- xen_in_range(i << PAGE_SHIFT, (i + 1) << PAGE_SHIFT) )
+ /* Set up 1:1 mapping for dom0 for all RAM except Xen bits and reserved, unusable, etc. */
+ /* Modified to include reserved memory regions for some broken BIOS' */
+ if ( !page_is_ram_type(i, mem_type) ||
+ xen_in_range(i << PAGE_SHIFT, (i + 1) << PAGE_SHIFT) )
continue;
tmp = 1 << (PAGE_SHIFT - PAGE_SHIFT_4K);
diff -r f8187a343ad2 xen/drivers/video/vga.c
--- a/xen/drivers/video/vga.c Fri Feb 20 17:02:36 2009 +0000
+++ b/xen/drivers/video/vga.c Mon Feb 23 14:35:20 2009 -0500
@@ -79,7 +79,7 @@ void __init vga_init(void)
switch ( vga_console_info.video_type )
{
case XEN_VGATYPE_TEXT_MODE_3:
- if ( page_is_conventional_ram(paddr_to_pfn(0xB8000)) ||
+ if ( page_is_ram_type(paddr_to_pfn(0xB8000), RAM_TYPE_CONVENTIONAL) ||
((video = ioremap(0xB8000, 0x8000)) == NULL) )
return;
outw(0x200a, 0x3d4); /* disable cursor */
diff -r f8187a343ad2 xen/include/xen/mm.h
--- a/xen/include/xen/mm.h Fri Feb 20 17:02:36 2009 +0000
+++ b/xen/include/xen/mm.h Mon Feb 23 14:35:20 2009 -0500
@@ -273,8 +273,10 @@ unsigned long avail_scrub_pages(void);
int guest_remove_page(struct domain *d, unsigned long gmfn);
-/* Returns TRUE if the whole page at @mfn is ordinary RAM. */
-int page_is_conventional_ram(unsigned long mfn);
+#define RAM_TYPE_CONVENTIONAL 0x00000001
+#define RAM_TYPE_RESERVED 0x00000002
+/* Returns TRUE if the whole page at @mfn is of the requested RAM type(s) above. */
+int page_is_ram_type(unsigned long mfn, unsigned long mem_type);
extern unsigned long *alloc_bitmap; /* for vmcoreinfo */
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread* RE: [PATCH] Included reserved memory regions in dom0 iommu mappings
2009-02-23 20:00 [PATCH] Included reserved memory regions in dom0 iommu mappings Ross Philipson
@ 2009-02-26 9:20 ` Cui, Dexuan
2009-02-26 14:05 ` Ross Philipson
2009-02-26 15:30 ` Keir Fraser
0 siblings, 2 replies; 9+ messages in thread
From: Cui, Dexuan @ 2009-02-26 9:20 UTC (permalink / raw)
To: Ross Philipson, xen-devel@lists.xensource.com
[-- Attachment #1: Type: text/plain, Size: 1513 bytes --]
The patch is useful when BIOS doesn’t report RMRR correctly; however the patch may not help in some situations.
E.g., to work around a buggy BIOS, we may have to map such an E820 entry
(XEN) 00000000cff0b000 - 00000000d0000000 (reserved).
But if we use a xen parameter "mem=512m", or, if the host only has 512m memory, the variable 'max_page" is 512m/PAGE_SIZE, so even with the patch, the E820 entry would not be mapped, and Xen would still hang.
-- Dexuan
________________________________________
From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Ross Philipson
Sent: 2009年2月24日 4:01
To: xen-devel@lists.xensource.com
Subject: [Xen-devel] [PATCH] Included reserved memory regions in dom0 iommu mappings
This adds a boolean boot parameter to xen to allow reserved memory
regions to be added to the iommu mappings for dom0. The parameter
is "iommu_include_reserved" and is off by default. A warning is
also traced when incorrect RMRR to system memory map values are
detected. This is being added to address some incorrect BIOS's that
do not report correctly the requied reserved memory ranges in
the RMRRs. When this occurs it currently can cause early boot hangs
and crashes.
Signed-off-by: Ross Philipson <ross.philipson@citrix.com>
Based on changeset 19238
Thanks
Ross
Ross Philipson
Senior Software Engineer
Citrix Systems, Inc
14 Crosby Drive
Bedford, MA 01730
781-301-7949
ross.philipson@citrix.com
[-- Attachment #2: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH] Included reserved memory regions in dom0 iommu mappings
2009-02-26 9:20 ` Cui, Dexuan
@ 2009-02-26 14:05 ` Ross Philipson
2009-02-26 15:30 ` Keir Fraser
1 sibling, 0 replies; 9+ messages in thread
From: Ross Philipson @ 2009-02-26 14:05 UTC (permalink / raw)
To: Cui, Dexuan, xen-devel@lists.xensource.com
Agreed. Bear in mind it is a workaround just for some cases we have seen. But yes if there are reserved ranges beyond the highest E820_RAM type in the memory map then they would still be excluded. The workaround could be extended to add these but I guess where does the working around end. For example I got an email yesterday from someone who has a really broken BIOS where the RMRR end addresses are higher than the start addresses. The patch can't help here either.
Thanks
Ross
-----Original Message-----
From: Cui, Dexuan [mailto:dexuan.cui@intel.com]
Sent: Thursday, February 26, 2009 4:20 AM
To: Ross Philipson; xen-devel@lists.xensource.com
Subject: RE: [Xen-devel] [PATCH] Included reserved memory regions in dom0 iommu mappings
The patch is useful when BIOS doesn’t report RMRR correctly; however the patch may not help in some situations.
E.g., to work around a buggy BIOS, we may have to map such an E820 entry
(XEN) 00000000cff0b000 - 00000000d0000000 (reserved).
But if we use a xen parameter "mem=512m", or, if the host only has 512m memory, the variable 'max_page" is 512m/PAGE_SIZE, so even with the patch, the E820 entry would not be mapped, and Xen would still hang.
-- Dexuan
________________________________________
From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Ross Philipson
Sent: 2009年2月24日 4:01
To: xen-devel@lists.xensource.com
Subject: [Xen-devel] [PATCH] Included reserved memory regions in dom0 iommu mappings
This adds a boolean boot parameter to xen to allow reserved memory
regions to be added to the iommu mappings for dom0. The parameter
is "iommu_include_reserved" and is off by default. A warning is
also traced when incorrect RMRR to system memory map values are
detected. This is being added to address some incorrect BIOS's that
do not report correctly the requied reserved memory ranges in
the RMRRs. When this occurs it currently can cause early boot hangs
and crashes.
Signed-off-by: Ross Philipson <ross.philipson@citrix.com>
Based on changeset 19238
Thanks
Ross
Ross Philipson
Senior Software Engineer
Citrix Systems, Inc
14 Crosby Drive
Bedford, MA 01730
781-301-7949
ross.philipson@citrix.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Included reserved memory regions in dom0 iommu mappings
2009-02-26 9:20 ` Cui, Dexuan
2009-02-26 14:05 ` Ross Philipson
@ 2009-02-26 15:30 ` Keir Fraser
2009-02-26 15:38 ` Ross Philipson
1 sibling, 1 reply; 9+ messages in thread
From: Keir Fraser @ 2009-02-26 15:30 UTC (permalink / raw)
To: Cui, Dexuan, Ross Philipson, xen-devel@lists.xensource.com
I'm not keen on Ross's patch anyway. I think if you have such a broken
system, the cmdline option should simply identity-map everything below 4GB,
unconditionally. Easy.
-- Keir
On 26/02/2009 09:20, "Cui, Dexuan" <dexuan.cui@intel.com> wrote:
> The patch is useful when BIOS doesn’t report RMRR correctly; however the patch
> may not help in some situations.
> E.g., to work around a buggy BIOS, we may have to map such an E820 entry
> (XEN) 00000000cff0b000 - 00000000d0000000 (reserved).
> But if we use a xen parameter "mem=512m", or, if the host only has 512m
> memory, the variable 'max_page" is 512m/PAGE_SIZE, so even with the patch, the
> E820 entry would not be mapped, and Xen would still hang.
>
> -- Dexuan
>
> ________________________________________
> From: xen-devel-bounces@lists.xensource.com
> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Ross Philipson
> Sent: 2009年2月24日 4:01
> To: xen-devel@lists.xensource.com
> Subject: [Xen-devel] [PATCH] Included reserved memory regions in dom0 iommu
> mappings
>
> This adds a boolean boot parameter to xen to allow reserved memory
> regions to be added to the iommu mappings for dom0. The parameter
> is "iommu_include_reserved" and is off by default. A warning is
> also traced when incorrect RMRR to system memory map values are
> detected. This is being added to address some incorrect BIOS's that
> do not report correctly the requied reserved memory ranges in
> the RMRRs. When this occurs it currently can cause early boot hangs
> and crashes.
>
> Signed-off-by: Ross Philipson <ross.philipson@citrix.com>
>
> Based on changeset 19238
>
> Thanks
> Ross
>
>
> Ross Philipson
> Senior Software Engineer
> Citrix Systems, Inc
> 14 Crosby Drive
> Bedford, MA 01730
> 781-301-7949
> ross.philipson@citrix.com
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH] Included reserved memory regions in dom0 iommu mappings
2009-02-26 15:30 ` Keir Fraser
@ 2009-02-26 15:38 ` Ross Philipson
2009-02-26 16:11 ` Keir Fraser
0 siblings, 1 reply; 9+ messages in thread
From: Ross Philipson @ 2009-02-26 15:38 UTC (permalink / raw)
To: Keir Fraser, Cui, Dexuan, xen-devel@lists.xensource.com
There are some regions that I think would really need to be excluded that are related to TXT and tboot too though. The current tboot code puts these in the e820 as unusable as apposed to reserved. What if we mapped in all 4GB with the exception of unusable ranges and where xen is?
Thanks
Ross
-----Original Message-----
From: Keir Fraser
Sent: Thursday, February 26, 2009 10:30 AM
To: Cui, Dexuan; Ross Philipson; xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] [PATCH] Included reserved memory regions in dom0 iommu mappings
I'm not keen on Ross's patch anyway. I think if you have such a broken
system, the cmdline option should simply identity-map everything below 4GB,
unconditionally. Easy.
-- Keir
On 26/02/2009 09:20, "Cui, Dexuan" <dexuan.cui@intel.com> wrote:
> The patch is useful when BIOS doesn’t report RMRR correctly; however the patch
> may not help in some situations.
> E.g., to work around a buggy BIOS, we may have to map such an E820 entry
> (XEN) 00000000cff0b000 - 00000000d0000000 (reserved).
> But if we use a xen parameter "mem=512m", or, if the host only has 512m
> memory, the variable 'max_page" is 512m/PAGE_SIZE, so even with the patch, the
> E820 entry would not be mapped, and Xen would still hang.
>
> -- Dexuan
>
> ________________________________________
> From: xen-devel-bounces@lists.xensource.com
> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Ross Philipson
> Sent: 2009年2月24日 4:01
> To: xen-devel@lists.xensource.com
> Subject: [Xen-devel] [PATCH] Included reserved memory regions in dom0 iommu
> mappings
>
> This adds a boolean boot parameter to xen to allow reserved memory
> regions to be added to the iommu mappings for dom0. The parameter
> is "iommu_include_reserved" and is off by default. A warning is
> also traced when incorrect RMRR to system memory map values are
> detected. This is being added to address some incorrect BIOS's that
> do not report correctly the requied reserved memory ranges in
> the RMRRs. When this occurs it currently can cause early boot hangs
> and crashes.
>
> Signed-off-by: Ross Philipson <ross.philipson@citrix.com>
>
> Based on changeset 19238
>
> Thanks
> Ross
>
>
> Ross Philipson
> Senior Software Engineer
> Citrix Systems, Inc
> 14 Crosby Drive
> Bedford, MA 01730
> 781-301-7949
> ross.philipson@citrix.com
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Included reserved memory regions in dom0 iommu mappings
2009-02-26 15:38 ` Ross Philipson
@ 2009-02-26 16:11 ` Keir Fraser
2009-02-26 16:15 ` Ross Philipson
0 siblings, 1 reply; 9+ messages in thread
From: Keir Fraser @ 2009-02-26 16:11 UTC (permalink / raw)
To: Ross Philipson, Cui, Dexuan, xen-devel@lists.xensource.com
Yes, blacklist rather than whitelist, below 4G. Sounds good.
-- Keir
On 26/02/2009 15:38, "Ross Philipson" <Ross.Philipson@citrix.com> wrote:
> There are some regions that I think would really need to be excluded that are
> related to TXT and tboot too though. The current tboot code puts these in the
> e820 as unusable as apposed to reserved. What if we mapped in all 4GB with the
> exception of unusable ranges and where xen is?
>
> Thanks
> Ross
>
> -----Original Message-----
> From: Keir Fraser
> Sent: Thursday, February 26, 2009 10:30 AM
> To: Cui, Dexuan; Ross Philipson; xen-devel@lists.xensource.com
> Subject: Re: [Xen-devel] [PATCH] Included reserved memory regions in dom0
> iommu mappings
>
> I'm not keen on Ross's patch anyway. I think if you have such a broken
> system, the cmdline option should simply identity-map everything below 4GB,
> unconditionally. Easy.
>
> -- Keir
>
> On 26/02/2009 09:20, "Cui, Dexuan" <dexuan.cui@intel.com> wrote:
>
>> The patch is useful when BIOS doesn’t report RMRR correctly; however the
>> patch
>> may not help in some situations.
>> E.g., to work around a buggy BIOS, we may have to map such an E820 entry
>> (XEN) 00000000cff0b000 - 00000000d0000000 (reserved).
>> But if we use a xen parameter "mem=512m", or, if the host only has 512m
>> memory, the variable 'max_page" is 512m/PAGE_SIZE, so even with the patch,
>> the
>> E820 entry would not be mapped, and Xen would still hang.
>>
>> -- Dexuan
>>
>> ________________________________________
>> From: xen-devel-bounces@lists.xensource.com
>> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Ross Philipson
>> Sent: 2009年2月24日 4:01
>> To: xen-devel@lists.xensource.com
>> Subject: [Xen-devel] [PATCH] Included reserved memory regions in dom0 iommu
>> mappings
>>
>> This adds a boolean boot parameter to xen to allow reserved memory
>> regions to be added to the iommu mappings for dom0. The parameter
>> is "iommu_include_reserved" and is off by default. A warning is
>> also traced when incorrect RMRR to system memory map values are
>> detected. This is being added to address some incorrect BIOS's that
>> do not report correctly the requied reserved memory ranges in
>> the RMRRs. When this occurs it currently can cause early boot hangs
>> and crashes.
>>
>> Signed-off-by: Ross Philipson <ross.philipson@citrix.com>
>>
>> Based on changeset 19238
>>
>> Thanks
>> Ross
>>
>>
>> Ross Philipson
>> Senior Software Engineer
>> Citrix Systems, Inc
>> 14 Crosby Drive
>> Bedford, MA 01730
>> 781-301-7949
>> ross.philipson@citrix.com
>>
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH] Included reserved memory regions in dom0 iommu mappings
2009-02-26 16:11 ` Keir Fraser
@ 2009-02-26 16:15 ` Ross Philipson
2009-02-26 17:34 ` Cihula, Joseph
0 siblings, 1 reply; 9+ messages in thread
From: Ross Philipson @ 2009-02-26 16:15 UTC (permalink / raw)
To: Keir Fraser, Cui, Dexuan, xen-devel@lists.xensource.com
I will put together something like this then and resubmit. I would like Joe Cihula at Intel to comment and make sure I am not missing something that will impact tboot security.
Thanks
Ross
-----Original Message-----
From: Keir Fraser
Sent: Thursday, February 26, 2009 11:12 AM
To: Ross Philipson; Cui, Dexuan; xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] [PATCH] Included reserved memory regions in dom0 iommu mappings
Yes, blacklist rather than whitelist, below 4G. Sounds good.
-- Keir
On 26/02/2009 15:38, "Ross Philipson" <Ross.Philipson@citrix.com> wrote:
> There are some regions that I think would really need to be excluded that are
> related to TXT and tboot too though. The current tboot code puts these in the
> e820 as unusable as apposed to reserved. What if we mapped in all 4GB with the
> exception of unusable ranges and where xen is?
>
> Thanks
> Ross
>
> -----Original Message-----
> From: Keir Fraser
> Sent: Thursday, February 26, 2009 10:30 AM
> To: Cui, Dexuan; Ross Philipson; xen-devel@lists.xensource.com
> Subject: Re: [Xen-devel] [PATCH] Included reserved memory regions in dom0
> iommu mappings
>
> I'm not keen on Ross's patch anyway. I think if you have such a broken
> system, the cmdline option should simply identity-map everything below 4GB,
> unconditionally. Easy.
>
> -- Keir
>
> On 26/02/2009 09:20, "Cui, Dexuan" <dexuan.cui@intel.com> wrote:
>
>> The patch is useful when BIOS doesn’t report RMRR correctly; however the
>> patch
>> may not help in some situations.
>> E.g., to work around a buggy BIOS, we may have to map such an E820 entry
>> (XEN) 00000000cff0b000 - 00000000d0000000 (reserved).
>> But if we use a xen parameter "mem=512m", or, if the host only has 512m
>> memory, the variable 'max_page" is 512m/PAGE_SIZE, so even with the patch,
>> the
>> E820 entry would not be mapped, and Xen would still hang.
>>
>> -- Dexuan
>>
>> ________________________________________
>> From: xen-devel-bounces@lists.xensource.com
>> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Ross Philipson
>> Sent: 2009年2月24日 4:01
>> To: xen-devel@lists.xensource.com
>> Subject: [Xen-devel] [PATCH] Included reserved memory regions in dom0 iommu
>> mappings
>>
>> This adds a boolean boot parameter to xen to allow reserved memory
>> regions to be added to the iommu mappings for dom0. The parameter
>> is "iommu_include_reserved" and is off by default. A warning is
>> also traced when incorrect RMRR to system memory map values are
>> detected. This is being added to address some incorrect BIOS's that
>> do not report correctly the requied reserved memory ranges in
>> the RMRRs. When this occurs it currently can cause early boot hangs
>> and crashes.
>>
>> Signed-off-by: Ross Philipson <ross.philipson@citrix.com>
>>
>> Based on changeset 19238
>>
>> Thanks
>> Ross
>>
>>
>> Ross Philipson
>> Senior Software Engineer
>> Citrix Systems, Inc
>> 14 Crosby Drive
>> Bedford, MA 01730
>> 781-301-7949
>> ross.philipson@citrix.com
>>
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH] Included reserved memory regions in dom0 iommu mappings
2009-02-26 16:15 ` Ross Philipson
@ 2009-02-26 17:34 ` Cihula, Joseph
2009-02-26 18:11 ` Ross Philipson
0 siblings, 1 reply; 9+ messages in thread
From: Cihula, Joseph @ 2009-02-26 17:34 UTC (permalink / raw)
To: Ross Philipson, Keir Fraser, Cui, Dexuan,
xen-devel@lists.xensource.com
> From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On
> Behalf Of Ross Philipson
>
> I will put together something like this then and resubmit. I would like Joe Cihula at Intel to
> comment and make sure I am not missing something that will impact tboot security.
>
> Thanks
> Ross
I don't see a better way to solve this problem, so I'm OK with this as long as the Xen checks are left in. It will mostly be the same as Ross's patch but including a larger memory region and also the ACPI and NV memory types. As long as E820_UNUSABLE is still excluded, that will cover tboot's memory.
Joe
>
> -----Original Message-----
> From: Keir Fraser
> Sent: Thursday, February 26, 2009 11:12 AM
> To: Ross Philipson; Cui, Dexuan; xen-devel@lists.xensource.com
> Subject: Re: [Xen-devel] [PATCH] Included reserved memory regions in dom0 iommu mappings
>
> Yes, blacklist rather than whitelist, below 4G. Sounds good.
>
> -- Keir
>
> On 26/02/2009 15:38, "Ross Philipson" <Ross.Philipson@citrix.com> wrote:
>
> > There are some regions that I think would really need to be excluded that are
> > related to TXT and tboot too though. The current tboot code puts these in the
> > e820 as unusable as apposed to reserved. What if we mapped in all 4GB with the
> > exception of unusable ranges and where xen is?
> >
> > Thanks
> > Ross
> >
> > -----Original Message-----
> > From: Keir Fraser
> > Sent: Thursday, February 26, 2009 10:30 AM
> > To: Cui, Dexuan; Ross Philipson; xen-devel@lists.xensource.com
> > Subject: Re: [Xen-devel] [PATCH] Included reserved memory regions in dom0
> > iommu mappings
> >
> > I'm not keen on Ross's patch anyway. I think if you have such a broken
> > system, the cmdline option should simply identity-map everything below 4GB,
> > unconditionally. Easy.
> >
> > -- Keir
> >
> > On 26/02/2009 09:20, "Cui, Dexuan" <dexuan.cui@intel.com> wrote:
> >
> >> The patch is useful when BIOS doesn’t report RMRR correctly; however the
> >> patch
> >> may not help in some situations.
> >> E.g., to work around a buggy BIOS, we may have to map such an E820 entry
> >> (XEN) 00000000cff0b000 - 00000000d0000000 (reserved).
> >> But if we use a xen parameter "mem=512m", or, if the host only has 512m
> >> memory, the variable 'max_page" is 512m/PAGE_SIZE, so even with the patch,
> >> the
> >> E820 entry would not be mapped, and Xen would still hang.
> >>
> >> -- Dexuan
> >>
> >> ________________________________________
> >> From: xen-devel-bounces@lists.xensource.com
> >> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Ross Philipson
> >> Sent: 2009年2月24日 4:01
> >> To: xen-devel@lists.xensource.com
> >> Subject: [Xen-devel] [PATCH] Included reserved memory regions in dom0 iommu
> >> mappings
> >>
> >> This adds a boolean boot parameter to xen to allow reserved memory
> >> regions to be added to the iommu mappings for dom0. The parameter
> >> is "iommu_include_reserved" and is off by default. A warning is
> >> also traced when incorrect RMRR to system memory map values are
> >> detected. This is being added to address some incorrect BIOS's that
> >> do not report correctly the requied reserved memory ranges in
> >> the RMRRs. When this occurs it currently can cause early boot hangs
> >> and crashes.
> >>
> >> Signed-off-by: Ross Philipson <ross.philipson@citrix.com>
> >>
> >> Based on changeset 19238
> >>
> >> Thanks
> >> Ross
> >>
> >>
> >> Ross Philipson
> >> Senior Software Engineer
> >> Citrix Systems, Inc
> >> 14 Crosby Drive
> >> Bedford, MA 01730
> >> 781-301-7949
> >> ross.philipson@citrix.com
> >>
> >
> >
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH] Included reserved memory regions in dom0 iommu mappings
2009-02-26 17:34 ` Cihula, Joseph
@ 2009-02-26 18:11 ` Ross Philipson
0 siblings, 0 replies; 9+ messages in thread
From: Ross Philipson @ 2009-02-26 18:11 UTC (permalink / raw)
To: Cihula, Joseph, Keir Fraser, Cui, Dexuan,
xen-devel@lists.xensource.com
OK, I will remake the patch to include all memory under 4GB excluding xen and memory marked as unusable in sys memory map. I will make a new param to enable this - it will be off by default.
Thaks
Ross
-----Original Message-----
From: Cihula, Joseph [mailto:joseph.cihula@intel.com]
Sent: Thursday, February 26, 2009 12:34 PM
To: Ross Philipson; Keir Fraser; Cui, Dexuan; xen-devel@lists.xensource.com
Subject: RE: [Xen-devel] [PATCH] Included reserved memory regions in dom0 iommu mappings
> From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On
> Behalf Of Ross Philipson
>
> I will put together something like this then and resubmit. I would like Joe Cihula at Intel to
> comment and make sure I am not missing something that will impact tboot security.
>
> Thanks
> Ross
I don't see a better way to solve this problem, so I'm OK with this as long as the Xen checks are left in. It will mostly be the same as Ross's patch but including a larger memory region and also the ACPI and NV memory types. As long as E820_UNUSABLE is still excluded, that will cover tboot's memory.
Joe
>
> -----Original Message-----
> From: Keir Fraser
> Sent: Thursday, February 26, 2009 11:12 AM
> To: Ross Philipson; Cui, Dexuan; xen-devel@lists.xensource.com
> Subject: Re: [Xen-devel] [PATCH] Included reserved memory regions in dom0 iommu mappings
>
> Yes, blacklist rather than whitelist, below 4G. Sounds good.
>
> -- Keir
>
> On 26/02/2009 15:38, "Ross Philipson" <Ross.Philipson@citrix.com> wrote:
>
> > There are some regions that I think would really need to be excluded that are
> > related to TXT and tboot too though. The current tboot code puts these in the
> > e820 as unusable as apposed to reserved. What if we mapped in all 4GB with the
> > exception of unusable ranges and where xen is?
> >
> > Thanks
> > Ross
> >
> > -----Original Message-----
> > From: Keir Fraser
> > Sent: Thursday, February 26, 2009 10:30 AM
> > To: Cui, Dexuan; Ross Philipson; xen-devel@lists.xensource.com
> > Subject: Re: [Xen-devel] [PATCH] Included reserved memory regions in dom0
> > iommu mappings
> >
> > I'm not keen on Ross's patch anyway. I think if you have such a broken
> > system, the cmdline option should simply identity-map everything below 4GB,
> > unconditionally. Easy.
> >
> > -- Keir
> >
> > On 26/02/2009 09:20, "Cui, Dexuan" <dexuan.cui@intel.com> wrote:
> >
> >> The patch is useful when BIOS doesn’t report RMRR correctly; however the
> >> patch
> >> may not help in some situations.
> >> E.g., to work around a buggy BIOS, we may have to map such an E820 entry
> >> (XEN) 00000000cff0b000 - 00000000d0000000 (reserved).
> >> But if we use a xen parameter "mem=512m", or, if the host only has 512m
> >> memory, the variable 'max_page" is 512m/PAGE_SIZE, so even with the patch,
> >> the
> >> E820 entry would not be mapped, and Xen would still hang.
> >>
> >> -- Dexuan
> >>
> >> ________________________________________
> >> From: xen-devel-bounces@lists.xensource.com
> >> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Ross Philipson
> >> Sent: 2009年2月24日 4:01
> >> To: xen-devel@lists.xensource.com
> >> Subject: [Xen-devel] [PATCH] Included reserved memory regions in dom0 iommu
> >> mappings
> >>
> >> This adds a boolean boot parameter to xen to allow reserved memory
> >> regions to be added to the iommu mappings for dom0. The parameter
> >> is "iommu_include_reserved" and is off by default. A warning is
> >> also traced when incorrect RMRR to system memory map values are
> >> detected. This is being added to address some incorrect BIOS's that
> >> do not report correctly the requied reserved memory ranges in
> >> the RMRRs. When this occurs it currently can cause early boot hangs
> >> and crashes.
> >>
> >> Signed-off-by: Ross Philipson <ross.philipson@citrix.com>
> >>
> >> Based on changeset 19238
> >>
> >> Thanks
> >> Ross
> >>
> >>
> >> Ross Philipson
> >> Senior Software Engineer
> >> Citrix Systems, Inc
> >> 14 Crosby Drive
> >> Bedford, MA 01730
> >> 781-301-7949
> >> ross.philipson@citrix.com
> >>
> >
> >
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-02-26 18:11 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-23 20:00 [PATCH] Included reserved memory regions in dom0 iommu mappings Ross Philipson
2009-02-26 9:20 ` Cui, Dexuan
2009-02-26 14:05 ` Ross Philipson
2009-02-26 15:30 ` Keir Fraser
2009-02-26 15:38 ` Ross Philipson
2009-02-26 16:11 ` Keir Fraser
2009-02-26 16:15 ` Ross Philipson
2009-02-26 17:34 ` Cihula, Joseph
2009-02-26 18:11 ` Ross Philipson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.