Trivial patches 20190919

-----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEEzS913cjjpNwuT1Fz8ww4vT8vvjwFAl2Dh78SHGxhdXJlbnRA
 dml2aWVyLmV1AAoJEPMMOL0/L748znUP/3gcyTubxxZgk8P4ufRn/9QY7O/Ohsj+
 /8QikSdYFkPPGUcGeuQDHmN4KZbUnoEZuI4QxnlLNc1aWg69+0+JygMsSE2OTRVV
 BoPWnxpFy5PPDfpYoR8DfIgmKocdpBSTg50u57W3NciJRzIYSol5AOpy4ANOiDp4
 V8jXkWtTIXCHytKyWppxpzZjmJADQRgbFwS58+CvWoLRqO7xqWnJKfdvoQzDsGlj
 6I0CbxTwDdBJJrYG8gUhyj/Gz4VEfZWskn4Jt+/Uxw2Ll7aOLPgF0mf4g6h1EZ/V
 j5wVHXntR6cYdQ1jpi3unUQ3nkaGOssLbj0rA8//KjLU+VxlYdJFQj7BSSBbYLWk
 BGKw/rhFZw1kXk32kaZPtd0VgCbQu7e81/7k2/Yc2u6vg8BRIJCjOK4H8V58QOQ6
 ISu1ngrRAj9Tzoqv79ZQw+jZFD7nrEC+Vl9KcZQq245Ju5WrFxw8D4Mk3EnT5Pn8
 3AAZswquOhC7MELZAbWUc2UEF72rqvuiH8OoqXcMmCOuFLZwNmuj2lCOCbiFBtjA
 qzvqTunKIt6OcLtF0NPoJ2iSHoMhqnZ7dJEKq88T2lGPXdUfpMqXcRrj6milj6Ow
 4d/7KNwAZyCYJfwbNz71bpn2EpxPPpA835iMKyAzrNOWYIQ7JBlQMvHeKaqeNps/
 GlXSETiFMl6G
 =WZXd
 -----END PGP SIGNATURE-----

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

Trivial patches 20190919

# gpg: Signature made Thu 19 Sep 2019 14:50:55 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-pull-request:
  configure: Add xkbcommon configure options
  kvm: Fix typo in header of kvm_device_access()
  Fix cacheline detection on FreeBSD/powerpc.
  build: Don't ignore qapi-visit-core.c
  target/m68k/fpu_helper.c: rename the access arguments
  Replace '-machine accel=xyz' with '-accel xyz'
  cutils: Move size_to_str() from "qemu-common.h" to "qemu/cutils.h"
  vfio: fix a typo

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2019-09-20 13:58:04 +01:00
commit f5c7af6295
16 changed files with 36 additions and 27 deletions

1
.gitignore vendored
View File

@ -41,6 +41,7 @@
/qapi/qapi-types-*.[ch] /qapi/qapi-types-*.[ch]
/qapi/qapi-types.[ch] /qapi/qapi-types.[ch]
/qapi/qapi-visit-*.[ch] /qapi/qapi-visit-*.[ch]
!/qapi/qapi-visit-core.c
/qapi/qapi-visit.[ch] /qapi/qapi-visit.[ch]
/qapi/qapi-doc.texi /qapi/qapi-doc.texi
/qemu-doc.html /qemu-doc.html

View File

@ -23,7 +23,7 @@
*/ */
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "qemu-common.h" #include "qemu/cutils.h"
#include "block/qapi.h" #include "block/qapi.h"
#include "block/block_int.h" #include "block/block_int.h"
#include "block/throttle-groups.h" #include "block/throttle-groups.h"

5
configure vendored
View File

@ -1521,6 +1521,10 @@ for opt do
;; ;;
--disable-libpmem) libpmem=no --disable-libpmem) libpmem=no
;; ;;
--enable-xkbcommon) xkbcommon=yes
;;
--disable-xkbcommon) xkbcommon=no
;;
*) *)
echo "ERROR: unknown option $opt" echo "ERROR: unknown option $opt"
echo "Try '$0 --help' for more information" echo "Try '$0 --help' for more information"
@ -1804,6 +1808,7 @@ disabled with --disable-FEATURE, default is enabled if available:
capstone capstone disassembler support capstone capstone disassembler support
debug-mutex mutex debugging support debug-mutex mutex debugging support
libpmem libpmem support libpmem libpmem support
xkbcommon xkbcommon support
NOTE: The object files are built at the place where configure is launched NOTE: The object files are built at the place where configure is launched
EOF EOF

View File

