aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/tboot.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-09-22 08:16:49 +0100
committerKeir Fraser <keir.fraser@citrix.com>2009-09-22 08:16:49 +0100
commitbac2000063ba239d33b631f6edda48cc6b57425b (patch)
tree1202e917a4903bdf3975f4ba018c8a4233c80973 /xen/arch/x86/tboot.c
parent615588563e99a23aaf37037c3fee0c413b051f4d (diff)
downloadxen-bac2000063ba239d33b631f6edda48cc6b57425b.tar.gz
xen-bac2000063ba239d33b631f6edda48cc6b57425b.tar.bz2
xen-bac2000063ba239d33b631f6edda48cc6b57425b.zip
x86-64: reduce range spanned by 1:1 mapping and frame table indexes
Introduces a virtual space conserving transformation on the MFN thus far used to index 1:1 mapping and frame table, removing the largest range of contiguous bits (below the most significant one) which are zero for all valid MFNs from the MFN representation, to be used to index into those arrays, thereby cutting the virtual range these tables must cover approximately by half with each bit removed. Since this should account for hotpluggable memory (in order to not requiring a re-write when that gets supported), the determination of which bits are candidates for removal must not be based on the E820 information, but instead has to use the SRAT. That in turn requires a change to the ordering of steps done during early boot. Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/arch/x86/tboot.c')
-rw-r--r--xen/arch/x86/tboot.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/xen/arch/x86/tboot.c b/xen/arch/x86/tboot.c
index 17f6147def..49254273ec 100644
--- a/xen/arch/x86/tboot.c
+++ b/xen/arch/x86/tboot.c
@@ -175,6 +175,9 @@ static void update_pagetable_mac(vmac_ctx_t *ctx)
for ( mfn = 0; mfn < max_page; mfn++ )
{
struct page_info *page = mfn_to_page(mfn);
+
+ if ( !mfn_valid(mfn) )
+ continue;
if ( is_page_in_use(page) && !is_xen_heap_page(page) ) {
if ( page->count_info & PGC_page_table ) {
void *pg = map_domain_page(mfn);
@@ -237,6 +240,9 @@ static void tboot_gen_xenheap_integrity(const uint8_t key[TB_KEY_SIZE],
for ( mfn = 0; mfn < max_page; mfn++ )
{
struct page_info *page = __mfn_to_page(mfn);
+
+ if ( !mfn_valid(mfn) )
+ continue;
if ( is_page_in_use(page) && is_xen_heap_page(page) ) {
void *pg = mfn_to_virt(mfn);
vmac_update((uint8_t *)pg, PAGE_SIZE, &ctx);
@@ -258,7 +264,7 @@ static void tboot_gen_frametable_integrity(const uint8_t key[TB_KEY_SIZE],
vmac_set_key((uint8_t *)key, &ctx);
*mac = vmac((uint8_t *)frame_table,
- PFN_UP(max_page * sizeof(*frame_table)), nonce, NULL, &ctx);
+ PFN_UP(max_pdx * sizeof(*frame_table)), nonce, NULL, &ctx);
printk("MAC for frametable is: 0x%08"PRIx64"\n", *mac);