* [PATCH 1/2] Test cmps between two IO locations.
@ 2010-04-27 12:56 Gleb Natapov
2010-04-27 12:56 ` [PATCH 2/2] Add test for ljmp Gleb Natapov
0 siblings, 1 reply; 3+ messages in thread
From: Gleb Natapov @ 2010-04-27 12:56 UTC (permalink / raw)
To: avi, mtosatti; +Cc: kvm
Signed-off-by: Gleb Natapov <gleb@redhat.com>
---
kvm/user/test/x86/emulator.c | 22 ++++++++++++++--------
roms/seabios | 2 +-
2 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/kvm/user/test/x86/emulator.c b/kvm/user/test/x86/emulator.c
index c6adbb5..db84c13 100644
--- a/kvm/user/test/x86/emulator.c
+++ b/kvm/user/test/x86/emulator.c
@@ -17,18 +17,11 @@ void report(const char *name, int result)
}
}
-void test_cmps(void *mem)
+void test_cmps_one(unsigned char *m1, unsigned char *m3)
{
- unsigned char *m1 = mem, *m2 = mem + 1024;
- unsigned char m3[1024];
void *rsi, *rdi;
long rcx, tmp;
- for (int i = 0; i < 100; ++i)
- m1[i] = m2[i] = m3[i] = i;
- for (int i = 100; i < 200; ++i)
- m1[i] = (m3[i] = m2[i] = i) + 1;
-
rsi = m1; rdi = m3; rcx = 30;
asm volatile("xor %[tmp], %[tmp] \n\t"
"repe/cmpsb"
@@ -91,6 +84,19 @@ void test_cmps(void *mem)
}
+void test_cmps(void *mem)
+{
+ unsigned char *m1 = mem, *m2 = mem + 1024;
+ unsigned char m3[1024];
+
+ for (int i = 0; i < 100; ++i)
+ m1[i] = m2[i] = m3[i] = i;
+ for (int i = 100; i < 200; ++i)
+ m1[i] = (m3[i] = m2[i] = i) + 1;
+ test_cmps_one(m1, m3);
+ test_cmps_one(m1, m2);
+}
+
void test_cr8(void)
{
unsigned long src, dst;
diff --git a/roms/seabios b/roms/seabios
index 8f469b9..0360e8e 160000
--- a/roms/seabios
+++ b/roms/seabios
@@ -1 +1 @@
-Subproject commit 8f469b9676127ba6bb52609d89ec774e61db0ee1
+Subproject commit 0360e8e69bb3a773ceb9d2b091b62c027bca862b
--
1.6.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] Add test for ljmp.
2010-04-27 12:56 [PATCH 1/2] Test cmps between two IO locations Gleb Natapov
@ 2010-04-27 12:56 ` Gleb Natapov
2010-04-28 16:31 ` Marcelo Tosatti
0 siblings, 1 reply; 3+ messages in thread
From: Gleb Natapov @ 2010-04-27 12:56 UTC (permalink / raw)
To: avi, mtosatti; +Cc: kvm
Test that ljmp with operand in IO memory works.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
---
kvm/user/test/x86/emulator.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/kvm/user/test/x86/emulator.c b/kvm/user/test/x86/emulator.c
index db84c13..4967d1f 100644
--- a/kvm/user/test/x86/emulator.c
+++ b/kvm/user/test/x86/emulator.c
@@ -183,6 +183,19 @@ void test_pop(void *mem)
report("ret", 1);
}
+void test_ljmp(void *mem)
+{
+ unsigned char *m = mem;
+ volatile int res = 1;
+
+ *(unsigned long**)m = &&jmpf;
+ asm volatile ("data16/mov %%cs, %0":"=m"(*(m + sizeof(unsigned long))));
+ asm volatile ("rex64/ljmp *%0"::"m"(*m));
+ res = 0;
+jmpf:
+ report("ljmp", res);
+}
+
unsigned long read_cr0(void)
{
unsigned long cr0;
@@ -258,6 +271,7 @@ int main()
test_smsw();
test_lmsw();
+ test_ljmp(mem);
printf("\nSUMMARY: %d tests, %d failures\n", tests, fails);
return fails ? 1 : 0;
--
1.6.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/2] Add test for ljmp.
2010-04-27 12:56 ` [PATCH 2/2] Add test for ljmp Gleb Natapov
@ 2010-04-28 16:31 ` Marcelo Tosatti
0 siblings, 0 replies; 3+ messages in thread
From: Marcelo Tosatti @ 2010-04-28 16:31 UTC (permalink / raw)
To: Gleb Natapov; +Cc: avi, kvm
On Tue, Apr 27, 2010 at 03:56:04PM +0300, Gleb Natapov wrote:
> Test that ljmp with operand in IO memory works.
>
> Signed-off-by: Gleb Natapov <gleb@redhat.com>
Applied both, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-04-28 16:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-27 12:56 [PATCH 1/2] Test cmps between two IO locations Gleb Natapov
2010-04-27 12:56 ` [PATCH 2/2] Add test for ljmp Gleb Natapov
2010-04-28 16:31 ` Marcelo Tosatti
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.