Trivial Patches Pull request 20201013

-----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEEzS913cjjpNwuT1Fz8ww4vT8vvjwFAl+FlGcSHGxhdXJlbnRA
 dml2aWVyLmV1AAoJEPMMOL0/L748eJgQALXBL9j942qnCFfwntG/lm1ZABAjHxMb
 6oRt7J6+iKImOuZrZ8m87ET90sO+dPl3u+L9mq7BfaM2vewarwSSIYFrfyTO2Acf
 sFzKCfBC/mJJBzI0AqvV3caHGCxFhhzCxPO25JPC2yxgyHxTvG3k0krs5C6Wv9BF
 nHQPE9PZHguLpvJSH8Wmr70rdCbAOHwaIxkVIN9au/1nVktvPk9vPSjZVFpoMQRA
 gwIRb+Lo0Chqb9DY2Ino/0AFAMV8CbfopLZt8r8pg3mGFdh2U/KEkmtxDTYdVdbr
 d2LDAhiNP7C9SNRF7VyFcW21YpWOjWG+vzYnPl5KKces1fAbrseTD8fcNrqf5JZc
 ont2DdpmGZ+reE3ekyoT2YBk4tz3wGtCDoN19QAwFIvVYRyZW52HLg5zCNb2hq4T
 1/J5BQvhPxpbY7hFN6QkQa6i2e6EB2kqtrL/H3pjrw8CLAhQ2ZviCZvyLRpv26w/
 OzY5+u2GMdo27+EBqxkbpgZO86GWAhPPzqq4Rnd+wMcttTIHbyqALHIdAaqKz29T
 4fVF/nULBJcZL8srz+QdU7xlW9ETbZ+fyTWEo0ZZZnntNlD4ZzQB7HVt8d/kNoC6
 wR0I+gt/QAvlPIIP8pWa3MXKYcFNNXGWH2p0WK+jNUDVk7NnNkYkgBQigLPZw973
 uOHb/cR9lyrN
 =qJdy
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-for-5.2-pull-request' into staging

Trivial Patches Pull request 20201013

# gpg: Signature made Tue 13 Oct 2020 12:49:59 BST
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "laurent@vivier.eu"
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/trivial-branch-for-5.2-pull-request:
  meson.build: drop duplicate 'sparc64' entry
  mingw: fix error __USE_MINGW_ANSI_STDIO redefined
  target/sparc/int32_helper: Remove duplicated 'Tag Overflow' entry
  goldfish_rtc: change MemoryRegionOps endianness to DEVICE_NATIVE_ENDIAN
  hw/char/serial: remove duplicate .class_init in serial_mm_info
  block/blkdebug: fix memory leak
  hw/pci: Fix typo in PCI hot-plug error message
  softmmu/memory: Log invalid memory accesses
  hw/acpi/piix4: Rename piix4_pm_add_propeties() to piix4_pm_add_properties()
  vmdk: fix maybe uninitialized warnings
  tests/test-char: Use a proper fallthrough comment
  hw/block/nvme: Simplify timestamp sum
  target/i386/cpu: Update comment that mentions Texinfo
  qemu-img-cmds.hx: Update comment that mentions Texinfo

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2020-10-13 14:06:21 +01:00
commit 96292515c0
16 changed files with 34 additions and 23 deletions

View File

