Discussion:
[Xen-changelog] [xen staging] x86/HVM: hvm_map_guest_frame_rw() should respect p2m_ioreq_server
p***@xen.org
2018-11-15 15:55:15 UTC
Permalink
commit 1f04469a0793fb9500d51215ee935849ec74ed56
Author: Jan Beulich <***@suse.com>
AuthorDate: Thu Nov 15 16:43:03 2018 +0100
Commit: Jan Beulich <***@suse.com>
CommitDate: Thu Nov 15 16:43:03 2018 +0100

x86/HVM: hvm_map_guest_frame_rw() should respect p2m_ioreq_server

Writes to such pages would need to be handed to the emulator, which we're
not prepared to do at this point.

Signed-off-by: Jan Beulich <***@suse.com>
Reviewed-by: Paul Durrant <***@citrix.com>
Acked-by: Andrew Cooper <***@citrix.com>
---
xen/arch/x86/hvm/hvm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 65ab6a9b23..0bc676cd94 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2558,7 +2558,8 @@ static void *_hvm_map_guest_frame(unsigned long gfn, bool_t permanent,

if ( writable )
{
- if ( unlikely(p2m_is_discard_write(p2mt)) )
+ if ( unlikely(p2m_is_discard_write(p2mt)) ||
+ unlikely(p2mt == p2m_ioreq_server) )
*writable = 0;
else if ( !permanent )
paging_mark_pfn_dirty(d, _pfn(gfn));
--
generated by git-patchbot for /home/xen/git/xen.git#staging

Loading...