From: Marcelo Tosatti <mtosatti@redhat.com>
To: kvm@vger.kernel.org
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Subject: [patch 8/8] test: long rmap chains
Date: Wed, 24 Mar 2010 18:24:16 -0300 [thread overview]
Message-ID: <20100324212726.903978877@amt.cnet> (raw)
In-Reply-To: 20100324212408.790319364@amt.cnet
[-- Attachment #1: test-rmap-chain --]
[-- Type: text/plain, Size: 2572 bytes --]
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Index: qemu-kvm/kvm/user/config-x86-common.mak
===================================================================
--- qemu-kvm.orig/kvm/user/config-x86-common.mak
+++ qemu-kvm/kvm/user/config-x86-common.mak
@@ -45,6 +45,9 @@ $(TEST_DIR)/vmexit.flat: $(cstart.o) $(T
$(TEST_DIR)/slot_deletion.flat: $(cstart.o) $(TEST_DIR)/slot_deletion.o \
$(TEST_DIR)/print.o $(TEST_DIR)/vm.o
+
+$(TEST_DIR)/rmap_chain.flat: $(cstart.o) $(TEST_DIR)/rmap_chain.o \
+ $(TEST_DIR)/print.o $(TEST_DIR)/vm.o
$(TEST_DIR)/test32.flat: $(TEST_DIR)/test32.o
Index: qemu-kvm/kvm/user/config-x86_64.mak
===================================================================
--- qemu-kvm.orig/kvm/user/config-x86_64.mak
+++ qemu-kvm/kvm/user/config-x86_64.mak
@@ -8,6 +8,6 @@ tests = $(TEST_DIR)/access.flat $(TEST_D
$(TEST_DIR)/simple.flat $(TEST_DIR)/stringio.flat \
$(TEST_DIR)/memtest1.flat $(TEST_DIR)/emulator.flat \
$(TEST_DIR)/hypercall.flat $(TEST_DIR)/apic.flat \
- $(TEST_DIR)/slot_deletion.flat
+ $(TEST_DIR)/slot_deletion.flat $(TEST_DIR)/rmap_chain.flat
include config-x86-common.mak
Index: qemu-kvm/kvm/user/test/x86/rmap_chain.c
===================================================================
--- /dev/null
+++ qemu-kvm/kvm/user/test/x86/rmap_chain.c
@@ -0,0 +1,53 @@
+/* test long rmap chains */
+
+#include "libcflat.h"
+#include "vm.h"
+#include "smp.h"
+
+void print(const char *s);
+
+static unsigned int inl(unsigned short port)
+{
+ unsigned int val;
+ asm volatile ("inl %w1, %0":"=a" (val):"Nd" (port));
+ return val;
+}
+
+int main (void)
+{
+ int i;
+ int nr_pages;
+ void *target_page, *virt_addr;
+
+ setup_vm();
+
+ nr_pages = inl(0xd1) / PAGE_SIZE;
+ nr_pages -= 1000;
+ target_page = alloc_page();
+
+ virt_addr = (void *) 0xfffffa000;
+ for (i = 0; i < nr_pages; i++) {
+ install_page(phys_to_virt(read_cr3()), virt_to_phys(target_page),
+ virt_addr);
+ virt_addr += PAGE_SIZE;
+ }
+ printf("created %d mappings\n", nr_pages);
+
+ virt_addr = (void *) 0xfffffa000;
+ for (i = 0; i < nr_pages; i++) {
+ unsigned long *touch = virt_addr;
+
+ *touch = 0;
+ virt_addr += PAGE_SIZE;
+ }
+ printf("instantiated mappings\n");
+
+ virt_addr += PAGE_SIZE;
+ install_pte(phys_to_virt(read_cr3()), 1, virt_addr,
+ 0 | PTE_PRESENT | PTE_WRITE, target_page);
+
+ *(unsigned long *)virt_addr = 0;
+ printf("SUCCESS\n");
+
+ return 0;
+}
prev parent reply other threads:[~2010-03-24 21:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-24 21:24 [patch 0/8] add slot deletion, rmap chain tests Marcelo Tosatti
2010-03-24 21:24 ` [patch 1/8] test: allow functions to execute on non-irq context remotely Marcelo Tosatti
2010-03-25 16:25 ` Avi Kivity
2010-03-25 18:07 ` Marcelo Tosatti
2010-03-28 6:32 ` Avi Kivity
2010-03-24 21:24 ` [patch 2/8] test: add pagefault exception handler Marcelo Tosatti
2010-03-24 21:24 ` [patch 3/8] test: protect fwcfg accesses with lock Marcelo Tosatti
2010-03-24 21:24 ` [patch 4/8] test: export vm helpers Marcelo Tosatti
2010-03-24 21:24 ` [patch 5/8] testdev: add port to create/delete memslots Marcelo Tosatti
2010-03-25 16:27 ` Avi Kivity
2010-03-24 21:24 ` [patch 6/8] test: parallel faults vs slot deletion Marcelo Tosatti
2010-03-24 21:24 ` [patch 7/8] test: bump max vcpus to 64 Marcelo Tosatti
2010-03-24 21:24 ` Marcelo Tosatti [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100324212726.903978877@amt.cnet \
--to=mtosatti@redhat.com \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox