xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 1/2] mem_access: Fix npfec.kind propagation
@ 2018-09-26 16:47 George Dunlap
  2018-09-26 16:47 ` [RFC PATCH 2/2] x86/mm: Add mem access rights to NPT George Dunlap
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: George Dunlap @ 2018-09-26 16:47 UTC (permalink / raw)
  To: xen-devel
  Cc: Razvan Cojocaru, Andrew Cooper, Tim Deegan, George Dunlap,
	Jan Beulich, Tamas K Lengyel, Alexandru Isaila

The name of the "with_gla" flag is confusing; it has nothing to do
with the existence or lack thereof of a faulting GLA, but rather where
the fault originated.  The npfec.kind value is always valid, and
should thus be propagated, regardless of whether gla_valid is set or
not.

In particular, gla_valid will never be set on AMD systems; but
npfec.kind will still be valid and should still be propagated.

Signed-off-by: Alexandru Isaila <aisaila@bitdefender.com>
Signed-off-by: George Dunlap <george.dunlap@citrix.com>
---
CC: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Jan Beulich <jbeulich@suse.com>
CC: Tim Deegan <tim@xen.org>
CC: Tamas K Lengyel <tamas.lengyel@zentific.com>
CC: Razvan Cojocaru <rcojocaru@bitdefender.com>
---
 xen/arch/x86/mm/mem_access.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/mm/mem_access.c b/xen/arch/x86/mm/mem_access.c
index d9e64fcbb9..699a315076 100644
--- a/xen/arch/x86/mm/mem_access.c
+++ b/xen/arch/x86/mm/mem_access.c
@@ -232,12 +232,12 @@ bool p2m_mem_access_check(paddr_t gpa, unsigned long gla,
         {
             req->u.mem_access.flags |= MEM_ACCESS_GLA_VALID;
             req->u.mem_access.gla = gla;
-
-            if ( npfec.kind == npfec_kind_with_gla )
-                req->u.mem_access.flags |= MEM_ACCESS_FAULT_WITH_GLA;
-            else if ( npfec.kind == npfec_kind_in_gpt )
-                req->u.mem_access.flags |= MEM_ACCESS_FAULT_IN_GPT;
         }
+
+        if ( npfec.kind == npfec_kind_with_gla )
+            req->u.mem_access.flags |= MEM_ACCESS_FAULT_WITH_GLA;
+        else if ( npfec.kind == npfec_kind_in_gpt )
+            req->u.mem_access.flags |= MEM_ACCESS_FAULT_IN_GPT;
         req->u.mem_access.flags |= npfec.read_access    ? MEM_ACCESS_R : 0;
         req->u.mem_access.flags |= npfec.write_access   ? MEM_ACCESS_W : 0;
         req->u.mem_access.flags |= npfec.insn_fetch     ? MEM_ACCESS_X : 0;
-- 
2.19.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-06-17 11:59 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-26 16:47 [RFC PATCH 1/2] mem_access: Fix npfec.kind propagation George Dunlap
2018-09-26 16:47 ` [RFC PATCH 2/2] x86/mm: Add mem access rights to NPT George Dunlap
2018-09-26 17:22   ` Andrew Cooper
2018-09-27 10:37     ` George Dunlap
2018-09-27 10:53       ` Paul Durrant
2019-01-09  9:30       ` Alexandru Stefan ISAILA
2018-09-27  9:38   ` Isaila Alexandru
2019-06-13 10:56   ` [Xen-devel] " Alexandru Stefan ISAILA
2019-06-17 10:48     ` George Dunlap
2019-06-17 11:58       ` Andrew Cooper
2019-06-13 15:19   ` Tamas Lengyel
2019-06-13 15:21     ` Razvan Cojocaru
2018-09-26 16:51 ` [RFC PATCH 1/2] mem_access: Fix npfec.kind propagation Tamas Lengyel
2018-09-26 17:00 ` Andrew Cooper
2018-09-27  7:04   ` Jan Beulich
2018-09-27  8:46     ` George Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).