|
From: | Avi Kivity |
Subject: | Re: [Qemu-devel] [PATCH] hw: Add test device for unittests execution |
Date: | Mon, 29 Aug 2011 08:47:55 +0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0 |
On 08/27/2011 12:22 AM, Anthony Liguori wrote:
I think I posted patches at some point for kvm unittests to use a standard UART. Was there any reason not to do use a UART?
No.
+static void test_device_exit(void *opaque, uint32_t addr, uint32_t data)+{ + exit(data); +}Port 501 can do this.
Right.
+ +static uint32_t test_device_memsize_read(void *opaque, uint32_t addr) +{ + return ram_size; +}This can be read through fw_cfg, any reason to do PIO for this?
Legacy. We even have a fw_cfg driver in k-u-t.git.
+static void test_device_flush_page(void *opaque, uint32_t addr, uint32_t data)+{ + target_phys_addr_t len = 4096; + void *a = cpu_physical_memory_map(data& ~0xffful,&len, 0); + + mprotect(a, 4096, PROT_NONE); + mprotect(a, 4096, PROT_READ|PROT_WRITE); + cpu_physical_memory_unmap(a, len, 0, 0);This hard codes page size (get it via sysconf).
(or getpagesize())
I think mprotect probably isn't available on windows either.
Google thinks it is.
Should this use MemoryRegion?
Yes.Lucas, do you want to tackle these yourself? I'll help with any questions. Otherwise I'll do it.
-- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.
[Prev in Thread] | Current Thread | [Next in Thread] |