Two fixes for KVM unit tests
PATCH 2/2 s390x: fixing I/O memory allocation
In reply to Pierre MorelThe allocator allocate pages it follows the size must be rounded to pages before the allocation.
--- lib/s390x/malloc_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/s390x/malloc_io.c +2 -2
@@ -41,7 +41,7 @@ static void unshare_pages(void *p, int count)void *alloc_io_mem (int size,int flags) { -int order =get_order (size >>PAGE_SHIFT ); +int order =get_order (PAGE_ALIGN (size) >>PAGE_SHIFT );void *p;int n;
@@ -62,7 +62,7 @@ void *alloc_io_mem(int size, int flags)void free_io_mem (void *p,int size) { -int order =get_order (size >>PAGE_SHIFT ); +int order =get_order (PAGE_ALIGN (size) >>PAGE_SHIFT );assert (IS_ALIGNED ((uintptr_t )p,PAGE_SIZE ));
Signature · 1 line
2.25.1
PATCH 1/2 Makefile: Fix cscope
In reply to Pierre MorelIn Linux, cscope uses a wrong directory.
Simply search from the directory where the make is started.
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
@@ -119,7 +119,7 @@ cscope: cscope_dirs = lib lib/libfdt lib/linux $(TEST_DIR) $(ARCH_LIBDIRS) lib/a cscope: $(RM) ./cscope.* find -L $(cscope_dirs) -maxdepth 1 \ - -name '*.[chsS]' -exec realpath --relative-base=$(PWD) {} \; | sort -u > ./cscope.files + -name '*.[chsS]' -exec realpath --relative-base=. {} \; | sort -u > ./cscope.files cscope -bk .PHONY: tags
Signature · 1 line
2.25.1
cover Two fixes for KVM unit tests
Hello,
I am not sure about the first one, cscope, it works for me but may be someone has a better solution.
The second one fixes a bug of mine...
Regards,
Pierre
Pierre Morel (2):
Makefile: Fix cscope
s390x: fixing I/O memory allocation
Makefile | 2 +- lib/s390x/malloc_io.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.25.1
Re: [kvm-unit-tests PATCH 2/2] s390x: fixing I/O memory allocation
In reply to Pierre MorelQuoted 6 lines · On Wed, 25 Aug 2021 18:20:21 +0200 Pierre Morel <[email protected]> wrote:
The allocator allocate pages it follows the size must be rounded to pages before the allocation.
Fixes b0fe3988 "s390x: define UV compatible I/O allocation"Signed-off-by Pierre Morel <[email protected]>
Quoted 26 lines
--- lib/s390x/malloc_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)lib/s390x/malloc_io.c +2
-2@@ -41,7 +41,7 @@ static void unshare_pages(void *p, int count)void *alloc_io_mem (int size,int flags) { -int order =get_order (size >>PAGE_SHIFT ); +int order =get_order (PAGE_ALIGN (size) >>PAGE_SHIFT );void *p;int n;@@ -62,7 +62,7 @@ void *alloc_io_mem(int size, int flags)void free_io_mem (void *p,int size) { -int order =get_order (size >>PAGE_SHIFT ); +int order =get_order (PAGE_ALIGN (size) >>PAGE_SHIFT );assert (IS_ALIGNED ((uintptr_t )p,PAGE_SIZE ));
Re: [kvm-unit-tests PATCH 1/2] Makefile: Fix cscope
In reply to Pierre MorelQuoted 13 lines · Pierre Morel
In Linux, cscope uses a wrong directory.
Simply search from the directory where the make is started.Signed-off-by Pierre Morel <[email protected]>--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Makefile +0
-0
Makefile cscope: cscope_dirs = lib lib/libfdt lib/linux $(TEST_DIR) $(ARCH_LIBDIRS) lib/a · line 122
Quoted 5 lines
Makefile +1
-1@@ -119,7 +119,7 @@ cscope: cscope_dirs = lib lib/libfdt lib/linux $(TEST_DIR) $(ARCH_LIBDIRS) lib/a cscope: $(RM) ./cscope.* find -L $(cscope_dirs) -maxdepth 1 \ - -name '*.[chsS]' -exec realpath --relative-base=$(PWD) {} \; | sort -u > ./cscope.files + -name '*.[chsS]' -exec realpath --relative-base=. {} \; | sort -u > ./cscope.files
Why is $PWD not pointing to the same location as "." ? Are you doing in-tree or out-of-tree builds?
Thomas
Re: [kvm-unit-tests PATCH 1/2] Makefile: Fix cscope
Quoted 25 lines · Thomas Huth
Quoted 13 lines · Pierre Morel
In Linux, cscope uses a wrong directory.
Simply search from the directory where the make is started.Signed-off-by Pierre Morel <[email protected]>---
Makefile| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)Makefile +0
-0@@ -119,7 +119,7 @@ cscope: cscope_dirs = lib lib/libfdt lib/linuxQuoted 8 lines
$(TEST_DIR) $(ARCH_LIBDIRS) lib/a
cscope:
$(RM) ./cscope.*
find -L $(cscope_dirs) -maxdepth 1 \
- -name '*.[chsS]' -exec realpath --relative-base=$(PWD) {} \; | sort -u > ./cscope.files
+ -name '*.[chsS]' -exec realpath --relative-base=. {} \; | sort -u > ./cscope.filesWhy is $PWD not pointing to the same location as "." ? Are you doing in-tree or out-of-tree builds?
Quoted 2 lines
Thomas
In tree.
That is the point, why is PWD indicating void ? I use a bash on s390x.
inside bash PWD shows current directory GNU Make is 4.2.1 on Ubuntu 18.04
This works on X with redhat and GNU make 3.82
This happens on s390x since:51b8f0b1 2017-11-23 Andrew Jones Makefile: fix cscope target
So I add Andrew as CC, I did forgot to do before.
Regards,
Pierre
Signature · 2 lines
Pierre Morel IBM Lab Boeblingen
Re: [kvm-unit-tests PATCH 2/2] s390x: fixing I/O memory allocation
In reply to Claudio ImbrendaQuoted 12 lines · Claudio Imbrenda
Quoted 6 lines · On Wed, 25 Aug 2021 18:20:21 +0200 Pierre Morel <[email protected]> wrote:
The allocator allocate pages it follows the size must be rounded to pages before the allocation.
Fixes b0fe3988 "s390x: define UV compatible I/O allocation"Signed-off-by Pierre Morel <[email protected]>Reviewed-by Claudio Imbrenda <[email protected]>
Thanks,
Pierre
Signature · 2 lines
Pierre Morel IBM Lab Boeblingen
Re: [kvm-unit-tests PATCH 1/2] Makefile: Fix cscope
In reply to Pierre MorelQuoted 29 lines · Pierre Morel
Quoted 26 lines · Thomas Huth
Quoted 13 lines · Pierre Morel
In Linux, cscope uses a wrong directory.
Simply search from the directory where the make is started.Signed-off-by Pierre Morel <[email protected]>---
Makefile| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)Makefile +0
-0@@ -119,7 +119,7 @@ cscope: cscope_dirs = lib lib/libfdt lib/linuxQuoted 8 lines
$(TEST_DIR) $(ARCH_LIBDIRS) lib/a
cscope:
$(RM) ./cscope.*
find -L $(cscope_dirs) -maxdepth 1 \
- -name '*.[chsS]' -exec realpath --relative-base=$(PWD) {} \; | sort -u > ./cscope.files
+ -name '*.[chsS]' -exec realpath --relative-base=. {} \; | sort -u > ./cscope.filesWhy is $PWD not pointing to the same location as "." ? Are you doing in-tree or out-of-tree builds?
Quoted 5 lines
Quoted 2 lines
Thomas
In tree.
That is the point, why is PWD indicating void ?
If you do 'env' I'll bet you'll see something like
...
PWD=
...
Quoted 8 lines
I use a bash on s390x.
inside bash PWD shows current directory
GNU Make is 4.2.1 on Ubuntu 18.04This works on X with redhat and GNU make 3.82
This happens on s390x since:
51b8f0b12017-11-23 Andrew JonesMakefile: fix cscope target
No surprise there, that's when the $(PWD) use was first introduced.
Quoted 3 lines
So I add Andrew as CC, I did forgot to do before.
I'll send a patch changing $(PWD) to $(shell pwd)
Thanks,
drew
Re: [kvm-unit-tests PATCH 1/2] Makefile: Fix cscope
In reply to Pierre MorelQuoted 28 lines · Pierre Morel
Quoted 25 lines · Thomas Huth
Quoted 13 lines · Pierre Morel
In Linux, cscope uses a wrong directory.
Simply search from the directory where the make is started.Signed-off-by Pierre Morel <[email protected]>---
Makefile| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)Makefile +0
-0@@ -119,7 +119,7 @@ cscope: cscope_dirs = lib lib/libfdt lib/linuxQuoted 8 lines
$(TEST_DIR) $(ARCH_LIBDIRS) lib/a
cscope:
$(RM) ./cscope.*
find -L $(cscope_dirs) -maxdepth 1 \
- -name '*.[chsS]' -exec realpath --relative-base=$(PWD) {} \; | sort -u > ./cscope.files
+ -name '*.[chsS]' -exec realpath --relative-base=. {} \; | sort -u > ./cscope.filesWhy is $PWD not pointing to the same location as "." ? Are you doing in-tree or out-of-tree builds?
Quoted 8 lines
Quoted 2 lines
Thomas
In tree.
That is the point, why is PWD indicating void ? I use a bash on s390x.
inside bash PWD shows current directory GNU Make is 4.2.1 on Ubuntu 18.04
Hmm, looking at the code twice, $(PWD) is used a a Make variable, not as a shell variable. For using a shell variable, it should use double $$ instead ...
So yes, this is broken since $(PWD) does not seem to be an official Make variable. There is $(CURDIR) which could do the job, too, but I guess "." is just fine as well. Andrew, what do you think?
Thomas
Paolo Bonzini
maintainerRe: [kvm-unit-tests PATCH 1/2] Makefile: Fix cscope
In reply to Andrew JonesQuoted 6 lines · Andrew Jones
Quoted 1 line
51b8f0b12017-11-23 Andrew JonesMakefile: fix cscope targetNo surprise there, that's when the $(PWD) use was first introduced.
Quoted 2 lines
So I add Andrew as CC, I did forgot to do before.
I'll send a patch changing $(PWD) to $(shell pwd)
I could not find the patch using $(CURDIR) in my mailbox, though I found it on spinics.net. I fudged the following
From 164507376abae4be15b0f65aa14d56f179198a99 Mon Sep 17 00:00:00 2001
From: Andrew Jones <[email protected]>
Date: Fri, 27 Aug 2021 12:31:15 +0200
Subject: [PATCH kvm-unit-tests] Makefile: Don't trust PWD
It's possible that PWD is already set to something which isn't the full path of the current working directory. Let's use $(CURDIR) instead, which is always correct.
Makefile +1 -1
@@ -119,7 +119,7 @@ cscope: cscope_dirs = lib lib/libfdt lib/linux $(TEST_DIR) $(ARCH_LIBDIRS) lib/a cscope: $(RM) ./cscope.* find -L $(cscope_dirs) -maxdepth 1 \ - -name '*.[chsS]' -exec realpath --relative-base=$(PWD) {} \; | sort -u > ./cscope.files + -name '*.[chsS]' -exec realpath --relative-base=$(CURDIR) {} \; | sort -u > ./cscope.files cscope -bk .PHONY: tags
and queued it.
Paolo
Re: [kvm-unit-tests PATCH 1/2] Makefile: Fix cscope
Quoted 37 lines · Paolo Bonzini
Quoted 6 lines · Andrew Jones
Quoted 1 line
51b8f0b12017-11-23 Andrew JonesMakefile: fix cscope targetNo surprise there, that's when the $(PWD) use was first introduced.
Quoted 2 lines
So I add Andrew as CC, I did forgot to do before.
I'll send a patch changing $(PWD) to $(shell pwd)
I could not find the patch using $(CURDIR) in my mailbox, though I found it on spinics.net. I fudged the following
From
164507376abae4be15b0f65aa14d56f179198a99Mon Sep 17 00:00:00 2001
From: Andrew Jones <[email protected]>
Date: Fri, 27 Aug 2021 12:31:15 +0200
Subject: [PATCH kvm-unit-tests]Makefile: Don't trust PWDIt's possible that PWD is already set to something which isn't the full path of the current working directory. Let's use $(CURDIR) instead, which is always correct.
Suggested-by Thomas Huth <[email protected]>Signed-off-by Andrew Jones <[email protected]>Signed-off-by Paolo Bonzini <[email protected]>Makefile +1
-1@@ -119,7 +119,7 @@ cscope: cscope_dirs = lib lib/libfdt lib/linux $(TEST_DIR) $(ARCH_LIBDIRS) lib/a cscope: $(RM) ./cscope.* find -L $(cscope_dirs) -maxdepth 1 \ - -name '*.[chsS]' -exec realpath --relative-base=$(PWD) {} \; | sort -u > ./cscope.files + -name '*.[chsS]' -exec realpath --relative-base=$(CURDIR) {} \; | sort -u > ./cscope.files cscope -bk .PHONY: tags
Quoted 1 line
and queued it.
Hi Paolo,
You'll get a conflict when you go to merge because I already did it :-)
commit 3d4eb24cb5b4de6c26f79b849fe2818d5315a691 (origin/misc/queue, misc/queue)
Author: Andrew Jones <[email protected]> Date: Fri Aug 27 12:25:27 2021 +0200
Makefile: Don't trust PWD
PWD comes from the environment and it's possible that it's already set to something which isn't the full path of the current working directory. Use the make variable $(CURDIR) instead.
misc/queue is something I recently invented for stuff like this in order to help lighten your load a bit.
Thanks,
drew
Paolo Bonzini
maintainerRe: [kvm-unit-tests PATCH 1/2] Makefile: Fix cscope
Quoted 21 lines · Andrew Jones
Hi Paolo,
You'll get a conflict when you go to merge because I already did it :-)
commit
3d4eb24cb5b4de6c26f79b849fe2818d5315a691(origin/misc/queue, misc/queue)Author: Andrew Jones <[email protected]> Date: Fri Aug 27 12:25:27 2021 +0200
Makefile: Don't trust PWDPWD comes from the environment and it's possible that it's already set to something which isn't the full path of the current working directory. Use the make variable $(CURDIR) instead.
Reviewed-by Pierre Morel <[email protected]>Reviewed-by Thomas Huth <[email protected]>Suggested-by Thomas Huth <[email protected]>Signed-off-by Andrew Jones <[email protected]>
Quoted 2 lines
misc/queue is something I recently invented for stuff like this in order to help lighten your load a bit.
Ok, are you going to create a merge request?
Re: [kvm-unit-tests PATCH 1/2] Makefile: Fix cscope
Quoted 20 lines · Paolo Bonzini
Quoted 19 lines · Andrew Jones
Hi Paolo,
You'll get a conflict when you go to merge because I already did it :-)
commit
3d4eb24cb5b4de6c26f79b849fe2818d5315a691(origin/misc/queue, misc/queue)Author: Andrew Jones <[email protected]> Date: Fri Aug 27 12:25:27 2021 +0200
Makefile: Don't trust PWD
PWD comes from the environment and it's possible that it's already set to something which isn't the full path of the current working directory. Use the make variable $(CURDIR) instead.Reviewed-by Pierre Morel <[email protected]>Reviewed-by Thomas Huth <[email protected]>Suggested-by Thomas Huth <[email protected]>Signed-off-by Andrew Jones <[email protected]>
Quoted 5 lines
Quoted 2 lines
misc/queue is something I recently invented for stuff like this in order to help lighten your load a bit.
Ok, are you going to create a merge request?
I did. And I merged it.
https://gitlab.com/kvm-unit-tests/kvm-unit-tests/-/merge_requests/16
Thanks,
drew