mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
* IEC units series (Philippe) * Hyper-V PV TLB flush (Vitaly) * git archive detection (Daniel) * host serial passthrough fix (David) * NPT support for SVM emulation (Jan) * x86 "info mem" and "info tlb" fix (Doug) # gpg: Signature made Mon 02 Jul 2018 16:18:21 BST # gpg: using RSA key BFFBD25F78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini/tags/for-upstream: (50 commits) tcg: simplify !CONFIG_TCG handling of tb_invalidate_* i386/monitor.c: make addresses canonical for "info mem" and "info tlb" target-i386: Add NPT support serial: Open non-block bsd-user: Use the IEC binary prefix definitions linux-user: Use the IEC binary prefix definitions tests/crypto: Use the IEC binary prefix definitions vl: Use the IEC binary prefix definitions monitor: Use the IEC binary prefix definitions cutils: Do not include "qemu/units.h" directly hw/rdma: Use the IEC binary prefix definitions hw/virtio: Use the IEC binary prefix definitions hw/vfio: Use the IEC binary prefix definitions hw/sd: Use the IEC binary prefix definitions hw/usb: Use the IEC binary prefix definitions hw/net: Use the IEC binary prefix definitions hw/i386: Use the IEC binary prefix definitions hw/ppc: Use the IEC binary prefix definitions hw/mips: Use the IEC binary prefix definitions hw/mips/r4k: Constify params_size ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
#include "tcg/tcg.h"
|
||||
#include "exec/cpu-common.h"
|
||||
#include "exec/exec-all.h"
|
||||
#include "translate-all.h"
|
||||
|
||||
void tb_flush(CPUState *cpu)
|
||||
{
|
||||
@@ -25,8 +24,3 @@ void tb_flush(CPUState *cpu)
|
||||
void tlb_set_dirty(CPUState *cpu, target_ulong vaddr)
|
||||
{
|
||||
}
|
||||
|
||||
void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end,
|
||||
int is_cpu_write_access)
|
||||
{
|
||||
}
|
||||
|
||||
+3
-4
@@ -50,6 +50,7 @@
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/units.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qobject-input-visitor.h"
|
||||
#include "qapi/qapi-visit-block-core.h"
|
||||
@@ -83,9 +84,6 @@
|
||||
/* Command line option for static images. */
|
||||
#define BLOCK_OPT_STATIC "static"
|
||||
|
||||
#define KiB 1024
|
||||
#define MiB (KiB * KiB)
|
||||
|
||||
#define SECTOR_SIZE 512
|
||||
#define DEFAULT_CLUSTER_SIZE (1 * MiB)
|
||||
|
||||
@@ -434,7 +432,8 @@ static int vdi_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
goto fail;
|
||||
} else if (header.block_size != DEFAULT_CLUSTER_SIZE) {
|
||||
error_setg(errp, "unsupported VDI image (block size %" PRIu32
|
||||
" is not %u)", header.block_size, DEFAULT_CLUSTER_SIZE);
|
||||
" is not %" PRIu64 ")",
|
||||
header.block_size, DEFAULT_CLUSTER_SIZE);
|
||||
ret = -ENOTSUP;
|
||||
goto fail;
|
||||
} else if (header.disk_size >
|
||||
|
||||
+3
-2
@@ -17,6 +17,7 @@
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/units.h"
|
||||
#include "qemu-version.h"
|
||||
#include <machine/trap.h>
|
||||
|
||||
@@ -795,9 +796,9 @@ int main(int argc, char **argv)
|
||||
if (x86_stack_size <= 0)
|
||||
usage();
|
||||
if (*r == 'M')
|
||||
x86_stack_size *= 1024 * 1024;
|
||||
x86_stack_size *= MiB;
|
||||
else if (*r == 'k' || *r == 'K')
|
||||
x86_stack_size *= 1024;
|
||||
x86_stack_size *= KiB;
|
||||
} else if (!strcmp(r, "L")) {
|
||||
interp_prefix = argv[optind++];
|
||||
} else if (!strcmp(r, "p")) {
|
||||
|
||||
@@ -265,7 +265,8 @@ static void qmp_chardev_open_serial(Chardev *chr,
|
||||
ChardevHostdev *serial = backend->u.serial.data;
|
||||
int fd;
|
||||
|
||||
fd = qmp_chardev_open_file_source(serial->device, O_RDWR, errp);
|
||||
fd = qmp_chardev_open_file_source(serial->device, O_RDWR | O_NONBLOCK,
|
||||
errp);
|
||||
if (fd < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -300,6 +300,24 @@ then
|
||||
else
|
||||
git_update=no
|
||||
git_submodules=""
|
||||
|
||||
if ! test -f "$source_path/ui/keycodemapdb/README"
|
||||
then
|
||||
echo
|
||||
echo "ERROR: missing file $source_path/ui/keycodemapdb/README"
|
||||
echo
|
||||
echo "This is not a GIT checkout but module content appears to"
|
||||
echo "be missing. Do not use 'git archive' or GitHub download links"
|
||||
echo "to acquire QEMU source archives. Non-GIT builds are only"
|
||||
echo "supported with source archives linked from:"
|
||||
echo
|
||||
echo " https://www.qemu.org/download/"
|
||||
echo
|
||||
echo "Developers working with GIT can use scripts/archive-source.sh"
|
||||
echo "if they need to create valid source archives."
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
git="git"
|
||||
|
||||
|
||||
@@ -1027,7 +1027,7 @@ const char *parse_cpu_model(const char *cpu_model)
|
||||
return cpu_type;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_USER_ONLY) || !defined(CONFIG_TCG)
|
||||
#if defined(CONFIG_USER_ONLY)
|
||||
void tb_invalidate_phys_addr(target_ulong addr)
|
||||
{
|
||||
mmap_lock();
|
||||
@@ -1046,6 +1046,10 @@ void tb_invalidate_phys_addr(AddressSpace *as, hwaddr addr, MemTxAttrs attrs)
|
||||
MemoryRegion *mr;
|
||||
hwaddr l = 1;
|
||||
|
||||
if (!tcg_enabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
rcu_read_lock();
|
||||
mr = address_space_translate(as, addr, &addr, &l, false, attrs);
|
||||
if (!(memory_region_is_ram(mr)
|
||||
|
||||
+8
-9
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/units.h"
|
||||
#include "qapi/error.h"
|
||||
#include "cpu.h"
|
||||
#include "hw/hw.h"
|
||||
@@ -813,8 +814,6 @@ PCIBus *typhoon_init(ram_addr_t ram_size, ISABus **isa_bus,
|
||||
qemu_irq *p_rtc_irq,
|
||||
AlphaCPU *cpus[4], pci_map_irq_fn sys_map_irq)
|
||||
{
|
||||
const uint64_t MB = 1024 * 1024;
|
||||
const uint64_t GB = 1024 * MB;
|
||||
MemoryRegion *addr_space = get_system_memory();
|
||||
DeviceState *dev;
|
||||
TyphoonState *s;
|
||||
@@ -855,30 +854,30 @@ PCIBus *typhoon_init(ram_addr_t ram_size, ISABus **isa_bus,
|
||||
|
||||
/* Pchip0 CSRs, 0x801.8000.0000, 256MB. */
|
||||
memory_region_init_io(&s->pchip.region, OBJECT(s), &pchip_ops, s, "pchip0",
|
||||
256*MB);
|
||||
256 * MiB);
|
||||
memory_region_add_subregion(addr_space, 0x80180000000ULL,
|
||||
&s->pchip.region);
|
||||
|
||||
/* Cchip CSRs, 0x801.A000.0000, 256MB. */
|
||||
memory_region_init_io(&s->cchip.region, OBJECT(s), &cchip_ops, s, "cchip0",
|
||||
256*MB);
|
||||
256 * MiB);
|
||||
memory_region_add_subregion(addr_space, 0x801a0000000ULL,
|
||||
&s->cchip.region);
|
||||
|
||||
/* Dchip CSRs, 0x801.B000.0000, 256MB. */
|
||||
memory_region_init_io(&s->dchip_region, OBJECT(s), &dchip_ops, s, "dchip0",
|
||||
256*MB);
|
||||
256 * MiB);
|
||||
memory_region_add_subregion(addr_space, 0x801b0000000ULL,
|
||||
&s->dchip_region);
|
||||
|
||||
/* Pchip0 PCI memory, 0x800.0000.0000, 4GB. */
|
||||
memory_region_init(&s->pchip.reg_mem, OBJECT(s), "pci0-mem", 4*GB);
|
||||
memory_region_init(&s->pchip.reg_mem, OBJECT(s), "pci0-mem", 4 * GiB);
|
||||
memory_region_add_subregion(addr_space, 0x80000000000ULL,
|
||||
&s->pchip.reg_mem);
|
||||
|
||||
/* Pchip0 PCI I/O, 0x801.FC00.0000, 32MB. */
|
||||
memory_region_init_io(&s->pchip.reg_io, OBJECT(s), &alpha_pci_ignore_ops,
|
||||
NULL, "pci0-io", 32*MB);
|
||||
NULL, "pci0-io", 32 * MiB);
|
||||
memory_region_add_subregion(addr_space, 0x801fc000000ULL,
|
||||
&s->pchip.reg_io);
|
||||
|
||||
@@ -899,13 +898,13 @@ PCIBus *typhoon_init(ram_addr_t ram_size, ISABus **isa_bus,
|
||||
|
||||
/* Pchip0 PCI special/interrupt acknowledge, 0x801.F800.0000, 64MB. */
|
||||
memory_region_init_io(&s->pchip.reg_iack, OBJECT(s), &alpha_pci_iack_ops,
|
||||
b, "pci0-iack", 64*MB);
|
||||
b, "pci0-iack", 64 * MiB);
|
||||
memory_region_add_subregion(addr_space, 0x801f8000000ULL,
|
||||
&s->pchip.reg_iack);
|
||||
|
||||
/* Pchip0 PCI configuration, 0x801.FE00.0000, 16MB. */
|
||||
memory_region_init_io(&s->pchip.reg_conf, OBJECT(s), &alpha_pci_conf1_ops,
|
||||
b, "pci0-conf", 16*MB);
|
||||
b, "pci0-conf", 16 * MiB);
|
||||
memory_region_add_subregion(addr_space, 0x801fe000000ULL,
|
||||
&s->pchip.reg_conf);
|
||||
|
||||
|
||||
+3
-3
@@ -23,13 +23,13 @@
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/units.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu-common.h"
|
||||
#include "hw/arm/arm.h"
|
||||
#include "exec/address-spaces.h"
|
||||
#include "hw/char/serial.h"
|
||||
#include "hw/boards.h"
|
||||
#include "qemu/cutils.h"
|
||||
#include "hw/arm/msf2-soc.h"
|
||||
#include "hw/misc/unimp.h"
|
||||
|
||||
@@ -40,14 +40,14 @@
|
||||
|
||||
#define SRAM_BASE_ADDRESS 0x20000000
|
||||
|
||||
#define MSF2_ENVM_MAX_SIZE (512 * K_BYTE)
|
||||
#define MSF2_ENVM_MAX_SIZE (512 * KiB)
|
||||
|
||||
/*
|
||||
* eSRAM max size is 80k without SECDED(Single error correction and
|
||||
* dual error detection) feature and 64k with SECDED.
|
||||
* We do not support SECDED now.
|
||||
*/
|
||||
#define MSF2_ESRAM_MAX_SIZE (80 * K_BYTE)
|
||||
#define MSF2_ESRAM_MAX_SIZE (80 * KiB)
|
||||
|
||||
static const uint32_t spi_addr[MSF2_NUM_SPIS] = { 0x40001000 , 0x40011000 };
|
||||
static const uint32_t uart_addr[MSF2_NUM_UARTS] = { 0x40000000 , 0x40010000 };
|
||||
|
||||
+4
-4
@@ -23,20 +23,20 @@
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/units.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "hw/boards.h"
|
||||
#include "hw/arm/arm.h"
|
||||
#include "exec/address-spaces.h"
|
||||
#include "qemu/cutils.h"
|
||||
#include "hw/arm/msf2-soc.h"
|
||||
#include "cpu.h"
|
||||
|
||||
#define DDR_BASE_ADDRESS 0xA0000000
|
||||
#define DDR_SIZE (64 * M_BYTE)
|
||||
#define DDR_SIZE (64 * MiB)
|
||||
|
||||
#define M2S010_ENVM_SIZE (256 * K_BYTE)
|
||||
#define M2S010_ESRAM_SIZE (64 * K_BYTE)
|
||||
#define M2S010_ENVM_SIZE (256 * KiB)
|
||||
#define M2S010_ESRAM_SIZE (64 * KiB)
|
||||
|
||||
static void emcraft_sf2_s2s010_init(MachineState *machine)
|
||||
{
|
||||
|
||||
+3
-2
@@ -22,6 +22,7 @@
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/units.h"
|
||||
#include "hw/hw.h"
|
||||
#include "sysemu/block-backend.h"
|
||||
#include "hw/ssi/ssi.h"
|
||||
@@ -541,12 +542,12 @@ static void flash_erase(Flash *s, int offset, FlashCMD cmd)
|
||||
switch (cmd) {
|
||||
case ERASE_4K:
|
||||
case ERASE4_4K:
|
||||
len = 4 << 10;
|
||||
len = 4 * KiB;
|
||||
capa_to_assert = ER_4K;
|
||||
break;
|
||||
case ERASE_32K:
|
||||
case ERASE4_32K:
|
||||
len = 32 << 10;
|
||||
len = 32 * KiB;
|
||||
capa_to_assert = ER_32K;
|
||||
break;
|
||||
case ERASE_SECTOR:
|
||||
|
||||
+2
-1
@@ -26,6 +26,7 @@
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/units.h"
|
||||
#include "hw/block/block.h"
|
||||
#include "hw/hw.h"
|
||||
#include "hw/pci/msix.h"
|
||||
@@ -649,7 +650,7 @@ static uint16_t nvme_identify_ns(NvmeCtrl *n, NvmeIdentify *c)
|
||||
|
||||
static uint16_t nvme_identify_nslist(NvmeCtrl *n, NvmeIdentify *c)
|
||||
{
|
||||
static const int data_len = 4096;
|
||||
static const int data_len = 4 * KiB;
|
||||
uint32_t min_nsid = le32_to_cpu(c->nsid);
|
||||
uint64_t prp1 = le64_to_cpu(c->prp1);
|
||||
uint64_t prp2 = le64_to_cpu(c->prp2);
|
||||
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/units.h"
|
||||
#include "hw/hw.h"
|
||||
#include "hw/sh4/sh.h"
|
||||
#include "hw/loader.h"
|
||||
@@ -26,7 +27,7 @@ typedef struct {
|
||||
|
||||
static tc58128_dev tc58128_devs[2];
|
||||
|
||||
#define FLASH_SIZE (16*1024*1024)
|
||||
#define FLASH_SIZE (16 * MiB)
|
||||
|
||||
static void init_dev(tc58128_dev * dev, const char *filename)
|
||||
{
|
||||
|
||||
+2
-1
@@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/units.h"
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/uio.h>
|
||||
|
||||
@@ -814,7 +815,7 @@ static int blk_connect(struct XenDevice *xendev)
|
||||
xen_pv_printf(xendev, 1, "type \"%s\", fileproto \"%s\", filename \"%s\","
|
||||
" size %" PRId64 " (%" PRId64 " MB)\n",
|
||||
blkdev->type, blkdev->fileproto, blkdev->filename,
|
||||
blkdev->file_size, blkdev->file_size >> 20);
|
||||
blkdev->file_size, blkdev->file_size / MiB);
|
||||
|
||||
/* Fill in number of sector size and number of sectors */
|
||||
xenstore_write_be_int(xendev, "sector-size", blkdev->file_blk);
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/units.h"
|
||||
#include "exec/memory.h"
|
||||
#include "hw/loader.h"
|
||||
#include "hw/loader-fit.h"
|
||||
@@ -194,7 +195,7 @@ static int fit_load_fdt(const struct fit_loader *ldr, const void *itb,
|
||||
|
||||
err = fit_image_addr(itb, img_off, "load", &load_addr);
|
||||
if (err == -ENOENT) {
|
||||
load_addr = ROUND_UP(kernel_end, 64 * K_BYTE) + (10 * M_BYTE);
|
||||
load_addr = ROUND_UP(kernel_end, 64 * KiB) + (10 * MiB);
|
||||
} else if (err) {
|
||||
ret = err;
|
||||
goto out;
|
||||
|
||||
+2
-2
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/units.h"
|
||||
#include "hw/boards.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-visit-common.h"
|
||||
@@ -19,7 +20,6 @@
|
||||
#include "sysemu/sysemu.h"
|
||||
#include "sysemu/numa.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qemu/cutils.h"
|
||||
#include "sysemu/qtest.h"
|
||||
|
||||
static char *machine_get_accel(Object *obj, Error **errp)
|
||||
@@ -522,7 +522,7 @@ static void machine_class_init(ObjectClass *oc, void *data)
|
||||
MachineClass *mc = MACHINE_CLASS(oc);
|
||||
|
||||
/* Default 128 MB as guest ram size */
|
||||
mc->default_ram_size = 128 * M_BYTE;
|
||||
mc->default_ram_size = 128 * MiB;
|
||||
mc->rom_file_has_mr = true;
|
||||
|
||||
/* numa node memory size aligned on 8MB by default.
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/units.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu-common.h"
|
||||
#include "cpu.h"
|
||||
@@ -242,7 +243,7 @@ static const MemoryRegionOps gpio_ops = {
|
||||
},
|
||||
};
|
||||
|
||||
#define INTMEM_SIZE (128 * 1024)
|
||||
#define INTMEM_SIZE (128 * KiB)
|
||||
|
||||
static struct cris_load_info li;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
* See the COPYING file in the top-level directory.
|
||||
*/
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/units.h"
|
||||
#include "hw/hw.h"
|
||||
#include "hw/pci/pci.h"
|
||||
#include "hw/display/bochs-vbe.h"
|
||||
@@ -70,7 +71,7 @@ static uint64_t bochs_display_vbe_read(void *ptr, hwaddr addr,
|
||||
case VBE_DISPI_INDEX_ID:
|
||||
return VBE_DISPI_ID5;
|
||||
case VBE_DISPI_INDEX_VIDEO_MEMORY_64K:
|
||||
return s->vgamem / (64 * 1024);
|
||||
return s->vgamem / (64 * KiB);
|
||||
}
|
||||
|
||||
if (index >= ARRAY_SIZE(s->vbe_regs)) {
|
||||
@@ -258,10 +259,10 @@ static void bochs_display_realize(PCIDevice *dev, Error **errp)
|
||||
|
||||
s->con = graphic_console_init(DEVICE(dev), 0, &bochs_display_gfx_ops, s);
|
||||
|
||||
if (s->vgamem < (4 * 1024 * 1024)) {
|
||||
if (s->vgamem < 4 * MiB) {
|
||||
error_setg(errp, "bochs-display: video memory too small");
|
||||
}
|
||||
if (s->vgamem > (256 * 1024 * 1024)) {
|
||||
if (s->vgamem > 256 * MiB) {
|
||||
error_setg(errp, "bochs-display: video memory too big");
|
||||
}
|
||||
s->vgamem = pow2ceil(s->vgamem);
|
||||
@@ -323,7 +324,7 @@ static void bochs_display_exit(PCIDevice *dev)
|
||||
}
|
||||
|
||||
static Property bochs_display_properties[] = {
|
||||
DEFINE_PROP_SIZE("vgamem", BochsDisplayState, vgamem, 16 * 1024 * 1024),
|
||||
DEFINE_PROP_SIZE("vgamem", BochsDisplayState, vgamem, 16 * MiB),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
* available at http://home.worldonline.dk/~finth/
|
||||
*/
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/units.h"
|
||||
#include "qapi/error.h"
|
||||
#include "trace.h"
|
||||
#include "hw/hw.h"
|
||||
@@ -2218,7 +2219,7 @@ static inline void cirrus_cursor_compute_yrange(CirrusVGAState *s)
|
||||
uint32_t content;
|
||||
int y, y_min, y_max;
|
||||
|
||||
src = s->vga.vram_ptr + s->real_vram_size - 16 * 1024;
|
||||
src = s->vga.vram_ptr + s->real_vram_size - 16 * KiB;
|
||||
if (s->vga.sr[0x12] & CIRRUS_CURSOR_LARGE) {
|
||||
src += (s->vga.sr[0x13] & 0x3c) * 256;
|
||||
y_min = 64;
|
||||
@@ -2347,7 +2348,7 @@ static void cirrus_cursor_draw_line(VGACommonState *s1, uint8_t *d1, int scr_y)
|
||||
return;
|
||||
}
|
||||
|
||||
src = s->vga.vram_ptr + s->real_vram_size - 16 * 1024;
|
||||
src = s->vga.vram_ptr + s->real_vram_size - 16 * KiB;
|
||||
if (s->vga.sr[0x12] & CIRRUS_CURSOR_LARGE) {
|
||||
src += (s->vga.sr[0x13] & 0x3c) * 256;
|
||||
src += (scr_y - s->vga.hw_cursor_y) * 16;
|
||||
@@ -2995,8 +2996,7 @@ static void cirrus_init_common(CirrusVGAState *s, Object *owner,
|
||||
|
||||
/* I/O handler for LFB */
|
||||
memory_region_init_io(&s->cirrus_linear_io, owner, &cirrus_linear_io_ops, s,
|
||||
"cirrus-linear-io", s->vga.vram_size_mb
|
||||
* 1024 * 1024);
|
||||
"cirrus-linear-io", s->vga.vram_size_mb * MiB);
|
||||
memory_region_set_flush_coalesced(&s->cirrus_linear_io);
|
||||
|
||||
/* I/O handler for LFB */
|
||||
@@ -3013,7 +3013,7 @@ static void cirrus_init_common(CirrusVGAState *s, Object *owner,
|
||||
memory_region_set_flush_coalesced(&s->cirrus_mmio_io);
|
||||
|
||||
s->real_vram_size =
|
||||
(s->device_id == CIRRUS_ID_CLGD5446) ? 4096 * 1024 : 2048 * 1024;
|
||||
(s->device_id == CIRRUS_ID_CLGD5446) ? 4 * MiB : 2 * MiB;
|
||||
|
||||
/* XXX: s->vga.vram_size must be a power of two */
|
||||
s->cirrus_addr_mask = s->real_vram_size - 1;
|
||||
|
||||
+2
-2
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/units.h"
|
||||
#include "hw/hw.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "ui/console.h"
|
||||
@@ -510,8 +511,7 @@ static void g364fb_sysbus_reset(DeviceState *d)
|
||||
}
|
||||
|
||||
static Property g364fb_sysbus_properties[] = {
|
||||
DEFINE_PROP_UINT32("vram_size", G364SysBusState, g364.vram_size,
|
||||
8 * 1024 * 1024),
|
||||
DEFINE_PROP_UINT32("vram_size", G364SysBusState, g364.vram_size, 8 * MiB),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
|
||||
+14
-16
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/units.h"
|
||||
#include <zlib.h>
|
||||
|
||||
#include "qapi/error.h"
|
||||
@@ -2012,11 +2013,11 @@ static void qxl_init_ramsize(PCIQXLDevice *qxl)
|
||||
if (qxl->vgamem_size_mb > 256) {
|
||||
qxl->vgamem_size_mb = 256;
|
||||
}
|
||||
qxl->vgamem_size = qxl->vgamem_size_mb * 1024 * 1024;
|
||||
qxl->vgamem_size = qxl->vgamem_size_mb * MiB;
|
||||
|
||||
/* vga ram (bar 0, total) */
|
||||
if (qxl->ram_size_mb != -1) {
|
||||
qxl->vga.vram_size = qxl->ram_size_mb * 1024 * 1024;
|
||||
qxl->vga.vram_size = qxl->ram_size_mb * MiB;
|
||||
}
|
||||
if (qxl->vga.vram_size < qxl->vgamem_size * 2) {
|
||||
qxl->vga.vram_size = qxl->vgamem_size * 2;
|
||||
@@ -2024,7 +2025,7 @@ static void qxl_init_ramsize(PCIQXLDevice *qxl)
|
||||
|
||||
/* vram32 (surfaces, 32bit, bar 1) */
|
||||
if (qxl->vram32_size_mb != -1) {
|
||||
qxl->vram32_size = qxl->vram32_size_mb * 1024 * 1024;
|
||||
qxl->vram32_size = qxl->vram32_size_mb * MiB;
|
||||
}
|
||||
if (qxl->vram32_size < 4096) {
|
||||
qxl->vram32_size = 4096;
|
||||
@@ -2032,7 +2033,7 @@ static void qxl_init_ramsize(PCIQXLDevice *qxl)
|
||||
|
||||
/* vram (surfaces, 64bit, bar 4+5) */
|
||||
if (qxl->vram_size_mb != -1) {
|
||||
qxl->vram_size = (uint64_t)qxl->vram_size_mb * 1024 * 1024;
|
||||
qxl->vram_size = (uint64_t)qxl->vram_size_mb * MiB;
|
||||
}
|
||||
if (qxl->vram_size < qxl->vram32_size) {
|
||||
qxl->vram_size = qxl->vram32_size;
|
||||
@@ -2134,13 +2135,12 @@ static void qxl_realize_common(PCIQXLDevice *qxl, Error **errp)
|
||||
}
|
||||
|
||||
/* print pci bar details */
|
||||
dprint(qxl, 1, "ram/%s: %d MB [region 0]\n",
|
||||
qxl->id == 0 ? "pri" : "sec",
|
||||
qxl->vga.vram_size / (1024*1024));
|
||||
dprint(qxl, 1, "vram/32: %" PRIx64 "d MB [region 1]\n",
|
||||
qxl->vram32_size / (1024*1024));
|
||||
dprint(qxl, 1, "vram/64: %" PRIx64 "d MB %s\n",
|
||||
qxl->vram_size / (1024*1024),
|
||||
dprint(qxl, 1, "ram/%s: %" PRId64 " MB [region 0]\n",
|
||||
qxl->id == 0 ? "pri" : "sec", qxl->vga.vram_size / MiB);
|
||||
dprint(qxl, 1, "vram/32: %" PRIx64 " MB [region 1]\n",
|
||||
qxl->vram32_size / MiB);
|
||||
dprint(qxl, 1, "vram/64: %" PRIx64 " MB %s\n",
|
||||
qxl->vram_size / MiB,
|
||||
qxl->vram32_size < qxl->vram_size ? "[region 4]" : "[unmapped]");
|
||||
|
||||
qxl->ssd.qxl.base.sif = &qxl_interface.base;
|
||||
@@ -2167,7 +2167,7 @@ static void qxl_realize_primary(PCIDevice *dev, Error **errp)
|
||||
qxl->id = 0;
|
||||
qxl_init_ramsize(qxl);
|
||||
vga->vbe_size = qxl->vgamem_size;
|
||||
vga->vram_size_mb = qxl->vga.vram_size >> 20;
|
||||
vga->vram_size_mb = qxl->vga.vram_size / MiB;
|
||||
vga_common_init(vga, OBJECT(dev), true);
|
||||
vga_init(vga, OBJECT(dev),
|
||||
pci_address_space(dev), pci_address_space_io(dev), false);
|
||||
@@ -2391,10 +2391,8 @@ static VMStateDescription qxl_vmstate = {
|
||||
};
|
||||
|
||||
static Property qxl_properties[] = {
|
||||
DEFINE_PROP_UINT32("ram_size", PCIQXLDevice, vga.vram_size,
|
||||
64 * 1024 * 1024),
|
||||
DEFINE_PROP_UINT64("vram_size", PCIQXLDevice, vram32_size,
|
||||
64 * 1024 * 1024),
|
||||
DEFINE_PROP_UINT32("ram_size", PCIQXLDevice, vga.vram_size, 64 * MiB),
|
||||
DEFINE_PROP_UINT64("vram_size", PCIQXLDevice, vram32_size, 64 * MiB),
|
||||
DEFINE_PROP_UINT32("revision", PCIQXLDevice, revision,
|
||||
QXL_DEFAULT_REVISION),
|
||||
DEFINE_PROP_UINT32("debug", PCIQXLDevice, debug, 0),
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user