Compare commits
35 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
e389e937a7 | ||
|
73b48d914f | ||
|
3999bf3244 | ||
|
a3441a43a6 | ||
|
49a3aaac4a | ||
|
027866ce23 | ||
|
04babf6c6f | ||
|
d2b8117310 | ||
|
0c4b9aef7b | ||
|
431c829f33 | ||
|
be7398ec06 | ||
|
be59ce1f48 | ||
|
eacad66dbe | ||
|
66dbb62824 | ||
|
d47d251286 | ||
|
348af56fae | ||
|
09866b9baa | ||
|
e1daf40e3e | ||
|
de3ea06d59 | ||
|
fe46a160ce | ||
|
8033c42abd | ||
|
4713c69fa2 | ||
|
d68bf60838 | ||
|
57fa5ca551 | ||
|
8610774f79 | ||
|
76ba04832b | ||
|
644f5de21b | ||
|
dcc0da8297 | ||
|
41193c50fa | ||
|
da0266005a | ||
|
eacdccbb3e | ||
|
65e8c51928 | ||
|
e470436f19 | ||
|
b60c2c74f3 | ||
|
c56651312b |
36
Changelog
36
Changelog
@@ -1,7 +1,41 @@
|
||||
version 0.12.2:
|
||||
- Qemu's internal TFTP server breaks lock-step-iness of TFTP (Milan Plzik)
|
||||
- osdep.c: Fix accept4 fallback (Kevin Wolf)
|
||||
- pc: add rombar to compat properties for pc-0.10 and pc-0.11 (Gerd Hoffmann)
|
||||
- pci: allow loading roms via fw_cfg. (Gerd Hoffmann)
|
||||
- roms: rework rom loading via fw (Gerd Hoffmann)
|
||||
- fw_cfg: rom loader tweaks. (Gerd Hoffmann)
|
||||
- roms: minor fixes and cleanups. (Gerd Hoffmann)
|
||||
- pc: add machine type for 0.12 (Gerd Hoffmann)
|
||||
- loader: more ignores for rom intended to be loaded by the bios (Aurelien Jarno)
|
||||
- vnc_refresh: return if vd->timer is NULL (Stefano Stabellini)
|
||||
- QMP: Don't free async event's 'data' (Luiz Capitulino)
|
||||
- Handle TFTP ERROR from client (Thomas Horsten)
|
||||
- dmg: fix ->open failure (Christoph Hellwig)
|
||||
- virtio-pci: thinko fix (Michael S. Tsirkin)
|
||||
- pc-bios: Update README (SeaBIOS) (Stefan Weil)
|
||||
- vmware_vga: Check cursor dimensions passed from guest to avoid buffer overflow (Roland Dreier)
|
||||
- remove pending exception on vcpu reset. (Gleb Natapov)
|
||||
- Fix CPU topology initialization (Jiri Denemark)
|
||||
- MCE: Fix bug of IA32_MCG_STATUS after system reset (Huang Ying)
|
||||
- linuxboot: fix gdt address calculation (Avi Kivity)
|
||||
- QMP: Drop wrong assert() (Luiz Capitulino)
|
||||
- vnc: Fix artifacts in hextile decoding (Anthony Liguori)
|
||||
- target-i386: Fix "call im" on x86_64 when executing 32-bit code (Aurelien Jarno)
|
||||
- Add missing newline at the end of options list (Michael Tokarev)
|
||||
- Don't load options roms intended to be loaded by the bios in qemu (Avi Kivity)
|
||||
- USB: Improve usbdevice error messages (Scott Tsai)
|
||||
- cpu-all.h: fix cpu_get_real_ticks() #ifdef (Aurelien Jarno)
|
||||
- alpha: fix compile (Blue Swirl)
|
||||
- user_only: compile everything with -fpie (Kirill A. Shutemov)
|
||||
- fdc/sparc32: don't hang on detection under OBP (Artyom Tarasenko)
|
||||
- scsi-disk: Inquiry with allocation length of CDB < 36 (v4) (Artyom Tarasenko)
|
||||
- e1000: fix init values for command register (Michael S. Tsirkin)
|
||||
|
||||
version 0.12.1:
|
||||
- loader: fix rom loading at address 0 (fixes target-arm) (Aurelien Jarno)
|
||||
- loader: fix rom_copy (fixes multiboot) (Kevin Wolf)
|
||||
|
||||
|
||||
version 0.12.0:
|
||||
|
||||
- Update to SeaBIOS 0.5.0
|
||||
|
@@ -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..
|
||||
|
||||
|
28
block/dmg.c
28
block/dmg.c
@@ -90,24 +90,21 @@ static int dmg_open(BlockDriverState *bs, const char *filename, int flags)
|
||||
|
||||
/* read offset of info blocks */
|
||||
if(lseek(s->fd,-0x1d8,SEEK_END)<0) {
|
||||
dmg_close:
|
||||
close(s->fd);
|
||||
/* open raw instead */
|
||||
bs->drv=bdrv_find_format("raw");
|
||||
return bs->drv->bdrv_open(bs, filename, flags);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
info_begin=read_off(s->fd);
|
||||
if(info_begin==0)
|
||||
goto dmg_close;
|
||||
goto fail;
|
||||
if(lseek(s->fd,info_begin,SEEK_SET)<0)
|
||||
goto dmg_close;
|
||||
goto fail;
|
||||
if(read_uint32(s->fd)!=0x100)
|
||||
goto dmg_close;
|
||||
goto fail;
|
||||
if((count = read_uint32(s->fd))==0)
|
||||
goto dmg_close;
|
||||
goto fail;
|
||||
info_end = info_begin+count;
|
||||
if(lseek(s->fd,0xf8,SEEK_CUR)<0)
|
||||
goto dmg_close;
|
||||
goto fail;
|
||||
|
||||
/* read offsets */
|
||||
last_in_offset = last_out_offset = 0;
|
||||
@@ -116,14 +113,14 @@ dmg_close:
|
||||
|
||||
count = read_uint32(s->fd);
|
||||
if(count==0)
|
||||
goto dmg_close;
|
||||
goto fail;
|
||||
type = read_uint32(s->fd);
|
||||
if(type!=0x6d697368 || count<244)
|
||||
lseek(s->fd,count-4,SEEK_CUR);
|
||||
else {
|
||||
int new_size, chunk_count;
|
||||
if(lseek(s->fd,200,SEEK_CUR)<0)
|
||||
goto dmg_close;
|
||||
goto fail;
|
||||
chunk_count = (count-204)/40;
|
||||
new_size = sizeof(uint64_t) * (s->n_chunks + chunk_count);
|
||||
s->types = qemu_realloc(s->types, new_size/2);
|
||||
@@ -142,7 +139,7 @@ dmg_close:
|
||||
chunk_count--;
|
||||
i--;
|
||||
if(lseek(s->fd,36,SEEK_CUR)<0)
|
||||
goto dmg_close;
|
||||
goto fail;
|
||||
continue;
|
||||
}
|
||||
read_uint32(s->fd);
|
||||
@@ -163,11 +160,14 @@ dmg_close:
|
||||
s->compressed_chunk = qemu_malloc(max_compressed_size+1);
|
||||
s->uncompressed_chunk = qemu_malloc(512*max_sectors_per_chunk);
|
||||
if(inflateInit(&s->zstream) != Z_OK)
|
||||
goto dmg_close;
|
||||
goto fail;
|
||||
|
||||
s->current_chunk = s->n_chunks;
|
||||
|
||||
return 0;
|
||||
fail:
|
||||
close(s->fd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static inline int is_sector_in_chunk(BDRVDMGState* s,
|
||||
|
3
configure
vendored
3
configure
vendored
@@ -2652,3 +2652,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
|
||||
|
@@ -1017,7 +1017,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
|
||||
|
6
hw/fdc.c
6
hw/fdc.c
@@ -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;
|
||||
|
18
hw/fw_cfg.c
18
hw/fw_cfg.c
@@ -278,7 +278,7 @@ int fw_cfg_add_file(FWCfgState *s, const char *dir, const char *filename,
|
||||
uint8_t *data, uint32_t len)
|
||||
{
|
||||
const char *basename;
|
||||
int index;
|
||||
int i, index;
|
||||
|
||||
if (!s->files) {
|
||||
int dsize = sizeof(uint32_t) + sizeof(FWCfgFile) * FW_CFG_FILE_SLOTS;
|
||||
@@ -300,13 +300,17 @@ int fw_cfg_add_file(FWCfgState *s, const char *dir, const char *filename,
|
||||
} else {
|
||||
basename = filename;
|
||||
}
|
||||
if (dir) {
|
||||
snprintf(s->files->f[index].name, sizeof(s->files->f[index].name),
|
||||
"%s/%s", dir, basename);
|
||||
} else {
|
||||
snprintf(s->files->f[index].name, sizeof(s->files->f[index].name),
|
||||
"%s", basename);
|
||||
|
||||
snprintf(s->files->f[index].name, sizeof(s->files->f[index].name),
|
||||
"%s/%s", dir, basename);
|
||||
for (i = 0; i < index; i++) {
|
||||
if (strcmp(s->files->f[index].name, s->files->f[i].name) == 0) {
|
||||
FW_CFG_DPRINTF("%s: skip duplicate: %s\n", __FUNCTION__,
|
||||
s->files->f[index].name);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
s->files->f[index].size = cpu_to_be32(len);
|
||||
s->files->f[index].select = cpu_to_be16(FW_CFG_FILE_FIRST + index);
|
||||
FW_CFG_DPRINTF("%s: #%d: %s (%d bytes)\n", __FUNCTION__,
|
||||
|
63
hw/loader.c
63
hw/loader.c
@@ -535,6 +535,7 @@ struct Rom {
|
||||
QTAILQ_ENTRY(Rom) next;
|
||||
};
|
||||
|
||||
static FWCfgState *fw_cfg;
|
||||
static QTAILQ_HEAD(, Rom) roms = QTAILQ_HEAD_INITIALIZER(roms);
|
||||
int rom_enable_driver_roms;
|
||||
|
||||
@@ -556,7 +557,7 @@ static void rom_insert(Rom *rom)
|
||||
QTAILQ_INSERT_TAIL(&roms, rom, next);
|
||||
}
|
||||
|
||||
int rom_add_file(const char *file, const char *fw_dir, const char *fw_file,
|
||||
int rom_add_file(const char *file, const char *fw_dir,
|
||||
target_phys_addr_t addr)
|
||||
{
|
||||
Rom *rom;
|
||||
@@ -576,8 +577,10 @@ int rom_add_file(const char *file, const char *fw_dir, const char *fw_file,
|
||||
goto err;
|
||||
}
|
||||
|
||||
rom->fw_dir = fw_dir ? qemu_strdup(fw_dir) : NULL;
|
||||
rom->fw_file = fw_file ? qemu_strdup(fw_file) : NULL;
|
||||
if (fw_dir) {
|
||||
rom->fw_dir = qemu_strdup(fw_dir);
|
||||
rom->fw_file = qemu_strdup(file);
|
||||
}
|
||||
rom->addr = addr;
|
||||
rom->romsize = lseek(fd, 0, SEEK_END);
|
||||
rom->data = qemu_mallocz(rom->romsize);
|
||||
@@ -590,6 +593,8 @@ int rom_add_file(const char *file, const char *fw_dir, const char *fw_file,
|
||||
}
|
||||
close(fd);
|
||||
rom_insert(rom);
|
||||
if (rom->fw_file && fw_cfg)
|
||||
fw_cfg_add_file(fw_cfg, rom->fw_dir, rom->fw_file, rom->data, rom->romsize);
|
||||
return 0;
|
||||
|
||||
err:
|
||||
@@ -621,14 +626,14 @@ int rom_add_vga(const char *file)
|
||||
{
|
||||
if (!rom_enable_driver_roms)
|
||||
return 0;
|
||||
return rom_add_file(file, "vgaroms", file, 0);
|
||||
return rom_add_file(file, "vgaroms", 0);
|
||||
}
|
||||
|
||||
int rom_add_option(const char *file)
|
||||
{
|
||||
if (!rom_enable_driver_roms)
|
||||
return 0;
|
||||
return rom_add_file(file, "genroms", file, 0);
|
||||
return rom_add_file(file, "genroms", 0);
|
||||
}
|
||||
|
||||
static void rom_reset(void *unused)
|
||||
@@ -636,8 +641,12 @@ static void rom_reset(void *unused)
|
||||
Rom *rom;
|
||||
|
||||
QTAILQ_FOREACH(rom, &roms, next) {
|
||||
if (rom->data == NULL)
|
||||
if (rom->fw_file) {
|
||||
continue;
|
||||
}
|
||||
if (rom->data == NULL) {
|
||||
continue;
|
||||
}
|
||||
cpu_physical_memory_write_rom(rom->addr, rom->data, rom->romsize);
|
||||
if (rom->isrom) {
|
||||
/* rom needs to be written only once */
|
||||
@@ -654,6 +663,9 @@ int rom_load_all(void)
|
||||
Rom *rom;
|
||||
|
||||
QTAILQ_FOREACH(rom, &roms, next) {
|
||||
if (rom->fw_file) {
|
||||
continue;
|
||||
}
|
||||
if (addr > rom->addr) {
|
||||
fprintf(stderr, "rom: requested regions overlap "
|
||||
"(rom %s. free=0x" TARGET_FMT_plx
|
||||
@@ -672,16 +684,9 @@ int rom_load_all(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rom_load_fw(void *fw_cfg)
|
||||
void rom_set_fw(void *f)
|
||||
{
|
||||
Rom *rom;
|
||||
|
||||
QTAILQ_FOREACH(rom, &roms, next) {
|
||||
if (!rom->fw_file)
|
||||
continue;
|
||||
fw_cfg_add_file(fw_cfg, rom->fw_dir, rom->fw_file, rom->data, rom->romsize);
|
||||
}
|
||||
return 0;
|
||||
fw_cfg = f;
|
||||
}
|
||||
|
||||
static Rom *find_rom(target_phys_addr_t addr)
|
||||
@@ -689,10 +694,15 @@ static Rom *find_rom(target_phys_addr_t addr)
|
||||
Rom *rom;
|
||||
|
||||
QTAILQ_FOREACH(rom, &roms, next) {
|
||||
if (rom->addr > addr)
|
||||
if (rom->fw_file) {
|
||||
continue;
|
||||
if (rom->addr + rom->romsize < addr)
|
||||
}
|
||||
if (rom->addr > addr) {
|
||||
continue;
|
||||
}
|
||||
if (rom->addr + rom->romsize < addr) {
|
||||
continue;
|
||||
}
|
||||
return rom;
|
||||
}
|
||||
return NULL;
|
||||
@@ -711,12 +721,18 @@ int rom_copy(uint8_t *dest, target_phys_addr_t addr, size_t size)
|
||||
Rom *rom;
|
||||
|
||||
QTAILQ_FOREACH(rom, &roms, next) {
|
||||
if (rom->addr + rom->romsize < addr)
|
||||
if (rom->fw_file) {
|
||||
continue;
|
||||
if (rom->addr > end)
|
||||
}
|
||||
if (rom->addr + rom->romsize < addr) {
|
||||
continue;
|
||||
}
|
||||
if (rom->addr > end) {
|
||||
break;
|
||||
if (!rom->data)
|
||||
}
|
||||
if (!rom->data) {
|
||||
continue;
|
||||
}
|
||||
|
||||
d = dest + (rom->addr - addr);
|
||||
s = rom->data;
|
||||
@@ -752,17 +768,16 @@ void do_info_roms(Monitor *mon)
|
||||
Rom *rom;
|
||||
|
||||
QTAILQ_FOREACH(rom, &roms, next) {
|
||||
if (rom->addr) {
|
||||
if (!rom->fw_file) {
|
||||
monitor_printf(mon, "addr=" TARGET_FMT_plx
|
||||
" size=0x%06zx mem=%s name=\"%s\" \n",
|
||||
rom->addr, rom->romsize,
|
||||
rom->isrom ? "rom" : "ram",
|
||||
rom->name);
|
||||
} else {
|
||||
monitor_printf(mon, "fw=%s%s%s"
|
||||
monitor_printf(mon, "fw=%s/%s"
|
||||
" size=0x%06zx name=\"%s\" \n",
|
||||
rom->fw_dir ? rom->fw_dir : "",
|
||||
rom->fw_dir ? "/" : "",
|
||||
rom->fw_dir,
|
||||
rom->fw_file,
|
||||
rom->romsize,
|
||||
rom->name);
|
||||
|
@@ -19,18 +19,19 @@ void pstrcpy_targphys(const char *name,
|
||||
target_phys_addr_t dest, int buf_size,
|
||||
const char *source);
|
||||
|
||||
int rom_add_file(const char *file, const char *fw_dir, const char *fw_file,
|
||||
|
||||
int rom_add_file(const char *file, const char *fw_dir,
|
||||
target_phys_addr_t addr);
|
||||
int rom_add_blob(const char *name, const void *blob, size_t len,
|
||||
target_phys_addr_t addr);
|
||||
int rom_load_all(void);
|
||||
int rom_load_fw(void *fw_cfg);
|
||||
void rom_set_fw(void *f);
|
||||
int rom_copy(uint8_t *dest, target_phys_addr_t addr, size_t size);
|
||||
void *rom_ptr(target_phys_addr_t addr);
|
||||
void do_info_roms(Monitor *mon);
|
||||
|
||||
#define rom_add_file_fixed(_f, _a) \
|
||||
rom_add_file(_f, NULL, NULL, _a)
|
||||
rom_add_file(_f, NULL, _a)
|
||||
#define rom_add_blob_fixed(_f, _b, _l, _a) \
|
||||
rom_add_blob(_f, _b, _l, _a)
|
||||
|
||||
|
29
hw/pc.c
29
hw/pc.c
@@ -1090,6 +1090,7 @@ static void pc_init1(ram_addr_t ram_size,
|
||||
bios_size, bios_offset | IO_MEM_ROM);
|
||||
|
||||
fw_cfg = bochs_bios_init();
|
||||
rom_set_fw(fw_cfg);
|
||||
|
||||
if (linux_boot) {
|
||||
load_linux(fw_cfg, kernel_filename, initrd_filename, kernel_cmdline, below_4g_mem_size);
|
||||
@@ -1250,8 +1251,6 @@ static void pc_init1(ram_addr_t ram_size,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rom_load_fw(fw_cfg);
|
||||
}
|
||||
|
||||
static void pc_init_pci(ram_addr_t ram_size,
|
||||
@@ -1289,7 +1288,7 @@ void cmos_set_s3_resume(void)
|
||||
}
|
||||
|
||||
static QEMUMachine pc_machine = {
|
||||
.name = "pc-0.11",
|
||||
.name = "pc-0.12",
|
||||
.alias = "pc",
|
||||
.desc = "Standard PC",
|
||||
.init = pc_init_pci,
|
||||
@@ -1297,6 +1296,25 @@ static QEMUMachine pc_machine = {
|
||||
.is_default = 1,
|
||||
};
|
||||
|
||||
static QEMUMachine pc_machine_v0_11 = {
|
||||
.name = "pc-0.11",
|
||||
.desc = "Standard PC, qemu 0.11",
|
||||
.init = pc_init_pci,
|
||||
.max_cpus = 255,
|
||||
.compat_props = (GlobalProperty[]) {
|
||||
{
|
||||
.driver = "virtio-blk-pci",
|
||||
.property = "vectors",
|
||||
.value = stringify(0),
|
||||
},{
|
||||
.driver = "PCI",
|
||||
.property = "rombar",
|
||||
.value = stringify(0),
|
||||
},
|
||||
{ /* end of list */ }
|
||||
}
|
||||
};
|
||||
|
||||
static QEMUMachine pc_machine_v0_10 = {
|
||||
.name = "pc-0.10",
|
||||
.desc = "Standard PC, qemu 0.10",
|
||||
@@ -1319,6 +1337,10 @@ static QEMUMachine pc_machine_v0_10 = {
|
||||
.driver = "virtio-blk-pci",
|
||||
.property = "vectors",
|
||||
.value = stringify(0),
|
||||
},{
|
||||
.driver = "PCI",
|
||||
.property = "rombar",
|
||||
.value = stringify(0),
|
||||
},
|
||||
{ /* end of list */ }
|
||||
},
|
||||
@@ -1334,6 +1356,7 @@ static QEMUMachine isapc_machine = {
|
||||
static void pc_machine_init(void)
|
||||
{
|
||||
qemu_register_machine(&pc_machine);
|
||||
qemu_register_machine(&pc_machine_v0_11);
|
||||
qemu_register_machine(&pc_machine_v0_10);
|
||||
qemu_register_machine(&isapc_machine);
|
||||
}
|
||||
|
15
hw/pci.c
15
hw/pci.c
@@ -64,6 +64,7 @@ static struct BusInfo pci_bus_info = {
|
||||
.props = (Property[]) {
|
||||
DEFINE_PROP_PCI_DEVFN("addr", PCIDevice, devfn, -1),
|
||||
DEFINE_PROP_STRING("romfile", PCIDevice, romfile),
|
||||
DEFINE_PROP_UINT32("rombar", PCIDevice, rom_bar, 1),
|
||||
DEFINE_PROP_END_OF_LIST()
|
||||
}
|
||||
};
|
||||
@@ -1464,6 +1465,20 @@ static int pci_add_option_rom(PCIDevice *pdev)
|
||||
if (strlen(pdev->romfile) == 0)
|
||||
return 0;
|
||||
|
||||
if (!pdev->rom_bar) {
|
||||
/*
|
||||
* Load rom via fw_cfg instead of creating a rom bar,
|
||||
* for 0.11 compatibility.
|
||||
*/
|
||||
int class = pci_get_word(pdev->config + PCI_CLASS_DEVICE);
|
||||
if (class == 0x0300) {
|
||||
rom_add_vga(pdev->romfile);
|
||||
} else {
|
||||
rom_add_option(pdev->romfile);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
path = qemu_find_file(QEMU_FILE_TYPE_BIOS, pdev->romfile);
|
||||
if (path == NULL) {
|
||||
path = qemu_strdup(pdev->romfile);
|
||||
|
1
hw/pci.h
1
hw/pci.h
@@ -246,6 +246,7 @@ struct PCIDevice {
|
||||
/* Location of option rom */
|
||||
char *romfile;
|
||||
ram_addr_t rom_offset;
|
||||
uint32_t rom_bar;
|
||||
};
|
||||
|
||||
PCIDevice *pci_register_device(PCIBus *bus, const char *name,
|
||||
|
@@ -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;
|
||||
|
@@ -372,7 +372,7 @@ static void virtio_write_config(PCIDevice *pci_dev, uint32_t address,
|
||||
|
||||
if (PCI_COMMAND == address) {
|
||||
if (!(val & PCI_COMMAND_MASTER)) {
|
||||
proxy->vdev->status &= !VIRTIO_CONFIG_S_DRIVER_OK;
|
||||
proxy->vdev->status &= ~VIRTIO_CONFIG_S_DRIVER_OK;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -562,6 +562,13 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s)
|
||||
cursor.height = y = vmsvga_fifo_read(s);
|
||||
vmsvga_fifo_read(s);
|
||||
cursor.bpp = vmsvga_fifo_read(s);
|
||||
|
||||
if (SVGA_BITMAP_SIZE(x, y) > sizeof cursor.mask ||
|
||||
SVGA_PIXMAP_SIZE(x, y, cursor.bpp) > sizeof cursor.image) {
|
||||
args = SVGA_BITMAP_SIZE(x, y) + SVGA_PIXMAP_SIZE(x, y, cursor.bpp);
|
||||
goto badcmd;
|
||||
}
|
||||
|
||||
for (args = 0; args < SVGA_BITMAP_SIZE(x, y); args ++)
|
||||
cursor.mask[args] = vmsvga_fifo_read_raw(s);
|
||||
for (args = 0; args < SVGA_PIXMAP_SIZE(x, y, cursor.bpp); args ++)
|
||||
|
@@ -283,7 +283,6 @@ static void monitor_protocol_emitter(Monitor *mon, QObject *data)
|
||||
if (!monitor_has_error(mon)) {
|
||||
/* success response */
|
||||
if (data) {
|
||||
assert(qobject_type(data) == QTYPE_QDICT);
|
||||
qobject_incref(data);
|
||||
qdict_put_obj(qmp, "return", data);
|
||||
} else {
|
||||
@@ -366,8 +365,10 @@ void monitor_protocol_event(MonitorEvent event, QObject *data)
|
||||
qmp = qdict_new();
|
||||
timestamp_put(qmp);
|
||||
qdict_put(qmp, "event", qstring_from_str(event_name));
|
||||
if (data)
|
||||
if (data) {
|
||||
qobject_incref(data);
|
||||
qdict_put_obj(qmp, "data", data);
|
||||
}
|
||||
|
||||
monitor_json_emitter(mon, QOBJECT(qmp));
|
||||
QDECREF(qmp);
|
||||
|
2
osdep.c
2
osdep.c
@@ -306,7 +306,7 @@ int qemu_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
|
||||
|
||||
#ifdef CONFIG_ACCEPT4
|
||||
ret = accept4(s, addr, addrlen, SOCK_CLOEXEC);
|
||||
if (ret != -1 || errno != EINVAL) {
|
||||
if (ret != -1 || errno != ENOSYS) {
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,4 +1,5 @@
|
||||
- The PC BIOS comes from the Bochs project (http://bochs.sourceforge.net/).
|
||||
- SeaBIOS (bios.bin) is the successor of pc bios.
|
||||
See http://www.seabios.org/ for more information.
|
||||
|
||||
- The VGA BIOS and the Cirrus VGA BIOS come from the LGPL VGA bios
|
||||
project (http://www.nongnu.org/vgabios/).
|
||||
|
BIN
pc-bios/bios.bin
BIN
pc-bios/bios.bin
Binary file not shown.
@@ -86,9 +86,10 @@ copy_kernel:
|
||||
/* Now create the GDT descriptor */
|
||||
movw $((3 * 8) - 1), -16(%bp)
|
||||
mov %cs, %eax
|
||||
movzwl %ax, %eax
|
||||
shl $4, %eax
|
||||
addl $gdt, %ebx
|
||||
movl %ebx, -14(%bp)
|
||||
addl $gdt, %eax
|
||||
movl %eax, -14(%bp)
|
||||
|
||||
/* And load the GDT */
|
||||
data32 lgdt -16(%bp)
|
||||
|
@@ -1936,4 +1936,4 @@ DEF("readconfig", HAS_ARG, QEMU_OPTION_readconfig,
|
||||
"-readconfig <file>\n")
|
||||
DEF("writeconfig", HAS_ARG, QEMU_OPTION_writeconfig,
|
||||
"-writeconfig <file>\n"
|
||||
" read/write config file")
|
||||
" read/write config file\n")
|
||||
|
Submodule roms/seabios updated: 494302fe19...5da68339ec
24
slirp/tftp.c
24
slirp/tftp.c
@@ -264,6 +264,12 @@ static void tftp_handle_rrq(Slirp *slirp, struct tftp_t *tp, int pktlen)
|
||||
size_t prefix_len;
|
||||
char *req_fname;
|
||||
|
||||
/* check if a session already exists and if so terminate it */
|
||||
s = tftp_session_find(slirp, tp);
|
||||
if (s >= 0) {
|
||||
tftp_session_terminate(&slirp->tftp_sessions[s]);
|
||||
}
|
||||
|
||||
s = tftp_session_allocate(slirp, tp);
|
||||
|
||||
if (s < 0) {
|
||||
@@ -362,6 +368,7 @@ static void tftp_handle_rrq(Slirp *slirp, struct tftp_t *tp, int pktlen)
|
||||
}
|
||||
|
||||
tftp_send_oack(spt, "tsize", tsize, tp);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -385,6 +392,19 @@ static void tftp_handle_ack(Slirp *slirp, struct tftp_t *tp, int pktlen)
|
||||
}
|
||||
}
|
||||
|
||||
static void tftp_handle_error(Slirp *slirp, struct tftp_t *tp, int pktlen)
|
||||
{
|
||||
int s;
|
||||
|
||||
s = tftp_session_find(slirp, tp);
|
||||
|
||||
if (s < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
tftp_session_terminate(&slirp->tftp_sessions[s]);
|
||||
}
|
||||
|
||||
void tftp_input(struct mbuf *m)
|
||||
{
|
||||
struct tftp_t *tp = (struct tftp_t *)m->m_data;
|
||||
@@ -397,5 +417,9 @@ void tftp_input(struct mbuf *m)
|
||||
case TFTP_ACK:
|
||||
tftp_handle_ack(m->slirp, tp, m->m_len);
|
||||
break;
|
||||
|
||||
case TFTP_ERROR:
|
||||
tftp_handle_error(m->slirp, tp, m->m_len);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -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) {
|
||||
|
@@ -617,6 +617,8 @@ void cpu_reset(CPUX86State *env)
|
||||
env->dr[7] = DR7_FIXED_1;
|
||||
cpu_breakpoint_remove_all(env, BP_CPU);
|
||||
cpu_watchpoint_remove_all(env, BP_CPU);
|
||||
|
||||
env->mcg_status = 0;
|
||||
}
|
||||
|
||||
void cpu_x86_close(CPUX86State *env)
|
||||
|
@@ -227,6 +227,7 @@ int kvm_arch_init_vcpu(CPUState *env)
|
||||
|
||||
void kvm_arch_reset_vcpu(CPUState *env)
|
||||
{
|
||||
env->exception_injected = -1;
|
||||
env->interrupt_injected = -1;
|
||||
env->nmi_injected = 0;
|
||||
env->nmi_pending = 0;
|
||||
|
@@ -6259,6 +6259,8 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
|
||||
tval += next_eip;
|
||||
if (s->dflag == 0)
|
||||
tval &= 0xffff;
|
||||
else if(!CODE64(s))
|
||||
tval &= 0xffffffff;
|
||||
gen_movtl_T0_im(next_eip);
|
||||
gen_push_T0(s);
|
||||
gen_jmp(s, tval);
|
||||
|
25
vl.c
25
vl.c
@@ -2689,17 +2689,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);
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************/
|
||||
@@ -3473,10 +3484,10 @@ void qemu_init_vcpu(void *_env)
|
||||
{
|
||||
CPUState *env = _env;
|
||||
|
||||
if (kvm_enabled())
|
||||
kvm_init_vcpu(env);
|
||||
env->nr_cores = smp_cores;
|
||||
env->nr_threads = smp_threads;
|
||||
if (kvm_enabled())
|
||||
kvm_init_vcpu(env);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3802,12 +3813,12 @@ void qemu_init_vcpu(void *_env)
|
||||
{
|
||||
CPUState *env = _env;
|
||||
|
||||
env->nr_cores = smp_cores;
|
||||
env->nr_threads = smp_threads;
|
||||
if (kvm_enabled())
|
||||
kvm_start_vcpu(env);
|
||||
else
|
||||
tcg_init_vcpu(env);
|
||||
env->nr_cores = smp_cores;
|
||||
env->nr_threads = smp_threads;
|
||||
}
|
||||
|
||||
void qemu_notify_event(void)
|
||||
|
4
vnc.c
4
vnc.c
@@ -2305,6 +2305,10 @@ static void vnc_refresh(void *opaque)
|
||||
rects += vnc_update_client(vs, has_dirty);
|
||||
vs = vs->next;
|
||||
}
|
||||
/* vd->timer could be NULL now if the last client disconnected,
|
||||
* in this case don't update the timer */
|
||||
if (vd->timer == NULL)
|
||||
return;
|
||||
|
||||
if (has_dirty && rects) {
|
||||
vd->timer_interval /= 2;
|
||||
|
@@ -165,6 +165,8 @@ static void CONCAT(send_hextile_tile_, NAME)(VncState *vs,
|
||||
irow += ds_get_linesize(vs->ds) / sizeof(pixel_t);
|
||||
}
|
||||
|
||||
/* A SubrectsColoured subtile invalidates the foreground color */
|
||||
*has_fg = 0;
|
||||
if (n_data > (w * h * sizeof(pixel_t))) {
|
||||
n_colors = 4;
|
||||
flags = 0x01;
|
||||
|
Reference in New Issue
Block a user