]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
core: Do not flush hypervisor TLB on unrelated page table changes
authorJan Kiszka <jan.kiszka@siemens.com>
Sun, 15 Jun 2014 05:35:26 +0000 (07:35 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Sun, 15 Jun 2014 05:52:18 +0000 (07:52 +0200)
Only when working against the hypervisor page table in page_map_create
and page_map_destroy, we actually need to flush TLBs. Other page tables
require arch-specific flushings that we perform on arch_config_commit.

This measurably speeds up Jailhouse activation, e.g., when a significant
number of EPT and VT-d page table changes are performed.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
hypervisor/paging.c

index d78a775977ec80dbdda304a04b69fbe4f6ba77a5..c5fdbd3fd603976ffea229f118d75be09c24c3d3 100644 (file)
@@ -219,7 +219,8 @@ int page_map_create(const struct paging_structures *pg_structs,
                        }
                        paging++;
                }
-               arch_tlb_flush_page(virt);
+               if (pg_structs == &hv_paging_structs)
+                       arch_tlb_flush_page(virt);
 
                phys += paging->page_size;
                virt += paging->page_size;
@@ -274,7 +275,8 @@ int page_map_destroy(const struct paging_structures *pg_structs,
                        paging--;
                        pte = paging->get_entry(pt[--n], virt);
                }
-               arch_tlb_flush_page(virt);
+               if (pg_structs == &hv_paging_structs)
+                       arch_tlb_flush_page(virt);
 
                if (page_size > size)
                        break;