From: Alexandru Stefan ISAILA <aisaila@bitdefender.com> To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org> Cc: "tamas@tklengyel.com" <tamas@tklengyel.com>, "wei.liu2@citrix.com" <wei.liu2@citrix.com>, "rcojocaru@bitdefender.com" <rcojocaru@bitdefender.com>, "george.dunlap@eu.citrix.com" <george.dunlap@eu.citrix.com>, "andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>, "jbeulich@suse.com" <jbeulich@suse.com>, Alexandru Stefan ISAILA <aisaila@bitdefender.com>, "roger.pau@citrix.com" <roger.pau@citrix.com> Subject: [PATCH v3 3/3] x86/mm: Fix p2m_set_suppress_ve Date: Tue, 9 Apr 2019 12:04:00 +0000 [thread overview] Message-ID: <20190409120324.13940-3-aisaila@bitdefender.com> (raw) In-Reply-To: <20190409120324.13940-1-aisaila@bitdefender.com> On a new altp2m view the p2m_set_suppress_ve() func will fail with invalid mfn from p2m->get_entry() if p2m->set_entry() was not called before. This patch solves the problem by getting the mfn from hostp2m. Signed-off-by: Alexandru Isaila <aisaila@bitdefender.com> --- xen/arch/x86/mm/p2m.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index d38d7c29ca..aee82f814d 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -2982,6 +2982,7 @@ int p2m_set_suppress_ve(struct domain *d, gfn_t gfn, bool suppress_ve, p2m_access_t a; p2m_type_t t; int rc; + bool found_in_hostp2m; if ( altp2m_idx > 0 ) { @@ -2999,7 +3000,7 @@ int p2m_set_suppress_ve(struct domain *d, gfn_t gfn, bool suppress_ve, if ( ap2m ) p2m_lock(ap2m); - mfn = p2m->get_entry(p2m, gfn, &t, &a, 0, NULL, NULL); + mfn = altp2m_get_gfn_type_access(p2m, gfn, &t, &a, NULL, &found_in_hostp2m); if ( !mfn_valid(mfn) ) { rc = -ESRCH; -- 2.17.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
WARNING: multiple messages have this Message-ID (diff)
From: Alexandru Stefan ISAILA <aisaila@bitdefender.com> To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org> Cc: "tamas@tklengyel.com" <tamas@tklengyel.com>, "wei.liu2@citrix.com" <wei.liu2@citrix.com>, "rcojocaru@bitdefender.com" <rcojocaru@bitdefender.com>, "george.dunlap@eu.citrix.com" <george.dunlap@eu.citrix.com>, "andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>, "jbeulich@suse.com" <jbeulich@suse.com>, Alexandru Stefan ISAILA <aisaila@bitdefender.com>, "roger.pau@citrix.com" <roger.pau@citrix.com> Subject: [Xen-devel] [PATCH v3 3/3] x86/mm: Fix p2m_set_suppress_ve Date: Tue, 9 Apr 2019 12:04:00 +0000 [thread overview] Message-ID: <20190409120324.13940-3-aisaila@bitdefender.com> (raw) Message-ID: <20190409120400.A3pmF6F0uohTcpRMK3EAzKW0Z9-hqzwGg0VZEpyhjfw@z> (raw) In-Reply-To: <20190409120324.13940-1-aisaila@bitdefender.com> On a new altp2m view the p2m_set_suppress_ve() func will fail with invalid mfn from p2m->get_entry() if p2m->set_entry() was not called before. This patch solves the problem by getting the mfn from hostp2m. Signed-off-by: Alexandru Isaila <aisaila@bitdefender.com> --- xen/arch/x86/mm/p2m.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index d38d7c29ca..aee82f814d 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -2982,6 +2982,7 @@ int p2m_set_suppress_ve(struct domain *d, gfn_t gfn, bool suppress_ve, p2m_access_t a; p2m_type_t t; int rc; + bool found_in_hostp2m; if ( altp2m_idx > 0 ) { @@ -2999,7 +3000,7 @@ int p2m_set_suppress_ve(struct domain *d, gfn_t gfn, bool suppress_ve, if ( ap2m ) p2m_lock(ap2m); - mfn = p2m->get_entry(p2m, gfn, &t, &a, 0, NULL, NULL); + mfn = altp2m_get_gfn_type_access(p2m, gfn, &t, &a, NULL, &found_in_hostp2m); if ( !mfn_valid(mfn) ) { rc = -ESRCH; -- 2.17.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2019-04-09 12:04 UTC|newest] Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-04-09 12:03 [PATCH v3 1/3] x86/mm: Introduce altp2m_get_gfn_type_access Alexandru Stefan ISAILA 2019-04-09 12:03 ` [Xen-devel] " Alexandru Stefan ISAILA 2019-04-09 12:03 ` [PATCH v3 2/3] x86/mm: Introduce altp2m_set_entry_by_page_order Alexandru Stefan ISAILA 2019-04-09 12:03 ` [Xen-devel] " Alexandru Stefan ISAILA 2019-04-09 13:44 ` Tamas K Lengyel 2019-04-09 13:44 ` [Xen-devel] " Tamas K Lengyel 2019-04-10 14:18 ` George Dunlap 2019-04-10 14:18 ` [Xen-devel] " George Dunlap 2019-04-10 14:22 ` Alexandru Stefan ISAILA 2019-04-10 14:22 ` [Xen-devel] " Alexandru Stefan ISAILA 2019-05-02 14:46 ` Jan Beulich 2019-05-02 14:46 ` [Xen-devel] " Jan Beulich 2019-04-09 12:04 ` Alexandru Stefan ISAILA [this message] 2019-04-09 12:04 ` [Xen-devel] [PATCH v3 3/3] x86/mm: Fix p2m_set_suppress_ve Alexandru Stefan ISAILA 2019-04-09 13:48 ` [PATCH v3 1/3] x86/mm: Introduce altp2m_get_gfn_type_access Tamas K Lengyel 2019-04-09 13:48 ` [Xen-devel] " Tamas K Lengyel 2019-04-09 14:03 ` Alexandru Stefan ISAILA 2019-04-09 14:03 ` [Xen-devel] " Alexandru Stefan ISAILA 2019-04-09 14:37 ` Tamas K Lengyel 2019-04-09 14:37 ` [Xen-devel] " Tamas K Lengyel 2019-04-09 14:48 ` Alexandru Stefan ISAILA 2019-04-09 14:48 ` [Xen-devel] " Alexandru Stefan ISAILA 2019-04-09 15:26 ` Tamas K Lengyel 2019-04-09 15:26 ` [Xen-devel] " Tamas K Lengyel 2019-04-09 15:37 ` Alexandru Stefan ISAILA 2019-04-09 15:37 ` [Xen-devel] " Alexandru Stefan ISAILA 2019-04-10 16:02 ` George Dunlap 2019-04-10 16:02 ` [Xen-devel] " George Dunlap 2019-04-11 12:17 ` Alexandru Stefan ISAILA 2019-04-11 12:17 ` [Xen-devel] " Alexandru Stefan ISAILA 2019-04-11 12:50 ` George Dunlap 2019-04-11 12:50 ` [Xen-devel] " George Dunlap 2019-04-11 13:28 ` Tamas K Lengyel 2019-04-11 13:28 ` [Xen-devel] " Tamas K Lengyel 2019-04-12 10:59 ` Alexandru Stefan ISAILA 2019-04-12 10:59 ` [Xen-devel] " Alexandru Stefan ISAILA 2019-05-02 14:43 ` Jan Beulich 2019-05-02 14:43 ` [Xen-devel] " Jan Beulich
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190409120324.13940-3-aisaila@bitdefender.com \ --to=aisaila@bitdefender.com \ --cc=andrew.cooper3@citrix.com \ --cc=george.dunlap@eu.citrix.com \ --cc=jbeulich@suse.com \ --cc=rcojocaru@bitdefender.com \ --cc=roger.pau@citrix.com \ --cc=tamas@tklengyel.com \ --cc=wei.liu2@citrix.com \ --cc=xen-devel@lists.xenproject.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.