[PATCH v1 2/2] Fix nvmm_ram_block_added() function arguments

Reinoud Zandijk posted 2 patches 4 years, 6 months ago
Maintainers: Reinoud Zandijk <reinoud@netbsd.org>, Kamil Rytarowski <kamil@netbsd.org>
[PATCH v1 2/2] Fix nvmm_ram_block_added() function arguments
Posted by Reinoud Zandijk 4 years, 6 months ago
A parameter max_size was added to the RAMBlockNotifier
ram_block_added function. Use the max_size for pre allocation
of hva space.

Signed-off-by: Reinoud Zandijk <Reinoud@NetBSD.org>
---
 target/i386/nvmm/nvmm-all.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/target/i386/nvmm/nvmm-all.c b/target/i386/nvmm/nvmm-all.c
index dfa690d65d..fdcd37ed3e 100644
--- a/target/i386/nvmm/nvmm-all.c
+++ b/target/i386/nvmm/nvmm-all.c
@@ -1134,13 +1134,14 @@ static MemoryListener nvmm_memory_listener = {
 };
 
 static void
-nvmm_ram_block_added(RAMBlockNotifier *n, void *host, size_t size)
+nvmm_ram_block_added(RAMBlockNotifier *n, void *host, size_t size,
+                     size_t max_size)
 {
     struct nvmm_machine *mach = get_nvmm_mach();
     uintptr_t hva = (uintptr_t)host;
     int ret;
 
-    ret = nvmm_hva_map(mach, hva, size);
+    ret = nvmm_hva_map(mach, hva, max_size);
 
     if (ret == -1) {
         error_report("NVMM: Failed to map HVA, HostVA:%p "
-- 
2.31.1


Re: [PATCH v1 2/2] Fix nvmm_ram_block_added() function arguments
Posted by Peter Maydell 4 years, 6 months ago
On Sun, 18 Jul 2021 at 14:54, Reinoud Zandijk <reinoud@netbsd.org> wrote:
>
> A parameter max_size was added to the RAMBlockNotifier
> ram_block_added function. Use the max_size for pre allocation
> of hva space.
>
> Signed-off-by: Reinoud Zandijk <Reinoud@NetBSD.org>
> ---
>  target/i386/nvmm/nvmm-all.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/target/i386/nvmm/nvmm-all.c b/target/i386/nvmm/nvmm-all.c
> index dfa690d65d..fdcd37ed3e 100644
> --- a/target/i386/nvmm/nvmm-all.c
> +++ b/target/i386/nvmm/nvmm-all.c
> @@ -1134,13 +1134,14 @@ static MemoryListener nvmm_memory_listener = {
>  };
>
>  static void
> -nvmm_ram_block_added(RAMBlockNotifier *n, void *host, size_t size)
> +nvmm_ram_block_added(RAMBlockNotifier *n, void *host, size_t size,
> +                     size_t max_size)
>  {
>      struct nvmm_machine *mach = get_nvmm_mach();
>      uintptr_t hva = (uintptr_t)host;
>      int ret;
>
> -    ret = nvmm_hva_map(mach, hva, size);
> +    ret = nvmm_hva_map(mach, hva, max_size);
>
>      if (ret == -1) {
>          error_report("NVMM: Failed to map HVA, HostVA:%p "

This suggests that this code isn't being covered by our CI. Is
there something we can do to get it tested?

-- PMM

Re: [PATCH v1 2/2] Fix nvmm_ram_block_added() function arguments
Posted by Reinoud Zandijk 4 years, 6 months ago
Hi,

On Sun, Jul 18, 2021 at 05:38:58PM +0100, Peter Maydell wrote:
> On Sun, 18 Jul 2021 at 14:54, Reinoud Zandijk <reinoud@netbsd.org> wrote:
> > A parameter max_size was added to the RAMBlockNotifier
> > ram_block_added function. Use the max_size for pre allocation
> > of hva space.
> >
> > Signed-off-by: Reinoud Zandijk <Reinoud@NetBSD.org>
> > ---
> >  target/i386/nvmm/nvmm-all.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/target/i386/nvmm/nvmm-all.c b/target/i386/nvmm/nvmm-all.c
> > index dfa690d65d..fdcd37ed3e 100644
> > --- a/target/i386/nvmm/nvmm-all.c
> > +++ b/target/i386/nvmm/nvmm-all.c
> > @@ -1134,13 +1134,14 @@ static MemoryListener nvmm_memory_listener = {
> >  };
> >
> >  static void
> > -nvmm_ram_block_added(RAMBlockNotifier *n, void *host, size_t size)
> > +nvmm_ram_block_added(RAMBlockNotifier *n, void *host, size_t size,
> > +                     size_t max_size)
> >  {
> >      struct nvmm_machine *mach = get_nvmm_mach();
> >      uintptr_t hva = (uintptr_t)host;
> >      int ret;
> >
> > -    ret = nvmm_hva_map(mach, hva, size);
> > +    ret = nvmm_hva_map(mach, hva, max_size);
> >
> >      if (ret == -1) {
> >          error_report("NVMM: Failed to map HVA, HostVA:%p "
> 
> This suggests that this code isn't being covered by our CI. Is
> there something we can do to get it tested?

NVMM acceleration is currently NetBSD host only so can only be tested on
NetBSD hosts. Unless Qemu is smart enough to allow a guest NetBSD to run
NetBSD to test NVMM in a nested Qemu I don't think its possible to otherwise
automatically test on Linux.

Is there a README or documentation on how to modify and run the tests?

With regard,
Reinoud


applied? Re: [PATCH v1 0/2] Update NVMM support to recent changes, [PATCH v1 1/2] Only check CONFIG_NVMM when NEED_CPU_H is defined, [PATCH v1 2/2] Fix nvmm_ram_block_added() function arguments
Posted by Reinoud Zandijk 4 years, 5 months ago
Hi :)

Have these patches been applied? How can I easily check it without manually
checking if they are there in a git pullup? Am I notified normally when
patches are applied?

With regards,
Reinoud

On Sun, Jul 18, 2021 at 03:46:48PM +0200, Reinoud Zandijk wrote:
> This patchset fixes small NVMM accelerator compilation issues due to
> changes made in the rest of Qemu since its import.
> 
> Signed-off-by: Reinoud Zandijk <Reinoud@NetBSD.org>
> ---
> 
> Reinoud Zandijk (2):
>   Only check CONFIG_NVMM when NEED_CPU_H is defined
>   Fix nvmm_ram_block_added() function arguments
> 
>  include/sysemu/nvmm.h       | 7 ++++---
>  target/i386/nvmm/nvmm-all.c | 5 +++--
>  2 files changed, 7 insertions(+), 5 deletions(-)
> 
> -- 
> 2.31.1

On Sun, Jul 18, 2021 at 03:46:49PM +0200, Reinoud Zandijk wrote:
> Userland targers will otherwise use a poisoned CONFIG_NVMM
> 
> Signed-off-by: Reinoud Zandijk <Reinoud@NetBSD.org>
> ---
>  include/sysemu/nvmm.h | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/include/sysemu/nvmm.h b/include/sysemu/nvmm.h
> index 6d216599b0..833670fccb 100644
> --- a/include/sysemu/nvmm.h
> +++ b/include/sysemu/nvmm.h
> @@ -10,8 +10,7 @@
>  #ifndef QEMU_NVMM_H
>  #define QEMU_NVMM_H
>  
> -#include "config-host.h"
> -#include "qemu-common.h"
> +#ifdef NEED_CPU_H
>  
>  #ifdef CONFIG_NVMM
>  
> @@ -23,4 +22,6 @@ int nvmm_enabled(void);
>  
>  #endif /* CONFIG_NVMM */
>  
> -#endif /* CONFIG_NVMM */
> +#endif /* NEED_CPU_H */
> +
> +#endif /* QEMU_NVMM_H */
> -- 
> 2.31.1

On Sun, Jul 18, 2021 at 03:46:50PM +0200, Reinoud Zandijk wrote:
> A parameter max_size was added to the RAMBlockNotifier
> ram_block_added function. Use the max_size for pre allocation
> of hva space.
> 
> Signed-off-by: Reinoud Zandijk <Reinoud@NetBSD.org>
> ---
>  target/i386/nvmm/nvmm-all.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/target/i386/nvmm/nvmm-all.c b/target/i386/nvmm/nvmm-all.c
> index dfa690d65d..fdcd37ed3e 100644
> --- a/target/i386/nvmm/nvmm-all.c
> +++ b/target/i386/nvmm/nvmm-all.c
> @@ -1134,13 +1134,14 @@ static MemoryListener nvmm_memory_listener = {
>  };
>  
>  static void
> -nvmm_ram_block_added(RAMBlockNotifier *n, void *host, size_t size)
> +nvmm_ram_block_added(RAMBlockNotifier *n, void *host, size_t size,
> +                     size_t max_size)
>  {
>      struct nvmm_machine *mach = get_nvmm_mach();
>      uintptr_t hva = (uintptr_t)host;
>      int ret;
>  
> -    ret = nvmm_hva_map(mach, hva, size);
> +    ret = nvmm_hva_map(mach, hva, max_size);
>  
>      if (ret == -1) {
>          error_report("NVMM: Failed to map HVA, HostVA:%p "
> -- 
> 2.31.1


Re: applied? Re: [PATCH v1 0/2] Update NVMM support to recent changes, [PATCH v1 1/2] Only check CONFIG_NVMM when NEED_CPU_H is defined, [PATCH v1 2/2] Fix nvmm_ram_block_added() function arguments
Posted by Peter Maydell 4 years, 5 months ago
On Sun, 29 Aug 2021 at 17:06, Reinoud Zandijk <reinoud@13thmonkey.org> wrote:
>
> Hi :)
>
> Have these patches been applied? How can I easily check it without manually
> checking if they are there in a git pullup? Am I notified normally when
> patches are applied?

Generally when a submaintainer picks up a patchset they'll send
an email reply to the patch cover letter to say they've done so.
At that point it should get into upstream git eventually.
Until that happens it's the initial submitter's responsibility to
'ping' the patch after a few weeks if nobody's replied to it
or reviewed it.

Ccing Paolo who seems to have taken the initial nvmm patches
through his tree.

thanks
-- PMM