Re: [Qemu-devel] [PATCH] cirrus_vga: Remove unneeded reset
On Mon, Mar 28, 2011 at 07:18:04AM +0200, Stefan Weil wrote: > Am 28.03.2011 04:17, schrieb Isaku Yamahata: >> Hi. cirrus_init_common() is used by both isa and pci cirrus. >> and isa cirrus isn't qdevfied yet. >> So what you want is >> - remove qemu_register_reset() and cirrus_reset() from cirrus_init_common() >> >> - add to PCIDeviceInfo cirrus_vga_info >>.qdev.reset = cirrus_reset() >>in order to use pci reset framework. >> >> - add qemu_register_reset() and cirrus_reset() to isa_cirrus_vga_init() >>(Hopefully convert isa cirrus to qdev. and use .qdev.reset at best. >> But it's up to you) >> >> thanks, >> >> On Sat, Mar 26, 2011 at 10:53:09PM +0100, Stefan Weil wrote: >>> cirrus_reset is also called by the pci framework, >>> so there is no need to call it in cirrus_init_common. >>> >>> Cc: Michael S. Tsirkin >>> Signed-off-by: Stefan Weil >>> --- >>> hw/cirrus_vga.c |1 - >>> 1 files changed, 0 insertions(+), 1 deletions(-) >>> >>> diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c >>> index 2724f7b..bdf4c8b 100644 >>> --- a/hw/cirrus_vga.c >>> +++ b/hw/cirrus_vga.c >>> @@ -3024,7 +3024,6 @@ static void cirrus_init_common(CirrusVGAState * s, >>> int device_id, int is_pci) >>> s->vga.cursor_draw_line = cirrus_cursor_draw_line; >>> >>> qemu_register_reset(cirrus_reset, s); >>> -cirrus_reset(s); >>> } >>> >>> /*** >>> -- >>> 1.7.2.5 >> > > > I tested the new code with isa pc, too. In gdb, I could see that it also > calls > cirrus_reset twice. But isa pc is broken since the switch to sea bios, so > obviously isa is an unmaintained part of qemu. Even with bochs bios, > it no longer works, so it is broken at least twice. Ah, I see. The the second reset is called not via pci reset framework, but qemu reset framework. So removing the above reset call makes sense. It would be another patch to make use of pci reset framework. -- yamahata
Re: [Qemu-devel] [PATCH] cirrus_vga: Remove unneeded reset
Am 28.03.2011 04:17, schrieb Isaku Yamahata: Hi. cirrus_init_common() is used by both isa and pci cirrus. and isa cirrus isn't qdevfied yet. So what you want is - remove qemu_register_reset() and cirrus_reset() from cirrus_init_common() - add to PCIDeviceInfo cirrus_vga_info .qdev.reset = cirrus_reset() in order to use pci reset framework. - add qemu_register_reset() and cirrus_reset() to isa_cirrus_vga_init() (Hopefully convert isa cirrus to qdev. and use .qdev.reset at best. But it's up to you) thanks, On Sat, Mar 26, 2011 at 10:53:09PM +0100, Stefan Weil wrote: cirrus_reset is also called by the pci framework, so there is no need to call it in cirrus_init_common. Cc: Michael S. Tsirkin Signed-off-by: Stefan Weil --- hw/cirrus_vga.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c index 2724f7b..bdf4c8b 100644 --- a/hw/cirrus_vga.c +++ b/hw/cirrus_vga.c @@ -3024,7 +3024,6 @@ static void cirrus_init_common(CirrusVGAState * s, int device_id, int is_pci) s->vga.cursor_draw_line = cirrus_cursor_draw_line; qemu_register_reset(cirrus_reset, s); -cirrus_reset(s); } /*** -- 1.7.2.5 I tested the new code with isa pc, too. In gdb, I could see that it also calls cirrus_reset twice. But isa pc is broken since the switch to sea bios, so obviously isa is an unmaintained part of qemu. Even with bochs bios, it no longer works, so it is broken at least twice. Stefan
Re: [Qemu-devel] qemu not starting
Did you install from src? Try add --enable-sdl when configure and run qemu with "-vga std". On Mon, Mar 28, 2011 at 12:15 PM, chandra shekar wrote: > hi friends after installing qemu when i try to start qemu then i get an > error as "Could not open SDL display" > plz someone help,thanks > > -- > chandra > > -- Best regards! Fam Zheng
[Qemu-devel] RFC: Small cleanup to legacy drive option parsing
Currently, the old-style options for specifying drives (-hd[abcd], -cdrom, etc.) are equivalent to more longer new-style (-drive) options. However, in the code which handles these, the equivalency is not directly obvious, since it's handled via the drive_add() function which somewhat awkwardly translates an interface type enum into a string option, so that drive_def() can change it back again. This patch cleanups up this handling, by abolishing drive_add() and replacing it with drive_def_print(), a convenience wrapper around drive_def() which should make the equivalency between the leagcy options and longer -drive strings more obvious to C programmers. This also slighly reduces code size: blockdev.c | 22 --- vl.c | 68 + 2 files changed, 42 insertions(+), 48 deletions(-) diff --git a/blockdev.c b/blockdev.c index ecf2252..7b8b8ef 100644 --- a/blockdev.c +++ b/blockdev.c @@ -92,28 +92,6 @@ QemuOpts *drive_def(const char *optstr) return qemu_opts_parse(qemu_find_opts("drive"), optstr, 0); } -QemuOpts *drive_add(BlockInterfaceType type, int index, const char *file, -const char *optstr) -{ -QemuOpts *opts; -char buf[32]; - -opts = drive_def(optstr); -if (!opts) { -return NULL; -} -if (type != IF_DEFAULT) { -qemu_opt_set(opts, "if", if_name[type]); -} -if (index >= 0) { -snprintf(buf, sizeof(buf), "%d", index); -qemu_opt_set(opts, "index", buf); -} -if (file) -qemu_opt_set(opts, "file", file); -return opts; -} - DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit) { DriveInfo *dinfo; diff --git a/vl.c b/vl.c index 192a240..8b9dfed 100644 --- a/vl.c +++ b/vl.c @@ -21,6 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#include #include #include #include @@ -623,10 +624,10 @@ static int bt_parse(const char *opt) #define HD_OPTS "media=disk" #define CDROM_OPTS "media=cdrom" -#define FD_OPTS "" -#define PFLASH_OPTS "" -#define MTD_OPTS "" -#define SD_OPTS "" +#define FD_OPTS "if=floppy" +#define PFLASH_OPTS "if=pflash" +#define MTD_OPTS "if=mtd" +#define SD_OPTS "if=sd" static int drive_init_func(QemuOpts *opts, void *opaque) { @@ -643,21 +644,37 @@ static int drive_enable_snapshot(QemuOpts *opts, void *opaque) return 0; } +static QemuOpts *drive_def_printf(const char *fmt, ...) +{ +QemuOpts *opts; +char *optstr; +va_list ap; + +va_start(ap, fmt); + +if (vasprintf(&optstr, fmt, ap) < 0) { +fprintf(stderr, "Failed to allocate memory: %s\n", strerror(errno)); +abort(); +} + +opts = drive_def(optstr); + +free(optstr); + +return opts; +} + static void default_drive(int enable, int snapshot, int use_scsi, BlockInterfaceType type, int index, const char *optstr) { QemuOpts *opts; -if (type == IF_DEFAULT) { -type = use_scsi ? IF_SCSI : IF_IDE; -} - if (!enable || drive_get_by_index(type, index)) { return; } -opts = drive_add(type, index, NULL, optstr); +opts = drive_def_printf("%s,index=%d", optstr, index); if (snapshot) { drive_enable_snapshot(opts, NULL); } @@ -2130,7 +2147,7 @@ int main(int argc, char **argv, char **envp) if (optind >= argc) break; if (argv[optind][0] != '-') { - hda_opts = drive_add(IF_DEFAULT, 0, argv[optind++], HD_OPTS); + hda_opts = drive_def_printf("%s,file=%s", HD_OPTS, argv[optind++]); } else { const QEMUOption *popt; @@ -2170,25 +2187,24 @@ int main(int argc, char **argv, char **envp) break; case QEMU_OPTION_hda: { -char buf[256]; -if (cyls == 0) -snprintf(buf, sizeof(buf), "%s", HD_OPTS); -else -snprintf(buf, sizeof(buf), - "%s,cyls=%d,heads=%d,secs=%d%s", - HD_OPTS , cyls, heads, secs, +char chsopts[256] = ""; +if (cyls != 0) +snprintf(chsopts, sizeof(chsopts), + ",cyls=%d,heads=%d,secs=%d%s", + cyls, heads, secs, translation == BIOS_ATA_TRANSLATION_LBA ? ",trans=lba" : translation == BIOS_ATA_TRANSLATION_NONE ? ",trans=none" : ""); -drive_add(IF_DEFAULT, 0, optarg, buf); +drive_def_printf("%s%s,index=0,file=%s", + HD_OPTS, chsopts, optarg); break; }
[Qemu-devel] qemu not starting
hi friends after installing qemu when i try to start qemu then i get an error as "Could not open SDL display" plz someone help,thanks -- chandra
[Qemu-devel] [V2 PATCH] floppy: save and restore DIR register
We need to keep DIR register unchanged across migration, but currently it depends on the media_changed flags from block layer. Since we do not save/restore it and the bdrv_open() called in dest node may set the media_changed flag when trying to open floppy image, guest driver may think the floppy have changed after migration. To fix this, a new filed media_changed in FDrive strcutre was introduced in order to save and restore the it from block layer through pre_save/post_load callbacks. Signed-off-by: Jason Wang --- hw/fdc.c | 52 +++- 1 files changed, 51 insertions(+), 1 deletions(-) diff --git a/hw/fdc.c b/hw/fdc.c index 9fdbc75..865ff0e 100644 --- a/hw/fdc.c +++ b/hw/fdc.c @@ -36,6 +36,7 @@ #include "qdev-addr.h" #include "blockdev.h" #include "sysemu.h" +#include "block_int.h" // /* debug Floppy devices */ @@ -82,6 +83,7 @@ typedef struct FDrive { uint8_t max_track;/* Nb of tracks */ uint16_t bps; /* Bytes per sector */ uint8_t ro; /* Is read-only */ +uint8_t media_changed;/* Is media changed */ } FDrive; static void fd_init(FDrive *drv) @@ -533,16 +535,64 @@ static CPUWriteMemoryFunc * const fdctrl_mem_write_strict[3] = { NULL, }; +static void fdrive_media_changed_pre_save(void *opaque) +{ +FDrive *drive = opaque; + +drive->media_changed = drive->bs->media_changed; +} + +static int fdrive_media_changed_post_load(void *opaque, int version_id) +{ +FDrive *drive = opaque; + +if (drive->bs == NULL) { +return 1; +} + +drive->bs->media_changed = drive->media_changed; + +return 0; +} + +static bool fdrive_has_driver(void *opaque) +{ +FDrive *drive = opaque; + +return drive->bs != NULL; +} + +static const VMStateDescription vmstate_fdrive_media_changed = { +.name = "fdrive/media_changed", +.version_id = 1, +.minimum_version_id = 1, +.minimum_version_id_old = 1, +.pre_save = fdrive_media_changed_pre_save, +.post_load = fdrive_media_changed_post_load, +.fields = (VMStateField[]) { +VMSTATE_UINT8(media_changed, FDrive), +VMSTATE_END_OF_LIST() +} +}; + static const VMStateDescription vmstate_fdrive = { .name = "fdrive", .version_id = 1, .minimum_version_id = 1, .minimum_version_id_old = 1, -.fields = (VMStateField []) { +.fields = (VMStateField[]) { VMSTATE_UINT8(head, FDrive), VMSTATE_UINT8(track, FDrive), VMSTATE_UINT8(sect, FDrive), VMSTATE_END_OF_LIST() +}, +.subsections = (VMStateSubsection[]) { +{ +.vmsd = &vmstate_fdrive_media_changed, +.needed = &fdrive_has_driver, +} , { +/* empty */ +} } };
[Qemu-devel] Re: [PATCH] floppy: save and restore DIR register
Paolo Bonzini writes: > On 03/25/2011 07:27 AM, Jason Wang wrote: > > We need to keep DIR register unchanged across migration, but currently it > > depends on the media_changed flags from block layer and we do not > > save/restore > > it which could let the guest driver think the floppy have changed after > > migration. To fix this, a new filed media_changed in FDrive strcutre was > > introduced in order to save and restore the it from block layer through > > pre_save/post_load callbacks. > > I guess you can avoid saving if the media changed flag is zero, too > (which should be the common case after the guest has booted, right?). > > Paolo > Yes, zero is the common case, but the bdrv_open() called by listening qemu in dest mode would always set the media_changed to one, so we must save and restore it during migration.
Re: [Qemu-devel] [PATCH] cirrus_vga: Remove unneeded reset
Hi. cirrus_init_common() is used by both isa and pci cirrus. and isa cirrus isn't qdevfied yet. So what you want is - remove qemu_register_reset() and cirrus_reset() from cirrus_init_common() - add to PCIDeviceInfo cirrus_vga_info .qdev.reset = cirrus_reset() in order to use pci reset framework. - add qemu_register_reset() and cirrus_reset() to isa_cirrus_vga_init() (Hopefully convert isa cirrus to qdev. and use .qdev.reset at best. But it's up to you) thanks, On Sat, Mar 26, 2011 at 10:53:09PM +0100, Stefan Weil wrote: > cirrus_reset is also called by the pci framework, > so there is no need to call it in cirrus_init_common. > > Cc: Michael S. Tsirkin > Signed-off-by: Stefan Weil > --- > hw/cirrus_vga.c |1 - > 1 files changed, 0 insertions(+), 1 deletions(-) > > diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c > index 2724f7b..bdf4c8b 100644 > --- a/hw/cirrus_vga.c > +++ b/hw/cirrus_vga.c > @@ -3024,7 +3024,6 @@ static void cirrus_init_common(CirrusVGAState * s, int > device_id, int is_pci) > s->vga.cursor_draw_line = cirrus_cursor_draw_line; > > qemu_register_reset(cirrus_reset, s); > -cirrus_reset(s); > } > > /*** > -- > 1.7.2.5 > > -- yamahata
Re: [Qemu-devel] [PATCH 27/27] Add SLOF-based partition firmware for pSeries machine, allowing more boot options
On Fri, Mar 25, 2011 at 01:29:17PM -0500, Anthony Liguori wrote: > On 03/24/2011 10:21 PM, David Gibson wrote: > >Currently, the emulated pSeries machine requires the use of the > >-kernel parameter in order to explicitly load a guest kernel. This > >means booting from the virtual disk, cdrom or network is not possible. > > > >This patch addresses this limitation by inserting a within-partition > >firmware image (derived from the "SLOF" free Open Firmware project). > >If -kernel is not specified, qemu will now load the SLOF image, which > >has access to the qemu boot device list through the device tree, and > >can boot from any of the usual virtual devices. > > > >In order to support the new firmware, an extension to the emulated > >machine/hypervisor is necessary. Unlike Linux, which expects > >multi-CPU entry to be handled kexec() style, the SLOF firmware expects > >only one CPU to be active at entry, and to use a hypervisor RTAS > >method to enable the other CPUs one by one. > > > >This patch also implements this 'start-cpu' method, so that SLOF can > >start the secondary CPUs and marshal them into the kexec() holding > >pattern ready for entry into the guest OS. Linux should, and in the > >future might directly use the start-cpu method to enable initially > >disabled CPUs, but for now it does require kexec() entry. > > > >Signed-off-by: Benjamin Herrenschmidt > >Signed-off-by: Paul Mackerras > >Signed-off-by: David Gibson > > We should pull in SLOF via a git submodule. That ensures we ship > the source code along with the binary. Um, ok. Do I need to do anything about this? -- David Gibson| I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
[Qemu-devel] [PATCH 2/4] trace: generalize the "property" concept in the trace-events file
This adds/modifies the following functions: * get_name: Get _only_ the event name * has_property: Return whether an event has a property (keyword before the event name) Signed-off-by: Lluís Vilanova --- docs/tracing.txt |4 +-- scripts/tracetool | 73 - 2 files changed, 35 insertions(+), 42 deletions(-) diff --git a/docs/tracing.txt b/docs/tracing.txt index f15069c..5dbd3c0 100644 --- a/docs/tracing.txt +++ b/docs/tracing.txt @@ -98,7 +98,7 @@ portability macros, ensure they are preceded and followed by double quotes: 4. Name trace events after their function. If there are multiple trace events in one function, append a unique distinguisher at the end of the name. -5. Declare trace events with the "disable" keyword. Some trace events can +5. Declare trace events with the "disable" property. Some trace events can produce a lot of output and users are typically only interested in a subset of trace events. Marking trace events disabled by default saves the user from having to manually disable noisy trace events. @@ -168,7 +168,7 @@ The st_change_trace_event_state() function can be used to enable or disable trac events at runtime inside QEMU: #include "trace.h" - + st_change_trace_event_state("virtio_irq", true); /* enable */ [...] st_change_trace_event_state("virtio_irq", false); /* disable */ diff --git a/scripts/tracetool b/scripts/tracetool index d88cb43..6d8ead2 100755 --- a/scripts/tracetool +++ b/scripts/tracetool @@ -43,7 +43,26 @@ EOF # Get the name of a trace event get_name() { -echo ${1%%\(*} +local name +name=${1%%\(*} +echo "${name##* }" +} + +# Get the given property of a trace event +# 1: trace-events line +# 2: property name +# -> return 0 if property is present, or 1 otherwise +has_property() +{ +local props prop +props=${1%%\(*} +props=${props% *} +for prop in $props; do +if [ "$prop" = "$2" ]; then +return 0 +fi +done +return 1 } # Get the argument list of a trace event, including types and names @@ -101,20 +120,6 @@ get_fmt() echo "$fmt" } -# Get the state of a trace event -get_state() -{ -local str disable state -str=$(get_name "$1") -disable=${str##disable } -if [ "$disable" = "$str" ] ; then -state=1 -else -state=0 -fi -echo "$state" -} - linetoh_begin_nop() { return @@ -174,14 +179,10 @@ cast_args_to_uint64_t() linetoh_simple() { -local name args argc trace_args state +local name args argc trace_args name=$(get_name "$1") args=$(get_args "$1") argc=$(get_argc "$1") -state=$(get_state "$1") -if [ "$state" = "0" ]; then -name=${name##disable } -fi trace_args="$simple_event_num" if [ "$argc" -gt 0 ] @@ -222,9 +223,10 @@ linetoc_simple() { local name state name=$(get_name "$1") -state=$(get_state "$1") -if [ "$state" = "0" ] ; then -name=${name##disable } +if has_property "$1" "disable"; then +state="0" +else +state="1" fi cat <
[Qemu-devel] [PATCH 1/4] trace: [ust] fix generation of 'trace.c' on events without args
Signed-off-by: Lluís Vilanova --- scripts/tracetool |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/tracetool b/scripts/tracetool index 412f695..d88cb43 100755 --- a/scripts/tracetool +++ b/scripts/tracetool @@ -338,6 +338,7 @@ linetoc_ust() name=$(get_name "$1") args=$(get_args "$1") argnames=$(get_argnames "$1", ",") +[ -z "$argnames" ] || argnames=", $argnames" fmt=$(get_fmt "$1") cat <
[Qemu-devel] [PATCH 3/4] trace: always use the "nop" backend on events with the "disable" keyword
Any event with the keyword/property "disable" generates an empty trace event using the "nop" backend, regardless of the current backend. Signed-off-by: Lluís Vilanova --- docs/tracing.txt |3 +++ scripts/tracetool | 15 ++- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/docs/tracing.txt b/docs/tracing.txt index 5dbd3c0..49e030e 100644 --- a/docs/tracing.txt +++ b/docs/tracing.txt @@ -126,6 +126,9 @@ The "nop" backend generates empty trace event functions so that the compiler can optimize out trace events completely. This is the default and imposes no performance penalty. +Note that regardless of the selected trace backend, events with the "disable" +property will be generated with the "nop" backend. + === Stderr === The "stderr" backend sends trace events directly to standard error. This diff --git a/scripts/tracetool b/scripts/tracetool index 6d8ead2..7506776 100755 --- a/scripts/tracetool +++ b/scripts/tracetool @@ -506,21 +506,10 @@ convert() # Skip comments and empty lines test -z "${str%%#*}" && continue +echo # Process the line. The nop backend handles disabled lines. -disable="0" if has_property "$str" "disable"; then -disable="1" -fi -echo -if [ "$disable" = "1" ]; then -# Pass the disabled state as an arg for the simple -# or DTrace backends which handle it dynamically. -# For all other backends, call lineto$1_nop() -if [ $backend = "simple" -o "$backend" = "dtrace" ]; then -"$process_line" "$str" -else -"lineto$1_nop" "${str##disable }" -fi +"lineto$1_nop" "$str" else "$process_line" "$str" fi
[Qemu-devel] [Bug 423910] Re: openbios-sparc has no installation candidate
** Changed in: openbios-sparc (Ubuntu) Status: New => Confirmed -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/423910 Title: openbios-sparc has no installation candidate Status in QEMU: Invalid Status in “openbios-sparc” package in Ubuntu: Confirmed Status in “qemu-kvm” package in Ubuntu: Fix Released Bug description: When installing Qemu through apt-get, openbios-sparc is recommended, but, Package openbios-sparc is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package openbios-sparc has no installation candidate
[Qemu-devel] [PATCH 4/4] trace: [simple] always enable trace points
Signed-off-by: Lluís Vilanova --- scripts/tracetool |9 ++--- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/scripts/tracetool b/scripts/tracetool index 7506776..b355ac5 100755 --- a/scripts/tracetool +++ b/scripts/tracetool @@ -221,15 +221,10 @@ EOF linetoc_simple() { -local name state +local name name=$(get_name "$1") -if has_property "$1" "disable"; then -state="0" -else -state="1" -fi cat <
[Qemu-devel] [PATCH] [arm m68k] move helpers.h to helper.h
This provides a consistent naming scheme across all targets. Signed-off-by: Lluís Vilanova --- target-arm/helper.c|2 target-arm/helper.h| 475 target-arm/helpers.h | 475 target-arm/iwmmxt_helper.c |2 target-arm/neon_helper.c |2 target-arm/op_helper.c |2 target-arm/translate.c |6 - target-m68k/helper.c |2 target-m68k/helper.h | 54 + target-m68k/helpers.h | 54 - target-m68k/op_helper.c|2 target-m68k/translate.c|6 - 12 files changed, 541 insertions(+), 541 deletions(-) create mode 100644 target-arm/helper.h delete mode 100644 target-arm/helpers.h create mode 100644 target-m68k/helper.h delete mode 100644 target-m68k/helpers.h diff --git a/target-arm/helper.c b/target-arm/helper.c index 78f3d39..5260e13 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -5,7 +5,7 @@ #include "cpu.h" #include "exec-all.h" #include "gdbstub.h" -#include "helpers.h" +#include "helper.h" #include "qemu-common.h" #include "host-utils.h" #if !defined(CONFIG_USER_ONLY) diff --git a/target-arm/helper.h b/target-arm/helper.h new file mode 100644 index 000..bd6977c --- /dev/null +++ b/target-arm/helper.h @@ -0,0 +1,475 @@ +#include "def-helper.h" + +DEF_HELPER_1(clz, i32, i32) +DEF_HELPER_1(sxtb16, i32, i32) +DEF_HELPER_1(uxtb16, i32, i32) + +DEF_HELPER_2(add_setq, i32, i32, i32) +DEF_HELPER_2(add_saturate, i32, i32, i32) +DEF_HELPER_2(sub_saturate, i32, i32, i32) +DEF_HELPER_2(add_usaturate, i32, i32, i32) +DEF_HELPER_2(sub_usaturate, i32, i32, i32) +DEF_HELPER_1(double_saturate, i32, s32) +DEF_HELPER_2(sdiv, s32, s32, s32) +DEF_HELPER_2(udiv, i32, i32, i32) +DEF_HELPER_1(rbit, i32, i32) +DEF_HELPER_1(abs, i32, i32) + +#define PAS_OP(pfx) \ +DEF_HELPER_3(pfx ## add8, i32, i32, i32, ptr) \ +DEF_HELPER_3(pfx ## sub8, i32, i32, i32, ptr) \ +DEF_HELPER_3(pfx ## sub16, i32, i32, i32, ptr) \ +DEF_HELPER_3(pfx ## add16, i32, i32, i32, ptr) \ +DEF_HELPER_3(pfx ## addsubx, i32, i32, i32, ptr) \ +DEF_HELPER_3(pfx ## subaddx, i32, i32, i32, ptr) + +PAS_OP(s) +PAS_OP(u) +#undef PAS_OP + +#define PAS_OP(pfx) \ +DEF_HELPER_2(pfx ## add8, i32, i32, i32) \ +DEF_HELPER_2(pfx ## sub8, i32, i32, i32) \ +DEF_HELPER_2(pfx ## sub16, i32, i32, i32) \ +DEF_HELPER_2(pfx ## add16, i32, i32, i32) \ +DEF_HELPER_2(pfx ## addsubx, i32, i32, i32) \ +DEF_HELPER_2(pfx ## subaddx, i32, i32, i32) +PAS_OP(q) +PAS_OP(sh) +PAS_OP(uq) +PAS_OP(uh) +#undef PAS_OP + +DEF_HELPER_2(ssat, i32, i32, i32) +DEF_HELPER_2(usat, i32, i32, i32) +DEF_HELPER_2(ssat16, i32, i32, i32) +DEF_HELPER_2(usat16, i32, i32, i32) + +DEF_HELPER_2(usad8, i32, i32, i32) + +DEF_HELPER_1(logicq_cc, i32, i64) + +DEF_HELPER_3(sel_flags, i32, i32, i32, i32) +DEF_HELPER_1(exception, void, i32) +DEF_HELPER_0(wfi, void) + +DEF_HELPER_2(cpsr_write, void, i32, i32) +DEF_HELPER_0(cpsr_read, i32) + +DEF_HELPER_3(v7m_msr, void, env, i32, i32) +DEF_HELPER_2(v7m_mrs, i32, env, i32) + +DEF_HELPER_3(set_cp15, void, env, i32, i32) +DEF_HELPER_2(get_cp15, i32, env, i32) + +DEF_HELPER_3(set_cp, void, env, i32, i32) +DEF_HELPER_2(get_cp, i32, env, i32) + +DEF_HELPER_2(get_r13_banked, i32, env, i32) +DEF_HELPER_3(set_r13_banked, void, env, i32, i32) + +DEF_HELPER_1(get_user_reg, i32, i32) +DEF_HELPER_2(set_user_reg, void, i32, i32) + +DEF_HELPER_1(vfp_get_fpscr, i32, env) +DEF_HELPER_2(vfp_set_fpscr, void, env, i32) + +DEF_HELPER_3(vfp_adds, f32, f32, f32, env) +DEF_HELPER_3(vfp_addd, f64, f64, f64, env) +DEF_HELPER_3(vfp_subs, f32, f32, f32, env) +DEF_HELPER_3(vfp_subd, f64, f64, f64, env) +DEF_HELPER_3(vfp_muls, f32, f32, f32, env) +DEF_HELPER_3(vfp_muld, f64, f64, f64, env) +DEF_HELPER_3(vfp_divs, f32, f32, f32, env) +DEF_HELPER_3(vfp_divd, f64, f64, f64, env) +DEF_HELPER_1(vfp_negs, f32, f32) +DEF_HELPER_1(vfp_negd, f64, f64) +DEF_HELPER_1(vfp_abss, f32, f32) +DEF_HELPER_1(vfp_absd, f64, f64) +DEF_HELPER_2(vfp_sqrts, f32, f32, env) +DEF_HELPER_2(vfp_sqrtd, f64, f64, env) +DEF_HELPER_3(vfp_cmps, void, f32, f32, env) +DEF_HELPER_3(vfp_cmpd, void, f64, f64, env) +DEF_HELPER_3(vfp_cmpes, void, f32, f32, env) +DEF_HELPER_3(vfp_cmped, void, f64, f64, env) + +DEF_HELPER_2(vfp_fcvtds, f64, f32, env) +DEF_HELPER_2(vfp_fcvtsd, f32, f64, env) + +DEF_HELPER_2(vfp_uitos, f32, f32, env) +DEF_HELPER_2(vfp_uitod, f64, f32, env) +DEF_HELPER_2(vfp_sitos, f32, f32, env) +DEF_HELPER_2(vfp_sitod, f64, f32, env) + +DEF_HELPER_2(vfp_touis, f32, f32, env) +DEF_HELPER_2(vfp_touid, f32, f64, env) +DEF_HELPER_2(vfp_touizs, f32, f32, env) +DEF_HELPER_2(vfp_touizd, f32, f64, env) +DEF_HELPER_2(vfp_tosis, f32, f32, env) +DEF_HELPER_2(vfp_tosid, f32, f64, env) +DEF_HELPER_2(vfp_tosizs, f32, f32, env) +DEF_HELPER_2(vfp_tosizd, f32, f64, env) + +DEF_HELPER_3(vfp_toshs, f32, f32, i32, env) +DEF_HELPER_3(vfp_tosls, f32, f32, i32, env) +DEF_HELPER_3(vfp_touhs, f32, f32, i
[Qemu-devel] [PATCH] e1000: check buffer availability
Reduce spurious packet drops on RX ring empty by verifying that we have at least 1 buffer ahead of the time. Signed-off-by: Michael S. Tsirkin --- hw/e1000.c | 16 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/e1000.c b/hw/e1000.c index 0a4574c..380d6fe 100644 --- a/hw/e1000.c +++ b/hw/e1000.c @@ -623,14 +623,6 @@ e1000_set_link_status(VLANClientState *nc) set_ics(s, 0, E1000_ICR_LSC); } -static int -e1000_can_receive(VLANClientState *nc) -{ -E1000State *s = DO_UPCAST(NICState, nc, nc)->opaque; - -return (s->mac_reg[RCTL] & E1000_RCTL_EN); -} - static bool e1000_has_rxbufs(E1000State *s, size_t total_size) { int bufs; @@ -649,6 +641,14 @@ static bool e1000_has_rxbufs(E1000State *s, size_t total_size) return total_size <= bufs * s->rxbuf_size; } +static int +e1000_can_receive(VLANClientState *nc) +{ +E1000State *s = DO_UPCAST(NICState, nc, nc)->opaque; + +return (s->mac_reg[RCTL] & E1000_RCTL_EN) && e1000_has_rxbufs(s, 1); +} + static ssize_t e1000_receive(VLANClientState *nc, const uint8_t *buf, size_t size) { -- 1.7.3.2.91.g446ac
[Qemu-devel] Re: [PATCH v5 0/4] piix_pci: optimize irq data path
On Wed, Mar 23, 2011 at 11:17:19AM +0900, Isaku Yamahata wrote: > v4 has minor typo. I sent it too early. Here's fixed one. > > v3 -> v4 Main changes are > - use pirq, pci_intx instead of irq_num in piix_pci.c > - patch 4/4 cleans the code a bit With this applied e1000 fails to work for me. Command line: qemu-system-x86_64 -enable-kvm -m 1G -drive if=virtio,file=/home/mst/rhel6.qcow2 -netdev user,id=bar -net nic,netdev=bar,model=e1000,macaddr=52:54:00:12:34:57 -redir tcp:8022::22 -net nic,model=e1000,netdev=foo,macaddr=52:54:00:12:34:56 -netdev tap,id=foo,ifname=msttap0,script=/home/mst/ifup,downscript=no -nographic Could you try that please? > 4/4 needs more extensive tests. So please feel free to pick it up now or > drop it for now. > > patch description: > This patch series optimizes irq data path of piix_pci. > So far piix3 tracks each pirq level and checks whether a given pic pins is > asserted by seeing if each pirq is mapped into the pic pin. > This is independent on irq routing, but data path is on slow path. > > Given that irq routing is rarely changed and asserting pic pins is on > data path, the path that asserts pic pins should be optimized and > chainging irq routing should be on slow path. > The new behavior with this patch series is to use bitmap which is addressed > by pirq and pic pins with a given irq routing. > When pirq is asserted, the bitmap is set and see if the pic pins is > asserted by checking the bitmaps. > When irq routing is changed, rebuild the bitmap and re-assert pic pins. > > Changes v4 -> v5: > - typo > > Changes v3 -> v4: > - use pirq, pci_intx instead of irq_num in piix_pci.c > - use symbolic constant PIC_NUM_PINS > - introduced new patch 4/4 which cleans up a bit. > > Changes v2 -> v3: > - s/dummy_for_save_load_compat/pci_irq_levels_vmstate/g > - move down unused member of pci_irq_levels_vmstate in the structure > for cache efficiency > > Changes v1 -> v2: > - addressed review comments. > > Isaku Yamahata (4): > pci: add accessor function to get irq levels > piix_pci: eliminate PIIX3State::pci_irq_levels > piix_pci: optimize set irq path > piix_pci: load path clean up > > hw/pci.c |7 +++ > hw/pci.h |1 + > hw/piix_pci.c | 128 +--- > 3 files changed, 111 insertions(+), 25 deletions(-)
[Qemu-devel] [PATCH] spice: add option for disabling copy paste support
Some people want to be able disable spice's guest <-> client copy paste support because of security considerations. --- qemu-config.c |3 +++ qemu-options.hx |3 +++ ui/spice-core.c |9 + 3 files changed, 15 insertions(+), 0 deletions(-) diff --git a/qemu-config.c b/qemu-config.c index 323d3c2..661c8a8 100644 --- a/qemu-config.c +++ b/qemu-config.c @@ -386,6 +386,9 @@ QemuOptsList qemu_spice_opts = { .name = "disable-ticketing", .type = QEMU_OPT_BOOL, },{ +.name = "disable-copy-paste", +.type = QEMU_OPT_BOOL, +},{ .name = "x509-dir", .type = QEMU_OPT_STRING, },{ diff --git a/qemu-options.hx b/qemu-options.hx index ef60730..1a38311 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -715,6 +715,9 @@ Set the password you need to authenticate. @item disable-ticketing Allow client connects without authentication. +@item disable-copy-paste +Disable copy paste between the client and the guest. + @item tls-port= Set the TCP port spice is listening on for encrypted channels. diff --git a/ui/spice-core.c b/ui/spice-core.c index ef56ed6..a21fabc 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -554,6 +554,15 @@ void qemu_spice_init(void) spice_server_set_noauth(spice_server); } +if (qemu_opt_get_bool(opts, "disable-copy-paste", 0)) { +#if SPICE_SERVER_VERSION >= 0x000801 +spice_server_set_agent_copypaste(spice_server, 0); +#else +fprintf(stderr, "spice: disable-copy-paste is only supported when compiled with spice-server >= 0.8.1\n"); +exit(1); +#endif +} + compression = SPICE_IMAGE_COMPRESS_AUTO_GLZ; str = qemu_opt_get(opts, "image-compression"); if (str) { -- 1.7.4.1
[Qemu-devel] [PATCH]hw/xen_disk: ioreq not finished on error
Bug fix: routines 'ioreq_runio_qemu_sync' and 'ioreq_runio_qemu_aio' won't call 'ioreq_unmap' or 'ioreq_finish' on errors, leaving ioreq in the blkdev->inflight list and a leak. Signed-off-by: Feiran Zheng --- hw/xen_disk.c | 22 +- 1 files changed, 17 insertions(+), 5 deletions(-) diff --git a/hw/xen_disk.c b/hw/xen_disk.c index 445bf03..7940fab 100644 --- a/hw/xen_disk.c +++ b/hw/xen_disk.c @@ -309,8 +309,10 @@ static int ioreq_runio_qemu_sync(struct ioreq *ioreq) int i, rc, len = 0; off_t pos; -if (ioreq->req.nr_segments && ioreq_map(ioreq) == -1) - goto err; +if (ioreq->req.nr_segments) { + if (ioreq_map(ioreq) == -1) + goto err_no_map; +} if (ioreq->presync) bdrv_flush(blkdev->bs); @@ -364,6 +366,9 @@ static int ioreq_runio_qemu_sync(struct ioreq *ioreq) return 0; err: +ioreq_unmap(ioreq); +err_no_map: +ioreq_finish(ioreq); ioreq->status = BLKIF_RSP_ERROR; return -1; } @@ -392,8 +397,10 @@ static int ioreq_runio_qemu_aio(struct ioreq *ioreq) { struct XenBlkDev *blkdev = ioreq->blkdev; -if (ioreq->req.nr_segments && ioreq_map(ioreq) == -1) - goto err; +if (ioreq->req.nr_segments) { + if (ioreq_map(ioreq) == -1) + goto err_no_map; +} ioreq->aio_inflight++; if (ioreq->presync) @@ -425,9 +432,14 @@ static int ioreq_runio_qemu_aio(struct ioreq *ioreq) qemu_aio_complete(ioreq, 0); return 0; + +err_no_map: +ioreq_finish(ioreq); +ioreq->status = BLKIF_RSP_ERROR; +return -1; err: -ioreq->status = BLKIF_RSP_ERROR; +qemu_aio_complete(ioreq, -1); return -1; }