diff mbox series

[Xen-devel,v4,06/16] xen/x86: Remove unused override of page_to_mfn/mfn_to_page

Message ID 20180221140259.29360-7-julien.grall@arm.com
State Superseded
Headers show
Series xen: Convert page_to_mfn and mfn_to_page to use typesafe MFN | expand

Commit Message

Julien Grall Feb. 21, 2018, 2:02 p.m. UTC
A few files override page_to_mfn/mfn_to_page but actually never use
those macros. So drop them.

Signed-off-by: Julien Grall <julien.grall@arm.com>

---
Cc: George Dunlap <george.dunlap@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>

    Changes in v4:
        - Patch added
---
 xen/arch/x86/mm/hap/nested_hap.c | 3 ---
 xen/arch/x86/mm/p2m-pt.c         | 6 ------
 xen/arch/x86/pv/iret.c           | 6 ------
 xen/arch/x86/pv/mm.c             | 6 ------
 xen/arch/x86/pv/traps.c          | 6 ------
 5 files changed, 27 deletions(-)

Comments

George Dunlap March 1, 2018, 11:20 a.m. UTC | #1
On 02/21/2018 02:02 PM, Julien Grall wrote:
> A few files override page_to_mfn/mfn_to_page but actually never use
> those macros. So drop them.
> 
> Signed-off-by: Julien Grall <julien.grall@arm.com>

Acked-by: George Dunlap <george.dunlap@citrix.com>
Jan Beulich March 2, 2018, 2:42 p.m. UTC | #2
>>> On 21.02.18 at 15:02, <julien.grall@arm.com> wrote:
> A few files override page_to_mfn/mfn_to_page but actually never use
> those macros. So drop them.
> 
> Signed-off-by: Julien Grall <julien.grall@arm.com>

It doesn't look like there are any risky uses of the removed
symbols in the headers, so
Acked-by: Jan Beulich <jbeulich@suse.com>
assuming this has been build-tested in relevant configurations.

Jan
Julien Grall March 2, 2018, 2:44 p.m. UTC | #3
Hi,

On 02/03/18 14:42, Jan Beulich wrote:
>>>> On 21.02.18 at 15:02, <julien.grall@arm.com> wrote:
>> A few files override page_to_mfn/mfn_to_page but actually never use
>> those macros. So drop them.
>>
>> Signed-off-by: Julien Grall <julien.grall@arm.com>
> 
> It doesn't look like there are any risky uses of the removed
> symbols in the headers, so
> Acked-by: Jan Beulich <jbeulich@suse.com>
> assuming this has been build-tested in relevant configurations.

All patches have been build-tested one by one. I have also looked at the 
code to see if there was any use within the code.

Note that after patch #16, they will become irrelevant.

Cheers,
Jan Beulich March 2, 2018, 3:11 p.m. UTC | #4
>>> On 02.03.18 at 15:44, <julien.grall@arm.com> wrote:
> On 02/03/18 14:42, Jan Beulich wrote:
>>>>> On 21.02.18 at 15:02, <julien.grall@arm.com> wrote:
>>> A few files override page_to_mfn/mfn_to_page but actually never use
>>> those macros. So drop them.
>>>
>>> Signed-off-by: Julien Grall <julien.grall@arm.com>
>> 
>> It doesn't look like there are any risky uses of the removed
>> symbols in the headers, so
>> Acked-by: Jan Beulich <jbeulich@suse.com>
>> assuming this has been build-tested in relevant configurations.
> 
> All patches have been build-tested one by one.

I've taken that for given. I did say "in relevant configurations"
because things like BIGMEM=y or SHADOW_PAGING=n may
cause issues despite a "normal" build having gone fine.

Jan
Julien Grall March 5, 2018, 1:29 p.m. UTC | #5
Hi Jan,