@ -44,7 +44,7 @@
#define TYPE_VFIO_PCI "vfio-pci" #define TYPE_VFIO_PCI "vfio-pci"
#define PCI_VFIO(obj) OBJECT_CHECK(VFIOPCIDevice, obj, TYPE_VFIO_PCI) #define PCI_VFIO(obj) OBJECT_CHECK(VFIOPCIDevice, obj, TYPE_VFIO_PCI)
#define TYPE_VIFO_PCI_NOHOTPLUG "vfio-pci-nohotplug" #define TYPE_VFIO_PCI_NOHOTPLUG "vfio-pci-nohotplug"
static void vfio_disable_interrupts(VFIOPCIDevice *vdev); static void vfio_disable_interrupts(VFIOPCIDevice *vdev);
static void vfio_mmap_set_enabled(VFIOPCIDevice *vdev, bool enabled); static void vfio_mmap_set_enabled(VFIOPCIDevice *vdev, bool enabled);
@ -3199,7 +3199,7 @@ static void vfio_pci_nohotplug_dev_class_init(ObjectClass *klass, void *data)
} }
static const TypeInfo vfio_pci_nohotplug_dev_info = { static const TypeInfo vfio_pci_nohotplug_dev_info = {
.name = TYPE_VIFO_PCI_NOHOTPLUG, .name = TYPE_VFIO_PCI_NOHOTPLUG,
.parent = TYPE_VFIO_PCI, .parent = TYPE_VFIO_PCI,
.instance_size = sizeof(VFIOPCIDevice), .instance_size = sizeof(VFIOPCIDevice),
.class_init = vfio_pci_nohotplug_dev_class_init, .class_init = vfio_pci_nohotplug_dev_class_init,

View File

@ -123,7 +123,6 @@ void qemu_hexdump(const char *buf, FILE *fp, const char *prefix, size_t size);
int parse_debug_env(const char *name, int max, int initial); int parse_debug_env(const char *name, int max, int initial);
const char *qemu_ether_ntoa(const MACAddr *mac); const char *qemu_ether_ntoa(const MACAddr *mac);
char *size_to_str(uint64_t val);
void page_size_init(void); void page_size_init(void);
/* returns non-zero if dump is in progress, otherwise zero is /* returns non-zero if dump is in progress, otherwise zero is

View File

@ -155,6 +155,8 @@ int qemu_strtosz(const char *nptr, const char **end, uint64_t *result);
int qemu_strtosz_MiB(const char *nptr, const char **end, uint64_t *result); int qemu_strtosz_MiB(const char *nptr, const char **end, uint64_t *result);
int qemu_strtosz_metric(const char *nptr, const char **end, uint64_t *result); int qemu_strtosz_metric(const char *nptr, const char **end, uint64_t *result);
char *size_to_str(uint64_t val);
/* used to print char* safely */ /* used to print char* safely */
#define STR_OR_NULL(str) ((str) ? (str) : "null") #define STR_OR_NULL(str) ((str) ? (str) : "null")

View File

@ -308,7 +308,7 @@ int kvm_vm_check_attr(KVMState *s, uint32_t group, uint64_t attr);
int kvm_device_check_attr(int fd, uint32_t group, uint64_t attr); int kvm_device_check_attr(int fd, uint32_t group, uint64_t attr);
/** /**
* kvm_device_access - set or get value of a specific vm attribute * kvm_device_access - set or get value of a specific device attribute
* @fd: The device file descriptor * @fd: The device file descriptor
* @group: the group * @group: the group
* @attr: the attribute of that group to set or get * @attr: the attribute of that group to set or get

View File

@ -96,7 +96,7 @@ class QEMUQtestMachine(QEMUMachine):
def _base_args(self): def _base_args(self):
args = super(QEMUQtestMachine, self)._base_args() args = super(QEMUQtestMachine, self)._base_args()
args.extend(['-qtest', 'unix:path=' + self._qtest_path, args.extend(['-qtest', 'unix:path=' + self._qtest_path,
'-machine', 'accel=qtest']) '-accel', 'qtest'])
return args return args
def _pre_launch(self): def _pre_launch(self):

View File

@ -11,7 +11,7 @@
*/ */
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "qemu-common.h" #include "qemu/cutils.h"
#include "qapi/string-output-visitor.h" #include "qapi/string-output-visitor.h"
#include "qapi/visitor-impl.h" #include "qapi/visitor-impl.h"
#include "qemu/host-utils.h" #include "qemu/host-utils.h"

View File

@ -26,8 +26,7 @@ The @option{enforce-config-section} parameter is replaced by the
@subsection -no-kvm (since 1.3.0) @subsection -no-kvm (since 1.3.0)
The ``-no-kvm'' argument is now a synonym for setting The ``-no-kvm'' argument is now a synonym for setting ``-accel tcg''.
``-machine accel=tcg''.
@subsection -usbdevice (since 2.10.0) @subsection -usbdevice (since 2.10.0)

View File

@ -4156,7 +4156,7 @@ STEXI
Enable FIPS 140-2 compliance mode. Enable FIPS 140-2 compliance mode.
ETEXI ETEXI
HXCOMM Deprecated by -machine accel=tcg property HXCOMM Deprecated by -accel tcg
DEF("no-kvm", 0, QEMU_OPTION_no_kvm, "", QEMU_ARCH_I386) DEF("no-kvm", 0, QEMU_OPTION_no_kvm, "", QEMU_ARCH_I386)
DEF("msg", HAS_ARG, QEMU_OPTION_msg, DEF("msg", HAS_ARG, QEMU_OPTION_msg,

View File

@ -396,14 +396,14 @@ typedef int (*float_access)(CPUM68KState *env, uint32_t addr, FPReg *fp,
uintptr_t ra); uintptr_t ra);
static uint32_t fmovem_predec(CPUM68KState *env, uint32_t addr, uint32_t mask, static uint32_t fmovem_predec(CPUM68KState *env, uint32_t addr, uint32_t mask,
float_access access) float_access access_fn)
{ {
uintptr_t ra = GETPC(); uintptr_t ra = GETPC();
int i, size; int i, size;
for (i = 7; i >= 0; i--, mask <<= 1) { for (i = 7; i >= 0; i--, mask <<= 1) {
if (mask & 0x80) { if (mask & 0x80) {
size = access(env, addr, &env->fregs[i], ra); size = access_fn(env, addr, &env->fregs[i], ra);
if ((mask & 0xff) != 0x80) { if ((mask & 0xff) != 0x80) {
addr -= size; addr -= size;
} }
@ -414,14 +414,14 @@ static uint32_t fmovem_predec(CPUM68KState *env, uint32_t addr, uint32_t mask,
} }
static uint32_t fmovem_postinc(CPUM68KState *env, uint32_t addr, uint32_t mask, static uint32_t fmovem_postinc(CPUM68KState *env, uint32_t addr, uint32_t mask,
float_access access) float_access access_fn)
{ {
uintptr_t ra = GETPC(); uintptr_t ra = GETPC();
int i, size; int i, size;
for (i = 0; i < 8; i++, mask <<= 1) { for (i = 0; i < 8; i++, mask <<= 1) {
if (mask & 0x80) { if (mask & 0x80) {
size = access(env, addr, &env->fregs[i], ra); size = access_fn(env, addr, &env->fregs[i], ra);
addr += size; addr += size;
} }
} }

View File

@ -241,7 +241,7 @@ QTestState *qtest_init_without_qmp_handshake(const char *extra_args)
"-qtest-log %s " "-qtest-log %s "
"-chardev socket,path=%s,id=char0 " "-chardev socket,path=%s,id=char0 "
"-mon chardev=char0,mode=control " "-mon chardev=char0,mode=control "
"-machine accel=qtest " "-accel qtest "
"-display none " "-display none "
"%s", qemu_binary, socket_path, "%s", qemu_binary, socket_path,
getenv("QTEST_LOG") ? "/dev/fd/2" : "/dev/null", getenv("QTEST_LOG") ? "/dev/fd/2" : "/dev/null",

View File

@ -287,7 +287,7 @@ class Engine(object):
cmdline = "'" + cmdline + "'" cmdline = "'" + cmdline + "'"
argv = [ argv = [
"-machine", "accel=kvm", "-accel", "kvm",
"-cpu", "host", "-cpu", "host",
"-kernel", self._kernel, "-kernel", self._kernel,
"-initrd", self._initrd, "-initrd", self._initrd,

View File

@ -55,7 +55,7 @@ do_run_qemu()
done done
fi fi
echo quit echo quit
) | $QEMU -machine accel=qtest -nographic -monitor stdio -serial none "$@" ) | $QEMU -accel qtest -nographic -monitor stdio -serial none "$@"
echo echo
} }

View File

@ -65,25 +65,28 @@ static void sys_cache_info(int *isize, int *dsize)
g_free(buf); g_free(buf);
} }
#elif defined(__APPLE__) \ #elif defined(__APPLE__)
|| defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
# include <sys/sysctl.h> # include <sys/sysctl.h>
# if defined(__APPLE__)
# define SYSCTL_CACHELINE_NAME "hw.cachelinesize"
# else
# define SYSCTL_CACHELINE_NAME "machdep.cacheline_size"
# endif
static void sys_cache_info(int *isize, int *dsize) static void sys_cache_info(int *isize, int *dsize)
{ {
/* There's only a single sysctl for both I/D cache line sizes. */ /* There's only a single sysctl for both I/D cache line sizes. */
long size; long size;
size_t len = sizeof(size); size_t len = sizeof(size);
if (!sysctlbyname(SYSCTL_CACHELINE_NAME, &size, &len, NULL, 0)) { if (!sysctlbyname("hw.cachelinesize", &size, &len, NULL, 0)) {
*isize = *dsize = size;
}
}
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
# include <sys/sysctl.h>
static void sys_cache_info(int *isize, int *dsize)
{
/* There's only a single sysctl for both I/D cache line sizes. */
int size;
size_t len = sizeof(size);
if (!sysctlbyname("machdep.cacheline_size", &size, &len, NULL, 0)) {
*isize = *dsize = size; *isize = *dsize = size;
} }
} }
#else #else
/* POSIX */ /* POSIX */