Re: [PATCH 3/3] memblock: cleanup memblock_free interface

2021-09-23 Thread Mike Rapoport
On Thu, Sep 23, 2021 at 03:54:46PM +0200, Christophe Leroy wrote: > > Le 23/09/2021 à 14:01, Mike Rapoport a écrit : > > On Thu, Sep 23, 2021 at 11:47:48AM +0200, Christophe Leroy wrote: > > > > > > > > > Le 23/09/2021 à 09:43, Mike Rapoport a écrit : > > > > From: Mike Rapoport > > > > > > >

Re: [PATCH v2] clocksource: arc_timer: eliminate redefined macro error

2021-09-23 Thread Vineet Gupta
On 9/23/21 7:08 PM, Randy Dunlap wrote: In drivers/clocksource/, 3 drivers use "TIMER_CTRL_IE" with 3 different values. Two of them (mps2-timer.c and timer-sp804.c/timer-sp.h) are localized and left unmodifed. One of them uses a shared header file (), which is what is causing the

[PATCH v2] clocksource: arc_timer: eliminate redefined macro error

2021-09-23 Thread Randy Dunlap
In drivers/clocksource/, 3 drivers use "TIMER_CTRL_IE" with 3 different values. Two of them (mps2-timer.c and timer-sp804.c/timer-sp.h) are localized and left unmodifed. One of them uses a shared header file (), which is what is causing the "redefined" warnings, so change the macro name in that

Re: [PATCH 0/3] memblock: cleanup memblock_free interface

2021-09-23 Thread Mike Rapoport
Hi Linus, On Thu, Sep 23, 2021 at 09:01:46AM -0700, Linus Torvalds wrote: > On Thu, Sep 23, 2021 at 12:43 AM Mike Rapoport wrote: > > > You need to be a LOT more careful. > > From a trivial check - exactly because I looked at doing it with a > script, and decided it's not so easy - I found

Re: [PATCH 3/3] memblock: cleanup memblock_free interface

2021-09-23 Thread Shahab Vahedi
On 9/23/21 9:43 AM, Mike Rapoport wrote: > From: Mike Rapoport > > For ages memblock_free() interface dealt with physical addresses even > despite the existence of memblock_alloc_xx() functions that return a > virtual pointer. > > Introduce memblock_phys_free() for freeing physical ranges and

Re: [PATCH 0/3] memblock: cleanup memblock_free interface

2021-09-23 Thread Linus Torvalds
On Thu, Sep 23, 2021 at 12:43 AM Mike Rapoport wrote: > > The core change is in the third patch that makes memblock_free() a > counterpart of memblock_alloc() and adds memblock_phys_alloc() to be a ^^^ > counterpart of memblock_phys_alloc(). That should be 'memblock_phys_free()'

Re: [PATCH] clocksource: arc_timer: eliminate redefined macro error

2021-09-23 Thread Randy Dunlap
On 9/23/21 2:42 AM, Shahab Vahedi wrote: Hi Randy, I have one minor comment. On 9/23/21 5:18 AM, Randy Dunlap wrote: --- linux-next-20210917.orig/include/soc/arc/timers.h +++ linux-next-20210917/include/soc/arc/timers.h @@ -17,7 +17,7 @@ #define ARC_REG_TIMER1_CNT0x100 /* timer 1

Re: [PATCH 3/3] memblock: cleanup memblock_free interface

2021-09-23 Thread Christophe Leroy
Le 23/09/2021 à 14:01, Mike Rapoport a écrit : On Thu, Sep 23, 2021 at 11:47:48AM +0200, Christophe Leroy wrote: Le 23/09/2021 à 09:43, Mike Rapoport a écrit : From: Mike Rapoport For ages memblock_free() interface dealt with physical addresses even despite the existence of

Re: [PATCH] clocksource: arc_timer: eliminate redefined macro error

2021-09-23 Thread Shahab Vahedi
Hi Randy, I have one minor comment. On 9/23/21 5:18 AM, Randy Dunlap wrote: > > --- linux-next-20210917.orig/include/soc/arc/timers.h > +++ linux-next-20210917/include/soc/arc/timers.h > @@ -17,7 +17,7 @@ > #define ARC_REG_TIMER1_CNT 0x100 /* timer 1 count */ > > /* CTRL reg bits */ >

Re: [PATCH 3/3] memblock: cleanup memblock_free interface

2021-09-23 Thread Juergen Gross
On 23.09.21 09:43, Mike Rapoport wrote: From: Mike Rapoport For ages memblock_free() interface dealt with physical addresses even despite the existence of memblock_alloc_xx() functions that return a virtual pointer. Introduce memblock_phys_free() for freeing physical ranges and repurpose

Re: [PATCH 2/3] xen/x86: free_p2m_page: use memblock_free_ptr() to free a virtual pointer

2021-09-23 Thread Juergen Gross
On 23.09.21 09:43, Mike Rapoport wrote: From: Mike Rapoport free_p2m_page() wrongly passes a virtual pointer to memblock_free() that treats it as a physical address. Call memblock_free_ptr() instead that gets a virtual address to free the memory. Signed-off-by: Mike Rapoport Reviewed-by:

Re: [PATCH 3/3] memblock: cleanup memblock_free interface

2021-09-23 Thread Mike Rapoport
On Thu, Sep 23, 2021 at 11:47:48AM +0200, Christophe Leroy wrote: > > > Le 23/09/2021 à 09:43, Mike Rapoport a écrit : > > From: Mike Rapoport > > > > For ages memblock_free() interface dealt with physical addresses even > > despite the existence of memblock_alloc_xx() functions that return a

Re: [PATCH 3/3] memblock: cleanup memblock_free interface

2021-09-23 Thread Christophe Leroy
Le 23/09/2021 à 09:43, Mike Rapoport a écrit : From: Mike Rapoport For ages memblock_free() interface dealt with physical addresses even despite the existence of memblock_alloc_xx() functions that return a virtual pointer. Introduce memblock_phys_free() for freeing physical ranges and

[PATCH 3/3] memblock: cleanup memblock_free interface

2021-09-23 Thread Mike Rapoport
From: Mike Rapoport For ages memblock_free() interface dealt with physical addresses even despite the existence of memblock_alloc_xx() functions that return a virtual pointer. Introduce memblock_phys_free() for freeing physical ranges and repurpose memblock_free() to free virtual pointers to

[PATCH 2/3] xen/x86: free_p2m_page: use memblock_free_ptr() to free a virtual pointer

2021-09-23 Thread Mike Rapoport
From: Mike Rapoport free_p2m_page() wrongly passes a virtual pointer to memblock_free() that treats it as a physical address. Call memblock_free_ptr() instead that gets a virtual address to free the memory. Signed-off-by: Mike Rapoport --- arch/x86/xen/p2m.c | 2 +- 1 file changed, 1

[PATCH 1/3] arch_numa: simplify numa_distance allocation

2021-09-23 Thread Mike Rapoport
From: Mike Rapoport Memory allocation of numa_distance uses memblock_phys_alloc_range() without actual range limits, converts the returned physical address to virtual and then only uses the virtual address for further initialization. Simplify this by replacing memblock_phys_alloc_range() with

[PATCH 0/3] memblock: cleanup memblock_free interface

2021-09-23 Thread Mike Rapoport
From: Mike Rapoport Hi, Following the discussion on [1] this is the fix for memblock freeing APIs mismatch. The first patch is a cleanup of numa_distance allocation in arch_numa I've spotted during the conversion. The second patch is a fix for Xen memory freeing on some of the error paths.