On 02/03/18 15:11, Jan Beulich wrote:
>>>> On 02.03.18 at 15:44, <julien.grall@arm.com> wrote:
>> On 02/03/18 14:42, Jan Beulich wrote:
>>>>>> On 21.02.18 at 15:02, <julien.grall@arm.com> wrote:
>>>> A few files override page_to_mfn/mfn_to_page but actually never use
>>>> those macros. So drop them.
>>>>
>>>> Signed-off-by: Julien Grall <julien.grall@arm.com>
>>>
>>> It doesn't look like there are any risky uses of the removed
>>> symbols in the headers, so
>>> Acked-by: Jan Beulich <jbeulich@suse.com>
>>> assuming this has been build-tested in relevant configurations.
>>
>> All patches have been build-tested one by one.
> 
> I've taken that for given. I did say "in relevant configurations"
> because things like BIGMEM=y or SHADOW_PAGING=n may
> cause issues despite a "normal" build having gone fine.

I have now built test this patch with BIGMEM=y, SHADOW_PAGING=n and saw 
not compilation errors.

Cheers,

> 
> Jan
>
diff mbox series

Patch

diff --git a/xen/arch/x86/mm/hap/nested_hap.c b/xen/arch/x86/mm/hap/nested_hap.c
index 4603ceced4..d2a07a5c79 100644
--- a/xen/arch/x86/mm/hap/nested_hap.c
+++ b/xen/arch/x86/mm/hap/nested_hap.c
@@ -70,9 +70,6 @@ 
 /********************************************/
 /*        NESTED VIRT P2M FUNCTIONS         */
 /********************************************/
-/* 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))
 
 void
 nestedp2m_write_p2m_entry(struct p2m_domain *p2m, unsigned long gfn,
diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 753124bdcd..b8c5d2ed26 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -39,12 +39,6 @@ 
 
 #include "mm-locks.h"
 
-/* Override macros from asm/page.h to make them work with mfn_t */
-#undef mfn_to_page
-#define mfn_to_page(_m) __mfn_to_page(mfn_x(_m))
-#undef page_to_mfn
-#define page_to_mfn(_pg) _mfn(__page_to_mfn(_pg))
-
 /*
  * We may store INVALID_MFN in PTEs.  We need to clip this to avoid trampling
  * over higher-order bits (NX, p2m type, IOMMU flags).  We seem to not need
diff --git a/xen/arch/x86/pv/iret.c b/xen/arch/x86/pv/iret.c
index 56aeac360a..ca433a69c4 100644
--- a/xen/arch/x86/pv/iret.c
+++ b/xen/arch/x86/pv/iret.c
@@ -24,12 +24,6 @@ 
 #include <asm/current.h>
 #include <asm/traps.h>
 
-/* Override macros from asm/page.h to make them work with mfn_t */
-#undef mfn_to_page
-#define mfn_to_page(mfn) __mfn_to_page(mfn_x(mfn))
-#undef page_to_mfn
-#define page_to_mfn(pg) _mfn(__page_to_mfn(pg))
-
 unsigned long do_iret(void)
 {
     struct cpu_user_regs *regs = guest_cpu_user_regs();
diff --git a/xen/arch/x86/pv/mm.c b/xen/arch/x86/pv/mm.c
index 8d7a4fd85f..b46fd94c2c 100644
--- a/xen/arch/x86/pv/mm.c
+++ b/xen/arch/x86/pv/mm.c
@@ -26,12 +26,6 @@ 
 
 #include "mm.h"
 
-/* Override macros from asm/page.h to make them work with mfn_t */
-#undef mfn_to_page
-#define mfn_to_page(mfn) __mfn_to_page(mfn_x(mfn))
-#undef page_to_mfn
-#define page_to_mfn(pg) _mfn(__page_to_mfn(pg))
-
 /*
  * Get a mapping of a PV guest's l1e for this linear address.  The return
  * pointer should be unmapped using unmap_domain_page().
diff --git a/xen/arch/x86/pv/traps.c b/xen/arch/x86/pv/traps.c
index d122881d13..2a605edf7f 100644
--- a/xen/arch/x86/pv/traps.c
+++ b/xen/arch/x86/pv/traps.c
@@ -29,12 +29,6 @@ 
 #include <asm/shared.h>
 #include <asm/traps.h>
 
-/* Override macros from asm/page.h to make them work with mfn_t */
-#undef mfn_to_page
-#define mfn_to_page(mfn) __mfn_to_page(mfn_x(mfn))
-#undef page_to_mfn
-#define page_to_mfn(pg) _mfn(__page_to_mfn(pg))
-
 void do_entry_int82(struct cpu_user_regs *regs)
 {
     if ( unlikely(untrusted_msi) )