@ -215,6 +215,7 @@ static int add_rule(void *opaque, QemuOpts *opts, Error **errp)
BLKDEBUG_IO_TYPE__MAX, &local_error); BLKDEBUG_IO_TYPE__MAX, &local_error);
if (local_error) { if (local_error) {
error_propagate(errp, local_error); error_propagate(errp, local_error);
g_free(rule);
return -1; return -1;
} }
if (iotype != BLKDEBUG_IO_TYPE__MAX) { if (iotype != BLKDEBUG_IO_TYPE__MAX) {

View File

@ -595,7 +595,7 @@ static int vmdk_open_vmfs_sparse(BlockDriverState *bs,
int ret; int ret;
uint32_t magic; uint32_t magic;
VMDK3Header header; VMDK3Header header;
VmdkExtent *extent; VmdkExtent *extent = NULL;
ret = bdrv_pread(file, sizeof(magic), &header, sizeof(header)); ret = bdrv_pread(file, sizeof(magic), &header, sizeof(header));
if (ret < 0) { if (ret < 0) {
@ -751,7 +751,7 @@ static int vmdk_open_se_sparse(BlockDriverState *bs,
int ret; int ret;
VMDKSESparseConstHeader const_header; VMDKSESparseConstHeader const_header;
VMDKSESparseVolatileHeader volatile_header; VMDKSESparseVolatileHeader volatile_header;
VmdkExtent *extent; VmdkExtent *extent = NULL;
ret = bdrv_apply_auto_read_only(bs, ret = bdrv_apply_auto_read_only(bs,
"No write support for seSparse images available", errp); "No write support for seSparse images available", errp);
@ -869,7 +869,7 @@ static int vmdk_open_vmdk4(BlockDriverState *bs,
uint32_t magic; uint32_t magic;
uint32_t l1_size, l1_entry_sectors; uint32_t l1_size, l1_entry_sectors;
VMDK4Header header; VMDK4Header header;
VmdkExtent *extent; VmdkExtent *extent = NULL;
BDRVVmdkState *s = bs->opaque; BDRVVmdkState *s = bs->opaque;
int64_t l1_backup_offset = 0; int64_t l1_backup_offset = 0;
bool compressed; bool compressed;
@ -1088,7 +1088,7 @@ static int vmdk_parse_extents(const char *desc, BlockDriverState *bs,
BdrvChild *extent_file; BdrvChild *extent_file;
BdrvChildRole extent_role; BdrvChildRole extent_role;
BDRVVmdkState *s = bs->opaque; BDRVVmdkState *s = bs->opaque;
VmdkExtent *extent; VmdkExtent *extent = NULL;
char extent_opt_prefix[32]; char extent_opt_prefix[32];
Error *local_err = NULL; Error *local_err = NULL;

View File

@ -437,7 +437,7 @@ static void piix4_pm_machine_ready(Notifier *n, void *opaque)
(memory_region_present(io_as, 0x2f8) ? 0x90 : 0); (memory_region_present(io_as, 0x2f8) ? 0x90 : 0);
} }
static void piix4_pm_add_propeties(PIIX4PMState *s) static void piix4_pm_add_properties(PIIX4PMState *s)
{ {
static const uint8_t acpi_enable_cmd = ACPI_ENABLE; static const uint8_t acpi_enable_cmd = ACPI_ENABLE;
static const uint8_t acpi_disable_cmd = ACPI_DISABLE; static const uint8_t acpi_disable_cmd = ACPI_DISABLE;
@ -509,7 +509,7 @@ static void piix4_pm_realize(PCIDevice *dev, Error **errp)
pci_get_bus(dev), s); pci_get_bus(dev), s);
qbus_set_hotplug_handler(BUS(pci_get_bus(dev)), OBJECT(s)); qbus_set_hotplug_handler(BUS(pci_get_bus(dev)), OBJECT(s));
piix4_pm_add_propeties(s); piix4_pm_add_properties(s);
} }
I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base,

View File

@ -1280,12 +1280,7 @@ static inline uint64_t nvme_get_timestamp(const NvmeCtrl *n)
union nvme_timestamp ts; union nvme_timestamp ts;
ts.all = 0; ts.all = 0;
ts.timestamp = n->host_timestamp + elapsed_time;
/*
* If the sum of the Timestamp value set by the host and the elapsed
* time exceeds 2^48, the value returned should be reduced modulo 2^48.
*/
ts.timestamp = (n->host_timestamp + elapsed_time) & 0xffffffffffff;
/* If the host timestamp is non-zero, set the timestamp origin */ /* If the host timestamp is non-zero, set the timestamp origin */
ts.origin = n->host_timestamp ? 0x01 : 0x00; ts.origin = n->host_timestamp ? 0x01 : 0x00;

View File

@ -1120,7 +1120,6 @@ static const TypeInfo serial_mm_info = {
.class_init = serial_mm_class_init, .class_init = serial_mm_class_init,
.instance_init = serial_mm_instance_init, .instance_init = serial_mm_instance_init,
.instance_size = sizeof(SerialMM), .instance_size = sizeof(SerialMM),
.class_init = serial_mm_class_init,
}; };
static void serial_register_types(void) static void serial_register_types(void)

View File

@ -1036,7 +1036,7 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev,
return NULL; return NULL;
} else if (dev->hotplugged && } else if (dev->hotplugged &&
pci_get_function_0(pci_dev)) { pci_get_function_0(pci_dev)) {
error_setg(errp, "PCI: slot %d function 0 already ocuppied by %s," error_setg(errp, "PCI: slot %d function 0 already occupied by %s,"
" new func %s cannot be exposed to guest.", " new func %s cannot be exposed to guest.",
PCI_SLOT(pci_get_function_0(pci_dev)->devfn), PCI_SLOT(pci_get_function_0(pci_dev)->devfn),
pci_get_function_0(pci_dev)->name, pci_get_function_0(pci_dev)->name,

View File

@ -1571,7 +1571,7 @@ static void spapr_pci_plug(HotplugHandler *plug_handler,
*/ */
if (plugged_dev->hotplugged && bus->devices[PCI_DEVFN(slotnr, 0)] && if (plugged_dev->hotplugged && bus->devices[PCI_DEVFN(slotnr, 0)] &&
PCI_FUNC(pdev->devfn) != 0) { PCI_FUNC(pdev->devfn) != 0) {
error_setg(errp, "PCI: slot %d function 0 already ocuppied by %s," error_setg(errp, "PCI: slot %d function 0 already occupied by %s,"
" additional functions can no longer be exposed to guest.", " additional functions can no longer be exposed to guest.",
slotnr, bus->devices[PCI_DEVFN(slotnr, 0)]->name); slotnr, bus->devices[PCI_DEVFN(slotnr, 0)]->name);
return; return;

View File

@ -217,7 +217,7 @@ static int goldfish_rtc_post_load(void *opaque, int version_id)
static const MemoryRegionOps goldfish_rtc_ops = { static const MemoryRegionOps goldfish_rtc_ops = {
.read = goldfish_rtc_read, .read = goldfish_rtc_read,
.write = goldfish_rtc_write, .write = goldfish_rtc_write,
.endianness = DEVICE_LITTLE_ENDIAN, .endianness = DEVICE_NATIVE_ENDIAN,
.valid = { .valid = {
.min_access_size = 4, .min_access_size = 4,
.max_access_size = 4 .max_access_size = 4

View File

@ -41,7 +41,7 @@ have_block = have_system or have_tools
python = import('python').find_installation() python = import('python').find_installation()
supported_oses = ['windows', 'freebsd', 'netbsd', 'openbsd', 'darwin', 'sunos', 'linux'] supported_oses = ['windows', 'freebsd', 'netbsd', 'openbsd', 'darwin', 'sunos', 'linux']
supported_cpus = ['ppc', 'ppc64', 's390x', 'sparc64', 'riscv32', 'riscv64', 'x86', 'x86_64', supported_cpus = ['ppc', 'ppc64', 's390x', 'riscv32', 'riscv64', 'x86', 'x86_64',
'arm', 'aarch64', 'mips', 'mips64', 'sparc', 'sparc64'] 'arm', 'aarch64', 'mips', 'mips64', 'sparc', 'sparc64']
cpu = host_machine.cpu_family() cpu = host_machine.cpu_family()

View File

@ -10,8 +10,9 @@
* See the COPYING file in the top-level directory. * See the COPYING file in the top-level directory.
*/ */
#include <zlib.h>
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include <zlib.h>
#include "qapi/error.h" #include "qapi/error.h"
#include "cpu.h" #include "cpu.h"
#include "qemu/config-file.h" #include "qemu/config-file.h"

View File

@ -1,5 +1,5 @@
HXCOMM Keep the list of subcommands sorted by name. HXCOMM Keep the list of subcommands sorted by name.
HXCOMM Use DEFHEADING() to define headings in both help text and texi HXCOMM Use DEFHEADING() to define headings in both help text and rST
HXCOMM Text between SRST and ERST are copied to rST version and HXCOMM Text between SRST and ERST are copied to rST version and
HXCOMM discarded from C version HXCOMM discarded from C version
HXCOMM DEF(command, callback, arg_string) is used to construct HXCOMM DEF(command, callback, arg_string) is used to construct

View File

@ -14,6 +14,7 @@
*/ */
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "qemu/log.h"
#include "qapi/error.h" #include "qapi/error.h"
#include "cpu.h" #include "cpu.h"
#include "exec/memory.h" #include "exec/memory.h"
@ -1353,10 +1354,18 @@ bool memory_region_access_valid(MemoryRegion *mr,
{ {
if (mr->ops->valid.accepts if (mr->ops->valid.accepts
&& !mr->ops->valid.accepts(mr->opaque, addr, size, is_write, attrs)) { && !mr->ops->valid.accepts(mr->opaque, addr, size, is_write, attrs)) {
qemu_log_mask(LOG_GUEST_ERROR, "Invalid access at addr "
"0x%" HWADDR_PRIX ", size %u, "
"region '%s', reason: rejected\n",
addr, size, memory_region_name(mr));
return false; return false;
} }
if (!mr->ops->valid.unaligned && (addr & (size - 1))) { if (!mr->ops->valid.unaligned && (addr & (size - 1))) {
qemu_log_mask(LOG_GUEST_ERROR, "Invalid access at addr "
"0x%" HWADDR_PRIX ", size %u, "
"region '%s', reason: unaligned\n",
addr, size, memory_region_name(mr));
return false; return false;
} }
@ -1367,6 +1376,13 @@ bool memory_region_access_valid(MemoryRegion *mr,
if (size > mr->ops->valid.max_access_size if (size > mr->ops->valid.max_access_size
|| size < mr->ops->valid.min_access_size) { || size < mr->ops->valid.min_access_size) {
qemu_log_mask(LOG_GUEST_ERROR, "Invalid access at addr "
"0x%" HWADDR_PRIX ", size %u, "
"region '%s', reason: invalid size "
"(min:%u max:%u)\n",
addr, size, memory_region_name(mr),
mr->ops->valid.min_access_size,
mr->ops->valid.max_access_size);
return false; return false;
} }
return true; return true;

View File

@ -4127,7 +4127,8 @@ static PropValue tcg_default_props[] = {
* We resolve CPU model aliases using -v1 when using "-machine * We resolve CPU model aliases using -v1 when using "-machine
* none", but this is just for compatibility while libvirt isn't * none", but this is just for compatibility while libvirt isn't
* adapted to resolve CPU model versions before creating VMs. * adapted to resolve CPU model versions before creating VMs.
* See "Runnability guarantee of CPU models" at * qemu-deprecated.texi. * See "Runnability guarantee of CPU models" at
* docs/system/deprecated.rst.
*/ */
X86CPUVersion default_cpu_version = 1; X86CPUVersion default_cpu_version = 1;

View File

@ -50,7 +50,6 @@ static const char * const excp_names[0x80] = {
[TT_EXTINT | 0xd] = "External Interrupt 13", [TT_EXTINT | 0xd] = "External Interrupt 13",
[TT_EXTINT | 0xe] = "External Interrupt 14", [TT_EXTINT | 0xe] = "External Interrupt 14",
[TT_EXTINT | 0xf] = "External Interrupt 15", [TT_EXTINT | 0xf] = "External Interrupt 15",
[TT_TOVF] = "Tag Overflow",
[TT_CODE_ACCESS] = "Instruction Access Error", [TT_CODE_ACCESS] = "Instruction Access Error",
[TT_DATA_ACCESS] = "Data Access Error", [TT_DATA_ACCESS] = "Data Access Error",
[TT_DIV_ZERO] = "Division By Zero", [TT_DIV_ZERO] = "Division By Zero",

View File

@ -8,7 +8,6 @@
* Author: Peter Xu <peterx@redhat.com> * Author: Peter Xu <peterx@redhat.com>
*/ */
#include <stdlib.h>
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "qemu/bitmap.h" #include "qemu/bitmap.h"

View File

@ -70,7 +70,7 @@ static void fe_event(void *opaque, QEMUChrEvent event)
h->openclose_mismatch = true; h->openclose_mismatch = true;
} }
h->is_open = new_open_state; h->is_open = new_open_state;
/* no break */ /* fallthrough */
default: default:
quit = true; quit = true;
break; break;