[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH v4 10/16] xen/mm: Switch map_pages_to_xen to use MFN typesafe
- To: Jan Beulich <JBeulich@xxxxxxxx>
- From: Julien Grall <julien.grall@xxxxxxx>
- Date: Mon, 5 Mar 2018 14:44:29 +0000
- Cc: Tim Deegan <tim@xxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wei.liu2@xxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxx, Shane Wang <shane.wang@xxxxxxxxx>, Gang Wei <gang.wei@xxxxxxxxx>
- Delivery-date: Mon, 05 Mar 2018 14:44:56 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Hi,
On 05/03/18 14:39, Jan Beulich wrote:
On 05.03.18 at 15:07, <julien.grall@xxxxxxx> wrote:
On 02/03/18 15:06, Jan Beulich wrote:
On 21.02.18 at 15:02, <julien.grall@xxxxxxx> wrote:
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -40,6 +40,10 @@ asm(".file \"" __FILE__ "\"");
#include <asm/mem_sharing.h>
#include <public/memory.h>
+/* Override macros from asm/page.h to make them work with mfn_t */
+#undef page_to_mfn
+#define page_to_mfn(pg) _mfn(__page_to_mfn(pg))
I can't spot where this is needed in this file.
@@ -234,7 +238,7 @@ void vunmap(const void *va)
#ifndef _PAGE_NONE
destroy_xen_mappings(addr, addr + PAGE_SIZE * pages);
#else /* Avoid tearing down intermediate page tables. */
- map_pages_to_xen(addr, 0, pages, _PAGE_NONE);
+ map_pages_to_xen(addr, _mfn(0), pages, _PAGE_NONE);
INVALID_MFN?
I can but then we end up to the same clumsiness as you mention in #8. So
what's your preference?
My preference is to skip the increments for INVALID_MFN in patch 8.
Since you don't want to do that, I guess we'll have to live with zero
being used everywhere.
It is not that I don't want. I don't have any x86 setup and not that
confident to provide a change bigger than switch from plain unsigned int
to typesafe and light clean-up.
I can provide a patch if you really want. But likely it is going to be
quicker for you to write it.
Cheers,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|