Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 146536 Details for
Bug 224227
[RHEL5] Fully virt install of RHEL-4 can reboot dom0
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
[XEN] Stricter TLB-flush discipline when unshadowing pagetables
p (text/plain), 4.81 KB, created by
Herbert Xu
on 2007-01-25 13:32:28 UTC
(
hide
)
Description:
[XEN] Stricter TLB-flush discipline when unshadowing pagetables
Filename:
MIME Type:
Creator:
Herbert Xu
Created:
2007-01-25 13:32:28 UTC
Size:
4.81 KB
patch
obsolete
>diff -ur xen.orig/arch/x86/mm/shadow/common.c xen/arch/x86/mm/shadow/common.c >--- xen.orig/arch/x86/mm/shadow/common.c 2007-01-25 22:24:46.000000000 +1100 >+++ xen/arch/x86/mm/shadow/common.c 2007-01-25 22:19:15.000000000 +1100 >@@ -573,13 +573,18 @@ > { > /* Need a vpcu for calling unpins; for now, since we don't have > * per-vcpu shadows, any will do */ >- struct vcpu *v = d->vcpu[0]; >+ struct vcpu *v, *v2; > struct list_head *l, *t; > struct page_info *pg; >+ cpumask_t flushmask = CPU_MASK_NONE; > mfn_t smfn; > > if ( chunk_is_available(d, order) ) return; > >+ v = current; >+ if ( v->domain != d ) >+ v = d->vcpu[0]; >+ > /* Stage one: walk the list of top-level pages, unpinning them */ > perfc_incrc(shadow_prealloc_1); > list_for_each_backwards_safe(l, t, &d->arch.shadow.toplevel_shadows) >@@ -608,24 +613,26 @@ > * loaded in cr3 on some vcpu. Walk them, unhooking the non-Xen > * mappings. */ > perfc_incrc(shadow_prealloc_2); >- v = current; >- if ( v->domain != d ) >- v = d->vcpu[0]; >- /* Walk the list from the tail: recently used toplevels have been pulled >- * to the head */ > list_for_each_backwards_safe(l, t, &d->arch.shadow.toplevel_shadows) > { > pg = list_entry(l, struct page_info, list); > smfn = page_to_mfn(pg); > shadow_unhook_mappings(v, smfn); > >- /* Need to flush TLB if we've altered our own tables */ >- if ( !shadow_mode_external(d) >- && pagetable_get_pfn(current->arch.shadow_table) == mfn_x(smfn) ) >- local_flush_tlb(); >- >+ /* Remember to flush TLBs: we have removed shadow entries that >+ * were in use by some vcpu(s). */ >+ for_each_vcpu(d, v2) >+ { >+ if ( pagetable_get_pfn(v2->arch.shadow_table) == mfn_x(smfn) ) >+ cpus_or(flushmask, v2->vcpu_dirty_cpumask, flushmask); >+ } >+ > /* See if that freed up a chunk of appropriate size */ >- if ( chunk_is_available(d, order) ) return; >+ if ( chunk_is_available(d, order) ) >+ { >+ flush_tlb_mask(flushmask); >+ return; >+ } > } > > /* Nothing more we can do: all remaining shadows are of pages that >@@ -2201,6 +2208,10 @@ > mfn_x(gmfn), pg->shadow_flags); > domain_crash(v->domain); > } >+ >+ /* Need to flush TLBs now, so that linear maps are safe next time we >+ * take a fault. */ >+ flush_tlb_mask(v->domain->domain_dirty_cpumask); > } > > void >diff -ur xen.orig/arch/x86/mm/shadow/multi.c xen/arch/x86/mm/shadow/multi.c >--- xen.orig/arch/x86/mm/shadow/multi.c 2007-01-04 17:21:27.000000000 +1100 >+++ xen/arch/x86/mm/shadow/multi.c 2007-01-25 22:16:44.000000000 +1100 >@@ -2821,35 +2821,10 @@ > sh_mfn_is_a_page_table(gmfn) ) > { > u32 flags = mfn_to_page(gmfn)->shadow_flags; >- mfn_t smfn; > if ( !(flags & (SHF_L2_32|SHF_L3_PAE|SHF_L4_64)) ) > { > perfc_incrc(shadow_early_unshadow); > sh_remove_shadows(v, gmfn, 0 /* Can fail to unshadow */ ); >- return; >- } >- /* SHF_unhooked_mappings is set to make sure we only unhook >- * once in a single batch of updates. It is reset when this >- * top-level page is loaded into CR3 again */ >- if ( !(flags & SHF_unhooked_mappings) ) >- { >- perfc_incrc(shadow_early_unshadow_top); >- mfn_to_page(gmfn)->shadow_flags |= SHF_unhooked_mappings; >- if ( flags & SHF_L2_32 ) >- { >- smfn = get_shadow_status(v, gmfn, PGC_SH_l2_32_shadow); >- shadow_unhook_mappings(v, smfn); >- } >- if ( flags & SHF_L3_PAE ) >- { >- smfn = get_shadow_status(v, gmfn, PGC_SH_l3_pae_shadow); >- shadow_unhook_mappings(v, smfn); >- } >- if ( flags & SHF_L4_64 ) >- { >- smfn = get_shadow_status(v, gmfn, PGC_SH_l4_64_shadow); >- shadow_unhook_mappings(v, smfn); >- } > } > } > v->arch.shadow.last_emulated_mfn = mfn_x(gmfn); >diff -ur xen.orig/include/asm-x86/perfc_defn.h xen/include/asm-x86/perfc_defn.h >--- xen.orig/include/asm-x86/perfc_defn.h 2007-01-04 17:21:29.000000000 +1100 >+++ xen/include/asm-x86/perfc_defn.h 2007-01-25 22:15:55.000000000 +1100 >@@ -75,7 +75,6 @@ > PERFCOUNTER_CPU(shadow_mappings, "shadow removes all mappings") > PERFCOUNTER_CPU(shadow_mappings_bf, "shadow rm-mappings brute-force") > PERFCOUNTER_CPU(shadow_early_unshadow, "shadow unshadows for fork/exit") >-PERFCOUNTER_CPU(shadow_early_unshadow_top, "shadow unhooks for fork/exit") > PERFCOUNTER_CPU(shadow_unshadow, "shadow unshadows a page") > PERFCOUNTER_CPU(shadow_up_pointer, "shadow unshadow by up-pointer") > PERFCOUNTER_CPU(shadow_unshadow_bf, "shadow unshadow brute-force")
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 224227
: 146536