* [PATCH 0/2] format string fixups for selftests
@ 2020-03-11 13:10 Christian Borntraeger
2020-03-11 13:10 ` [PATCH 1/2] selftests: KVM: s390: fixup fprintf format error in reset.c Christian Borntraeger
2020-03-11 13:10 ` [PATCH 2/2] selftests: KVM: s390: fix format strings for access reg test Christian Borntraeger
0 siblings, 2 replies; 6+ messages in thread
From: Christian Borntraeger @ 2020-03-11 13:10 UTC (permalink / raw)
To: Janosch Frank
Cc: KVM, Cornelia Huck, Christian Borntraeger, David Hildenbrand,
linux-s390, Thomas Huth, Andrew Jones
found by Andrews recent changes so I attributed him as Reported by.
Christian Borntraeger (2):
selftests: KVM: s390: fixup fprintf format error in reset.c
selftests: KVM: s390: fix format strings for access reg test
tools/testing/selftests/kvm/s390x/resets.c | 2 +-
tools/testing/selftests/kvm/s390x/sync_regs_test.c | 11 +++++++++--
2 files changed, 10 insertions(+), 3 deletions(-)
--
2.24.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] selftests: KVM: s390: fixup fprintf format error in reset.c
2020-03-11 13:10 [PATCH 0/2] format string fixups for selftests Christian Borntraeger
@ 2020-03-11 13:10 ` Christian Borntraeger
2020-03-11 14:02 ` Janosch Frank
2020-03-11 13:10 ` [PATCH 2/2] selftests: KVM: s390: fix format strings for access reg test Christian Borntraeger
1 sibling, 1 reply; 6+ messages in thread
From: Christian Borntraeger @ 2020-03-11 13:10 UTC (permalink / raw)
To: Janosch Frank
Cc: KVM, Cornelia Huck, Christian Borntraeger, David Hildenbrand,
linux-s390, Thomas Huth, Andrew Jones
value is u64 and not string.
Reported-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
tools/testing/selftests/kvm/s390x/resets.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kvm/s390x/resets.c b/tools/testing/selftests/kvm/s390x/resets.c
index b567705f0d41..221e9c9a8bd2 100644
--- a/tools/testing/selftests/kvm/s390x/resets.c
+++ b/tools/testing/selftests/kvm/s390x/resets.c
@@ -66,7 +66,7 @@ static void test_one_reg(uint64_t id, uint64_t value)
reg.addr = (uintptr_t)&eval_reg;
reg.id = id;
vcpu_get_reg(vm, VCPU_ID, ®);
- TEST_ASSERT(eval_reg == value, "value == %s", value);
+ TEST_ASSERT(eval_reg == value, "value == 0x%lx", value);
}
static void assert_noirq(void)
--
2.24.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] selftests: KVM: s390: fix format strings for access reg test
2020-03-11 13:10 [PATCH 0/2] format string fixups for selftests Christian Borntraeger
2020-03-11 13:10 ` [PATCH 1/2] selftests: KVM: s390: fixup fprintf format error in reset.c Christian Borntraeger
@ 2020-03-11 13:10 ` Christian Borntraeger
2020-03-11 14:03 ` Janosch Frank
1 sibling, 1 reply; 6+ messages in thread
From: Christian Borntraeger @ 2020-03-11 13:10 UTC (permalink / raw)
To: Janosch Frank
Cc: KVM, Cornelia Huck, Christian Borntraeger, David Hildenbrand,
linux-s390, Thomas Huth, Andrew Jones
acrs are 32 bit and not 64 bit.
Reported-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
tools/testing/selftests/kvm/s390x/sync_regs_test.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/kvm/s390x/sync_regs_test.c b/tools/testing/selftests/kvm/s390x/sync_regs_test.c
index b705637ca14b..70a56580042b 100644
--- a/tools/testing/selftests/kvm/s390x/sync_regs_test.c
+++ b/tools/testing/selftests/kvm/s390x/sync_regs_test.c
@@ -42,6 +42,13 @@ static void guest_code(void)
" values did not match: 0x%llx, 0x%llx\n", \
left->reg, right->reg)
+#define REG_COMPARE32(reg) \
+ TEST_ASSERT(left->reg == right->reg, \
+ "Register " #reg \
+ " values did not match: 0x%x, 0x%x\n", \
+ left->reg, right->reg)
+
+
static void compare_regs(struct kvm_regs *left, struct kvm_sync_regs *right)
{
int i;
@@ -55,7 +62,7 @@ static void compare_sregs(struct kvm_sregs *left, struct kvm_sync_regs *right)
int i;
for (i = 0; i < 16; i++)
- REG_COMPARE(acrs[i]);
+ REG_COMPARE32(acrs[i]);
for (i = 0; i < 16; i++)
REG_COMPARE(crs[i]);
@@ -155,7 +162,7 @@ int main(int argc, char *argv[])
"r11 sync regs value incorrect 0x%llx.",
run->s.regs.gprs[11]);
TEST_ASSERT(run->s.regs.acrs[0] == 1 << 11,
- "acr0 sync regs value incorrect 0x%llx.",
+ "acr0 sync regs value incorrect 0x%x.",
run->s.regs.acrs[0]);
vcpu_regs_get(vm, VCPU_ID, ®s);
--
2.24.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] selftests: KVM: s390: fixup fprintf format error in reset.c
2020-03-11 13:10 ` [PATCH 1/2] selftests: KVM: s390: fixup fprintf format error in reset.c Christian Borntraeger
@ 2020-03-11 14:02 ` Janosch Frank
0 siblings, 0 replies; 6+ messages in thread
From: Janosch Frank @ 2020-03-11 14:02 UTC (permalink / raw)
To: Christian Borntraeger, Janosch Frank
Cc: KVM, Cornelia Huck, David Hildenbrand, linux-s390, Thomas Huth,
Andrew Jones
[-- Attachment #1.1: Type: text/plain, Size: 967 bytes --]
On 3/11/20 2:10 PM, Christian Borntraeger wrote:
> value is u64 and not string.
>
> Reported-by: Andrew Jones <drjones@redhat.com>
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
> ---
> tools/testing/selftests/kvm/s390x/resets.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/kvm/s390x/resets.c b/tools/testing/selftests/kvm/s390x/resets.c
> index b567705f0d41..221e9c9a8bd2 100644
> --- a/tools/testing/selftests/kvm/s390x/resets.c
> +++ b/tools/testing/selftests/kvm/s390x/resets.c
> @@ -66,7 +66,7 @@ static void test_one_reg(uint64_t id, uint64_t value)
> reg.addr = (uintptr_t)&eval_reg;
> reg.id = id;
> vcpu_get_reg(vm, VCPU_ID, ®);
> - TEST_ASSERT(eval_reg == value, "value == %s", value);
> + TEST_ASSERT(eval_reg == value, "value == 0x%lx", value);
> }
>
> static void assert_noirq(void)
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] selftests: KVM: s390: fix format strings for access reg test
2020-03-11 13:10 ` [PATCH 2/2] selftests: KVM: s390: fix format strings for access reg test Christian Borntraeger
@ 2020-03-11 14:03 ` Janosch Frank
2020-03-11 14:07 ` Christian Borntraeger
0 siblings, 1 reply; 6+ messages in thread
From: Janosch Frank @ 2020-03-11 14:03 UTC (permalink / raw)
To: Christian Borntraeger, Janosch Frank
Cc: KVM, Cornelia Huck, David Hildenbrand, linux-s390, Thomas Huth,
Andrew Jones
[-- Attachment #1.1: Type: text/plain, Size: 1784 bytes --]
On 3/11/20 2:10 PM, Christian Borntraeger wrote:
> acrs are 32 bit and not 64 bit.
>
> Reported-by: Andrew Jones <drjones@redhat.com>
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Janosch Frank <frankja@linux.ibm.com>
> ---
> tools/testing/selftests/kvm/s390x/sync_regs_test.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/kvm/s390x/sync_regs_test.c b/tools/testing/selftests/kvm/s390x/sync_regs_test.c
> index b705637ca14b..70a56580042b 100644
> --- a/tools/testing/selftests/kvm/s390x/sync_regs_test.c
> +++ b/tools/testing/selftests/kvm/s390x/sync_regs_test.c
> @@ -42,6 +42,13 @@ static void guest_code(void)
> " values did not match: 0x%llx, 0x%llx\n", \
> left->reg, right->reg)
>
> +#define REG_COMPARE32(reg) \
> + TEST_ASSERT(left->reg == right->reg, \
> + "Register " #reg \
> + " values did not match: 0x%x, 0x%x\n", \
> + left->reg, right->reg)
> +
> +
One \n too much?
> static void compare_regs(struct kvm_regs *left, struct kvm_sync_regs *right)
> {
> int i;
> @@ -55,7 +62,7 @@ static void compare_sregs(struct kvm_sregs *left, struct kvm_sync_regs *right)
> int i;
>
> for (i = 0; i < 16; i++)
> - REG_COMPARE(acrs[i]);
> + REG_COMPARE32(acrs[i]);
>
> for (i = 0; i < 16; i++)
> REG_COMPARE(crs[i]);
> @@ -155,7 +162,7 @@ int main(int argc, char *argv[])
> "r11 sync regs value incorrect 0x%llx.",
> run->s.regs.gprs[11]);
> TEST_ASSERT(run->s.regs.acrs[0] == 1 << 11,
> - "acr0 sync regs value incorrect 0x%llx.",
> + "acr0 sync regs value incorrect 0x%x.",
> run->s.regs.acrs[0]);
>
> vcpu_regs_get(vm, VCPU_ID, ®s);
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] selftests: KVM: s390: fix format strings for access reg test
2020-03-11 14:03 ` Janosch Frank
@ 2020-03-11 14:07 ` Christian Borntraeger
0 siblings, 0 replies; 6+ messages in thread
From: Christian Borntraeger @ 2020-03-11 14:07 UTC (permalink / raw)
To: Janosch Frank, Janosch Frank
Cc: KVM, Cornelia Huck, David Hildenbrand, linux-s390, Thomas Huth,
Andrew Jones
On 11.03.20 15:03, Janosch Frank wrote:
> On 3/11/20 2:10 PM, Christian Borntraeger wrote:
>> acrs are 32 bit and not 64 bit.
>>
>> Reported-by: Andrew Jones <drjones@redhat.com>
>> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
>
> Acked-by: Janosch Frank <frankja@linux.ibm.com>
>
>> ---
>> tools/testing/selftests/kvm/s390x/sync_regs_test.c | 11 +++++++++--
>> 1 file changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/tools/testing/selftests/kvm/s390x/sync_regs_test.c b/tools/testing/selftests/kvm/s390x/sync_regs_test.c
>> index b705637ca14b..70a56580042b 100644
>> --- a/tools/testing/selftests/kvm/s390x/sync_regs_test.c
>> +++ b/tools/testing/selftests/kvm/s390x/sync_regs_test.c
>> @@ -42,6 +42,13 @@ static void guest_code(void)
>> " values did not match: 0x%llx, 0x%llx\n", \
>> left->reg, right->reg)
>>
>> +#define REG_COMPARE32(reg) \
>> + TEST_ASSERT(left->reg == right->reg, \
>> + "Register " #reg \
>> + " values did not match: 0x%x, 0x%x\n", \
>> + left->reg, right->reg)
>> +
>> +
>
> One \n too much?
yep.
>
>> static void compare_regs(struct kvm_regs *left, struct kvm_sync_regs *right)
>> {
>> int i;
>> @@ -55,7 +62,7 @@ static void compare_sregs(struct kvm_sregs *left, struct kvm_sync_regs *right)
>> int i;
>>
>> for (i = 0; i < 16; i++)
>> - REG_COMPARE(acrs[i]);
>> + REG_COMPARE32(acrs[i]);
>>
>> for (i = 0; i < 16; i++)
>> REG_COMPARE(crs[i]);
>> @@ -155,7 +162,7 @@ int main(int argc, char *argv[])
>> "r11 sync regs value incorrect 0x%llx.",
>> run->s.regs.gprs[11]);
>> TEST_ASSERT(run->s.regs.acrs[0] == 1 << 11,
>> - "acr0 sync regs value incorrect 0x%llx.",
>> + "acr0 sync regs value incorrect 0x%x.",
>> run->s.regs.acrs[0]);
>>
>> vcpu_regs_get(vm, VCPU_ID, ®s);
>>
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-03-11 14:09 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-11 13:10 [PATCH 0/2] format string fixups for selftests Christian Borntraeger
2020-03-11 13:10 ` [PATCH 1/2] selftests: KVM: s390: fixup fprintf format error in reset.c Christian Borntraeger
2020-03-11 14:02 ` Janosch Frank
2020-03-11 13:10 ` [PATCH 2/2] selftests: KVM: s390: fix format strings for access reg test Christian Borntraeger
2020-03-11 14:03 ` Janosch Frank
2020-03-11 14:07 ` Christian Borntraeger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).