Re: [Qemu-devel] [PATCH] Add QEMU DirectFB display driver
On 16.05.2010, at 03:10, Paul Brook wrote: >> The other solution would be to use the DirectFB driver for SDL which >> would allow to do slightly the same as this patch. But that would mean >> having to deal with an additional layer in the graphical stack, which is >> not exactly what one wants from a performance or a complexity point of >> view. > > I don't buy your complexity argument. Doesn't DirectFB-via-SDL already work? > If not why not? I'm pretty sure fixing that would be way simpler than adding > a > whole new output backend. Well, I can think of size as a reason. Not compiling in SDL, but directfb, would certainly shave off dependencies on a usually rather large SDL library. I also find SDL code less readable than Qemu code in general :). That said, I don't want to take sides - just wanted to state the obvious. Alex
Re: [Qemu-devel] [PATCH] Add QEMU DirectFB display driver
> The other solution would be to use the DirectFB driver for SDL which > would allow to do slightly the same as this patch. But that would mean > having to deal with an additional layer in the graphical stack, which is > not exactly what one wants from a performance or a complexity point of > view. I don't buy your complexity argument. Doesn't DirectFB-via-SDL already work? If not why not? I'm pretty sure fixing that would be way simpler than adding a whole new output backend. Paul
[Qemu-devel] Re: Qemu-KVM with 3x IDE HDD + CDROM not working
On Wed, May 12, 2010 at 03:19:26PM +0200, Peter Lieven wrote: > Hi Qemu/KVM Devel Team, > > if I create a VM with more than 2 harddisks and a CDROM Image and > want to boot from CDROM this is not working. > From my understanding at least 3 IDE Drives + 1 IDE CDROM should work. > > cmdline: > /usr/bin/qemu-kvm-0.12.4 -net none -drive > file=/dev/sdb,if=ide,boot=on,cache=none,aio=native -drive > file=/dev/sdc,if=ide,boot=off,cache=none,aio=native -drive > file=/dev/sdd,if=ide,boot=off,cache=none,aio=native -m 256 -cpu > qemu64,model_id='Intel(R) Xeon(R) CPU E5430 @ 2.66GHz' > -monitor tcp:0:4001,server,nowait -vnc :1 -name 'ide-test' -boot > order=dc,menu=on -cdrom > /home/kvm/cdrom/root/KNOPPIX_V6.2.1CD-2010-01-31-DE.iso -k de > -pidfile /var/run/qemu/vm-153.pid -mem-path /hugepages > -mem-prealloc -rtc base=utc,clock=vm -no-kvm-irqchip -usb > -usbdevice tablet > > SEABIOS shows error: Could not read from CDROM (code 0001) Your third drive conflicts with the cdrom. Try adding ",index=3" to the definition of sdd. Qemu should probably handle this better, but the above works for me. -Kevin
[Qemu-devel] [PATCH 2/2] sparc64: fix TT_WOTHER value
From: Igor V. Kovalenko - fix off by one error in spill trap number bit for other window (must be bit 5) - fixes invalid instruction issue with HelenOS --- target-sparc/cpu.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/target-sparc/cpu.h b/target-sparc/cpu.h index 22f3ad0..27b020b 100644 --- a/target-sparc/cpu.h +++ b/target-sparc/cpu.h @@ -79,7 +79,7 @@ #define TT_DPROT0x6c #define TT_SPILL0x80 #define TT_FILL 0xc0 -#define TT_WOTHER 0x10 +#define TT_WOTHER (1 << 5) #define TT_TRAP 0x100 #endif
[Qemu-devel] [PATCH 1/2] sparc64: fix mmu demap operand typo
From: Igor V. Kovalenko - must use store address operand to demap, not store value Signed-off-by: Igor V. Kovalenko --- target-sparc/op_helper.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c index fcfd3f3..ec39244 100644 --- a/target-sparc/op_helper.c +++ b/target-sparc/op_helper.c @@ -2877,7 +2877,7 @@ void helper_st_asi(target_ulong addr, target_ulong val, int asi, int size) return; } case 0x57: // I-MMU demap -demap_tlb(env->itlb, val, "immu", env); +demap_tlb(env->itlb, addr, "immu", env); return; case 0x58: // D-MMU regs { @@ -2942,7 +2942,7 @@ void helper_st_asi(target_ulong addr, target_ulong val, int asi, int size) return; } case 0x5f: // D-MMU demap -demap_tlb(env->dtlb, val, "dmmu", env); +demap_tlb(env->dtlb, addr, "dmmu", env); return; case 0x49: // Interrupt data receive // XXX
[Qemu-devel] [PATCH 0/2] fix HelenOS illegal instruction issue on sparc64
The following series fix a couple of typos in sparc target which cause illegal instruction issue booting HelenOS on sparc64. --- Igor V. Kovalenko (2): sparc64: fix mmu demap operand typo sparc64: fix TT_WOTHER value target-sparc/cpu.h |2 +- target-sparc/op_helper.c |4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) -- Kind regards, Igor V. Kovalenko
Re: [Qemu-devel] [PATCH 0/3] mingw32 compile fixes
Am 15.05.2010 22:49, schrieb Blue Swirl: Hi, With this mingw32 compiler: $ i586-mingw32msvc-gcc -v Using built-in specs. Target: i586-mingw32msvc Configured with: /tmp/buildd/gcc-mingw32-4.4.2/build-tree/gcc-4.4.2/configure --build=x86_64-linux-gnu --prefix=/usr --includedir='/usr/include' --mandir='/usr/share/man' --infodir='/usr/share/info' --sysconfdir=/etc --localstatedir=/var --libexecdir='/usr/lib/gcc-mingw32' --disable-multilib --enable-threads --enable-sjlj-exceptions --enable-version-specific-runtime-libs --disable-shared --target=i586-mingw32msvc --enable-languages=c,c++,fortran : (reconfigured) /tmp/buildd/gcc-mingw32-4.4.2/build-tree/gcc-4.4.2/configure --build=x86_64-linux-gnu --prefix=/usr --includedir='/usr/include' --mandir='/usr/share/man' --infodir='/usr/share/info' --sysconfdir=/etc --localstatedir=/var --libexecdir='/usr/lib/gcc-mingw32' --disable-multilib --enable-threads --enable-sjlj-exceptions --enable-version-specific-runtime-libs --disable-shared --target=i586-mingw32msvc --enable-languages=c,c++,fortran Thread model: win32 gcc version 4.4.2 (GCC) build will not succeed because formats %zd, %zu, %hh, %lld, %llx and %llu are not known by the compiler. Any %ll* use is clearly a bug, we have PRI*64 macros just for this purpose. For %hh and %z there may be better ways than these patches. With the patches I can build working Win32 binaries and there are no warnings. Blue Swirl (3): Fix %lld or %llx printf format use mingw32: avoid using %hh format which is not known by the compiler mingw32: avoid using %zd etc. formats which are not known by the compiler arch_init.c | 18 + audio/audio.c | 11 --- audio/audio_template.h|4 +- audio/esdaudio.c |8 +++--- audio/mixeng.c|3 +- audio/ossaudio.c |8 +++--- block/curl.c | 13 + block/parallels.c |7 +++- block/qcow2.c | 10 --- buffered_file.c | 13 + darwin-user/commpage.c|2 +- darwin-user/syscall.c |2 +- hw/ac97.c |4 +- hw/eepro100.c | 22 +-- hw/loader.c |8 +++--- hw/scsi-bus.c |4 +- hw/scsi-disk.c| 16 ++-- hw/usb-ohci.c |7 +++-- hw/vga.c |2 +- hw/vhost_net.c|2 +- hw/virtio-9p-debug.c |2 +- hw/virtio-9p.c|2 +- hw/xen_console.c |3 +- hw/xen_disk.c |6 +++- hw/xenfb.c|9 -- ia64-dis.c|9 -- nbd.c |4 +- osdep.c |2 +- qemu-common.h |7 + qemu-img.c| 10 +++--- qemu-io.c | 57 + sysemu.h |4 +++ target-cris/translate.c |6 ++-- target-microblaze/translate.c |2 +- target-ppc/translate.c|7 +++-- target-sparc/helper.c |2 +- usb-linux.c |2 +- vnc-auth-sasl.c |2 +- vnc.c |9 +++--- 39 files changed, 182 insertions(+), 127 deletions(-) It's a compiler bug that the compiler does not know these format strings. The code works nevertheless (at least with mingw libraries which are not too old) because the format strings are interpreted by the C runtime library. Is it worth changing a lot of files when we can expect a newer mingw compiler version which works correctly for standard format strings? Regards Stefan
Re: [Qemu-devel] [PATCH 3/3] mingw32: avoid using %zd etc. formats which are not known by the compiler
On Sat, 15 May 2010, Blue Swirl wrote: > Signed-off-by: Blue Swirl > --- > audio/audio.c | 11 ++- > audio/audio_template.h|2 +- > audio/esdaudio.c |8 > audio/mixeng.c|3 ++- > audio/ossaudio.c |8 > block/curl.c |4 ++-- > block/qcow2.c |2 +- > buffered_file.c | 13 +++-- > hw/ac97.c |4 ++-- > hw/eepro100.c | 22 +- > hw/loader.c |8 > hw/scsi-bus.c |4 ++-- > hw/scsi-disk.c| 16 > hw/usb-ohci.c |7 --- > hw/virtio-9p-debug.c |2 +- > hw/virtio-9p.c|2 +- > hw/xen_console.c |3 ++- > hw/xen_disk.c |6 -- > hw/xenfb.c|9 ++--- > osdep.c |2 +- > qemu-common.h |7 +++ > qemu-io.c |4 ++-- > target-cris/translate.c |2 +- > target-microblaze/translate.c |2 +- > usb-linux.c |2 +- > vnc-auth-sasl.c |2 +- > vnc.c |9 + > 27 files changed, 93 insertions(+), 71 deletions(-) > Audio parts are fine with me. [..snip..] -- mailto:av1...@comtv.ru
Re: [Qemu-devel] [PATCH 1/3] Fix %lld or %llx printf format use
On Sat, 15 May 2010, Blue Swirl wrote: > Signed-off-by: Blue Swirl > --- > audio/audio_template.h |2 +- > block/curl.c|9 --- > block/parallels.c |7 - > block/qcow2.c |8 -- > darwin-user/commpage.c |2 +- > darwin-user/syscall.c |2 +- > hw/vga.c|2 +- > hw/vhost_net.c |2 +- > ia64-dis.c |9 +-- > nbd.c |4 +- > qemu-img.c | 10 > qemu-io.c | 57 > --- > target-cris/translate.c |4 +- > target-ppc/translate.c |7 +++-- > target-sparc/helper.c |2 +- > 15 files changed, 69 insertions(+), 58 deletions(-) > > diff --git a/audio/audio_template.h b/audio/audio_template.h > index 6b19848..2f5224b 100644 > --- a/audio/audio_template.h > +++ b/audio/audio_template.h > @@ -541,7 +541,7 @@ uint64_t glue (AUD_get_elapsed_usec_, TYPE) (SW > *sw, QEMUAudioTimeStamp *ts) > > cur_ts = sw->hw->ts_helper; > old_ts = ts->old_ts; > -/* dolog ("cur %lld old %lld\n", cur_ts, old_ts); */ > +/* dolog ("cur %" PRId64 " old %" PRId64 "\n", cur_ts, old_ts); */ > > if (cur_ts >= old_ts) { > delta = cur_ts - old_ts; Fine with me. [..snip..] -- mailto:av1...@comtv.ru
[Qemu-devel] [PATCH 3/3] mingw32: avoid using %zd etc. formats which are not known by the compiler
Signed-off-by: Blue Swirl --- audio/audio.c | 11 ++- audio/audio_template.h|2 +- audio/esdaudio.c |8 audio/mixeng.c|3 ++- audio/ossaudio.c |8 block/curl.c |4 ++-- block/qcow2.c |2 +- buffered_file.c | 13 +++-- hw/ac97.c |4 ++-- hw/eepro100.c | 22 +- hw/loader.c |8 hw/scsi-bus.c |4 ++-- hw/scsi-disk.c| 16 hw/usb-ohci.c |7 --- hw/virtio-9p-debug.c |2 +- hw/virtio-9p.c|2 +- hw/xen_console.c |3 ++- hw/xen_disk.c |6 -- hw/xenfb.c|9 ++--- osdep.c |2 +- qemu-common.h |7 +++ qemu-io.c |4 ++-- target-cris/translate.c |2 +- target-microblaze/translate.c |2 +- usb-linux.c |2 +- vnc-auth-sasl.c |2 +- vnc.c |9 + 27 files changed, 93 insertions(+), 71 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index dbf0b96..fdb6f5e 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -189,7 +189,8 @@ void *audio_calloc (const char *funcname, int nmemb, size_t size) if (audio_bug ("audio_calloc", cond)) { AUD_log (NULL, "%s passed invalid arguments to audio_calloc\n", funcname); -AUD_log (NULL, "nmemb=%d size=%zu (len=%zu)\n", nmemb, size, len); +AUD_log (NULL, "nmemb=%d size=%" PRIzu " (len=%" PRIzu ")\n", + nmemb, size, len); return NULL; } @@ -801,7 +802,7 @@ static int audio_attach_capture (HWVoiceOut *hw) sc = audio_calloc (AUDIO_FUNC, 1, sizeof (*sc)); if (!sc) { -dolog ("Could not allocate soft capture voice (%zu bytes)\n", +dolog ("Could not allocate soft capture voice (%" PRIzu " bytes)\n", sizeof (*sc)); return -1; } @@ -1937,8 +1938,8 @@ CaptureVoiceOut *AUD_add_capture ( cb = audio_calloc (AUDIO_FUNC, 1, sizeof (*cb)); if (!cb) { -dolog ("Could not allocate capture callback information, size %zu\n", - sizeof (*cb)); +dolog ("Could not allocate capture callback information, size %" PRIzu + "\n", sizeof (*cb)); goto err0; } cb->ops = *ops; @@ -1955,7 +1956,7 @@ CaptureVoiceOut *AUD_add_capture ( cap = audio_calloc (AUDIO_FUNC, 1, sizeof (*cap)); if (!cap) { -dolog ("Could not allocate capture voice, size %zu\n", +dolog ("Could not allocate capture voice, size %" PRIzu "\n", sizeof (*cap)); goto err1; } diff --git a/audio/audio_template.h b/audio/audio_template.h index 2f5224b..c89af94 100644 --- a/audio/audio_template.h +++ b/audio/audio_template.h @@ -350,7 +350,7 @@ static SW *glue (audio_pcm_create_voice_pair_, TYPE) ( sw = audio_calloc (AUDIO_FUNC, 1, sizeof (*sw)); if (!sw) { -dolog ("Could not allocate soft voice `%s' (%zu bytes)\n", +dolog ("Could not allocate soft voice `%s' (%" PRIzu " bytes)\n", sw_name ? sw_name : "unknown", sizeof (*sw)); goto err1; } diff --git a/audio/esdaudio.c b/audio/esdaudio.c index 79142d1..c46ff63 100644 --- a/audio/esdaudio.c +++ b/audio/esdaudio.c @@ -131,8 +131,8 @@ static void *qesd_thread_out (void *arg) int wsamples = written >> hw->info.shift; int wbytes = wsamples << hw->info.shift; if (wbytes != written) { -dolog ("warning: Misaligned write %d (requested %zd), " - "alignment %d\n", +dolog ("warning: Misaligned write %d (requested %" PRIzd + "), alignment %d\n", wbytes, written, hw->info.align + 1); } to_mix -= wsamples; @@ -360,8 +360,8 @@ static void *qesd_thread_in (void *arg) int rsamples = nread >> hw->info.shift; int rbytes = rsamples << hw->info.shift; if (rbytes != nread) { -dolog ("warning: Misaligned write %d (requested %zd), " - "alignment %d\n", +dolog ("warning: Misaligned write %d (requested %" PRIzd + "), alignment %d\n", rbytes, nread, hw->info.align + 1); } to_grab -= rsamples; diff --git a/audio/mixeng.c b/audio/mixeng.c index 9f1d93f..27b544a 100644 --- a/audio/mixeng.c +++ b/audio/mixeng.c @@ -301,7 +301,8 @@ void *st_rate_start (int inrate, int ou
[Qemu-devel] [PATCH 2/3] mingw32: avoid using %hh format which is not known by the compiler
Signed-off-by: Blue Swirl --- arch_init.c | 18 ++ sysemu.h|4 2 files changed, 22 insertions(+), 0 deletions(-) diff --git a/arch_init.c b/arch_init.c index cfc03ea..110421b 100644 --- a/arch_init.c +++ b/arch_init.c @@ -441,10 +441,28 @@ int qemu_uuid_parse(const char *str, uint8_t *uuid) return -1; } +#ifndef _WIN32 ret = sscanf(str, UUID_FMT, &uuid[0], &uuid[1], &uuid[2], &uuid[3], &uuid[4], &uuid[5], &uuid[6], &uuid[7], &uuid[8], &uuid[9], &uuid[10], &uuid[11], &uuid[12], &uuid[13], &uuid[14], &uuid[15]); +#else +{ +int uuid2[16]; +unsigned int i; + +ret = sscanf(str, UUID_FMT, &uuid2[0], &uuid2[1], &uuid2[2], &uuid2[3], + &uuid2[4], &uuid2[5], &uuid2[6], &uuid2[7], &uuid2[8], + &uuid2[9], &uuid2[10], &uuid2[11], &uuid2[12], &uuid2[13], + &uuid2[14], &uuid2[15]); +if (ret == 16) { +for (i = 0; i < ret; i++) { +uuid[i] = uuid2[i]; +} +} + +} +#endif if (ret != 16) { return -1; diff --git a/sysemu.h b/sysemu.h index fa921df..0228e6b 100644 --- a/sysemu.h +++ b/sysemu.h @@ -22,7 +22,11 @@ extern int vm_running; extern const char *qemu_name; extern uint8_t qemu_uuid[]; int qemu_uuid_parse(const char *str, uint8_t *uuid); +#ifndef _WIN32 #define UUID_FMT "%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx" +#else +#define UUID_FMT "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x" +#endif typedef struct vm_change_state_entry VMChangeStateEntry; typedef void VMChangeStateHandler(void *opaque, int running, int reason); -- 1.6.2.4
[Qemu-devel] [PATCH 1/3] Fix %lld or %llx printf format use
Signed-off-by: Blue Swirl --- audio/audio_template.h |2 +- block/curl.c|9 --- block/parallels.c |7 - block/qcow2.c |8 -- darwin-user/commpage.c |2 +- darwin-user/syscall.c |2 +- hw/vga.c|2 +- hw/vhost_net.c |2 +- ia64-dis.c |9 +-- nbd.c |4 +- qemu-img.c | 10 qemu-io.c | 57 --- target-cris/translate.c |4 +- target-ppc/translate.c |7 +++-- target-sparc/helper.c |2 +- 15 files changed, 69 insertions(+), 58 deletions(-) diff --git a/audio/audio_template.h b/audio/audio_template.h index 6b19848..2f5224b 100644 --- a/audio/audio_template.h +++ b/audio/audio_template.h @@ -541,7 +541,7 @@ uint64_t glue (AUD_get_elapsed_usec_, TYPE) (SW *sw, QEMUAudioTimeStamp *ts) cur_ts = sw->hw->ts_helper; old_ts = ts->old_ts; -/* dolog ("cur %lld old %lld\n", cur_ts, old_ts); */ +/* dolog ("cur %" PRId64 " old %" PRId64 "\n", cur_ts, old_ts); */ if (cur_ts >= old_ts) { delta = cur_ts - old_ts; diff --git a/block/curl.c b/block/curl.c index b944740..94b451c 100644 --- a/block/curl.c +++ b/block/curl.c @@ -118,7 +118,7 @@ static size_t curl_read_cb(void *ptr, size_t size, size_t nmemb, void *opaque) size_t realsize = size * nmemb; int i; -DPRINTF("CURL: Just reading %lld bytes\n", (unsigned long long)realsize); +DPRINTF("CURL: Just reading %" PRId64 " bytes\n", (uint64_t)realsize); if (!s || !s->orig_buf) goto read_end; @@ -368,7 +368,7 @@ static int curl_open(BlockDriverState *bs, const char *filename, int flags) s->len = (size_t)d; else if(!s->len) goto out; -DPRINTF("CURL: Size = %lld\n", (long long)s->len); +DPRINTF("CURL: Size = %" PRId64 "\n", (int64_t)s->len); curl_clean_state(state); curl_easy_cleanup(state->curl); @@ -450,8 +450,9 @@ static BlockDriverAIOCB *curl_aio_readv(BlockDriverState *bs, state->orig_buf = qemu_malloc(state->buf_len); state->acb[0] = acb; -snprintf(state->range, 127, "%lld-%lld", (long long)start, (long long)end); -DPRINTF("CURL (AIO): Reading %d at %lld (%s)\n", (nb_sectors * SECTOR_SIZE), start, state->range); +snprintf(state->range, 127, "%" PRId64 "-%" PRId64, (int64_t)start, (int64_t)end); +DPRINTF("CURL (AIO): Reading %d at %" PRId64 " (%s)\n", +(nb_sectors * SECTOR_SIZE), start, state->range); curl_easy_setopt(state->curl, CURLOPT_RANGE, state->range); curl_multi_add_handle(s->multi, state->curl); diff --git a/block/parallels.c b/block/parallels.c index b217101..e0eb4dc 100644 --- a/block/parallels.c +++ b/block/parallels.c @@ -129,8 +129,11 @@ static inline int seek_to_sector(BlockDriverState *bs, int64_t sector_num) position = (uint64_t)(s->catalog_bitmap[index] + offset) * 512; -//fprintf(stderr, "sector: %llx index=%x offset=%x pointer=%x position=%x\n", -// sector_num, index, offset, s->catalog_bitmap[index], position); +/* +fprintf(stderr, "sector: %" PRIx64 " index=%x offset=%x pointer=%x" +"position=%x\n", sector_num, index, offset, +s->catalog_bitmap[index], position); +*/ if (lseek(s->fd, position, SEEK_SET) != position) return -1; diff --git a/block/qcow2.c b/block/qcow2.c index ebad4e1..e7d0676 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -93,8 +93,9 @@ static int qcow_read_extensions(BlockDriverState *bs, uint64_t start_offset, #endif if (bdrv_pread(bs->file, offset, &ext, sizeof(ext)) != sizeof(ext)) { -fprintf(stderr, "qcow_handle_extension: ERROR: pread fail from offset %llu\n", -(unsigned long long)offset); +fprintf(stderr, "qcow_handle_extension: ERROR: " +"pread fail from offset %" PRIu64 "\n", +offset); return 1; } be32_to_cpus(&ext.magic); @@ -1245,7 +1246,8 @@ static void dump_refcounts(BlockDriverState *bs) k++; while (k < nb_clusters && get_refcount(bs, k) == refcount) k++; -printf("%lld: refcount=%d nb=%lld\n", k, refcount, k - k1); +printf("%" PRId64 ": refcount=%d nb=%" PRId64 "\n", k, refcount, + k - k1); } } #endif diff --git a/darwin-user/commpage.c b/darwin-user/commpage.c index 2b41bc5..f6aa71e 100644 --- a/darwin-user/commpage.c +++ b/darwin-user/commpage.c @@ -237,7 +237,7 @@ void do_compare_and_swap64(void *cpu_env, int num) uint64_t *value = (uint64_t*)((CPUX86State*)cpu_env)->regs[R_ESI]; old = (uint64_t)((uint64_t)((CPUX86State*)cpu_env)->regs[R_EDX]) << 32 | (uint64_t)((CPUX86State*)cpu_env)->regs[R_EAX]; -DPRINTF("commpage: compare_and_swap64(%llx,new,%p)\n", old, value); +DPRINTF("commpage: compare_and_swap64(%" PRIx64 ",new,%p)\n", old, value); swapped_v
[Qemu-devel] [PATCH 0/3] mingw32 compile fixes
Hi, With this mingw32 compiler: $ i586-mingw32msvc-gcc -v Using built-in specs. Target: i586-mingw32msvc Configured with: /tmp/buildd/gcc-mingw32-4.4.2/build-tree/gcc-4.4.2/configure --build=x86_64-linux-gnu --prefix=/usr --includedir='/usr/include' --mandir='/usr/share/man' --infodir='/usr/share/info' --sysconfdir=/etc --localstatedir=/var --libexecdir='/usr/lib/gcc-mingw32' --disable-multilib --enable-threads --enable-sjlj-exceptions --enable-version-specific-runtime-libs --disable-shared --target=i586-mingw32msvc --enable-languages=c,c++,fortran : (reconfigured) /tmp/buildd/gcc-mingw32-4.4.2/build-tree/gcc-4.4.2/configure --build=x86_64-linux-gnu --prefix=/usr --includedir='/usr/include' --mandir='/usr/share/man' --infodir='/usr/share/info' --sysconfdir=/etc --localstatedir=/var --libexecdir='/usr/lib/gcc-mingw32' --disable-multilib --enable-threads --enable-sjlj-exceptions --enable-version-specific-runtime-libs --disable-shared --target=i586-mingw32msvc --enable-languages=c,c++,fortran Thread model: win32 gcc version 4.4.2 (GCC) build will not succeed because formats %zd, %zu, %hh, %lld, %llx and %llu are not known by the compiler. Any %ll* use is clearly a bug, we have PRI*64 macros just for this purpose. For %hh and %z there may be better ways than these patches. With the patches I can build working Win32 binaries and there are no warnings. Blue Swirl (3): Fix %lld or %llx printf format use mingw32: avoid using %hh format which is not known by the compiler mingw32: avoid using %zd etc. formats which are not known by the compiler arch_init.c | 18 + audio/audio.c | 11 --- audio/audio_template.h|4 +- audio/esdaudio.c |8 +++--- audio/mixeng.c|3 +- audio/ossaudio.c |8 +++--- block/curl.c | 13 + block/parallels.c |7 +++- block/qcow2.c | 10 --- buffered_file.c | 13 + darwin-user/commpage.c|2 +- darwin-user/syscall.c |2 +- hw/ac97.c |4 +- hw/eepro100.c | 22 +-- hw/loader.c |8 +++--- hw/scsi-bus.c |4 +- hw/scsi-disk.c| 16 ++-- hw/usb-ohci.c |7 +++-- hw/vga.c |2 +- hw/vhost_net.c|2 +- hw/virtio-9p-debug.c |2 +- hw/virtio-9p.c|2 +- hw/xen_console.c |3 +- hw/xen_disk.c |6 +++- hw/xenfb.c|9 -- ia64-dis.c|9 -- nbd.c |4 +- osdep.c |2 +- qemu-common.h |7 + qemu-img.c| 10 +++--- qemu-io.c | 57 + sysemu.h |4 +++ target-cris/translate.c |6 ++-- target-microblaze/translate.c |2 +- target-ppc/translate.c|7 +++-- target-sparc/helper.c |2 +- usb-linux.c |2 +- vnc-auth-sasl.c |2 +- vnc.c |9 +++--- 39 files changed, 182 insertions(+), 127 deletions(-)
[Qemu-devel] Re: [PATCH 3/8] Add QBuffer
On 05/15/2010 11:59 AM, Jan Kiszka wrote: Is this __class__ stuff documented anywhere? Not yet. Also, we should clarify the proposed private extension section that only "__some_key" is reserved for downstream, not '__some_other_key__' (i.e. downstream names must not end with '__'). Why use such weird names at all? What's wrong with 'class'? -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.
[Qemu-devel] Re: [PATCH 00/26] split out piix specific part from pc emulator and some clean ups
Thanks, applied all. On 5/14/10, Isaku Yamahata wrote: > patch series description: > This patch series is for spliting out piix specific part from pc emulator > to make it easier to implement other pc chipset emulator. > > I observed that make was confused not to rebuild files sometimes due to > splitting up a file into files. It results in duplicated/undefined symbols. > In that case, 'make clean;make' will fix it. > > > Blue, your patches were combied into 21/26, and 22/26. Please check it. > Your patches to acpi.c had some issues. I fixed them in this patch series. > > 1/2 acpi: remove static pm_state: > The first argument, dev, of piix4_device_hotplug() is not > PIIX4PMState device, but hot plugged device. > So the container_of() doesn't make sense. > 2/2 acpi: remove static gpe and pci0_status variables > The call back argument to pge_readb(), gpe_writeb() is struct gpe_regs. > Not PIIX4PMState. > The callback argument pcihotplug_read(), pcihotplug_write() is > struct pci_status. Not PIIX4PMState. > Those argument type is void*, so compiler didn't catch it. > > thanks, > > Changes from V12: > - 2/26 acpi: split out apm register emulation from acpi.c > The patch originally convert CMOS S3 code to qemu_irq. However > the conversion is already done by Blue Swirl. So the patch was simplified. > - 22/26 pci hotadd, acpi_piix4: remove global variables > Minor style fix according to Blue's patch. > - rebased to 5acd0646b6033d40ef5d0ae06338cc354108f640 > > Changes from V11: > - s/pc_smbus/pm_smbus/g, s/pc_apm/apm/g and so on > because it isn't pc specifc. mips also uses it. > - No logic changes. > > Changes from V10: > - pass DeviceState* to pc_smbus_init(), now info qtree shows smbus. > - change pci hotplug argument from void * to DeviceState*. > > Changes from V9: > - rebased 502e64fe23f19c086d42f6178cdda19e58996080 > - use qemu_irq to remove global variables, rtc_state > - make rtc_xxx functions accept/return ISADevice and related clean ups > - pci hot plug clean up > - removed #ifdef DEBUG patches. > > > Changes from V8: > - make rtc_xxx functions accept/return ISADevice. > - move up ioapic initalization patch. > - fixed up copyright notice. > > Changes from V7: > - rebased to fe0d61231eb6be6a83c54f4a2795f924ee963f8f > > Changes from v6: > - rebased to 731c54f86988d3f28268f184fabfe9b2a32fb5d3 > > Changes from v5: > - rebased 0.11.0-rc0 > - changed qemu_system_powerdown_register() to call > qemu_system_shutdown_request() if qemu_system_shutdown() is called before > registering. > > Changes from v4: > - fix version number. > - rebased anthony's staging tree whose latest change set is > 62969268f876c547ee64da6d60e0f363e0f1df75 > > Changes from v3: > - move qemu_system_powerdown() in vl.c and more generic > following the comment by Marcelo Tosatti > acpi.c: make qemu_system_powerdown() piix independent. > - define cmos_set_s3_resume_init() and cmos_set_s3_resume() in pc.c > even if TARGET_I386 isn't defined following th ecommit by > Paolo Bonzini > pc.c: remove a global variable, RTCState *rtc_state. > - minor compilation fixes > > Changes from v2: > - clean up pc_pci_device_init() not to use unnecessary braces. > > Changes from v1: > - make patches full bisectable > - typo s/allocte/allocate/ > - some minor fixes > - dropped a merged patch > > Isaku Yamahata (26): > acpi: split out piix4 smbus routines from acpi.c into pm_smbus.c > acpi: split out apm register emulation from acpi.c > acpi: add acpi constants from linux header files and use them. > acpi: split acpi.c into the common part and the piix4 part. > pc: initialize ioapic before use. > pc, i440fx: Make smm enable/disable function i440fx independent. > pc: make an unnecessary global variable, pit, local. > pc: remove a global variable, floppy_controller. > pc: remove global variable rtc_state by using qemu_irq. > pc: introduce a function to allocate cpu irq. > pc: make pc_init1() not refer ferr_irq directly. > pc: split out cpu initialization from pc_init1() into pc_cpus_init(). > pc: split out memory allocation from pc_init1() into pc_memory_init() > pc: split out vga initialization from pc_init1() into pc_vga_init(). > pc: split out basic device init from pc_init1() into > pc_basic_device_init() > pc: split out pci device init from pc_init1() into > pc_pci_device_init() > pc: split out piix specific part from pc.c into pc_piix.c > pc: move rtc declarations from pc.h into a dedicated header file. > rtc: make rtc_xxx accept/return ISADevice instead of RTCState. > acpi_piix4: qdevfy. > pci hotplug: add argument to pci hot plug callback. > pci hotadd, acpi_piix4: remove global variables > pm_smbus: remove #ifdef DEBUG. > acpi_piix4: remove #ifdef DEBUG. > apm: remove #ifdef DEBUG. > mc146818rtc: remove #ifdef DEBUG_CMOS. > > Makefile.target |2 + > hw/acpi.c| 743 > +
[Qemu-devel] Re: [PATCH v2 0/6] vmstate: Drop post_save / allow instance ID aliases
Thanks, applied all. On 5/15/10, Jan Kiszka wrote: > This series comes with two major contributions: > - after moving away the last user of post_save (tmp105), this vmstate >callback is dropped > - introduction of an instance ID alias to vmstate, allowing to drop a few >more explicit vmstate_register calls > > Changes in v2: > - incorporated Blue Swirl's suggestion to request and check the highest >vmstate version that requires the alias (updated patches 3..6) > > Jan Kiszka (6): > tmp105: Drop unused faults field > vmstate: Drop unused post_save handler > vmstate: Add support for alias ID > serial: Register vmstate via qdev > fdc: Register vmstate via qdev > mc146818rtc: Register vmstate via qdev > > hw/fdc.c | 35 ++- > hw/hw.h |5 - > hw/mc146818rtc.c |3 ++- > hw/qdev.c| 16 ++-- > hw/qdev.h|4 > hw/serial.c | 13 - > hw/tmp105.c | 10 -- > savevm.c | 23 +-- > 8 files changed, 83 insertions(+), 26 deletions(-) > >
[Qemu-devel] Re: [PATCH v3] sh: sm501: add 2D engine support
Thanks, applied. On 5/15/10, Shin-ichiro KAWASAKI wrote: > This patch reflects Blue Swirl's second review. > Rebased with recent commit, and modified field name with underscore prefix. > > > Best Regards, > Shin-ichiro KAWASAKI > > > > --- > > In linux kernel v2.6.33, sm501 frame buffer driver modified to support > 2D graphics engine on sm501 chip. One example is "fill rectangle" operation. > But current qemu's sm501 emulation doesn't support it. This results in > graphics console disturbance. > > This patch introduces sm501 2D graphics engine emulation and solve this > problem. > > Signed-off-by: Shin-ichiro KAWASAKI > > Add SM501 2D hardware engine support. > > - Add 2D engine register set read/write handlers. > - Support 'fill rectangle'. Other operations are left for future work. > - Update SM501 support status comment. > > --- > hw/sm501.c | 172 > ++- > 1 files changed, 169 insertions(+), 3 deletions(-) > > diff --git a/hw/sm501.c b/hw/sm501.c > > index 9310014..7ce809a 100644 > > --- a/hw/sm501.c > +++ b/hw/sm501.c > > @@ -31,16 +31,16 @@ > #include "qdev-addr.h" > > > /* > - * Status: 2008/11/02 > + * Status: 2010/05/07 > * - Minimum implementation for Linux console : mmio regs and CRT layer. > - * - Always updates full screen. > + * - 2D grapihcs acceleration partially supported : only fill rectangle. > * > * TODO: > * - Panel support > - * - Hardware cursor support > * - Touch panel support > * - USB support > * - UART support > + * - More 2D graphics engine support > * - Performance tuning > */ > > > @@ -510,6 +510,18 @@ typedef struct SM501State { > > uint32_t dc_crt_hwc_color_1_2; > uint32_t dc_crt_hwc_color_3; > > > +uint32_t twoD_destination; > +uint32_t twoD_dimension; > +uint32_t twoD_control; > +uint32_t twoD_pitch; > +uint32_t twoD_foreground; > +uint32_t twoD_stretch; > +uint32_t twoD_color_compare_mask; > +uint32_t twoD_mask; > +uint32_t twoD_window_width; > +uint32_t twoD_source_base; > +uint32_t twoD_destination_base; > > + > } SM501State; > > static uint32_t get_local_mem_size_index(uint32_t size) > > @@ -619,6 +631,69 @@ static int within_hwc_y_range(SM501State *state, int y, > int crt) > > return (hwc_y <= y && y < hwc_y + SM501_HWC_HEIGHT); > } > > +static void sm501_2d_operation(SM501State * s) > +{ > +/* obtain operation parameters */ > > +int operation = (s->twoD_control >> 16) & 0x1f; > +int dst_x = (s->twoD_destination >> 16) & 0x01FFF; > +int dst_y = s->twoD_destination & 0x; > +int operation_width = (s->twoD_dimension >> 16) & 0x1FFF; > +int operation_height = s->twoD_dimension & 0x; > +uint32_t color = s->twoD_foreground; > +int format_flags = (s->twoD_stretch >> 20) & 0x3; > +int addressing = (s->twoD_stretch >> 16) & 0xF; > > + > +/* get frame buffer info */ > +#if 0 /* for future use */ > > +uint8_t * src = s->local_mem + (s->twoD_source_base & 0x03FF); > +#endif > +uint8_t * dst = s->local_mem + (s->twoD_destination_base & 0x03FF); > > +int dst_width = (s->dc_crt_h_total & 0x0FFF) + 1; > + > +if (addressing != 0x0) { > +printf("%s: only XY addressing is supported.\n", __func__); > +abort(); > +} > + > > +if ((s->twoD_source_base & 0x0800) || > +(s->twoD_destination_base & 0x0800)) { > > +printf("%s: only local memory is supported.\n", __func__); > +abort(); > +} > + > +switch (operation) { > +case 0x01: /* fill rectangle */ > + > +#define FILL_RECT(_bpp, _pixel_type) { > \ > +int y, x; > \ > +for (y = 0; y < operation_height; y++) { > \ > +for (x = 0; x < operation_width; x++) { > \ > +int index = ((dst_y + y) * dst_width + dst_x + x) * _bpp; > \ > +*(_pixel_type*)&dst[index] = (_pixel_type)color; > \ > +} > \ > +} > \ > +} > + > +switch (format_flags) { > +case 0: > +FILL_RECT(1, uint8_t); > +break; > +case 1: > +FILL_RECT(2, uint16_t); > +break; > +case 2: > +FILL_RECT(4, uint32_t); > +break; > +} > +break; > + > +default: > +printf("non-implemented SM501 2D operation. %d\n", operation); > +abort(); > +break; > +} > +} > + > static uint32_t sm501_system_conf
[Qemu-devel] Re: [PATCH v2 1/6] tmp105: Drop unused faults field
andrzej zaborowski wrote: > Hi Jan, > > On 15 May 2010 13:32, Jan Kiszka wrote: >> From: Jan Kiszka >> >> It was only written, but never read. > > I pushed an alternate version to just move the update from post_save > to post_load. If you think of code as documentation, the struct > becomes less complete in representing the state of the device if you > remove the register. State doesn't have to be readable through the > busses, some state may be readable through qemu monitor and the like. That particular state is unreadable via any existing interface (except a debugger). For pretty-printing TMP105State::config, there will once be better mechanisms based on vmstate. I don't mind if that dead code remains, I just want to underline that it's useless (code as documentation was important before versioning control entered the scene). Jan signature.asc Description: OpenPGP digital signature
Re: [Qemu-devel] Re: sparc64 lazy conditional codes evaluation
Blue Swirl wrote: Guest time can be unreliable, it could also indicate that Linux executes a lot more timer interrupts. Could you retest and measure the wall clock time? I think the C flag change should only increase performance. The next commit may have negative effects because more work is done every interrupt, but it's also more correct now. Hmmm looks like you're right. I did a few more tests measuring wall clock time and averaging across a set of runs gives roughly the same time (although there does seem to be quite a bit of variation in resulting times on my system here). So nothing to worry about here. ATB, Mark. -- Mark Cave-Ayland - Senior Technical Architect PostgreSQL - PostGIS Sirius Corporation plc - control through freedom http://www.siriusit.co.uk t: +44 870 608 0063 Sirius Labs: http://www.siriusit.co.uk/labs
[Qemu-devel] Re: [PATCH v2 1/6] tmp105: Drop unused faults field
Hi Jan, On 15 May 2010 13:32, Jan Kiszka wrote: > From: Jan Kiszka > > It was only written, but never read. I pushed an alternate version to just move the update from post_save to post_load. If you think of code as documentation, the struct becomes less complete in representing the state of the device if you remove the register. State doesn't have to be readable through the busses, some state may be readable through qemu monitor and the like. Cheers
[Qemu-devel] [PATCH v3] sh: sm501: add 2D engine support
This patch reflects Blue Swirl's second review. Rebased with recent commit, and modified field name with underscore prefix. Best Regards, Shin-ichiro KAWASAKI --- In linux kernel v2.6.33, sm501 frame buffer driver modified to support 2D graphics engine on sm501 chip. One example is "fill rectangle" operation. But current qemu's sm501 emulation doesn't support it. This results in graphics console disturbance. This patch introduces sm501 2D graphics engine emulation and solve this problem. Signed-off-by: Shin-ichiro KAWASAKI Add SM501 2D hardware engine support. - Add 2D engine register set read/write handlers. - Support 'fill rectangle'. Other operations are left for future work. - Update SM501 support status comment. --- hw/sm501.c | 172 ++- 1 files changed, 169 insertions(+), 3 deletions(-) diff --git a/hw/sm501.c b/hw/sm501.c index 9310014..7ce809a 100644 --- a/hw/sm501.c +++ b/hw/sm501.c @@ -31,16 +31,16 @@ #include "qdev-addr.h" /* - * Status: 2008/11/02 + * Status: 2010/05/07 * - Minimum implementation for Linux console : mmio regs and CRT layer. - * - Always updates full screen. + * - 2D grapihcs acceleration partially supported : only fill rectangle. * * TODO: * - Panel support - * - Hardware cursor support * - Touch panel support * - USB support * - UART support + * - More 2D graphics engine support * - Performance tuning */ @@ -510,6 +510,18 @@ typedef struct SM501State { uint32_t dc_crt_hwc_color_1_2; uint32_t dc_crt_hwc_color_3; +uint32_t twoD_destination; +uint32_t twoD_dimension; +uint32_t twoD_control; +uint32_t twoD_pitch; +uint32_t twoD_foreground; +uint32_t twoD_stretch; +uint32_t twoD_color_compare_mask; +uint32_t twoD_mask; +uint32_t twoD_window_width; +uint32_t twoD_source_base; +uint32_t twoD_destination_base; + } SM501State; static uint32_t get_local_mem_size_index(uint32_t size) @@ -619,6 +631,69 @@ static int within_hwc_y_range(SM501State *state, int y, int crt) return (hwc_y <= y && y < hwc_y + SM501_HWC_HEIGHT); } +static void sm501_2d_operation(SM501State * s) +{ +/* obtain operation parameters */ +int operation = (s->twoD_control >> 16) & 0x1f; +int dst_x = (s->twoD_destination >> 16) & 0x01FFF; +int dst_y = s->twoD_destination & 0x; +int operation_width = (s->twoD_dimension >> 16) & 0x1FFF; +int operation_height = s->twoD_dimension & 0x; +uint32_t color = s->twoD_foreground; +int format_flags = (s->twoD_stretch >> 20) & 0x3; +int addressing = (s->twoD_stretch >> 16) & 0xF; + +/* get frame buffer info */ +#if 0 /* for future use */ +uint8_t * src = s->local_mem + (s->twoD_source_base & 0x03FF); +#endif +uint8_t * dst = s->local_mem + (s->twoD_destination_base & 0x03FF); +int dst_width = (s->dc_crt_h_total & 0x0FFF) + 1; + +if (addressing != 0x0) { +printf("%s: only XY addressing is supported.\n", __func__); +abort(); +} + +if ((s->twoD_source_base & 0x0800) || +(s->twoD_destination_base & 0x0800)) { +printf("%s: only local memory is supported.\n", __func__); +abort(); +} + +switch (operation) { +case 0x01: /* fill rectangle */ + +#define FILL_RECT(_bpp, _pixel_type) { \ +int y, x; \ +for (y = 0; y < operation_height; y++) {\ +for (x = 0; x < operation_width; x++) { \ +int index = ((dst_y + y) * dst_width + dst_x + x) * _bpp; \ +*(_pixel_type*)&dst[index] = (_pixel_type)color;\ +} \ +} \ +} + +switch (format_flags) { +case 0: +FILL_RECT(1, uint8_t); +break; +case 1: +FILL_RECT(2, uint16_t); +break; +case 2: +FILL_RECT(4, uint32_t); +break; +} +break; + +default: +printf("non-implemented SM501 2D operation. %d\n", operation); +abort(); +break; +} +} + static uint32_t sm501_system_config_read(void *opaque, target_phys_addr_t addr) { SM501State * s = (SM501State *)opaque; @@ -969,6 +1044,92 @@ static CPUWriteMemoryFunc * const sm501_disp_ctrl_writefn[] = { &sm501_disp_ctrl_write, }; +static uint32_t sm501_2d_engine_read(void *opaque, target_phys_addr_t addr) +{ +SM501State * s = (SM501State *)opaque; +uint32_t ret = 0; +SM501_DPRINTF("sm501 2d engine regs : read addr=%x\n", (int)addr); + +switch(addr) { +case SM501_2D_
[Qemu-devel] Re: [PATCH v2] sh: sm501: add 2D engine support
(2010/05/15 5:44), Blue Swirl wrote: On 5/11/10, Shin-ichiro KAWASAKI wrote: Hello Blue Swirl, and thank you for the review. Here's the patch modified according to your comments. abort() is used instead of assert(), and const modifier added for CPU*MemoryFunc. The patch does not apply. It seems to be based on some version before 61d3cf93e2676282ba1a8d568b2406257f208b26. Ah, I've not yet pulled newest one. * - Performance tuning */ @@ -508,6 +508,18 @@ typedef struct SM501State { uint32_t dc_crt_hwc_color_1_2; uint32_t dc_crt_hwc_color_3; +uint32_t _2d_destination; +uint32_t _2d_dimension; +uint32_t _2d_control; +uint32_t _2d_pitch; +uint32_t _2d_foreground; +uint32_t _2d_stretch; +uint32_t _2d_color_compare_mask; +uint32_t _2d_mask; +uint32_t _2d_window_width; +uint32_t _2d_source_base; +uint32_t _2d_destination_base; While at it, could you remove the underscore prefix from the field names? OK. I'll rename them, from _2d_* into twoD_*. Thank you for the review. Best Regards, Shin-ichiro KAWASAKI
[Qemu-devel] [PATCH v2 1/6] tmp105: Drop unused faults field
From: Jan Kiszka It was only written, but never read. Signed-off-by: Jan Kiszka CC: Andrzej Zaborowski --- hw/tmp105.c | 10 -- 1 files changed, 0 insertions(+), 10 deletions(-) diff --git a/hw/tmp105.c b/hw/tmp105.c index 8343aff..cac5f2b 100644 --- a/hw/tmp105.c +++ b/hw/tmp105.c @@ -31,7 +31,6 @@ typedef struct { uint8_t config; int16_t temperature; int16_t limit[2]; -int faults; uint8_t alarm; } TMP105State; @@ -124,7 +123,6 @@ static void tmp105_write(TMP105State *s) if (s->buf[0] & ~s->config & (1 << 0)) /* SD */ printf("%s: TMP105 shutdown\n", __FUNCTION__); s->config = s->buf[0]; -s->faults = tmp105_faultq[(s->config >> 3) & 3]; /* F */ tmp105_alarm_update(s); break; @@ -173,12 +171,6 @@ static void tmp105_event(i2c_slave *i2c, enum i2c_event event) s->len = 0; } -static void tmp105_post_save(void *opaque) -{ -TMP105State *s = opaque; -s->faults = tmp105_faultq[(s->config >> 3) & 3]; /* F */ -} - static int tmp105_post_load(void *opaque, int version_id) { TMP105State *s = opaque; @@ -192,7 +184,6 @@ static const VMStateDescription vmstate_tmp105 = { .version_id = 0, .minimum_version_id = 0, .minimum_version_id_old = 0, -.post_save = tmp105_post_save, .post_load = tmp105_post_load, .fields = (VMStateField []) { VMSTATE_UINT8(len, TMP105State), @@ -214,7 +205,6 @@ static void tmp105_reset(i2c_slave *i2c) s->temperature = 0; s->pointer = 0; s->config = 0; -s->faults = tmp105_faultq[(s->config >> 3) & 3]; s->alarm = 0; tmp105_interrupt_update(s); -- 1.6.0.2
[Qemu-devel] [PATCH v2 6/6] mc146818rtc: Register vmstate via qdev
From: Jan Kiszka After defining the required alias ID, we can push vmstate registration of mc146818rtc to qdev. Signed-off-by: Jan Kiszka --- hw/mc146818rtc.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c index 89a423e..905e670 100644 --- a/hw/mc146818rtc.c +++ b/hw/mc146818rtc.c @@ -609,7 +609,7 @@ static int rtc_initfn(ISADevice *dev) register_ioport_write(base, 2, 1, cmos_ioport_write, s); register_ioport_read(base, 2, 1, cmos_ioport_read, s); -vmstate_register(base, &vmstate_rtc, s); +qdev_set_legacy_instance_id(&dev->qdev, base, 2); qemu_register_reset(rtc_reset, s); return 0; } @@ -628,6 +628,7 @@ static ISADeviceInfo mc146818rtc_info = { .qdev.name = "mc146818rtc", .qdev.size = sizeof(RTCState), .qdev.no_user = 1, +.qdev.vmsd = &vmstate_rtc, .init = rtc_initfn, .qdev.props= (Property[]) { DEFINE_PROP_INT32("base_year", RTCState, base_year, 1980), -- 1.6.0.2
[Qemu-devel] [PATCH v2 2/6] vmstate: Drop unused post_save handler
From: Jan Kiszka No device makes use of it anymore. Signed-off-by: Jan Kiszka --- hw/hw.h |1 - savevm.c |3 --- 2 files changed, 0 insertions(+), 4 deletions(-) diff --git a/hw/hw.h b/hw/hw.h index 328b704..2d39724 100644 --- a/hw/hw.h +++ b/hw/hw.h @@ -321,7 +321,6 @@ struct VMStateDescription { int (*pre_load)(void *opaque); int (*post_load)(void *opaque, int version_id); void (*pre_save)(void *opaque); -void (*post_save)(void *opaque); VMStateField *fields; }; diff --git a/savevm.c b/savevm.c index 31a419c..74e553c 100644 --- a/savevm.c +++ b/savevm.c @@ -1231,9 +1231,6 @@ void vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd, } field++; } -if (vmsd->post_save) { -vmsd->post_save(opaque); -} } static int vmstate_load(QEMUFile *f, SaveStateEntry *se, int version_id) -- 1.6.0.2
[Qemu-devel] [PATCH v2 4/6] serial: Register vmstate via qdev
From: Jan Kiszka At least for isa-serial, we can already let qdev do the vmstate registration for us. It just takes wrapping vmstate for the encapsulating ISASerialState and defining the proper instance ID aliases. Signed-off-by: Jan Kiszka --- hw/serial.c | 13 - 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/hw/serial.c b/hw/serial.c index 90213c4..9102edb 100644 --- a/hw/serial.c +++ b/hw/serial.c @@ -771,7 +771,7 @@ static int serial_isa_initfn(ISADevice *dev) s->baudbase = 115200; isa_init_irq(dev, &s->irq, isa->isairq); serial_init_core(s); -vmstate_register(isa->iobase, &vmstate_serial, s); +qdev_set_legacy_instance_id(&dev->qdev, isa->iobase, 3); register_ioport_write(isa->iobase, 8, 1, serial_ioport_write, s); register_ioport_read(isa->iobase, 8, 1, serial_ioport_read, s); @@ -790,6 +790,16 @@ SerialState *serial_isa_init(int index, CharDriverState *chr) return &DO_UPCAST(ISASerialState, dev, dev)->state; } +static const VMStateDescription vmstate_isa_serial = { +.name = "serial", +.version_id = 3, +.minimum_version_id = 2, +.fields = (VMStateField []) { +VMSTATE_STRUCT(state, ISASerialState, 0, vmstate_serial, SerialState), +VMSTATE_END_OF_LIST() +} +}; + SerialState *serial_init(int base, qemu_irq irq, int baudbase, CharDriverState *chr) { @@ -956,6 +966,7 @@ SerialState *serial_mm_init (target_phys_addr_t base, int it_shift, static ISADeviceInfo serial_isa_info = { .qdev.name = "isa-serial", .qdev.size = sizeof(ISASerialState), +.qdev.vmsd = &vmstate_isa_serial, .init = serial_isa_initfn, .qdev.props = (Property[]) { DEFINE_PROP_UINT32("index", ISASerialState, index, -1), -- 1.6.0.2
[Qemu-devel] [PATCH v2 5/6] fdc: Register vmstate via qdev
From: Jan Kiszka Establish vmstate containers for ISA and sysbus variant, define the iobase as instance ID alias, and let qdev do the vmstate registration work. Signed-off-by: Jan Kiszka --- hw/fdc.c | 35 ++- 1 files changed, 30 insertions(+), 5 deletions(-) diff --git a/hw/fdc.c b/hw/fdc.c index c4ca9e9..6306496 100644 --- a/hw/fdc.c +++ b/hw/fdc.c @@ -1918,7 +1918,7 @@ FDCtrl *sun4m_fdctrl_init(qemu_irq irq, target_phys_addr_t io_base, return fdctrl; } -static int fdctrl_init_common(FDCtrl *fdctrl, target_phys_addr_t io_base) +static int fdctrl_init_common(FDCtrl *fdctrl) { int i, j; static int command_tables_inited = 0; @@ -1949,7 +1949,6 @@ static int fdctrl_init_common(FDCtrl *fdctrl, target_phys_addr_t io_base) DMA_register_channel(fdctrl->dma_chann, &fdctrl_transfer_handler, fdctrl); fdctrl_connect_drives(fdctrl); -vmstate_register(io_base, &vmstate_fdc, fdctrl); return 0; } @@ -1973,7 +1972,8 @@ static int isabus_fdc_init1(ISADevice *dev) isa_init_irq(&isa->busdev, &fdctrl->irq, isairq); fdctrl->dma_chann = dma_chann; -ret = fdctrl_init_common(fdctrl, iobase); +qdev_set_legacy_instance_id(&dev->qdev, iobase, 2); +ret = fdctrl_init_common(fdctrl); return ret; } @@ -1991,7 +1991,8 @@ static int sysbus_fdc_init1(SysBusDevice *dev) qdev_init_gpio_in(&dev->qdev, fdctrl_handle_tc, 1); fdctrl->dma_chann = -1; -ret = fdctrl_init_common(fdctrl, io); +qdev_set_legacy_instance_id(&dev->qdev, io, 2); +ret = fdctrl_init_common(fdctrl); return ret; } @@ -2008,14 +2009,26 @@ static int sun4m_fdc_init1(SysBusDevice *dev) qdev_init_gpio_in(&dev->qdev, fdctrl_handle_tc, 1); fdctrl->sun4m = 1; -return fdctrl_init_common(fdctrl, io); +qdev_set_legacy_instance_id(&dev->qdev, io, 2); +return fdctrl_init_common(fdctrl); } +static const VMStateDescription vmstate_isa_fdc ={ +.name = "fdc", +.version_id = 2, +.minimum_version_id = 2, +.fields = (VMStateField []) { +VMSTATE_STRUCT(state, FDCtrlISABus, 0, vmstate_fdc, FDCtrl), +VMSTATE_END_OF_LIST() +} +}; + static ISADeviceInfo isa_fdc_info = { .init = isabus_fdc_init1, .qdev.name = "isa-fdc", .qdev.size = sizeof(FDCtrlISABus), .qdev.no_user = 1, +.qdev.vmsd = &vmstate_isa_fdc, .qdev.reset = fdctrl_external_reset_isa, .qdev.props = (Property[]) { DEFINE_PROP_DRIVE("driveA", FDCtrlISABus, state.drives[0].dinfo), @@ -2024,10 +2037,21 @@ static ISADeviceInfo isa_fdc_info = { }, }; +static const VMStateDescription vmstate_sysbus_fdc ={ +.name = "fdc", +.version_id = 2, +.minimum_version_id = 2, +.fields = (VMStateField []) { +VMSTATE_STRUCT(state, FDCtrlSysBus, 0, vmstate_fdc, FDCtrl), +VMSTATE_END_OF_LIST() +} +}; + static SysBusDeviceInfo sysbus_fdc_info = { .init = sysbus_fdc_init1, .qdev.name = "sysbus-fdc", .qdev.size = sizeof(FDCtrlSysBus), +.qdev.vmsd = &vmstate_sysbus_fdc, .qdev.reset = fdctrl_external_reset_sysbus, .qdev.props = (Property[]) { DEFINE_PROP_DRIVE("driveA", FDCtrlSysBus, state.drives[0].dinfo), @@ -2040,6 +2064,7 @@ static SysBusDeviceInfo sun4m_fdc_info = { .init = sun4m_fdc_init1, .qdev.name = "SUNW,fdtwo", .qdev.size = sizeof(FDCtrlSysBus), +.qdev.vmsd = &vmstate_sysbus_fdc, .qdev.reset = fdctrl_external_reset_sysbus, .qdev.props = (Property[]) { DEFINE_PROP_DRIVE("drive", FDCtrlSysBus, state.drives[0].dinfo), -- 1.6.0.2
[Qemu-devel] [PATCH v2 3/6] vmstate: Add support for alias ID
From: Jan Kiszka Some legacy users (mostly PC devices) of vmstate_register manage instance IDs on their own, and that unfortunately in a way that is incompatible with automatically generated ones. This so far prevents switching those users to vmstates that are registered by qdev. To establish a migration path, this patch introduces the concept of alias IDs. They can be passed to an extended vmstate registration service, and qdev provides a set service to be used during device init. find_se will consider the alias in addition to the default ID. We can then start generating the default ID automatically and writing it on vmsave, thus converting that format without breaking support for upward migration. The user is required specify the highest vmstate version for which the alias is required. Once this version falls behind the minimum required for a specific vmstate, an assertion triggers to motivate cleaning up the obsolete alias. Signed-off-by: Jan Kiszka --- hw/hw.h |4 hw/qdev.c | 16 ++-- hw/qdev.h |4 savevm.c | 20 +--- 4 files changed, 39 insertions(+), 5 deletions(-) diff --git a/hw/hw.h b/hw/hw.h index 2d39724..fc2d184 100644 --- a/hw/hw.h +++ b/hw/hw.h @@ -758,5 +758,9 @@ extern void vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd, void *opaque); extern int vmstate_register(int instance_id, const VMStateDescription *vmsd, void *base); +extern int vmstate_register_with_alias_id(int instance_id, + const VMStateDescription *vmsd, + void *base, int alias_id, + int required_for_version); void vmstate_unregister(const VMStateDescription *vmsd, void *opaque); #endif diff --git a/hw/qdev.c b/hw/qdev.c index d3bf0fa..af17486 100644 --- a/hw/qdev.c +++ b/hw/qdev.c @@ -93,6 +93,7 @@ static DeviceState *qdev_create_from_info(BusState *bus, DeviceInfo *info) assert(bus->allow_hotplug); dev->hotplugged = 1; } +dev->instance_id_alias = -1; dev->state = DEV_STATE_CREATED; return dev; } @@ -278,12 +279,23 @@ int qdev_init(DeviceState *dev) return rc; } qemu_register_reset(qdev_reset, dev); -if (dev->info->vmsd) -vmstate_register(-1, dev->info->vmsd, dev); +if (dev->info->vmsd) { +vmstate_register_with_alias_id(-1, dev->info->vmsd, dev, + dev->instance_id_alias, + dev->alias_required_for_version); +} dev->state = DEV_STATE_INITIALIZED; return 0; } +void qdev_set_legacy_instance_id(DeviceState *dev, int alias_id, + int required_for_version) +{ +assert(dev->state == DEV_STATE_CREATED); +dev->instance_id_alias = alias_id; +dev->alias_required_for_version = required_for_version; +} + int qdev_unplug(DeviceState *dev) { if (!dev->parent_bus->allow_hotplug) { diff --git a/hw/qdev.h b/hw/qdev.h index d8fbc73..a44060e 100644 --- a/hw/qdev.h +++ b/hw/qdev.h @@ -44,6 +44,8 @@ struct DeviceState { QLIST_HEAD(, BusState) child_bus; int num_child_bus; QLIST_ENTRY(DeviceState) sibling; +int instance_id_alias; +int alias_required_for_version; }; typedef void (*bus_dev_printfn)(Monitor *mon, DeviceState *dev, int indent); @@ -112,6 +114,8 @@ int qdev_device_help(QemuOpts *opts); DeviceState *qdev_device_add(QemuOpts *opts); int qdev_init(DeviceState *dev) QEMU_WARN_UNUSED_RESULT; void qdev_init_nofail(DeviceState *dev); +void qdev_set_legacy_instance_id(DeviceState *dev, int alias_id, + int required_for_version); int qdev_unplug(DeviceState *dev); void qdev_free(DeviceState *dev); int qdev_simple_unplug_cb(DeviceState *dev); diff --git a/savevm.c b/savevm.c index 74e553c..dc20390 100644 --- a/savevm.c +++ b/savevm.c @@ -991,6 +991,7 @@ typedef struct SaveStateEntry { QTAILQ_ENTRY(SaveStateEntry) entry; char idstr[256]; int instance_id; +int alias_id; int version_id; int section_id; SaveSetParamsHandler *set_params; @@ -1079,11 +1080,16 @@ void unregister_savevm(const char *idstr, void *opaque) } } -int vmstate_register(int instance_id, const VMStateDescription *vmsd, - void *opaque) +int vmstate_register_with_alias_id(int instance_id, + const VMStateDescription *vmsd, + void *opaque, int alias_id, + int required_for_version) { SaveStateEntry *se; +/* If this triggers, alias support can be dropped for the vmsd. */ +assert(alias_id == -1 || required_for_version >= vmsd->minimum_version_id); + se = qemu_mallocz(sizeof(SaveStateEntry)); pstrcpy(se->idstr, sizeof(se->idstr), vmsd->name); se->version_id
[Qemu-devel] [PATCH v2 0/6] vmstate: Drop post_save / allow instance ID aliases
This series comes with two major contributions: - after moving away the last user of post_save (tmp105), this vmstate callback is dropped - introduction of an instance ID alias to vmstate, allowing to drop a few more explicit vmstate_register calls Changes in v2: - incorporated Blue Swirl's suggestion to request and check the highest vmstate version that requires the alias (updated patches 3..6) Jan Kiszka (6): tmp105: Drop unused faults field vmstate: Drop unused post_save handler vmstate: Add support for alias ID serial: Register vmstate via qdev fdc: Register vmstate via qdev mc146818rtc: Register vmstate via qdev hw/fdc.c | 35 ++- hw/hw.h |5 - hw/mc146818rtc.c |3 ++- hw/qdev.c| 16 ++-- hw/qdev.h|4 hw/serial.c | 13 - hw/tmp105.c | 10 -- savevm.c | 23 +-- 8 files changed, 83 insertions(+), 26 deletions(-)
[Qemu-devel] Re: [PATCH] Put dependency files in proper subdir
Jan Kiszka wrote: > From: Jan Kiszka > > This seems to resolve subtle breakages of our build system: > > Dependency files generated for targets like 'dir/foo.o' were saved as > 'foo.d'. Now, if there was also a target 'foo.o', one of the dependency > file was overwritten. Concrete example: libhw*/macio.o vs. > libhw*/ide/macio.o. And this often left a segfaulting build result > behind when changing the "wrong" data structures". Actually, most lethal was qdev.o vs. ide/qdev.o. Jan > > Fix it by generating proper 'dir/foo.d'. > > Signed-off-by: Jan Kiszka > --- > rules.mak |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/rules.mak b/rules.mak > index 7e10432..c843a13 100644 > --- a/rules.mak > +++ b/rules.mak > @@ -12,7 +12,7 @@ MAKEFLAGS += -rR > %.mak: > > # Flags for dependency generation > -QEMU_DGFLAGS += -MMD -MP -MT $@ > +QEMU_DGFLAGS += -MMD -MP -MT $@ -MF $(*D)/$(*F).d > > %.o: %.c > $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c > -o $@ $<," CC$(TARGET_DIR)$@") signature.asc Description: OpenPGP digital signature
[Qemu-devel] [PATCH] Clean libhw subdirs as well
From: Jan Kiszka Signed-off-by: Jan Kiszka --- Makefile.hw |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Makefile.hw b/Makefile.hw index be35359..b9181ab 100644 --- a/Makefile.hw +++ b/Makefile.hw @@ -18,7 +18,7 @@ all: $(hw-obj-y) @true clean: - rm -f *.o *.d *.a *~ + rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~ # Include automatically generated dependency files -include $(wildcard *.d */*.d) -- 1.6.0.2
[Qemu-devel] [PATCH] Put dependency files in proper subdir
From: Jan Kiszka This seems to resolve subtle breakages of our build system: Dependency files generated for targets like 'dir/foo.o' were saved as 'foo.d'. Now, if there was also a target 'foo.o', one of the dependency file was overwritten. Concrete example: libhw*/macio.o vs. libhw*/ide/macio.o. And this often left a segfaulting build result behind when changing the "wrong" data structures". Fix it by generating proper 'dir/foo.d'. Signed-off-by: Jan Kiszka --- rules.mak |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/rules.mak b/rules.mak index 7e10432..c843a13 100644 --- a/rules.mak +++ b/rules.mak @@ -12,7 +12,7 @@ MAKEFLAGS += -rR %.mak: # Flags for dependency generation -QEMU_DGFLAGS += -MMD -MP -MT $@ +QEMU_DGFLAGS += -MMD -MP -MT $@ -MF $(*D)/$(*F).d %.o: %.c $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," CC$(TARGET_DIR)$@") -- 1.6.0.2
[Qemu-devel] [PATCH 2/2] Compile pckbd only once
Use a qemu_irq to indicate A20 line changes. This changes the A20 logic so that when checking A20 line, i8042 and I/O port 92 may see different values if the other method is used to change the A20 line. Signed-off-by: Blue Swirl --- Makefile.objs|1 + Makefile.target |8 ++-- default-configs/i386-softmmu.mak |1 + default-configs/mips-softmmu.mak |1 + default-configs/mips64-softmmu.mak |1 + default-configs/mips64el-softmmu.mak |1 + default-configs/mipsel-softmmu.mak |1 + default-configs/ppc-softmmu.mak |1 + default-configs/ppc64-softmmu.mak|1 + default-configs/ppcemb-softmmu.mak |1 + default-configs/sparc64-softmmu.mak |1 + default-configs/x86_64-softmmu.mak |1 + hw/pc.c | 20 +++--- hw/pc.h |6 ++-- hw/pckbd.c | 64 +- hw/vmmouse.c |2 +- 16 files changed, 73 insertions(+), 38 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index 110f8fd..814b9e1 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -151,6 +151,7 @@ hw-obj-$(CONFIG_SERIAL) += serial.o hw-obj-$(CONFIG_PARALLEL) += parallel.o hw-obj-$(CONFIG_I8254) += i8254.o hw-obj-$(CONFIG_PCSPK) += pcspk.o +hw-obj-$(CONFIG_PCKBD) += pckbd.o hw-obj-$(CONFIG_USB_UHCI) += usb-uhci.o hw-obj-$(CONFIG_FDC) += fdc.o hw-obj-$(CONFIG_ACPI) += acpi.o diff --git a/Makefile.target b/Makefile.target index b62117c..559a44a 100644 --- a/Makefile.target +++ b/Makefile.target @@ -188,7 +188,7 @@ obj-y += rtl8139.o obj-y += e1000.o # Hardware support -obj-i386-y = pckbd.o dma.o +obj-i386-y = dma.o obj-i386-y += vga.o obj-i386-y += mc146818rtc.o i8259.o pc.o obj-i386-y += cirrus_vga.o apic.o ioapic.o piix_pci.o @@ -200,7 +200,7 @@ obj-i386-y += debugcon.o multiboot.o obj-ppc-y = ppc.o obj-ppc-y += vga.o dma.o # PREP target -obj-ppc-y += pckbd.o i8259.o mc146818rtc.o +obj-ppc-y += i8259.o mc146818rtc.o obj-ppc-y += ppc_prep.o # OldWorld PowerMac obj-ppc-y += ppc_oldworld.o @@ -218,7 +218,7 @@ obj-mips-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o obj-mips-y += mips_addr.o mips_timer.o mips_int.o obj-mips-y += dma.o vga.o i8259.o obj-mips-y += g364fb.o jazz_led.o -obj-mips-y += gt64xxx.o pckbd.o mc146818rtc.o +obj-mips-y += gt64xxx.o mc146818rtc.o obj-mips-y += piix4.o cirrus_vga.o obj-microblaze-y = petalogix_s3adsp1800_mmu.o @@ -242,7 +242,7 @@ obj-cris-y += etraxfs_timer.o obj-cris-y += etraxfs_ser.o ifeq ($(TARGET_ARCH), sparc64) -obj-sparc-y = sun4u.o pckbd.o apb_pci.o +obj-sparc-y = sun4u.o apb_pci.o obj-sparc-y += vga.o obj-sparc-y += mc146818rtc.o obj-sparc-y += cirrus_vga.o diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak index 4c1495f..92ef535 100644 --- a/default-configs/i386-softmmu.mak +++ b/default-configs/i386-softmmu.mak @@ -8,6 +8,7 @@ CONFIG_SERIAL=y CONFIG_PARALLEL=y CONFIG_I8254=y CONFIG_PCSPK=y +CONFIG_PCKBD=y CONFIG_USB_UHCI=y CONFIG_FDC=y CONFIG_ACPI=y diff --git a/default-configs/mips-softmmu.mak b/default-configs/mips-softmmu.mak index 7793dbc..15015c3 100644 --- a/default-configs/mips-softmmu.mak +++ b/default-configs/mips-softmmu.mak @@ -10,6 +10,7 @@ CONFIG_SERIAL=y CONFIG_PARALLEL=y CONFIG_I8254=y CONFIG_PCSPK=y +CONFIG_PCKBD=y CONFIG_USB_UHCI=y CONFIG_FDC=y CONFIG_ACPI=y diff --git a/default-configs/mips64-softmmu.mak b/default-configs/mips64-softmmu.mak index aa65d92..982462a 100644 --- a/default-configs/mips64-softmmu.mak +++ b/default-configs/mips64-softmmu.mak @@ -10,6 +10,7 @@ CONFIG_SERIAL=y CONFIG_PARALLEL=y CONFIG_I8254=y CONFIG_PCSPK=y +CONFIG_PCKBD=y CONFIG_USB_UHCI=y CONFIG_FDC=y CONFIG_ACPI=y diff --git a/default-configs/mips64el-softmmu.mak b/default-configs/mips64el-softmmu.mak index b9b8c71..c23d186 100644 --- a/default-configs/mips64el-softmmu.mak +++ b/default-configs/mips64el-softmmu.mak @@ -10,6 +10,7 @@ CONFIG_SERIAL=y CONFIG_PARALLEL=y CONFIG_I8254=y CONFIG_PCSPK=y +CONFIG_PCKBD=y CONFIG_USB_UHCI=y CONFIG_FDC=y CONFIG_ACPI=y diff --git a/default-configs/mipsel-softmmu.mak b/default-configs/mipsel-softmmu.mak index e14831e..cd76389 100644 --- a/default-configs/mipsel-softmmu.mak +++ b/default-configs/mipsel-softmmu.mak @@ -10,6 +10,7 @@ CONFIG_SERIAL=y CONFIG_PARALLEL=y CONFIG_I8254=y CONFIG_PCSPK=y +CONFIG_PCKBD=y CONFIG_USB_UHCI=y CONFIG_FDC=y CONFIG_ACPI=y diff --git a/default-configs/ppc-softmmu.mak b/default-configs/ppc-softmmu.mak index 958bf75..03cc20f 100644 --- a/default-configs/ppc-softmmu.mak +++ b/default-configs/ppc-softmmu.mak @@ -8,6 +8,7 @@ CONFIG_M48T59=y CONFIG_VGA_PCI=y CONFIG_SERIAL=y CONFIG_I8254=y +CONFIG_PCKBD=y CONFIG_FDC=y CONFIG_OPENPIC=y CONFIG_PREP_PCI=y diff --git a/default-configs/ppc64-softmmu.mak b/default-configs/ppc64-softmmu.mak index 9896662..8c77133 100644 --- a/default-configs/ppc64-softmmu.mak +
[Qemu-devel] [PATCH 1/2] pc: improve onboard I/O port debugging
Signed-off-by: Blue Swirl --- hw/pc.c | 18 +- 1 files changed, 17 insertions(+), 1 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index db2b9a2..938b2e0 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -51,6 +51,16 @@ /* output Bochs bios info messages */ //#define DEBUG_BIOS +/* debug board I/O ports */ +//#define DEBUG_IOPORTS + +#ifdef DEBUG_IOPORTS +#define DPRINTF_IO(fmt, ...) \ +do { printf("IOPORT: " fmt , ## __VA_ARGS__); } while (0) +#else +#define DPRINTF_IO(fmt, ...) +#endif + #define BIOS_FILENAME "bios.bin" #define PC_MAX_BIOS_SIZE (4 * 1024 * 1024) @@ -103,6 +113,7 @@ static void isa_irq_handler(void *opaque, int n, int level) static void ioport80_write(void *opaque, uint32_t addr, uint32_t data) { +DPRINTF_IO("write addr %x data %x\n", addr, data); } /* MSDOS compatibility mode FPU exception support */ @@ -384,13 +395,18 @@ int ioport_get_a20(void) static void ioport92_write(void *opaque, uint32_t addr, uint32_t val) { +DPRINTF_IO("write addr %x data %x\n", addr, val); ioport_set_a20((val >> 1) & 1); /* XXX: bit 0 is fast reset */ } static uint32_t ioport92_read(void *opaque, uint32_t addr) { -return ioport_get_a20() << 1; +uint32_t ret; + +ret = ioport_get_a20() << 1; +DPRINTF_IO("read addr %x data %x\n", addr, ret); +return ret; } /***/ -- 1.6.2.4
[Qemu-devel] [PATCH 0/2] pckbd improvements
In 2/2, A20 logic changes a bit but I doubt any guest would be broken if A20 line written through I/O port 92 couldn't be read via i8042. The reverse (write using i8042 and read port 92) will work. Blue Swirl (2): pc: improve onboard I/O port debugging Compile pckbd only once Makefile.objs|1 + Makefile.target |8 ++-- default-configs/i386-softmmu.mak |1 + default-configs/mips-softmmu.mak |1 + default-configs/mips64-softmmu.mak |1 + default-configs/mips64el-softmmu.mak |1 + default-configs/mipsel-softmmu.mak |1 + default-configs/ppc-softmmu.mak |1 + default-configs/ppc64-softmmu.mak|1 + default-configs/ppcemb-softmmu.mak |1 + default-configs/sparc64-softmmu.mak |1 + default-configs/x86_64-softmmu.mak |1 + hw/pc.c | 38 hw/pc.h |6 ++-- hw/pckbd.c | 64 +- hw/vmmouse.c |2 +- 16 files changed, 90 insertions(+), 39 deletions(-)
Re: [Qemu-devel] [Build-Failure] hw/pc: undefined reference's
* Isaku Yamahata [2010-05-15 17:46:59]: > Hi. > Which change set/patches are you using? > 'make clean; make' doesn't work? > Sorry for the noise. 'make defconfig' helped. Kamalesh
[Qemu-devel] Re: [PATCH 3/8] Add QBuffer
Avi Kivity wrote: > On 05/15/2010 11:45 AM, Jan Kiszka wrote: >> >>> Instead of encoding just as a string, it would be a good idea to encode >>> it as something like: >>> >>> {'__class__': 'base64', 'data': ...} >>> >>> We've discussed using hidden properties to describe special things like >>> abstract classes and since we already have this namespace reserved, I >>> think it's a good time to use it. >>> >>> The advantage is that in a dynamic language like Python, the parser can >>> convert base64 to binary strings automatically without having to >>> understand the QMP protocol. >>> >> Indeed, was amazingly simple to add and works nicely with qmp-shell as >> demonstrator. Will repost, also to fix a few remaining glitches I came >> across in the meantime. >> >> > > Is this __class__ stuff documented anywhere? > Not yet. Also, we should clarify the proposed private extension section that only "__some_key" is reserved for downstream, not '__some_other_key__' (i.e. downstream names must not end with '__'). Jan signature.asc Description: OpenPGP digital signature
[Qemu-devel] Re: [PATCH] char: Flush read buffer in mux_chr_can_read
Alexander Graf wrote: > On 15.05.2010, at 10:36, Jan Kiszka wrote: > >> Alexander Graf wrote: >>> On 14.05.2010, at 18:17, Jan Kiszka wrote: Alexander Graf wrote: > Now that I can finally reproduce the bug with --enable-io-thread, I can > verify that it does *not* fix the issue. I do not trust your tests. :p I just tried to reproduce with --enable-io-thread and the setup I described above - all still fine here. Can you reproduce with an x86 guest? >>> Nope, it works fine with an x86 guest. I put the following in /etc/inittab >>> of my guest: >>> >>> 11:2345:respawn:/sbin/mingetty --noclear /dev/hvc0 linux >>> >>> One major thing to keep in mind when talking about s390 guests is that we >>> almost never trap into userspace. >> Do you have the same problem when using an unbuffered backend, e.g. pty? >> Maybe that single-byte "fifo" of stdio makes the difference, though I >> wonder why only on s390 (guest exists should not block the polling done >> by the io-thread, just accelerate it). > > Mind to give me a small example on how to use that? :) -chardev pty,... echo whatever > /dev/pts/ Or you set up a telnet server. Jan signature.asc Description: OpenPGP digital signature
[Qemu-devel] Re: [PATCH 3/8] Add QBuffer
On 05/15/2010 11:45 AM, Jan Kiszka wrote: Instead of encoding just as a string, it would be a good idea to encode it as something like: {'__class__': 'base64', 'data': ...} We've discussed using hidden properties to describe special things like abstract classes and since we already have this namespace reserved, I think it's a good time to use it. The advantage is that in a dynamic language like Python, the parser can convert base64 to binary strings automatically without having to understand the QMP protocol. Indeed, was amazingly simple to add and works nicely with qmp-shell as demonstrator. Will repost, also to fix a few remaining glitches I came across in the meantime. Is this __class__ stuff documented anywhere? -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Re: [Qemu-devel] [Build-Failure] hw/pc: undefined reference's
Hi. Which change set/patches are you using? 'make clean; make' doesn't work? On Sat, May 15, 2010 at 02:00:00PM +0530, Kamalesh Babulal wrote: > Hi, > > Build fails with following error, > > arch_init.o:(.data+0x44): undefined reference to `SB16_init' > arch_init.o:(.data+0x58): undefined reference to `ac97_init' > arch_init.o:(.data+0x6c): undefined reference to `es1370_init' > pc.o: In function `pc_init1': > /other/srcs/qemu-kvm/hw/pc.c:1005: undefined reference to `serial_isa_init' > /other/srcs/qemu-kvm/hw/pc.c:1005: undefined reference to `serial_isa_init' > /other/srcs/qemu-kvm/hw/pc.c:1005: undefined reference to `serial_isa_init' > /other/srcs/qemu-kvm/hw/pc.c:1005: undefined reference to `serial_isa_init' > /other/srcs/qemu-kvm/hw/pc.c:1011: undefined reference to `parallel_init' > /other/srcs/qemu-kvm/hw/pc.c:1011: undefined reference to `parallel_init' > /other/srcs/qemu-kvm/hw/pc.c:1011: undefined reference to `parallel_init' > pc.o: In function `pc_init_ne2k_isa': > /other/srcs/qemu-kvm/hw/pc.c:756: undefined reference to `isa_ne2000_init' > pc.o: In function `pc_init1': > /other/srcs/qemu-kvm/hw/pc.c:1037: undefined reference to `isa_ide_init' > /other/srcs/qemu-kvm/hw/pc.c:1037: undefined reference to `isa_ide_init' > /other/srcs/qemu-kvm/hw/pc.c:1051: undefined reference to `fdctrl_init_isa' > pc.o: In function `cmos_init': > /other/srcs/qemu-kvm/hw/pc.c:318: undefined reference to > `fdctrl_get_drive_type' > /other/srcs/qemu-kvm/hw/pc.c:319: undefined reference to > `fdctrl_get_drive_type' > pc.o: In function `pc_init1': > /other/srcs/qemu-kvm/hw/pc.c:1034: undefined reference to `pci_piix3_ide_init' > /other/srcs/qemu-kvm/hw/pc.c:970: undefined reference to `pci_vmsvga_init' > /other/srcs/qemu-kvm/hw/pc.c:975: undefined reference to `pci_vga_init' > /other/srcs/qemu-kvm/hw/pc.c:1056: undefined reference to > `usb_uhci_piix3_init' > /other/srcs/qemu-kvm/hw/pc.c:977: undefined reference to `isa_vga_init' > collect2: ld returned 1 exit status > > > Kamalesh > -- yamahata
[Qemu-devel] Re: [PATCH 3/8] Add QBuffer
Anthony Liguori wrote: > On 05/14/2010 08:20 AM, Jan Kiszka wrote: >> diff --git a/qjson.c b/qjson.c >> index 483c667..4d1c21a 100644 >> --- a/qjson.c >> +++ b/qjson.c >> @@ -19,7 +19,9 @@ >> #include "qlist.h" >> #include "qbool.h" >> #include "qfloat.h" >> +#include "qbuffer.h" >> #include "qdict.h" >> +#include "base64.h" >> >> typedef struct JSONParsingState >> { >> @@ -235,6 +237,20 @@ static void to_json(const QObject *obj, QString >> *str) >> } >> break; >> } >> +case QTYPE_QBUFFER: { >> +QBuffer *val = qobject_to_qbuffer(obj); >> +size_t data_size = qbuffer_get_size(val); >> +size_t str_len = ((data_size + 2) / 3) * 4; >> +char *buffer = qemu_malloc(str_len + 3); >> + >> +buffer[0] = '"'; >> +base64_encode(qbuffer_get_data(val), data_size, buffer + 1); >> +buffer[str_len + 1] = '"'; >> +buffer[str_len + 2] = 0; >> +qstring_append(str, buffer); >> +qemu_free(buffer); >> +break; >> +} >> > > Instead of encoding just as a string, it would be a good idea to encode > it as something like: > > {'__class__': 'base64', 'data': ...} > > We've discussed using hidden properties to describe special things like > abstract classes and since we already have this namespace reserved, I > think it's a good time to use it. > > The advantage is that in a dynamic language like Python, the parser can > convert base64 to binary strings automatically without having to > understand the QMP protocol. Indeed, was amazingly simple to add and works nicely with qmp-shell as demonstrator. Will repost, also to fix a few remaining glitches I came across in the meantime. Jan signature.asc Description: OpenPGP digital signature
[Qemu-devel] Re: [PATCH 1/2] QMP: Introduce commands doc
Luiz Capitulino wrote: > On Fri, 14 May 2010 19:08:07 +0200 > Jan Kiszka wrote: > >> Avi Kivity wrote: >>> On 05/14/2010 08:01 PM, Avi Kivity wrote: On 05/14/2010 07:52 PM, Jan Kiszka wrote: >> In order not to compromise QMP adoption and make users' life easier, >> this commit adds a simple text documentation which fully describes >> all QMP supported commands. >> >> This is not ideal for a number of reasons (harder to maintain, >> text-only, etc) but does improve the current situation. > Even if it's temporary - maintaining it in a separate file looks rather > unhandy. > > Can't we generate the per-command documentation snippets also from > qemu-monitor.hx and merge them with a header/footer into some text file? > That .hx file is the one anyone adding/converting commands has to touch > anyway. If we do, then the generated documentation should be included in the patch changelog for review. >>> I mean, a patch introducing or modifying a monitor command. >> The snippets should be readable by themselves. I'm only proposing to >> keep them in the central file, at the same location where the others >> are. There is no difference compared to existing monitor commands, we >> just add the third documentation snippet, this time for QMP. > > It's not only the snippets. We add a json type for each parameter, a > more descriptive info and notes. Only QMP commands should be shown > this way. Whatever its semantic is, technically it's a text block of a few lines that has to be added somewhere. > > I'm sure there's a way to hack the qemu's doc script to do all this, > but the right solution is to move _everything_ to json and generate good, > well formatted documentation from there (along with self-description). I'm not talking about The Right solution, I'm talking about a more handy temporary setup. When do you plan to refactor the command documentation that way? And how many commands will be touched in the meantime? > > Also, adapting things will take time and this will delay even more this > doc to be merged, which is what I'm trying to avoid. > I can provide you the patch for hxtool and Makefile (a few lines), and I'm willing to split up the existing doc, just drop me a note. So nothing needs to be delayed any further. Jan signature.asc Description: OpenPGP digital signature
[Qemu-devel] Re: [PATCH] char: Flush read buffer in mux_chr_can_read
On 15.05.2010, at 10:36, Jan Kiszka wrote: > Alexander Graf wrote: >> On 14.05.2010, at 18:17, Jan Kiszka wrote: >>> Alexander Graf wrote: Now that I can finally reproduce the bug with --enable-io-thread, I can verify that it does *not* fix the issue. >>> I do not trust your tests. :p >>> >>> I just tried to reproduce with --enable-io-thread and the setup I >>> described above - all still fine here. Can you reproduce with an x86 guest? >> >> Nope, it works fine with an x86 guest. I put the following in /etc/inittab >> of my guest: >> >> 11:2345:respawn:/sbin/mingetty --noclear /dev/hvc0 linux >> >> One major thing to keep in mind when talking about s390 guests is that we >> almost never trap into userspace. > > Do you have the same problem when using an unbuffered backend, e.g. pty? > Maybe that single-byte "fifo" of stdio makes the difference, though I > wonder why only on s390 (guest exists should not block the polling done > by the io-thread, just accelerate it). Mind to give me a small example on how to use that? :) Alex
[Qemu-devel] Re: [PATCH] char: Flush read buffer in mux_chr_can_read
Alexander Graf wrote: > On 14.05.2010, at 18:17, Jan Kiszka wrote: >> Alexander Graf wrote: >>> Now that I can finally reproduce the bug with --enable-io-thread, I can >>> verify that it does *not* fix the issue. >> I do not trust your tests. :p >> >> I just tried to reproduce with --enable-io-thread and the setup I >> described above - all still fine here. Can you reproduce with an x86 guest? > > Nope, it works fine with an x86 guest. I put the following in /etc/inittab of > my guest: > > 11:2345:respawn:/sbin/mingetty --noclear /dev/hvc0 linux > > One major thing to keep in mind when talking about s390 guests is that we > almost never trap into userspace. Do you have the same problem when using an unbuffered backend, e.g. pty? Maybe that single-byte "fifo" of stdio makes the difference, though I wonder why only on s390 (guest exists should not block the polling done by the io-thread, just accelerate it). Jan signature.asc Description: OpenPGP digital signature
[Qemu-devel] [Build-Failure] hw/pc: undefined reference's
Hi, Build fails with following error, arch_init.o:(.data+0x44): undefined reference to `SB16_init' arch_init.o:(.data+0x58): undefined reference to `ac97_init' arch_init.o:(.data+0x6c): undefined reference to `es1370_init' pc.o: In function `pc_init1': /other/srcs/qemu-kvm/hw/pc.c:1005: undefined reference to `serial_isa_init' /other/srcs/qemu-kvm/hw/pc.c:1005: undefined reference to `serial_isa_init' /other/srcs/qemu-kvm/hw/pc.c:1005: undefined reference to `serial_isa_init' /other/srcs/qemu-kvm/hw/pc.c:1005: undefined reference to `serial_isa_init' /other/srcs/qemu-kvm/hw/pc.c:1011: undefined reference to `parallel_init' /other/srcs/qemu-kvm/hw/pc.c:1011: undefined reference to `parallel_init' /other/srcs/qemu-kvm/hw/pc.c:1011: undefined reference to `parallel_init' pc.o: In function `pc_init_ne2k_isa': /other/srcs/qemu-kvm/hw/pc.c:756: undefined reference to `isa_ne2000_init' pc.o: In function `pc_init1': /other/srcs/qemu-kvm/hw/pc.c:1037: undefined reference to `isa_ide_init' /other/srcs/qemu-kvm/hw/pc.c:1037: undefined reference to `isa_ide_init' /other/srcs/qemu-kvm/hw/pc.c:1051: undefined reference to `fdctrl_init_isa' pc.o: In function `cmos_init': /other/srcs/qemu-kvm/hw/pc.c:318: undefined reference to `fdctrl_get_drive_type' /other/srcs/qemu-kvm/hw/pc.c:319: undefined reference to `fdctrl_get_drive_type' pc.o: In function `pc_init1': /other/srcs/qemu-kvm/hw/pc.c:1034: undefined reference to `pci_piix3_ide_init' /other/srcs/qemu-kvm/hw/pc.c:970: undefined reference to `pci_vmsvga_init' /other/srcs/qemu-kvm/hw/pc.c:975: undefined reference to `pci_vga_init' /other/srcs/qemu-kvm/hw/pc.c:1056: undefined reference to `usb_uhci_piix3_init' /other/srcs/qemu-kvm/hw/pc.c:977: undefined reference to `isa_vga_init' collect2: ld returned 1 exit status Kamalesh