mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
[HVM] Only treat gfns in known MMIO regions as MMIO
instead of assuming that all non-RAM addresses are MMIO Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
This commit is contained in:
1 parent
80c79d9071
commit
ae83184fe3
2 files changed
+5
-4
No files matched your search
@@ -2394,7 +2394,8 @@ static int validate_gl1e(struct vcpu *v, void *new_ge, mfn_t sl1mfn, void *se)
|
||||
gfn = guest_l1e_get_gfn(*new_gl1e);
|
||||
gmfn = vcpu_gfn_to_mfn(v, gfn);
|
||||
|
||||
mmio = (is_hvm_vcpu(v) && paging_vcpu_mode_translate(v) && !mfn_valid(gmfn));
|
||||
mmio = (is_hvm_vcpu(v) && paging_vcpu_mode_translate(v) &&
|
||||
mmio_space(gfn_to_paddr(gfn)));
|
||||
l1e_propagate_from_guest(v, new_gl1e, _mfn(INVALID_MFN), gmfn, &new_sl1e,
|
||||
ft_prefetch, mmio);
|
||||
|
||||
|
||||
@@ -86,11 +86,11 @@ static inline unsigned long get_mfn_from_gpfn(unsigned long pfn)
|
||||
return mfn_x(gfn_to_mfn_current(pfn));
|
||||
}
|
||||
|
||||
/* Is this guest address an mmio one? (i.e. not defined in p2m map) */
|
||||
/* Is this guest address an mmio one? */
|
||||
static inline int mmio_space(paddr_t gpa)
|
||||
{
|
||||
unsigned long gfn = gpa >> PAGE_SHIFT;
|
||||
return !mfn_valid(mfn_x(gfn_to_mfn_current(gfn)));
|
||||
return (gpa >= 0xf0000000 /* 256MB hole just below 4GB */
|
||||
|| (gpa >= 0xa0000 && gpa < 0xc0000)); /* VGA hole */
|
||||
}
|
||||
|
||||
/* Translate the frame number held in an l1e from guest to machine */
|
||||
|
||||