Hi Shuah,
Today's linux-next merge of the kselftest tree got a conflict in:
tools/testing/selftests/kvm/dirty_log_test.c
between commit:
fff8dcd7b4a2 ("kvm: selftests: port dirty_log_test to aarch64")
from the kvm tree and commit:
cda94d9ffa0e ("selftests: kvm: Fix -Wformat warnings")
from the kselftest tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
--
Cheers,
Stephen Rothwell
diff --cc tools/testing/selftests/kvm/dirty_log_test.c
index d59820cc2d39,a9c4b5e21d7e..000000000000
--- a/tools/testing/selftests/kvm/dirty_log_test.c
+++ b/tools/testing/selftests/kvm/dirty_log_test.c
@@@ -17,52 -15,46 +17,52 @@@
#include "test_util.h"
#include "kvm_util.h"
+#include "processor.h"
+
+#define DEBUG printf
-#define DEBUG printf
+#define VCPU_ID 1
-#define VCPU_ID 1
/* The memory slot index to track dirty pages */
-#define TEST_MEM_SLOT_INDEX 1
-/*
- * GPA offset of the testing memory slot. Must be bigger than the
- * default vm mem slot, which is DEFAULT_GUEST_PHY_PAGES.
- */
-#define TEST_MEM_OFFSET (1ULL << 30) /* 1G */
-/* Size of the testing memory slot */
-#define TEST_MEM_PAGES (1ULL << 18) /* 1G for 4K pages */
+#define TEST_MEM_SLOT_INDEX 1
+
+/* Default guest test memory offset, 1G */
+#define DEFAULT_GUEST_TEST_MEM 0x40000000
+
/* How many pages to dirty for each guest loop */
-#define TEST_PAGES_PER_LOOP 1024
+#define TEST_PAGES_PER_LOOP 1024
+
/* How many host loops to run (one KVM_GET_DIRTY_LOG for each loop) */
- #define TEST_HOST_LOOP_N 32
-#define TEST_HOST_LOOP_N 32UL
++#define TEST_HOST_LOOP_N 32UL
+
/* Interval for each host loop (ms) */
- #define TEST_HOST_LOOP_INTERVAL 10
-#define TEST_HOST_LOOP_INTERVAL 10UL
++#define TEST_HOST_LOOP_INTERVAL 10UL
+
+/*
+ * Guest/Host shared variables. Ensure addr_gva2hva() and/or
+ * sync_global_to/from_guest() are used when accessing from
+ * the host. READ/WRITE_ONCE() should also be used with anything
+ * that may change.
+ */
+static uint64_t host_page_size;
+static uint64_t guest_page_size;
+static uint64_t guest_num_pages;
+static uint64_t random_array[TEST_PAGES_PER_LOOP];
+static uint64_t iteration;
/*
- * Guest variables. We use these variables to share data between host
- * and guest. There are two copies of the variables, one in host memory
- * (which is unused) and one in guest memory. When the host wants to
- * access these variables, it needs to call addr_gva2hva() to access the
- * guest copy.
+ * GPA offset of the testing memory slot. Must be bigger than
+ * DEFAULT_GUEST_PHY_PAGES.
*/
-uint64_t guest_random_array[TEST_PAGES_PER_LOOP];
-uint64_t guest_iteration;
-uint64_t guest_page_size;
+static uint64_t guest_test_mem = DEFAULT_GUEST_TEST_MEM;
/*
- * Writes to the first byte of a random page within the testing memory
- * region continuously.
+ * Continuously write to the first 8 bytes of a random pages within
+ * the testing memory region.
*/
-void guest_code(void)
+static void guest_code(void)
{
- int i = 0;
- uint64_t volatile *array = guest_random_array;
- uint64_t volatile *guest_addr;
+ int i;
while (true) {
for (i = 0; i < TEST_PAGES_PER_LOOP; i++) {
On 18/10/2018 06:50, Stephen Rothwell wrote:
> Hi Shuah,
>
> Today's linux-next merge of the kselftest tree got a conflict in:
>
> tools/testing/selftests/kvm/dirty_log_test.c
>
> between commit:
>
> fff8dcd7b4a2 ("kvm: selftests: port dirty_log_test to aarch64")
>
> from the kvm tree and commit:
>
> cda94d9ffa0e ("selftests: kvm: Fix -Wformat warnings")
>
> from the kselftest tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging. You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
>
Shuah, I think it's best if in the future the
tools/testing/selftests/kvm/ changes go through my tree, unless they
affect many selftests subdirectories.
Thanks,
Paolo
> Shuah, I think it's best if in the future the
> tools/testing/selftests/kvm/ changes go through my tree, unless they
> affect many selftests subdirectories.
Would the patch below make sense ?
(It wasn't the case of my patch, but you never know... ;D)
Output of get_maintainer.pl on tools/testing/selftests/kvm/:
Before:
Shuah Khan <[email protected]> (maintainer:KERNEL SELFTEST FRAMEWORK,commit_signer:5/23=22%)
Paolo Bonzini <[email protected]> (commit_signer:20/23=87%,authored:10/23=43%)
Peter Xu <[email protected]> (commit_signer:4/23=17%,authored:4/23=17%)
Anders Roxell <[email protected]> (commit_signer:3/23=13%,authored:3/23=13%)
Ken Hofsass <[email protected]> (commit_signer:2/23=9%)
[email protected] (open list:KERNEL SELFTEST FRAMEWORK)
[email protected] (open list)
After:
Paolo Bonzini <[email protected]> (supporter:KERNEL VIRTUAL MACHINE (KVM))
"Radim Krčmář" <[email protected]> (supporter:KERNEL VIRTUAL MACHINE (KVM))
Shuah Khan <[email protected]> (maintainer:KERNEL SELFTEST FRAMEWORK)
[email protected] (open list:KERNEL VIRTUAL MACHINE (KVM))
[email protected] (open list:KERNEL SELFTEST FRAMEWORK)
[email protected] (open list)
Cheers,
Andrea
---
commit 59fc1af0d7d0ae0c1ec9400bfbacaadce11e5f50
Author: Andrea Parri <[email protected]>
Date: Thu Oct 18 13:11:09 2018 +0200
MAINTAINERS: Add selftests to the KVM entry
Should ensure that Joe random dev will Cc: the KVM maintainers.
Signed-off-by: Andrea Parri <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: "Radim Krčmář" <[email protected]>
Cc: Shuah Khan <[email protected]>
diff --git a/MAINTAINERS b/MAINTAINERS
index 6ac000cc006d1..25755bf6365ee 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7997,6 +7997,7 @@ F: include/linux/kvm*
F: include/kvm/iodev.h
F: virt/kvm/*
F: tools/kvm/
+F: tools/testing/selftests/kvm/
KERNEL VIRTUAL MACHINE FOR AMD-V (KVM/amd)
M: Joerg Roedel <[email protected]>
---
>
> Thanks,
>
> Paolo
>
On 18/10/2018 13:50, Andrea Parri wrote:
>> Shuah, I think it's best if in the future the
>> tools/testing/selftests/kvm/ changes go through my tree, unless they
>> affect many selftests subdirectories.
>
> Would the patch below make sense ?
>
> (It wasn't the case of my patch, but you never know... ;D)
>
> Output of get_maintainer.pl on tools/testing/selftests/kvm/:
>
> Before:
>
> Shuah Khan <[email protected]> (maintainer:KERNEL SELFTEST FRAMEWORK,commit_signer:5/23=22%)
> Paolo Bonzini <[email protected]> (commit_signer:20/23=87%,authored:10/23=43%)
> Peter Xu <[email protected]> (commit_signer:4/23=17%,authored:4/23=17%)
> Anders Roxell <[email protected]> (commit_signer:3/23=13%,authored:3/23=13%)
> Ken Hofsass <[email protected]> (commit_signer:2/23=9%)
> [email protected] (open list:KERNEL SELFTEST FRAMEWORK)
> [email protected] (open list)
>
> After:
>
> Paolo Bonzini <[email protected]> (supporter:KERNEL VIRTUAL MACHINE (KVM))
> "Radim Krčmář" <[email protected]> (supporter:KERNEL VIRTUAL MACHINE (KVM))
> Shuah Khan <[email protected]> (maintainer:KERNEL SELFTEST FRAMEWORK)
> [email protected] (open list:KERNEL VIRTUAL MACHINE (KVM))
> [email protected] (open list:KERNEL SELFTEST FRAMEWORK)
> [email protected] (open list)
>
> Cheers,
> Andrea
>
> ---
> commit 59fc1af0d7d0ae0c1ec9400bfbacaadce11e5f50
> Author: Andrea Parri <[email protected]>
> Date: Thu Oct 18 13:11:09 2018 +0200
>
> MAINTAINERS: Add selftests to the KVM entry
>
> Should ensure that Joe random dev will Cc: the KVM maintainers.
>
> Signed-off-by: Andrea Parri <[email protected]>
> Cc: Paolo Bonzini <[email protected]>
> Cc: "Radim Krčmář" <[email protected]>
> Cc: Shuah Khan <[email protected]>
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 6ac000cc006d1..25755bf6365ee 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -7997,6 +7997,7 @@ F: include/linux/kvm*
> F: include/kvm/iodev.h
> F: virt/kvm/*
> F: tools/kvm/
> +F: tools/testing/selftests/kvm/
>
> KERNEL VIRTUAL MACHINE FOR AMD-V (KVM/amd)
> M: Joerg Roedel <[email protected]>
> ---
>
>>
>> Thanks,
>>
>> Paolo
>>
>
>
>
Yes, I've applied it.
Paolo
On 10/18/2018 04:51 AM, Paolo Bonzini wrote:
> On 18/10/2018 06:50, Stephen Rothwell wrote:
>> Hi Shuah,
>>
>> Today's linux-next merge of the kselftest tree got a conflict in:
>>
>> tools/testing/selftests/kvm/dirty_log_test.c
>>
>> between commit:
>>
>> fff8dcd7b4a2 ("kvm: selftests: port dirty_log_test to aarch64")
>>
>> from the kvm tree and commit:
>>
>> cda94d9ffa0e ("selftests: kvm: Fix -Wformat warnings")
>>
>> from the kselftest tree.
>>
>> I fixed it up (see below) and can carry the fix as necessary. This
>> is now fixed as far as linux-next is concerned, but any non trivial
>> conflicts should be mentioned to your upstream maintainer when your tree
>> is submitted for merging. You may also want to consider cooperating
>> with the maintainer of the conflicting tree to minimise any particularly
>> complex conflicts.
>>
>
>
> Shuah, I think it's best if in the future the
> tools/testing/selftests/kvm/ changes go through my tree, unless they
> affect many selftests subdirectories.
>
Yes. That makes sense. Looked like an harmless patch that might not have
any dependencies. Should have checked with you.
Thanks for taking care of the problem.
thanks,
-- Shuah