Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1718672 > unrolled thread
| Started by | Boris Ostrovsky <boris.ostrovsky@oracle.com> |
|---|---|
| First post | 2017-08-24 00:30 +0200 |
| Last post | 2017-08-24 08:20 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] xen: Don't try to call xen_alloc_p2m_entry() on autotranslating guests Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-08-24 00:30 +0200
Re: [PATCH] xen: Don't try to call xen_alloc_p2m_entry() on autotranslating guests Juergen Gross <jgross@suse.com> - 2017-08-24 08:20 +0200
| From | Boris Ostrovsky <boris.ostrovsky@oracle.com> |
|---|---|
| Date | 2017-08-24 00:30 +0200 |
| Subject | [PATCH] xen: Don't try to call xen_alloc_p2m_entry() on autotranslating guests |
| Message-ID | <uhMjT-6nQ-1@gated-at.bofh.it> |
Commit aba831a69632 ("xen: remove tests for pvh mode in pure pv paths")
removed XENFEAT_auto_translated_physmap test in xen_alloc_p2m_entry()
since it is assumed that the routine is never called by non-PV guests.
However, alloc_xenballooned_pages() may make this call on a PVH guest.
Prevent this from happening by adding XENFEAT_auto_translated_physmap
check there.
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Fixes: aba831a69632 ("xen: remove tests for pvh mode in pure pv paths")
---
drivers/xen/balloon.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index ab60925..f77e499 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -664,9 +664,11 @@ int alloc_xenballooned_pages(int nr_pages, struct page **pages)
*/
BUILD_BUG_ON(XEN_PAGE_SIZE != PAGE_SIZE);
- ret = xen_alloc_p2m_entry(page_to_pfn(page));
- if (ret < 0)
- goto out_undo;
+ if (!xen_feature(XENFEAT_auto_translated_physmap)) {
+ ret = xen_alloc_p2m_entry(page_to_pfn(page));
+ if (ret < 0)
+ goto out_undo;
+ }
#endif
} else {
ret = add_ballooned_pages(nr_pages - pgno);
--
1.8.3.1
[toc] | [next] | [standalone]
| From | Juergen Gross <jgross@suse.com> |
|---|---|
| Date | 2017-08-24 08:20 +0200 |
| Subject | Re: [PATCH] xen: Don't try to call xen_alloc_p2m_entry() on autotranslating guests |
| Message-ID | <uhTEK-2Mj-7@gated-at.bofh.it> |
| In reply to | #1718672 |
On 24/08/17 00:27, Boris Ostrovsky wrote:
> Commit aba831a69632 ("xen: remove tests for pvh mode in pure pv paths")
> removed XENFEAT_auto_translated_physmap test in xen_alloc_p2m_entry()
> since it is assumed that the routine is never called by non-PV guests.
>
> However, alloc_xenballooned_pages() may make this call on a PVH guest.
> Prevent this from happening by adding XENFEAT_auto_translated_physmap
> check there.
>
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Fixes: aba831a69632 ("xen: remove tests for pvh mode in pure pv paths")
Reviewed-by: Juergen Gross <jgross@suse.com>
Thanks,
Juergen
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web