mirror of
https://github.com/utmapp/qemu.git
synced 2026-12-02 15:46:49 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
71090deb4c | ||
|
|
fe0c88919c | ||
|
|
775bb790b9 | ||
|
|
4131b1f176 | ||
|
|
aada709c26 | ||
|
|
591618f27b | ||
|
|
7b15f81d63 | ||
|
|
62b7c90152 | ||
|
|
95743c7a39 | ||
|
|
ab0c94f1d7 | ||
|
|
a7a2570f22 | ||
|
|
a386866a8d | ||
|
|
adfe37a19a | ||
|
|
313f191150 | ||
|
|
06239e69e8 | ||
|
|
b1c78530ae | ||
|
|
10e169de73 | ||
|
|
ac1749e444 | ||
|
|
ac179ffe7e | ||
|
|
d9a0224b2a | ||
|
|
dff579171c | ||
|
|
e79947a57f | ||
|
|
3c0463a650 | ||
|
|
fdebed6dcd | ||
|
|
b9fd6d9521 | ||
|
|
d38d749a99 |
No files matched your search
+20
-8
@@ -346,29 +346,41 @@ static int vmdk_write_cid(BlockDriverState *bs, uint32_t cid)
|
||||
BDRVVmdkState *s = bs->opaque;
|
||||
int ret = 0;
|
||||
|
||||
desc = g_malloc0(DESC_SIZE);
|
||||
tmp_desc = g_malloc0(DESC_SIZE);
|
||||
ret = bdrv_pread(bs->file, s->desc_offset, DESC_SIZE, desc, 0);
|
||||
size_t desc_buf_size;
|
||||
|
||||
if (s->desc_offset == 0) {
|
||||
desc_buf_size = bdrv_getlength(bs->file->bs);
|
||||
if (desc_buf_size > 16ULL << 20) {
|
||||
error_report("VMDK description file too big");
|
||||
return -EFBIG;
|
||||
}
|
||||
} else {
|
||||
desc_buf_size = DESC_SIZE;
|
||||
}
|
||||
|
||||
desc = g_malloc0(desc_buf_size);
|
||||
tmp_desc = g_malloc0(desc_buf_size);
|
||||
ret = bdrv_pread(bs->file, s->desc_offset, desc_buf_size, desc, 0);
|
||||
if (ret < 0) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
desc[DESC_SIZE - 1] = '\0';
|
||||
desc[desc_buf_size - 1] = '\0';
|
||||
tmp_str = strstr(desc, "parentCID");
|
||||
if (tmp_str == NULL) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
pstrcpy(tmp_desc, DESC_SIZE, tmp_str);
|
||||
pstrcpy(tmp_desc, desc_buf_size, tmp_str);
|
||||
p_name = strstr(desc, "CID");
|
||||
if (p_name != NULL) {
|
||||
p_name += sizeof("CID");
|
||||
snprintf(p_name, DESC_SIZE - (p_name - desc), "%" PRIx32 "\n", cid);
|
||||
pstrcat(desc, DESC_SIZE, tmp_desc);
|
||||
snprintf(p_name, desc_buf_size - (p_name - desc), "%" PRIx32 "\n", cid);
|
||||
pstrcat(desc, desc_buf_size, tmp_desc);
|
||||
}
|
||||
|
||||
ret = bdrv_pwrite_sync(bs->file, s->desc_offset, DESC_SIZE, desc, 0);
|
||||
ret = bdrv_pwrite_sync(bs->file, s->desc_offset, desc_buf_size, desc, 0);
|
||||
|
||||
out:
|
||||
g_free(desc);
|
||||
|
||||
@@ -990,7 +990,7 @@ class. Here's a simple usage example:
|
||||
self.vm.launch()
|
||||
res = self.vm.command('human-monitor-command',
|
||||
command_line='info version')
|
||||
self.assertRegexpMatches(res, r'^(\d+\.\d+\.\d)')
|
||||
self.assertRegex(res, r'^(\d+\.\d+\.\d)')
|
||||
|
||||
To execute your test, run:
|
||||
|
||||
@@ -1051,7 +1051,7 @@ and hypothetical example follows:
|
||||
'human-monitor-command',
|
||||
command_line='info version')
|
||||
|
||||
self.assertEquals(first_res, second_res, third_res)
|
||||
self.assertEqual(first_res, second_res, third_res)
|
||||
|
||||
At test "tear down", ``avocado_qemu.Test`` handles all the QEMUMachines
|
||||
shutdown.
|
||||
|
||||
@@ -947,6 +947,7 @@ static const VMStateDescription erst_vmstate = {
|
||||
|
||||
static void erst_realizefn(PCIDevice *pci_dev, Error **errp)
|
||||
{
|
||||
ERRP_GUARD();
|
||||
ERSTDeviceState *s = ACPIERST(pci_dev);
|
||||
|
||||
trace_acpi_erst_realizefn_in();
|
||||
@@ -964,9 +965,15 @@ static void erst_realizefn(PCIDevice *pci_dev, Error **errp)
|
||||
|
||||
/* HostMemoryBackend size will be multiple of PAGE_SIZE */
|
||||
s->storage_size = object_property_get_int(OBJECT(s->hostmem), "size", errp);
|
||||
if (*errp) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Initialize backend storage and record_count */
|
||||
check_erst_backend_storage(s, errp);
|
||||
if (*errp) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* BAR 0: Programming registers */
|
||||
memory_region_init_io(&s->iomem_mr, OBJECT(pci_dev), &erst_reg_ops, s,
|
||||
@@ -977,6 +984,9 @@ static void erst_realizefn(PCIDevice *pci_dev, Error **errp)
|
||||
memory_region_init_ram(&s->exchange_mr, OBJECT(pci_dev),
|
||||
"erst.exchange",
|
||||
le32_to_cpu(s->header->record_size), errp);
|
||||
if (*errp) {
|
||||
return;
|
||||
}
|
||||
pci_register_bar(pci_dev, 1, PCI_BASE_ADDRESS_SPACE_MEMORY,
|
||||
&s->exchange_mr);
|
||||
|
||||
|
||||
+21
-8
@@ -22,6 +22,7 @@
|
||||
#include "hw/qdev-properties.h"
|
||||
#include "intel-hda.h"
|
||||
#include "migration/vmstate.h"
|
||||
#include "qemu/host-utils.h"
|
||||
#include "qemu/module.h"
|
||||
#include "intel-hda-defs.h"
|
||||
#include "audio/audio.h"
|
||||
@@ -190,9 +191,9 @@ struct HDAAudioState {
|
||||
bool use_timer;
|
||||
};
|
||||
|
||||
static inline int64_t hda_bytes_per_second(HDAAudioStream *st)
|
||||
static inline uint32_t hda_bytes_per_second(HDAAudioStream *st)
|
||||
{
|
||||
return 2LL * st->as.nchannels * st->as.freq;
|
||||
return 2 * (uint32_t)st->as.nchannels * (uint32_t)st->as.freq;
|
||||
}
|
||||
|
||||
static inline void hda_timer_sync_adjust(HDAAudioStream *st, int64_t target_pos)
|
||||
@@ -223,12 +224,18 @@ static void hda_audio_input_timer(void *opaque)
|
||||
|
||||
int64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
|
||||
|
||||
int64_t buft_start = st->buft_start;
|
||||
int64_t uptime = now - st->buft_start;
|
||||
int64_t wpos = st->wpos;
|
||||
int64_t rpos = st->rpos;
|
||||
int64_t wanted_rpos;
|
||||
|
||||
int64_t wanted_rpos = hda_bytes_per_second(st) * (now - buft_start)
|
||||
/ NANOSECONDS_PER_SECOND;
|
||||
if (uptime <= 0) {
|
||||
/* wanted_rpos <= 0 */
|
||||
goto out_timer;
|
||||
}
|
||||
|
||||
wanted_rpos = muldiv64(uptime, hda_bytes_per_second(st),
|
||||
NANOSECONDS_PER_SECOND);
|
||||
wanted_rpos &= -4; /* IMPORTANT! clip to frames */
|
||||
|
||||
if (wanted_rpos <= rpos) {
|
||||
@@ -287,12 +294,18 @@ static void hda_audio_output_timer(void *opaque)
|
||||
|
||||
int64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
|
||||
|
||||
int64_t buft_start = st->buft_start;
|
||||
int64_t uptime = now - st->buft_start;
|
||||
int64_t wpos = st->wpos;
|
||||
int64_t rpos = st->rpos;
|
||||
int64_t wanted_wpos;
|
||||
|
||||
int64_t wanted_wpos = hda_bytes_per_second(st) * (now - buft_start)
|
||||
/ NANOSECONDS_PER_SECOND;
|
||||
if (uptime <= 0) {
|
||||
/* wanted_wpos <= 0 */
|
||||
goto out_timer;
|
||||
}
|
||||
|
||||
wanted_wpos = muldiv64(uptime, hda_bytes_per_second(st),
|
||||
NANOSECONDS_PER_SECOND);
|
||||
wanted_wpos &= -4; /* IMPORTANT! clip to frames */
|
||||
|
||||
if (wanted_wpos <= wpos) {
|
||||
|
||||
+26
-1
@@ -622,9 +622,13 @@ static void ahci_init_d2h(AHCIDevice *ad)
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* For simplicity, do not call ahci_clear_cmd_issue() for this
|
||||
* ahci_write_fis_d2h(). (The reset value for PxCI is 0.)
|
||||
*/
|
||||
if (ahci_write_fis_d2h(ad, true)) {
|
||||
ad->init_d2h_sent = true;
|
||||
/* We're emulating receiving the first Reg H2D Fis from the device;
|
||||
/* We're emulating receiving the first Reg D2H FIS from the device;
|
||||
* Update the SIG register, but otherwise proceed as normal. */
|
||||
pr->sig = ((uint32_t)ide_state->hcyl << 24) |
|
||||
(ide_state->lcyl << 16) |
|
||||
@@ -662,6 +666,7 @@ static void ahci_reset_port(AHCIState *s, int port)
|
||||
pr->scr_act = 0;
|
||||
pr->tfdata = 0x7F;
|
||||
pr->sig = 0xFFFFFFFF;
|
||||
pr->cmd_issue = 0;
|
||||
d->busy_slot = -1;
|
||||
d->init_d2h_sent = false;
|
||||
|
||||
@@ -1242,10 +1247,30 @@ static void handle_reg_h2d_fis(AHCIState *s, int port,
|
||||
case STATE_RUN:
|
||||
if (cmd_fis[15] & ATA_SRST) {
|
||||
s->dev[port].port_state = STATE_RESET;
|
||||
/*
|
||||
* When setting SRST in the first H2D FIS in the reset sequence,
|
||||
* the device does not send a D2H FIS. Host software thus has to
|
||||
* set the "Clear Busy upon R_OK" bit such that PxCI (and BUSY)
|
||||
* gets cleared. See AHCI 1.3.1, section 10.4.1 Software Reset.
|
||||
*/
|
||||
if (opts & AHCI_CMD_CLR_BUSY) {
|
||||
ahci_clear_cmd_issue(ad, slot);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case STATE_RESET:
|
||||
if (!(cmd_fis[15] & ATA_SRST)) {
|
||||
/*
|
||||
* When clearing SRST in the second H2D FIS in the reset
|
||||
* sequence, the device will execute diagnostics. When this is
|
||||
* done, the device will send a D2H FIS with the good status.
|
||||
* See SATA 3.5a Gold, section 11.4 Software reset protocol.
|
||||
*
|
||||
* This D2H FIS is the first D2H FIS received from the device,
|
||||
* and is received regardless if the reset was performed by a
|
||||
* COMRESET or by setting and clearing the SRST bit. Therefore,
|
||||
* the logic for this is found in ahci_init_d2h() and not here.
|
||||
*/
|
||||
ahci_reset_port(s, port);
|
||||
}
|
||||
break;
|
||||
|
||||
+2
-2
@@ -877,9 +877,9 @@ static void write_bootloader(uint8_t *base, uint64_t run_addr,
|
||||
|
||||
/* Bus endianess is always reversed */
|
||||
#if TARGET_BIG_ENDIAN
|
||||
#define cpu_to_gt32 cpu_to_le32
|
||||
#define cpu_to_gt32(x) (x)
|
||||
#else
|
||||
#define cpu_to_gt32 cpu_to_be32
|
||||
#define cpu_to_gt32(x) bswap32(x)
|
||||
#endif
|
||||
|
||||
/* move GT64120 registers from 0x14000000 to 0x1be00000 */
|
||||
|
||||
@@ -329,6 +329,13 @@ static void mps2_scc_realize(DeviceState *dev, Error **errp)
|
||||
s->oscclk = g_new0(uint32_t, s->num_oscclk);
|
||||
}
|
||||
|
||||
static void mps2_scc_finalize(Object *obj)
|
||||
{
|
||||
MPS2SCC *s = MPS2_SCC(obj);
|
||||
|
||||
g_free(s->oscclk_reset);
|
||||
}
|
||||
|
||||
static const VMStateDescription mps2_scc_vmstate = {
|
||||
.name = "mps2-scc",
|
||||
.version_id = 3,
|
||||
@@ -385,6 +392,7 @@ static const TypeInfo mps2_scc_info = {
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(MPS2SCC),
|
||||
.instance_init = mps2_scc_init,
|
||||
.instance_finalize = mps2_scc_finalize,
|
||||
.class_init = mps2_scc_class_init,
|
||||
};
|
||||
|
||||
|
||||
@@ -824,7 +824,8 @@ static void allwinner_sun8i_emac_realize(DeviceState *dev, Error **errp)
|
||||
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
s->nic = qemu_new_nic(&net_allwinner_sun8i_emac_info, &s->conf,
|
||||
object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
object_get_typename(OBJECT(dev)), dev->id,
|
||||
&dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
}
|
||||
|
||||
|
||||
@@ -453,7 +453,8 @@ static void aw_emac_realize(DeviceState *dev, Error **errp)
|
||||
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
s->nic = qemu_new_nic(&net_aw_emac_info, &s->conf,
|
||||
object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
object_get_typename(OBJECT(dev)), dev->id,
|
||||
&dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
|
||||
fifo8_create(&s->rx_fifo, RX_FIFO_SIZE);
|
||||
|
||||
@@ -1633,7 +1633,8 @@ static void gem_realize(DeviceState *dev, Error **errp)
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
|
||||
s->nic = qemu_new_nic(&net_gem_info, &s->conf,
|
||||
object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
object_get_typename(OBJECT(dev)), dev->id,
|
||||
&dev->mem_reentrancy_guard, s);
|
||||
|
||||
if (s->jumbo_max_len > MAX_FRAME_SIZE) {
|
||||
error_setg(errp, "jumbo-max-len is greater than %d",
|
||||
|
||||
+2
-1
@@ -943,7 +943,8 @@ static void dp8393x_realize(DeviceState *dev, Error **errp)
|
||||
"dp8393x-regs", SONIC_REG_COUNT << s->it_shift);
|
||||
|
||||
s->nic = qemu_new_nic(&net_dp83932_info, &s->conf,
|
||||
object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
object_get_typename(OBJECT(dev)), dev->id,
|
||||
&dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
|
||||
s->watchdog = timer_new_ns(QEMU_CLOCK_VIRTUAL, dp8393x_watchdog, s);
|
||||
|
||||
+2
-1
@@ -1735,7 +1735,8 @@ static void pci_e1000_realize(PCIDevice *pci_dev, Error **errp)
|
||||
macaddr);
|
||||
|
||||
d->nic = qemu_new_nic(&net_e1000_info, &d->conf,
|
||||
object_get_typename(OBJECT(d)), dev->id, d);
|
||||
object_get_typename(OBJECT(d)), dev->id,
|
||||
&dev->mem_reentrancy_guard, d);
|
||||
|
||||
qemu_format_nic_info_str(qemu_get_queue(d->nic), macaddr);
|
||||
|
||||
|
||||
+1
-1
@@ -319,7 +319,7 @@ e1000e_init_net_peer(E1000EState *s, PCIDevice *pci_dev, uint8_t *macaddr)
|
||||
int i;
|
||||
|
||||
s->nic = qemu_new_nic(&net_e1000e_info, &s->conf,
|
||||
object_get_typename(OBJECT(s)), dev->id, s);
|
||||
object_get_typename(OBJECT(s)), dev->id, &dev->mem_reentrancy_guard, s);
|
||||
|
||||
s->core.max_queue_num = s->conf.peers.queues ? s->conf.peers.queues - 1 : 0;
|
||||
|
||||
|
||||
+3
-1
@@ -1874,7 +1874,9 @@ static void e100_nic_realize(PCIDevice *pci_dev, Error **errp)
|
||||
nic_reset(s);
|
||||
|
||||
s->nic = qemu_new_nic(&net_eepro100_info, &s->conf,
|
||||
object_get_typename(OBJECT(pci_dev)), pci_dev->qdev.id, s);
|
||||
object_get_typename(OBJECT(pci_dev)),
|
||||
pci_dev->qdev.id,
|
||||
&pci_dev->qdev.mem_reentrancy_guard, s);
|
||||
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
TRACE(OTHER, logout("%s\n", qemu_get_queue(s->nic)->info_str));
|
||||
|
||||
@@ -618,7 +618,8 @@ static void etraxfs_eth_realize(DeviceState *dev, Error **errp)
|
||||
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
s->nic = qemu_new_nic(&net_etraxfs_info, &s->conf,
|
||||
object_get_typename(OBJECT(s)), dev->id, s);
|
||||
object_get_typename(OBJECT(s)), dev->id,
|
||||
&dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
|
||||
s->phy.read = tdk_read;
|
||||
|
||||
@@ -390,7 +390,8 @@ static void etsec_realize(DeviceState *dev, Error **errp)
|
||||
eTSEC *etsec = ETSEC_COMMON(dev);
|
||||
|
||||
etsec->nic = qemu_new_nic(&net_etsec_info, &etsec->conf,
|
||||
object_get_typename(OBJECT(dev)), dev->id, etsec);
|
||||
object_get_typename(OBJECT(dev)), dev->id,
|
||||
&dev->mem_reentrancy_guard, etsec);
|
||||
qemu_format_nic_info_str(qemu_get_queue(etsec->nic), etsec->conf.macaddr.a);
|
||||
|
||||
etsec->ptimer = ptimer_init(etsec_timer_hit, etsec, PTIMER_POLICY_LEGACY);
|
||||
|
||||
+2
-1
@@ -1118,7 +1118,8 @@ static void ftgmac100_realize(DeviceState *dev, Error **errp)
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
|
||||
s->nic = qemu_new_nic(&net_ftgmac100_info, &s->conf,
|
||||
object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
object_get_typename(OBJECT(dev)), dev->id,
|
||||
&dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -743,7 +743,7 @@ void i82596_common_init(DeviceState *dev, I82596State *s, NetClientInfo *info)
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
}
|
||||
s->nic = qemu_new_nic(info, &s->conf, object_get_typename(OBJECT(dev)),
|
||||
dev->id, s);
|
||||
dev->id, &dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
|
||||
if (USE_TIMER) {
|
||||
|
||||
+1
-1
@@ -1318,7 +1318,7 @@ static void imx_eth_realize(DeviceState *dev, Error **errp)
|
||||
|
||||
s->nic = qemu_new_nic(&imx_eth_net_info, &s->conf,
|
||||
object_get_typename(OBJECT(dev)),
|
||||
dev->id, s);
|
||||
dev->id, &dev->mem_reentrancy_guard, s);
|
||||
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
}
|
||||
|
||||
+2
-1
@@ -1362,7 +1362,8 @@ static void lan9118_realize(DeviceState *dev, Error **errp)
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
|
||||
s->nic = qemu_new_nic(&net_lan9118_info, &s->conf,
|
||||
object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
object_get_typename(OBJECT(dev)), dev->id,
|
||||
&dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
s->eeprom[0] = 0xa5;
|
||||
for (i = 0; i < 6; i++) {
|
||||
|
||||
+2
-1
@@ -643,7 +643,8 @@ static void mcf_fec_realize(DeviceState *dev, Error **errp)
|
||||
mcf_fec_state *s = MCF_FEC_NET(dev);
|
||||
|
||||
s->nic = qemu_new_nic(&net_mcf_fec_info, &s->conf,
|
||||
object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
object_get_typename(OBJECT(dev)), dev->id,
|
||||
&dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -255,7 +255,8 @@ static void mipsnet_realize(DeviceState *dev, Error **errp)
|
||||
sysbus_init_irq(sbd, &s->irq);
|
||||
|
||||
s->nic = qemu_new_nic(&net_mipsnet_info, &s->conf,
|
||||
object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
object_get_typename(OBJECT(dev)), dev->id,
|
||||
&dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -530,7 +530,8 @@ static void msf2_emac_realize(DeviceState *dev, Error **errp)
|
||||
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
s->nic = qemu_new_nic(&net_msf2_emac_info, &s->conf,
|
||||
object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
object_get_typename(OBJECT(dev)), dev->id,
|
||||
&dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
}
|
||||
|
||||
|
||||
@@ -350,7 +350,8 @@ static void mv88w8618_eth_realize(DeviceState *dev, Error **errp)
|
||||
|
||||
address_space_init(&s->dma_as, s->dma_mr, "emac-dma");
|
||||
s->nic = qemu_new_nic(&net_mv88w8618_info, &s->conf,
|
||||
object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
object_get_typename(OBJECT(dev)), dev->id,
|
||||
&dev->mem_reentrancy_guard, s);
|
||||
}
|
||||
|
||||
static const VMStateDescription mv88w8618_eth_vmsd = {
|
||||
|
||||
+2
-1
@@ -74,7 +74,8 @@ static void isa_ne2000_realizefn(DeviceState *dev, Error **errp)
|
||||
ne2000_reset(s);
|
||||
|
||||
s->nic = qemu_new_nic(&net_ne2000_isa_info, &s->c,
|
||||
object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
object_get_typename(OBJECT(dev)), dev->id,
|
||||
&dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->c.macaddr.a);
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -71,7 +71,8 @@ static void pci_ne2000_realize(PCIDevice *pci_dev, Error **errp)
|
||||
|
||||
s->nic = qemu_new_nic(&net_ne2000_info, &s->c,
|
||||
object_get_typename(OBJECT(pci_dev)),
|
||||
pci_dev->qdev.id, s);
|
||||
pci_dev->qdev.id,
|
||||
&pci_dev->qdev.mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->c.macaddr.a);
|
||||
}
|
||||
|
||||
|
||||
@@ -803,7 +803,8 @@ static void npcm7xx_emc_realize(DeviceState *dev, Error **errp)
|
||||
|
||||
qemu_macaddr_default_if_unset(&emc->conf.macaddr);
|
||||
emc->nic = qemu_new_nic(&net_npcm7xx_emc_info, &emc->conf,
|
||||
object_get_typename(OBJECT(dev)), dev->id, emc);
|
||||
object_get_typename(OBJECT(dev)), dev->id,
|
||||
&dev->mem_reentrancy_guard, emc);
|
||||
qemu_format_nic_info_str(qemu_get_queue(emc->nic), emc->conf.macaddr.a);
|
||||
}
|
||||
|
||||
|
||||
@@ -732,7 +732,8 @@ static void sysbus_open_eth_realize(DeviceState *dev, Error **errp)
|
||||
sysbus_init_irq(sbd, &s->irq);
|
||||
|
||||
s->nic = qemu_new_nic(&net_open_eth_info, &s->conf,
|
||||
object_get_typename(OBJECT(s)), dev->id, s);
|
||||
object_get_typename(OBJECT(s)), dev->id,
|
||||
&dev->mem_reentrancy_guard, s);
|
||||
}
|
||||
|
||||
static void qdev_open_eth_reset(DeviceState *dev)
|
||||
|
||||
+2
-1
@@ -1718,7 +1718,8 @@ void pcnet_common_init(DeviceState *dev, PCNetState *s, NetClientInfo *info)
|
||||
s->poll_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, pcnet_poll_timer, s);
|
||||
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
s->nic = qemu_new_nic(info, &s->conf, object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
s->nic = qemu_new_nic(info, &s->conf, object_get_typename(OBJECT(dev)),
|
||||
dev->id, &dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
|
||||
/* Initialize the PROM */
|
||||
|
||||
@@ -241,8 +241,8 @@ FpPort *fp_port_alloc(Rocker *r, char *sw_name,
|
||||
port->conf.bootindex = -1;
|
||||
port->conf.peers = *peers;
|
||||
|
||||
port->nic = qemu_new_nic(&fp_port_info, &port->conf,
|
||||
sw_name, NULL, port);
|
||||
port->nic = qemu_new_nic(&fp_port_info, &port->conf, sw_name, NULL,
|
||||
&DEVICE(r)->mem_reentrancy_guard, port);
|
||||
qemu_format_nic_info_str(qemu_get_queue(port->nic),
|
||||
port->conf.macaddr.a);
|
||||
|
||||
|
||||
+2
-1
@@ -3400,7 +3400,8 @@ static void pci_rtl8139_realize(PCIDevice *dev, Error **errp)
|
||||
s->eeprom.contents[9] = s->conf.macaddr.a[4] | s->conf.macaddr.a[5] << 8;
|
||||
|
||||
s->nic = qemu_new_nic(&net_rtl8139_info, &s->conf,
|
||||
object_get_typename(OBJECT(dev)), d->id, s);
|
||||
object_get_typename(OBJECT(dev)), d->id,
|
||||
&d->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
|
||||
s->cplus_txbuffer = NULL;
|
||||
|
||||
+2
-1
@@ -783,7 +783,8 @@ static void smc91c111_realize(DeviceState *dev, Error **errp)
|
||||
sysbus_init_irq(sbd, &s->irq);
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
s->nic = qemu_new_nic(&net_smc91c111_info, &s->conf,
|
||||
object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
object_get_typename(OBJECT(dev)), dev->id,
|
||||
&dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
/* ??? Save/restore. */
|
||||
}
|
||||
|
||||
+2
-1
@@ -325,7 +325,8 @@ static void spapr_vlan_realize(SpaprVioDevice *sdev, Error **errp)
|
||||
memcpy(&dev->perm_mac.a, &dev->nicconf.macaddr.a, sizeof(dev->perm_mac.a));
|
||||
|
||||
dev->nic = qemu_new_nic(&net_spapr_vlan_info, &dev->nicconf,
|
||||
object_get_typename(OBJECT(sdev)), sdev->qdev.id, dev);
|
||||
object_get_typename(OBJECT(sdev)), sdev->qdev.id,
|
||||
&sdev->qdev.mem_reentrancy_guard, dev);
|
||||
qemu_format_nic_info_str(qemu_get_queue(dev->nic), dev->nicconf.macaddr.a);
|
||||
|
||||
dev->rxp_timer = timer_new_us(QEMU_CLOCK_VIRTUAL, spapr_vlan_flush_rx_queue,
|
||||
|
||||
@@ -492,7 +492,8 @@ static void stellaris_enet_realize(DeviceState *dev, Error **errp)
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
|
||||
s->nic = qemu_new_nic(&net_stellaris_enet_info, &s->conf,
|
||||
object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
object_get_typename(OBJECT(dev)), dev->id,
|
||||
&dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1361,7 +1361,7 @@ static void sungem_realize(PCIDevice *pci_dev, Error **errp)
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
s->nic = qemu_new_nic(&net_sungem_info, &s->conf,
|
||||
object_get_typename(OBJECT(dev)),
|
||||
dev->id, s);
|
||||
dev->id, &dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic),
|
||||
s->conf.macaddr.a);
|
||||
}
|
||||
|
||||
+2
-1
@@ -892,7 +892,8 @@ static void sunhme_realize(PCIDevice *pci_dev, Error **errp)
|
||||
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
s->nic = qemu_new_nic(&net_sunhme_info, &s->conf,
|
||||
object_get_typename(OBJECT(d)), d->id, s);
|
||||
object_get_typename(OBJECT(d)), d->id,
|
||||
&d->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -983,7 +983,8 @@ static void pci_tulip_realize(PCIDevice *pci_dev, Error **errp)
|
||||
|
||||
s->nic = qemu_new_nic(&net_tulip_info, &s->c,
|
||||
object_get_typename(OBJECT(pci_dev)),
|
||||
pci_dev->qdev.id, s);
|
||||
pci_dev->qdev.id,
|
||||
&pci_dev->qdev.mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->c.macaddr.a);
|
||||
}
|
||||
|
||||
|
||||
+4
-2
@@ -3633,10 +3633,12 @@ static void virtio_net_device_realize(DeviceState *dev, Error **errp)
|
||||
* Happen when virtio_net_set_netclient_name has been called.
|
||||
*/
|
||||
n->nic = qemu_new_nic(&net_virtio_info, &n->nic_conf,
|
||||
n->netclient_type, n->netclient_name, n);
|
||||
n->netclient_type, n->netclient_name,
|
||||
&dev->mem_reentrancy_guard, n);
|
||||
} else {
|
||||
n->nic = qemu_new_nic(&net_virtio_info, &n->nic_conf,
|
||||
object_get_typename(OBJECT(dev)), dev->id, n);
|
||||
object_get_typename(OBJECT(dev)), dev->id,
|
||||
&dev->mem_reentrancy_guard, n);
|
||||
}
|
||||
|
||||
for (i = 0; i < n->max_queue_pairs; i++) {
|
||||
|
||||
+1
-1
@@ -2083,7 +2083,7 @@ static void vmxnet3_net_init(VMXNET3State *s)
|
||||
|
||||
s->nic = qemu_new_nic(&net_vmxnet3_info, &s->conf,
|
||||
object_get_typename(OBJECT(s)),
|
||||
d->id, s);
|
||||
d->id, &d->mem_reentrancy_guard, s);
|
||||
|
||||
s->peer_has_vhdr = vmxnet3_peer_has_vnet_hdr(s);
|
||||
s->tx_sop = true;
|
||||
|
||||
+2
-1
@@ -294,7 +294,8 @@ static int net_init(struct XenLegacyDevice *xendev)
|
||||
}
|
||||
|
||||
netdev->nic = qemu_new_nic(&net_xen_info, &netdev->conf,
|
||||
"xen", NULL, netdev);
|
||||
"xen", NULL,
|
||||
&xendev->qdev.mem_reentrancy_guard, netdev);
|
||||
|
||||
qemu_set_info_str(qemu_get_queue(netdev->nic),
|
||||
"nic: xenbus vif macaddr=%s", netdev->mac);
|
||||
|
||||
+2
-1
@@ -402,7 +402,8 @@ static void xgmac_enet_realize(DeviceState *dev, Error **errp)
|
||||
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
s->nic = qemu_new_nic(&net_xgmac_enet_info, &s->conf,
|
||||
object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
object_get_typename(OBJECT(dev)), dev->id,
|
||||
&dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
|
||||
s->regs[XGMAC_ADDR_HIGH(0)] = (s->conf.macaddr.a[5] << 8) |
|
||||
|
||||
@@ -968,7 +968,8 @@ static void xilinx_enet_realize(DeviceState *dev, Error **errp)
|
||||
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
s->nic = qemu_new_nic(&net_xilinx_enet_info, &s->conf,
|
||||
object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
object_get_typename(OBJECT(dev)), dev->id,
|
||||
&dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
|
||||
tdk_init(&s->TEMAC.phy);
|
||||
|
||||
@@ -235,7 +235,8 @@ static void xilinx_ethlite_realize(DeviceState *dev, Error **errp)
|
||||
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
s->nic = qemu_new_nic(&net_xilinx_ethlite_info, &s->conf,
|
||||
object_get_typename(OBJECT(dev)), dev->id, s);
|
||||
object_get_typename(OBJECT(dev)), dev->id,
|
||||
&dev->mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
}
|
||||
|
||||
|
||||
@@ -217,6 +217,13 @@ static void efuse_realize(DeviceState *dev, Error **errp)
|
||||
}
|
||||
}
|
||||
|
||||
static void efuse_finalize(Object *obj)
|
||||
{
|
||||
XlnxEFuse *s = XLNX_EFUSE(obj);
|
||||
|
||||
g_free(s->ro_bits);
|
||||
}
|
||||
|
||||
static void efuse_prop_set_drive(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
{
|
||||
@@ -273,6 +280,7 @@ static const TypeInfo efuse_info = {
|
||||
.name = TYPE_XLNX_EFUSE,
|
||||
.parent = TYPE_DEVICE,
|
||||
.instance_size = sizeof(XlnxEFuse),
|
||||
.instance_finalize = efuse_finalize,
|
||||
.class_init = efuse_class_init,
|
||||
};
|
||||
|
||||
|
||||
@@ -725,6 +725,13 @@ static void efuse_ctrl_init(Object *obj)
|
||||
sysbus_init_irq(sbd, &s->irq_efuse_imr);
|
||||
}
|
||||
|
||||
static void efuse_ctrl_finalize(Object *obj)
|
||||
{
|
||||
XlnxVersalEFuseCtrl *s = XLNX_VERSAL_EFUSE_CTRL(obj);
|
||||
|
||||
g_free(s->extra_pg0_lock_spec);
|
||||
}
|
||||
|
||||
static const VMStateDescription vmstate_efuse_ctrl = {
|
||||
.name = TYPE_XLNX_VERSAL_EFUSE_CTRL,
|
||||
.version_id = 1,
|
||||
@@ -762,6 +769,7 @@ static const TypeInfo efuse_ctrl_info = {
|
||||
.instance_size = sizeof(XlnxVersalEFuseCtrl),
|
||||
.class_init = efuse_ctrl_class_init,
|
||||
.instance_init = efuse_ctrl_init,
|
||||
.instance_finalize = efuse_ctrl_finalize,
|
||||
};
|
||||
|
||||
static void efuse_ctrl_register_types(void)
|
||||
|
||||
@@ -639,6 +639,7 @@ undo:
|
||||
}
|
||||
dev->msix_vector_use_notifier = NULL;
|
||||
dev->msix_vector_release_notifier = NULL;
|
||||
dev->msix_vector_poll_notifier = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -178,7 +178,6 @@ static void register_vfs(PCIDevice *dev)
|
||||
num_vfs = pci_get_word(dev->config + sriov_cap + PCI_SRIOV_NUM_VF);
|
||||
|
||||
dev->exp.sriov_pf.vf = g_new(PCIDevice *, num_vfs);
|
||||
assert(dev->exp.sriov_pf.vf);
|
||||
|
||||
trace_sriov_register_vfs(dev->name, PCI_SLOT(dev->devfn),
|
||||
PCI_FUNC(dev->devfn), num_vfs);
|
||||
|
||||
@@ -1386,7 +1386,8 @@ static void usb_net_realize(USBDevice *dev, Error **errp)
|
||||
|
||||
qemu_macaddr_default_if_unset(&s->conf.macaddr);
|
||||
s->nic = qemu_new_nic(&net_usbnet_info, &s->conf,
|
||||
object_get_typename(OBJECT(s)), s->dev.qdev.id, s);
|
||||
object_get_typename(OBJECT(s)), s->dev.qdev.id,
|
||||
&s->dev.qdev.mem_reentrancy_guard, s);
|
||||
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
|
||||
snprintf(s->usbstring_mac, sizeof(s->usbstring_mac),
|
||||
"%02x%02x%02x%02x%02x%02x",
|
||||
|
||||
@@ -95,10 +95,18 @@ static void virtio_iommu_pci_instance_init(Object *obj)
|
||||
TYPE_VIRTIO_IOMMU);
|
||||
}
|
||||
|
||||
static void virtio_iommu_pci_instance_finalize(Object *obj)
|
||||
{
|
||||
VirtIOIOMMUPCI *dev = VIRTIO_IOMMU_PCI(obj);
|
||||
|
||||
g_free(dev->vdev.reserved_regions);
|
||||
}
|
||||
|
||||
static const VirtioPCIDeviceTypeInfo virtio_iommu_pci_info = {
|
||||
.generic_name = TYPE_VIRTIO_IOMMU_PCI,
|
||||
.instance_size = sizeof(VirtIOIOMMUPCI),
|
||||
.instance_init = virtio_iommu_pci_instance_init,
|
||||
.instance_finalize = virtio_iommu_pci_instance_finalize,
|
||||
.class_init = virtio_iommu_pci_class_init,
|
||||
};
|
||||
|
||||
|
||||
@@ -2174,6 +2174,7 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t)
|
||||
.parent = t->parent ? t->parent : TYPE_VIRTIO_PCI,
|
||||
.instance_size = t->instance_size,
|
||||
.instance_init = t->instance_init,
|
||||
.instance_finalize = t->instance_finalize,
|
||||
.class_size = t->class_size,
|
||||
.abstract = true,
|
||||
.interfaces = t->interfaces,
|
||||
|
||||
@@ -241,6 +241,7 @@ typedef struct VirtioPCIDeviceTypeInfo {
|
||||
size_t instance_size;
|
||||
size_t class_size;
|
||||
void (*instance_init)(Object *obj);
|
||||
void (*instance_finalize)(Object *obj);
|
||||
void (*class_init)(ObjectClass *klass, void *data);
|
||||
InterfaceInfo *interfaces;
|
||||
} VirtioPCIDeviceTypeInfo;
|
||||
|
||||
@@ -118,6 +118,7 @@ struct NetClientState {
|
||||
typedef struct NICState {
|
||||
NetClientState *ncs;
|
||||
NICConf *conf;
|
||||
MemReentrancyGuard *reentrancy_guard;
|
||||
void *opaque;
|
||||
bool peer_deleted;
|
||||
} NICState;
|
||||
@@ -151,6 +152,7 @@ NICState *qemu_new_nic(NetClientInfo *info,
|
||||
NICConf *conf,
|
||||
const char *model,
|
||||
const char *name,
|
||||
MemReentrancyGuard *reentrancy_guard,
|
||||
void *opaque);
|
||||
void qemu_del_nic(NICState *nic);
|
||||
NetClientState *qemu_get_subqueue(NICState *nic, int queue_index);
|
||||
|
||||
@@ -3001,7 +3001,7 @@ static void load_elf_image(const char *image_name, int image_fd,
|
||||
for (i = 0; i < ehdr->e_phnum; ++i) {
|
||||
struct elf_phdr *eppnt = phdr + i;
|
||||
if (eppnt->p_type == PT_LOAD) {
|
||||
abi_ulong a = eppnt->p_vaddr - eppnt->p_offset;
|
||||
abi_ulong a = eppnt->p_vaddr & TARGET_PAGE_MASK;
|
||||
if (a < loaddr) {
|
||||
loaddr = a;
|
||||
}
|
||||
|
||||
@@ -319,6 +319,7 @@ NICState *qemu_new_nic(NetClientInfo *info,
|
||||
NICConf *conf,
|
||||
const char *model,
|
||||
const char *name,
|
||||
MemReentrancyGuard *reentrancy_guard,
|
||||
void *opaque)
|
||||
{
|
||||
NetClientState **peers = conf->peers.ncs;
|
||||
@@ -331,6 +332,7 @@ NICState *qemu_new_nic(NetClientInfo *info,
|
||||
nic = g_malloc0(info->size + sizeof(NetClientState) * queues);
|
||||
nic->ncs = (void *)nic + info->size;
|
||||
nic->conf = conf;
|
||||
nic->reentrancy_guard = reentrancy_guard,
|
||||
nic->opaque = opaque;
|
||||
|
||||
for (i = 0; i < queues; i++) {
|
||||
@@ -786,6 +788,7 @@ static ssize_t qemu_deliver_packet_iov(NetClientState *sender,
|
||||
int iovcnt,
|
||||
void *opaque)
|
||||
{
|
||||
MemReentrancyGuard *owned_reentrancy_guard;
|
||||
NetClientState *nc = opaque;
|
||||
int ret;
|
||||
|
||||
@@ -798,12 +801,24 @@ static ssize_t qemu_deliver_packet_iov(NetClientState *sender,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (nc->info->type != NET_CLIENT_DRIVER_NIC ||
|
||||
qemu_get_nic(nc)->reentrancy_guard->engaged_in_io) {
|
||||
owned_reentrancy_guard = NULL;
|
||||
} else {
|
||||
owned_reentrancy_guard = qemu_get_nic(nc)->reentrancy_guard;
|
||||
owned_reentrancy_guard->engaged_in_io = true;
|
||||
}
|
||||
|
||||
if (nc->info->receive_iov && !(flags & QEMU_NET_PACKET_FLAG_RAW)) {
|
||||
ret = nc->info->receive_iov(nc, iov, iovcnt);
|
||||
} else {
|
||||
ret = nc_sendv_compat(nc, iov, iovcnt, flags);
|
||||
}
|
||||
|
||||
if (owned_reentrancy_guard) {
|
||||
owned_reentrancy_guard->engaged_in_io = false;
|
||||
}
|
||||
|
||||
if (ret == 0) {
|
||||
nc->receive_disabled = 1;
|
||||
}
|
||||
|
||||
+2
-30
@@ -1326,22 +1326,7 @@ static uint64_t memory_region_ram_device_read(void *opaque,
|
||||
hwaddr addr, unsigned size)
|
||||
{
|
||||
MemoryRegion *mr = opaque;
|
||||
uint64_t data = (uint64_t)~0;
|
||||
|
||||
switch (size) {
|
||||
case 1:
|
||||
data = *(uint8_t *)(mr->ram_block->host + addr);
|
||||
break;
|
||||
case 2:
|
||||
data = *(uint16_t *)(mr->ram_block->host + addr);
|
||||
break;
|
||||
case 4:
|
||||
data = *(uint32_t *)(mr->ram_block->host + addr);
|
||||
break;
|
||||
case 8:
|
||||
data = *(uint64_t *)(mr->ram_block->host + addr);
|
||||
break;
|
||||
}
|
||||
uint64_t data = ldn_he_p(mr->ram_block->host + addr, size);
|
||||
|
||||
trace_memory_region_ram_device_read(get_cpu_index(), mr, addr, data, size);
|
||||
|
||||
@@ -1355,20 +1340,7 @@ static void memory_region_ram_device_write(void *opaque, hwaddr addr,
|
||||
|
||||
trace_memory_region_ram_device_write(get_cpu_index(), mr, addr, data, size);
|
||||
|
||||
switch (size) {
|
||||
case 1:
|
||||
*(uint8_t *)(mr->ram_block->host + addr) = (uint8_t)data;
|
||||
break;
|
||||
case 2:
|
||||
*(uint16_t *)(mr->ram_block->host + addr) = (uint16_t)data;
|
||||
break;
|
||||
case 4:
|
||||
*(uint32_t *)(mr->ram_block->host + addr) = (uint32_t)data;
|
||||
break;
|
||||
case 8:
|
||||
*(uint64_t *)(mr->ram_block->host + addr) = data;
|
||||
break;
|
||||
}
|
||||
stn_he_p(mr->ram_block->host + addr, size, data);
|
||||
}
|
||||
|
||||
static const MemoryRegionOps ram_device_mem_ops = {
|
||||
|
||||
@@ -1498,6 +1498,16 @@ void arm_cpu_finalize_features(ARMCPU *cpu, Error **errp)
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* FEAT_SME is not architecturally dependent on FEAT_SVE (unless
|
||||
* FEAT_SME_FA64 is present). However our implementation currently
|
||||
* assumes it, so if the user asked for sve=off then turn off SME also.
|
||||
* (KVM doesn't currently support SME at all.)
|
||||
*/
|
||||
if (cpu_isar_feature(aa64_sme, cpu) && !cpu_isar_feature(aa64_sve, cpu)) {
|
||||
object_property_set_bool(OBJECT(cpu), "sme", false, &error_abort);
|
||||
}
|
||||
|
||||
arm_cpu_sme_finalize(cpu, &local_err);
|
||||
if (local_err != NULL) {
|
||||
error_propagate(errp, local_err);
|
||||
|
||||
+20
-2
@@ -1431,6 +1431,22 @@ static void pmcr_write(CPUARMState *env, const ARMCPRegInfo *ri,
|
||||
pmu_op_finish(env);
|
||||
}
|
||||
|
||||
static uint64_t pmcr_read(CPUARMState *env, const ARMCPRegInfo *ri)
|
||||
{
|
||||
uint64_t pmcr = env->cp15.c9_pmcr;
|
||||
|
||||
/*
|
||||
* If EL2 is implemented and enabled for the current security state, reads
|
||||
* of PMCR.N from EL1 or EL0 return the value of MDCR_EL2.HPMN or HDCR.HPMN.
|
||||
*/
|
||||
if (arm_current_el(env) <= 1 && arm_is_el2_enabled(env)) {
|
||||
pmcr &= ~PMCRN_MASK;
|
||||
pmcr |= (env->cp15.mdcr_el2 & MDCR_HPMN) << PMCRN_SHIFT;
|
||||
}
|
||||
|
||||
return pmcr;
|
||||
}
|
||||
|
||||
static void pmswinc_write(CPUARMState *env, const ARMCPRegInfo *ri,
|
||||
uint64_t value)
|
||||
{
|
||||
@@ -6499,8 +6515,9 @@ static void define_pmu_regs(ARMCPU *cpu)
|
||||
.access = PL0_RW,
|
||||
.type = ARM_CP_IO | ARM_CP_ALIAS,
|
||||
.fieldoffset = offsetoflow32(CPUARMState, cp15.c9_pmcr),
|
||||
.accessfn = pmreg_access, .writefn = pmcr_write,
|
||||
.raw_writefn = raw_write,
|
||||
.accessfn = pmreg_access,
|
||||
.readfn = pmcr_read, .raw_readfn = raw_read,
|
||||
.writefn = pmcr_write, .raw_writefn = raw_write,
|
||||
};
|
||||
ARMCPRegInfo pmcr64 = {
|
||||
.name = "PMCR_EL0", .state = ARM_CP_STATE_AA64,
|
||||
@@ -6509,6 +6526,7 @@ static void define_pmu_regs(ARMCPU *cpu)
|
||||
.type = ARM_CP_IO,
|
||||
.fieldoffset = offsetof(CPUARMState, cp15.c9_pmcr),
|
||||
.resetvalue = cpu->isar.reset_pmcr_el0,
|
||||
.readfn = pmcr_read, .raw_readfn = raw_read,
|
||||
.writefn = pmcr_write, .raw_writefn = raw_write,
|
||||
};
|
||||
|
||||
|
||||
@@ -1070,10 +1070,9 @@ void HELPER(sme_fmopa_h)(void *vza, void *vzn, void *vzm, void *vpn,
|
||||
|
||||
m = f16mop_adj_pair(m, pcol, 0);
|
||||
*a = f16_dotadd(*a, n, m, &fpst_std, &fpst_odd);
|
||||
|
||||
col += 4;
|
||||
pcol >>= 4;
|
||||
}
|
||||
col += 4;
|
||||
pcol >>= 4;
|
||||
} while (col & 15);
|
||||
}
|
||||
row += 4;
|
||||
@@ -1106,10 +1105,9 @@ void HELPER(sme_bfmopa)(void *vza, void *vzn, void *vzm, void *vpn,
|
||||
|
||||
m = f16mop_adj_pair(m, pcol, 0);
|
||||
*a = bfdotadd(*a, n, m);
|
||||
|
||||
col += 4;
|
||||
pcol >>= 4;
|
||||
}
|
||||
col += 4;
|
||||
pcol >>= 4;
|
||||
} while (col & 15);
|
||||
}
|
||||
row += 4;
|
||||
|
||||
@@ -212,7 +212,7 @@ static inline uint32_t syn_simd_access_trap(int cv, int cond, bool is_16bit)
|
||||
|
||||
static inline uint32_t syn_sve_access_trap(void)
|
||||
{
|
||||
return EC_SVEACCESSTRAP << ARM_EL_EC_SHIFT;
|
||||
return (EC_SVEACCESSTRAP << ARM_EL_EC_SHIFT) | ARM_EL_IL;
|
||||
}
|
||||
|
||||
static inline uint32_t syn_smetrap(SMEExceptionType etype, bool is_16bit)
|
||||
@@ -223,12 +223,12 @@ static inline uint32_t syn_smetrap(SMEExceptionType etype, bool is_16bit)
|
||||
|
||||
static inline uint32_t syn_pactrap(void)
|
||||
{
|
||||
return EC_PACTRAP << ARM_EL_EC_SHIFT;
|
||||
return (EC_PACTRAP << ARM_EL_EC_SHIFT) | ARM_EL_IL;
|
||||
}
|
||||
|
||||
static inline uint32_t syn_btitrap(int btype)
|
||||
{
|
||||
return (EC_BTITRAP << ARM_EL_EC_SHIFT) | btype;
|
||||
return (EC_BTITRAP << ARM_EL_EC_SHIFT) | ARM_EL_IL | btype;
|
||||
}
|
||||
|
||||
static inline uint32_t syn_bxjtrap(int cv, int cond, int rm)
|
||||
|
||||
@@ -31,4 +31,4 @@ class QueryCPUModelExpansion(QemuSystemTest):
|
||||
for c in cpus:
|
||||
model = {'name': c['name']}
|
||||
e = self.vm.command('query-cpu-model-expansion', model=model, type='full')
|
||||
self.assertEquals(e['model']['name'], c['name'])
|
||||
self.assertEqual(e['model']['name'], c['name'])
|
||||
@@ -15,5 +15,5 @@ class EmptyCPUModel(QemuSystemTest):
|
||||
self.vm.set_qmp_monitor(enabled=False)
|
||||
self.vm.launch()
|
||||
self.vm.wait()
|
||||
self.assertEquals(self.vm.exitcode(), 1, "QEMU exit code should be 1")
|
||||
self.assertEqual(self.vm.exitcode(), 1, "QEMU exit code should be 1")
|
||||
self.assertRegex(self.vm.get_log(), r'-cpu option cannot be empty')
|
||||
@@ -32,4 +32,4 @@ class OmittedCPUProps(QemuSystemTest):
|
||||
self.vm.add_args('-smp', '1,sockets=2,cores=2,threads=2,maxcpus=8')
|
||||
self.vm.add_args('-device', 'qemu64-x86_64-cpu,socket-id=1,core-id=0,thread-id=0')
|
||||
self.vm.launch()
|
||||
self.assertEquals(len(self.vm.command('query-cpus-fast')), 2)
|
||||
self.assertEqual(len(self.vm.command('query-cpus-fast')), 2)
|
||||
@@ -21,4 +21,4 @@ class Version(QemuSystemTest):
|
||||
self.vm.launch()
|
||||
res = self.vm.command('human-monitor-command',
|
||||
command_line='info version')
|
||||
self.assertRegexpMatches(res, r'^(\d+\.\d+\.\d)')
|
||||
self.assertRegex(res, r'^(\d+\.\d+\.\d)')
|
||||
@@ -119,94 +119,95 @@ class X86CPUModelAliases(avocado_qemu.QemuSystemTest):
|
||||
|
||||
self.assertFalse(cpus['Cascadelake-Server']['static'],
|
||||
'unversioned Cascadelake-Server CPU model must not be static')
|
||||
self.assertEquals(cpus['Cascadelake-Server'].get('alias-of'), 'Cascadelake-Server-v1',
|
||||
'Cascadelake-Server must be an alias of Cascadelake-Server-v1')
|
||||
self.assertEqual(cpus['Cascadelake-Server'].get('alias-of'),
|
||||
'Cascadelake-Server-v1',
|
||||
'Cascadelake-Server must be an alias of Cascadelake-Server-v1')
|
||||
self.assertNotIn('alias-of', cpus['Cascadelake-Server-v1'],
|
||||
'Cascadelake-Server-v1 must not be an alias')
|
||||
|
||||
self.assertFalse(cpus['qemu64']['static'],
|
||||
'unversioned qemu64 CPU model must not be static')
|
||||
self.assertEquals(cpus['qemu64'].get('alias-of'), 'qemu64-v1',
|
||||
'qemu64 must be an alias of qemu64-v1')
|
||||
self.assertEqual(cpus['qemu64'].get('alias-of'), 'qemu64-v1',
|
||||
'qemu64 must be an alias of qemu64-v1')
|
||||
self.assertNotIn('alias-of', cpus['qemu64-v1'],
|
||||
'qemu64-v1 must not be an alias')
|
||||
|
||||
self.validate_variant_aliases(cpus)
|
||||
|
||||
# On pc-*-4.1, -noTSX and -IBRS models should be aliases:
|
||||
self.assertEquals(cpus["Haswell"].get('alias-of'),
|
||||
"Haswell-v1",
|
||||
self.assertEqual(cpus["Haswell"].get('alias-of'),
|
||||
"Haswell-v1",
|
||||
"Haswell must be an alias")
|
||||
self.assertEquals(cpus["Haswell-noTSX"].get('alias-of'),
|
||||
"Haswell-v2",
|
||||
self.assertEqual(cpus["Haswell-noTSX"].get('alias-of'),
|
||||
"Haswell-v2",
|
||||
"Haswell-noTSX must be an alias")
|
||||
self.assertEquals(cpus["Haswell-IBRS"].get('alias-of'),
|
||||
"Haswell-v3",
|
||||
self.assertEqual(cpus["Haswell-IBRS"].get('alias-of'),
|
||||
"Haswell-v3",
|
||||
"Haswell-IBRS must be an alias")
|
||||
self.assertEquals(cpus["Haswell-noTSX-IBRS"].get('alias-of'),
|
||||
"Haswell-v4",
|
||||
self.assertEqual(cpus["Haswell-noTSX-IBRS"].get('alias-of'),
|
||||
"Haswell-v4",
|
||||
"Haswell-noTSX-IBRS must be an alias")
|
||||
|
||||
self.assertEquals(cpus["Broadwell"].get('alias-of'),
|
||||
"Broadwell-v1",
|
||||
self.assertEqual(cpus["Broadwell"].get('alias-of'),
|
||||
"Broadwell-v1",
|
||||
"Broadwell must be an alias")
|
||||
self.assertEquals(cpus["Broadwell-noTSX"].get('alias-of'),
|
||||
"Broadwell-v2",
|
||||
self.assertEqual(cpus["Broadwell-noTSX"].get('alias-of'),
|
||||
"Broadwell-v2",
|
||||
"Broadwell-noTSX must be an alias")
|
||||
self.assertEquals(cpus["Broadwell-IBRS"].get('alias-of'),
|
||||
"Broadwell-v3",
|
||||
self.assertEqual(cpus["Broadwell-IBRS"].get('alias-of'),
|
||||
"Broadwell-v3",
|
||||
"Broadwell-IBRS must be an alias")
|
||||
self.assertEquals(cpus["Broadwell-noTSX-IBRS"].get('alias-of'),
|
||||
"Broadwell-v4",
|
||||
self.assertEqual(cpus["Broadwell-noTSX-IBRS"].get('alias-of'),
|
||||
"Broadwell-v4",
|
||||
"Broadwell-noTSX-IBRS must be an alias")
|
||||
|
||||
self.assertEquals(cpus["Nehalem"].get('alias-of'),
|
||||
"Nehalem-v1",
|
||||
self.assertEqual(cpus["Nehalem"].get('alias-of'),
|
||||
"Nehalem-v1",
|
||||
"Nehalem must be an alias")
|
||||
self.assertEquals(cpus["Nehalem-IBRS"].get('alias-of'),
|
||||
"Nehalem-v2",
|
||||
self.assertEqual(cpus["Nehalem-IBRS"].get('alias-of'),
|
||||
"Nehalem-v2",
|
||||
"Nehalem-IBRS must be an alias")
|
||||
|
||||
self.assertEquals(cpus["Westmere"].get('alias-of'),
|
||||
"Westmere-v1",
|
||||
self.assertEqual(cpus["Westmere"].get('alias-of'),
|
||||
"Westmere-v1",
|
||||
"Westmere must be an alias")
|
||||
self.assertEquals(cpus["Westmere-IBRS"].get('alias-of'),
|
||||
"Westmere-v2",
|
||||
self.assertEqual(cpus["Westmere-IBRS"].get('alias-of'),
|
||||
"Westmere-v2",
|
||||
"Westmere-IBRS must be an alias")
|
||||
|
||||
self.assertEquals(cpus["SandyBridge"].get('alias-of'),
|
||||
"SandyBridge-v1",
|
||||
self.assertEqual(cpus["SandyBridge"].get('alias-of'),
|
||||
"SandyBridge-v1",
|
||||
"SandyBridge must be an alias")
|
||||
self.assertEquals(cpus["SandyBridge-IBRS"].get('alias-of'),
|
||||
"SandyBridge-v2",
|
||||
self.assertEqual(cpus["SandyBridge-IBRS"].get('alias-of'),
|
||||
"SandyBridge-v2",
|
||||
"SandyBridge-IBRS must be an alias")
|
||||
|
||||
self.assertEquals(cpus["IvyBridge"].get('alias-of'),
|
||||
"IvyBridge-v1",
|
||||
self.assertEqual(cpus["IvyBridge"].get('alias-of'),
|
||||
"IvyBridge-v1",
|
||||
"IvyBridge must be an alias")
|
||||
self.assertEquals(cpus["IvyBridge-IBRS"].get('alias-of'),
|
||||
"IvyBridge-v2",
|
||||
self.assertEqual(cpus["IvyBridge-IBRS"].get('alias-of'),
|
||||
"IvyBridge-v2",
|
||||
"IvyBridge-IBRS must be an alias")
|
||||
|
||||
self.assertEquals(cpus["Skylake-Client"].get('alias-of'),
|
||||
"Skylake-Client-v1",
|
||||
self.assertEqual(cpus["Skylake-Client"].get('alias-of'),
|
||||
"Skylake-Client-v1",
|
||||
"Skylake-Client must be an alias")
|
||||
self.assertEquals(cpus["Skylake-Client-IBRS"].get('alias-of'),
|
||||
"Skylake-Client-v2",
|
||||
self.assertEqual(cpus["Skylake-Client-IBRS"].get('alias-of'),
|
||||
"Skylake-Client-v2",
|
||||
"Skylake-Client-IBRS must be an alias")
|
||||
|
||||
self.assertEquals(cpus["Skylake-Server"].get('alias-of'),
|
||||
"Skylake-Server-v1",
|
||||
self.assertEqual(cpus["Skylake-Server"].get('alias-of'),
|
||||
"Skylake-Server-v1",
|
||||
"Skylake-Server must be an alias")
|
||||
self.assertEquals(cpus["Skylake-Server-IBRS"].get('alias-of'),
|
||||
"Skylake-Server-v2",
|
||||
self.assertEqual(cpus["Skylake-Server-IBRS"].get('alias-of'),
|
||||
"Skylake-Server-v2",
|
||||
"Skylake-Server-IBRS must be an alias")
|
||||
|
||||
self.assertEquals(cpus["EPYC"].get('alias-of'),
|
||||
"EPYC-v1",
|
||||
self.assertEqual(cpus["EPYC"].get('alias-of'),
|
||||
"EPYC-v1",
|
||||
"EPYC must be an alias")
|
||||
self.assertEquals(cpus["EPYC-IBPB"].get('alias-of'),
|
||||
"EPYC-v2",
|
||||
self.assertEqual(cpus["EPYC-IBPB"].get('alias-of'),
|
||||
"EPYC-v2",
|
||||
"EPYC-IBPB must be an alias")
|
||||
|
||||
self.validate_aliases(cpus)
|
||||
|
||||
@@ -84,6 +84,8 @@ echo
|
||||
echo "=== Testing big twoGbMaxExtentFlat ==="
|
||||
_make_test_img -o "subformat=twoGbMaxExtentFlat" 1000G
|
||||
_img_info --format-specific | _filter_img_info --format-specific
|
||||
$QEMU_IO -c "write 990G 512 -P 89" "$TEST_IMG" | _filter_qemu_io
|
||||
$QEMU_IO -c "read 990G 512 -P 89" "$TEST_IMG" | _filter_qemu_io
|
||||
_cleanup_test_img
|
||||
|
||||
echo
|
||||
|
||||
@@ -2032,6 +2032,10 @@ Format specific information:
|
||||
virtual size: 2147483648
|
||||
filename: TEST_DIR/t-f500.IMGFMT
|
||||
format: FLAT
|
||||
wrote 512/512 bytes at offset 1063004405760
|
||||
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
||||
read 512/512 bytes at offset 1063004405760
|
||||
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
||||
|
||||
=== Testing malformed VMFS extent description line ===
|
||||
qemu-img: Could not open 'TEST_DIR/t.IMGFMT': Invalid extent line: RW 12582912 VMFS "dummy.IMGFMT" 1
|
||||
|
||||
@@ -234,6 +234,13 @@ void gd_egl_scanout_texture(DisplayChangeListener *dcl,
|
||||
vc->gfx.h = h;
|
||||
vc->gfx.y0_top = backing_y_0_top;
|
||||
|
||||
if (!vc->gfx.esurface) {
|
||||
gd_egl_init(vc);
|
||||
if (!vc->gfx.esurface) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
eglMakeCurrent(qemu_egl_display, vc->gfx.esurface,
|
||||
vc->gfx.esurface, vc->gfx.ectx);
|
||||
|
||||
|
||||
@@ -69,6 +69,11 @@ static uint8_t *inflate_buffer(uint8_t *in, uint32_t in_len, uint32_t *size)
|
||||
}
|
||||
}
|
||||
|
||||
*size = stream.total_out;
|
||||
inflateEnd(&stream);
|
||||
|
||||
return out;
|
||||
|
||||
err_end:
|
||||
inflateEnd(&stream);
|
||||
err:
|
||||
|
||||
Reference in new issue
Block a user