diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2009-12-29 18:46:34 -0200 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2009-12-29 18:46:34 -0200 |
commit | a6ec654a7a863afff41b491a02ffd696c862cb41 (patch) | |
tree | 81aa66c89515b8be78d4b2e438d1cf17d99d8ecb | |
parent | 4dad7ff32aa6dcf18cef0c606d8fb43ff0b939a1 (diff) | |
parent | dcc0da8297bd610e582b851d1b3f9c62c335a6d2 (diff) |
Merge branch 'stable-0.12-upstream' into stable-0.12qemu-kvm-0.12.1.2
* stable-0.12-upstream: (7 commits)
Don't load options roms intended to be loaded by the bios in qemu
USB: Improve usbdevice error messages
cpu-all.h: fix cpu_get_real_ticks() #ifdef
alpha: fix compile
user_only: compile everything with -fpie
fdc/sparc32: don't hang on detection under OBP
scsi-disk: Inquiry with allocation length of CDB < 36 (v4)
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
-rw-r--r-- | Makefile.user | 7 | ||||
-rwxr-xr-x | configure | 3 | ||||
-rw-r--r-- | cpu-all.h | 3 | ||||
-rw-r--r-- | hw/fdc.c | 6 | ||||
-rw-r--r-- | hw/scsi-disk.c | 21 | ||||
-rw-r--r-- | target-alpha/op_helper.c | 4 | ||||
-rw-r--r-- | vl.c | 17 |
7 files changed, 48 insertions, 13 deletions
diff --git a/Makefile.user b/Makefile.user index 907e74bd9..7daedeff6 100644 --- a/Makefile.user +++ b/Makefile.user @@ -2,10 +2,15 @@ include ../config-host.mak include $(SRC_PATH)/rules.mak +-include config.mak .PHONY: all -VPATH=$(SRC_PATH) +# Do not take %.o from $(SRC_PATH), only %.c and %.h +# All %.o for user targets should be built with -fpie, when +# configured with --enable-user-pie, so we don't want to +# take %.o from $(SRC_PATH), since they built without -fpie +vpath %.c %.h $(SRC_PATH) QEMU_CFLAGS+=-I.. @@ -2827,3 +2827,6 @@ d=libuser mkdir -p $d rm -f $d/Makefile ln -s $source_path/Makefile.user $d/Makefile +if test "$static" = "no" -a "$user_pie" = "yes" ; then + echo "QEMU_CFLAGS+=-fpie" > $d/config.mak +fi @@ -1018,7 +1018,8 @@ static inline int64_t cpu_get_real_ticks (void) #endif } -#elif (defined(__mips_isa_rev) && __mips_isa_rev >= 2) || defined(__linux__) +#elif defined(__mips__) && \ + ((defined(__mips_isa_rev) && __mips_isa_rev >= 2) || defined(__linux__)) /* * binutils wants to use rdhwr only on mips32r2 * but as linux kernel emulate it, it's fine @@ -935,6 +935,12 @@ static uint32_t fdctrl_read_main_status (fdctrl_t *fdctrl) fdctrl->dsr &= ~FD_DSR_PWRDOWN; fdctrl->dor |= FD_DOR_nRESET; + /* Sparc mutation */ + if (fdctrl->sun4m) { + retval |= FD_MSR_DIO; + fdctrl_reset_irq(fdctrl); + }; + FLOPPY_DPRINTF("main status register: 0x%02x\n", retval); return retval; diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 2e7a57b2d..eb5b5a847 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -5,6 +5,12 @@ * Based on code by Fabrice Bellard * * Written by Paul Brook + * Modifications: + * 2009-Dec-12 Artyom Tarasenko : implemented stamdard inquiry for the case + * when the allocation length of CDB is smaller + * than 36. + * 2009-Oct-13 Artyom Tarasenko : implemented the block descriptor in the + * MODE SENSE response. * * This code is licenced under the LGPL. * @@ -406,11 +412,6 @@ static int scsi_disk_emulate_inquiry(SCSIRequest *req, uint8_t *outbuf) return -1; } - if (req->cmd.xfer < 36) { - BADF("Error: Inquiry (STANDARD) buffer size %zd " - "is less than 36 (TODO: only 5 required)\n", req->cmd.xfer); - } - buflen = req->cmd.xfer; if (buflen > SCSI_MAX_INQUIRY_LEN) buflen = SCSI_MAX_INQUIRY_LEN; @@ -436,7 +437,15 @@ static int scsi_disk_emulate_inquiry(SCSIRequest *req, uint8_t *outbuf) Some later commands are also implemented. */ outbuf[2] = 3; outbuf[3] = 2; /* Format 2 */ - outbuf[4] = buflen - 5; /* Additional Length = (Len - 1) - 4 */ + + if (buflen > 36) { + outbuf[4] = buflen - 5; /* Additional Length = (Len - 1) - 4 */ + } else { + /* If the allocation length of CDB is too small, + the additional length is not adjusted */ + outbuf[4] = 36 - 5; + } + /* Sync data transfer and TCQ. */ outbuf[7] = 0x10 | (req->bus->tcq ? 0x02 : 0); return buflen; diff --git a/target-alpha/op_helper.c b/target-alpha/op_helper.c index fe222dccd..7a3bf9c0f 100644 --- a/target-alpha/op_helper.c +++ b/target-alpha/op_helper.c @@ -46,10 +46,10 @@ uint64_t helper_load_fpcr (void) { uint64_t ret = 0; #ifdef CONFIG_SOFTFLOAT - ret |= env->fp_status.float_exception_flags << 52; + ret |= (uint64_t)env->fp_status.float_exception_flags << 52; if (env->fp_status.float_exception_flags) ret |= 1ULL << 63; - env->ipr[IPR_EXC_SUM] &= ~0x3E: + env->ipr[IPR_EXC_SUM] &= ~0x3E; env->ipr[IPR_EXC_SUM] |= env->fp_status.float_exception_flags << 1; #endif switch (env->fp_status.float_rounding_mode) { @@ -2713,17 +2713,28 @@ static int usb_device_del(const char *devname) static int usb_parse(const char *cmdline) { - return usb_device_add(cmdline, 0); + int r; + r = usb_device_add(cmdline, 0); + if (r < 0) { + fprintf(stderr, "qemu: could not add USB device '%s'\n", cmdline); + } + return r; } void do_usb_add(Monitor *mon, const QDict *qdict) { - usb_device_add(qdict_get_str(qdict, "devname"), 1); + const char *devname = qdict_get_str(qdict, "devname"); + if (usb_device_add(devname, 1) < 0) { + qemu_error("could not add USB device '%s'\n", devname); + } } void do_usb_del(Monitor *mon, const QDict *qdict) { - usb_device_del(qdict_get_str(qdict, "devname")); + const char *devname = qdict_get_str(qdict, "devname"); + if (usb_device_del(devname) < 0) { + qemu_error("could not delete USB device '%s'\n", devname); + } } /***********************************************************/ |