Compare commits
101 Commits
pull-input
...
qom-cpu-fo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0960be7cff | ||
|
|
63a946c7e3 | ||
|
|
d49dd523e4 | ||
|
|
20984673e6 | ||
|
|
df0900eb89 | ||
|
|
4f669905d9 | ||
|
|
9f87a4cacd | ||
|
|
dbad6b74b3 | ||
|
|
ca3e40e233 | ||
|
|
3c23402d40 | ||
|
|
4884b7bfe9 | ||
|
|
25a2a920dd | ||
|
|
e3fce97cf5 | ||
|
|
f8d82b8eb8 | ||
|
|
1d9edff78f | ||
|
|
b181974724 | ||
|
|
704b216887 | ||
|
|
ae31fb5491 | ||
|
|
82755ff202 | ||
|
|
cf72b57f89 | ||
|
|
31190ed781 | ||
|
|
de1372d466 | ||
|
|
3e866365e1 | ||
|
|
f6f56291de | ||
|
|
69b32a6ce4 | ||
|
|
c62b91e580 | ||
|
|
21e704256d | ||
|
|
d2fc4402cb | ||
|
|
9a78a5dd27 | ||
|
|
15324404f6 | ||
|
|
1be0ac2109 | ||
|
|
c2bea314f6 | ||
|
|
636f4dddfe | ||
|
|
35f9b6ef3a | ||
|
|
d3592199ba | ||
|
|
f04cf9239a | ||
|
|
e279200458 | ||
|
|
1842bdfdba | ||
|
|
751bcc3981 | ||
|
|
22de58fe15 | ||
|
|
aebf81680b | ||
|
|
3fad87881e | ||
|
|
2ce68e4cf5 | ||
|
|
c1bd899743 | ||
|
|
19b7bec4a3 | ||
|
|
5eeb40c5b1 | ||
|
|
68931a4082 | ||
|
|
5577e57b07 | ||
|
|
f822b7e497 | ||
|
|
8bfaa25fce | ||
|
|
1cd4e0f6f0 | ||
|
|
4ab729207f | ||
|
|
db3b2566e0 | ||
|
|
feacc6c2c8 | ||
|
|
09c7f58ca9 | ||
|
|
052bd52fa9 | ||
|
|
794e8f301a | ||
|
|
426c0df9e3 | ||
|
|
b080364aed | ||
|
|
2ab75df38e | ||
|
|
085b0b055b | ||
|
|
5bcfa0c543 | ||
|
|
88c5f205fa | ||
|
|
10817bf09d | ||
|
|
57cb38b383 | ||
|
|
e0d03b8ceb | ||
|
|
0983f5e6af | ||
|
|
2a8e21c7c8 | ||
|
|
17c55decec | ||
|
|
ee9dfed242 | ||
|
|
b38c0494c1 | ||
|
|
df81978368 | ||
|
|
c14e42d7a4 | ||
|
|
f52dd72dc1 | ||
|
|
5829b09720 | ||
|
|
b798c19057 | ||
|
|
37bc43f7fb | ||
|
|
974826f0ab | ||
|
|
e206ddfb57 | ||
|
|
e853ea1cc6 | ||
|
|
a1853dca74 | ||
|
|
f74df9bfce | ||
|
|
4005b4732e | ||
|
|
d697e30cff | ||
|
|
b4fe97c823 | ||
|
|
62c39b307b | ||
|
|
f693fe6ef4 | ||
|
|
8a0b5421a0 | ||
|
|
dc47995e52 | ||
|
|
6eaeae37a5 | ||
|
|
8e34bf364a | ||
|
|
f3a06403b8 | ||
|
|
fafcaf1d74 | ||
|
|
2cc06a8843 | ||
|
|
c886fc4c20 | ||
|
|
0b341a85ca | ||
|
|
a4c0d1deb7 | ||
|
|
c9eae1d4b9 | ||
|
|
57c3d238a5 | ||
|
|
6407d76eb4 | ||
|
|
7df953bd45 |
13
MAINTAINERS
13
MAINTAINERS
@@ -1193,6 +1193,19 @@ F: crypto/
|
||||
F: include/crypto/
|
||||
F: tests/test-crypto-*
|
||||
|
||||
Coroutines
|
||||
M: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
M: Kevin Wolf <kwolf@redhat.com>
|
||||
F: util/*coroutine*
|
||||
F: include/qemu/coroutine*
|
||||
F: tests/test-coroutine.c
|
||||
|
||||
Buffers
|
||||
M: Daniel P. Berrange <berrange@redhat.com>
|
||||
S: Odd fixes
|
||||
F: util/buffer.c
|
||||
F: include/qemu/buffer.h
|
||||
|
||||
Usermode Emulation
|
||||
------------------
|
||||
Overall
|
||||
|
||||
14
Makefile
14
Makefile
@@ -298,18 +298,15 @@ $(qapi-modules) $(SRC_PATH)/scripts/qapi-introspect.py $(qapi-py)
|
||||
QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
|
||||
$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN)
|
||||
|
||||
# we require QGA_VSS_PROVIDER files to be built alongside qemu-ga
|
||||
# executable since they are shipped together, but we don't want to actually
|
||||
# link against them
|
||||
qemu-ga$(EXESUF): $(qga-obj-y) libqemuutil.a libqemustub.a $(QGA_VSS_PROVIDER)
|
||||
$(call LINK, $(filter-out $(QGA_VSS_PROVIDER), $^))
|
||||
qemu-ga$(EXESUF): $(qga-obj-y) libqemuutil.a libqemustub.a
|
||||
$(call LINK, $^)
|
||||
|
||||
ifdef QEMU_GA_MSI_ENABLED
|
||||
QEMU_GA_MSI=qemu-ga-$(ARCH).msi
|
||||
|
||||
msi: $(QEMU_GA_MSI)
|
||||
|
||||
$(QEMU_GA_MSI): qemu-ga.exe
|
||||
$(QEMU_GA_MSI): qemu-ga.exe $(QGA_VSS_PROVIDER)
|
||||
|
||||
$(QEMU_GA_MSI): config-host.mak
|
||||
|
||||
@@ -321,6 +318,11 @@ msi:
|
||||
@echo "MSI build not configured or dependency resolution failed (reconfigure with --enable-guest-agent-msi option)"
|
||||
endif
|
||||
|
||||
ifneq ($(EXESUF),)
|
||||
.PHONY: qemu-ga
|
||||
qemu-ga: qemu-ga$(EXESUF) $(QGA_VSS_PROVIDER) $(QEMU_GA_MSI)
|
||||
endif
|
||||
|
||||
clean:
|
||||
# avoid old build problems by removing potentially incorrect old files
|
||||
rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
|
||||
|
||||
@@ -15,10 +15,6 @@ block-obj-$(CONFIG_WIN32) += aio-win32.o
|
||||
block-obj-y += block/
|
||||
block-obj-y += qemu-io-cmds.o
|
||||
|
||||
block-obj-y += qemu-coroutine.o qemu-coroutine-lock.o qemu-coroutine-io.o
|
||||
block-obj-y += qemu-coroutine-sleep.o
|
||||
block-obj-y += coroutine-$(CONFIG_COROUTINE_BACKEND).o
|
||||
|
||||
block-obj-m = block/
|
||||
|
||||
#######################################################################
|
||||
|
||||
2
block.c
2
block.c
@@ -33,7 +33,7 @@
|
||||
#include "sysemu/block-backend.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
#include "qemu/notify.h"
|
||||
#include "block/coroutine.h"
|
||||
#include "qemu/coroutine.h"
|
||||
#include "block/qapi.h"
|
||||
#include "qmp-commands.h"
|
||||
#include "qemu/timer.h"
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#define BLOCK_QCOW2_H
|
||||
|
||||
#include "crypto/cipher.h"
|
||||
#include "block/coroutine.h"
|
||||
#include "qemu/coroutine.h"
|
||||
|
||||
//#define DEBUG_ALLOC
|
||||
//#define DEBUG_ALLOC2
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
#include "block/block_int.h"
|
||||
#include "qemu/module.h"
|
||||
#include "migration/migration.h"
|
||||
#include "block/coroutine.h"
|
||||
#include "qemu/coroutine.h"
|
||||
|
||||
#if defined(CONFIG_UUID)
|
||||
#include <uuid/uuid.h>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
#include "block/block_int.h"
|
||||
#include "block/coroutine.h"
|
||||
#include "qemu/coroutine.h"
|
||||
#include "block/write-threshold.h"
|
||||
#include "qemu/notify.h"
|
||||
#include "qapi-event.h"
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "block/block_int.h"
|
||||
#include "qapi/qmp/qerror.h"
|
||||
#include "qapi/qmp/qjson.h"
|
||||
#include "block/coroutine.h"
|
||||
#include "qemu/coroutine.h"
|
||||
#include "qmp-commands.h"
|
||||
#include "qemu/timer.h"
|
||||
#include "qapi-event.h"
|
||||
|
||||
21
configure
vendored
21
configure
vendored
@@ -3491,6 +3491,22 @@ if compile_prog "" "" ; then
|
||||
eventfd=yes
|
||||
fi
|
||||
|
||||
# check if memfd is supported
|
||||
memfd=no
|
||||
cat > $TMPC << EOF
|
||||
#include <sys/memfd.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
return memfd_create("foo", MFD_ALLOW_SEALING);
|
||||
}
|
||||
EOF
|
||||
if compile_prog "" "" ; then
|
||||
memfd=yes
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# check for fallocate
|
||||
fallocate=no
|
||||
cat > $TMPC << EOF
|
||||
@@ -4437,7 +4453,7 @@ fi
|
||||
|
||||
if [ "$guest_agent" != "no" ]; then
|
||||
if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" -o "$mingw32" = "yes" ] ; then
|
||||
tools="qemu-ga\$(EXESUF) $tools"
|
||||
tools="qemu-ga $tools"
|
||||
guest_agent=yes
|
||||
elif [ "$guest_agent" != yes ]; then
|
||||
guest_agent=no
|
||||
@@ -4885,6 +4901,9 @@ fi
|
||||
if test "$eventfd" = "yes" ; then
|
||||
echo "CONFIG_EVENTFD=y" >> $config_host_mak
|
||||
fi
|
||||
if test "$memfd" = "yes" ; then
|
||||
echo "CONFIG_MEMFD=y" >> $config_host_mak
|
||||
fi
|
||||
if test "$fallocate" = "yes" ; then
|
||||
echo "CONFIG_FALLOCATE=y" >> $config_host_mak
|
||||
fi
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
include pci.mak
|
||||
include sound.mak
|
||||
include usb.mak
|
||||
CONFIG_VIRTIO_VGA=y
|
||||
CONFIG_ISA_MMIO=y
|
||||
CONFIG_ESCC=y
|
||||
CONFIG_M48T59=y
|
||||
|
||||
55
disas.c
55
disas.c
@@ -214,11 +214,6 @@ void target_disas(FILE *out, CPUState *cpu, target_ulong code,
|
||||
s.info.mach = bfd_mach_i386_i386;
|
||||
}
|
||||
s.info.print_insn = print_insn_i386;
|
||||
#elif defined(TARGET_SPARC)
|
||||
s.info.print_insn = print_insn_sparc;
|
||||
#ifdef TARGET_SPARC64
|
||||
s.info.mach = bfd_mach_sparc_v9b;
|
||||
#endif
|
||||
#elif defined(TARGET_PPC)
|
||||
if ((flags >> 16) & 1) {
|
||||
s.info.endian = BFD_ENDIAN_LITTLE;
|
||||
@@ -235,29 +230,6 @@ void target_disas(FILE *out, CPUState *cpu, target_ulong code,
|
||||
}
|
||||
s.info.disassembler_options = (char *)"any";
|
||||
s.info.print_insn = print_insn_ppc;
|
||||
#elif defined(TARGET_M68K)
|
||||
s.info.print_insn = print_insn_m68k;
|
||||
#elif defined(TARGET_MIPS)
|
||||
#ifdef TARGET_WORDS_BIGENDIAN
|
||||
s.info.print_insn = print_insn_big_mips;
|
||||
#else
|
||||
s.info.print_insn = print_insn_little_mips;
|
||||
#endif
|
||||
#elif defined(TARGET_SH4)
|
||||
s.info.mach = bfd_mach_sh4;
|
||||
s.info.print_insn = print_insn_sh;
|
||||
#elif defined(TARGET_ALPHA)
|
||||
s.info.mach = bfd_mach_alpha_ev6;
|
||||
s.info.print_insn = print_insn_alpha;
|
||||
#elif defined(TARGET_S390X)
|
||||
s.info.mach = bfd_mach_s390_64;
|
||||
s.info.print_insn = print_insn_s390;
|
||||
#elif defined(TARGET_MOXIE)
|
||||
s.info.mach = bfd_arch_moxie;
|
||||
s.info.print_insn = print_insn_moxie;
|
||||
#elif defined(TARGET_LM32)
|
||||
s.info.mach = bfd_mach_lm32;
|
||||
s.info.print_insn = print_insn_lm32;
|
||||
#endif
|
||||
if (s.info.print_insn == NULL) {
|
||||
s.info.print_insn = print_insn_od_target;
|
||||
@@ -429,13 +401,6 @@ void monitor_disas(Monitor *mon, CPUState *cpu,
|
||||
s.info.mach = bfd_mach_i386_i386;
|
||||
}
|
||||
s.info.print_insn = print_insn_i386;
|
||||
#elif defined(TARGET_ALPHA)
|
||||
s.info.print_insn = print_insn_alpha;
|
||||
#elif defined(TARGET_SPARC)
|
||||
s.info.print_insn = print_insn_sparc;
|
||||
#ifdef TARGET_SPARC64
|
||||
s.info.mach = bfd_mach_sparc_v9b;
|
||||
#endif
|
||||
#elif defined(TARGET_PPC)
|
||||
if (flags & 0xFFFF) {
|
||||
/* If we have a precise definition of the instruction set, use it. */
|
||||
@@ -451,26 +416,6 @@ void monitor_disas(Monitor *mon, CPUState *cpu,
|
||||
s.info.endian = BFD_ENDIAN_LITTLE;
|
||||
}
|
||||
s.info.print_insn = print_insn_ppc;
|
||||
#elif defined(TARGET_M68K)
|
||||
s.info.print_insn = print_insn_m68k;
|
||||
#elif defined(TARGET_MIPS)
|
||||
#ifdef TARGET_WORDS_BIGENDIAN
|
||||
s.info.print_insn = print_insn_big_mips;
|
||||
#else
|
||||
s.info.print_insn = print_insn_little_mips;
|
||||
#endif
|
||||
#elif defined(TARGET_SH4)
|
||||
s.info.mach = bfd_mach_sh4;
|
||||
s.info.print_insn = print_insn_sh;
|
||||
#elif defined(TARGET_S390X)
|
||||
s.info.mach = bfd_mach_s390_64;
|
||||
s.info.print_insn = print_insn_s390;
|
||||
#elif defined(TARGET_MOXIE)
|
||||
s.info.mach = bfd_arch_moxie;
|
||||
s.info.print_insn = print_insn_moxie;
|
||||
#elif defined(TARGET_LM32)
|
||||
s.info.mach = bfd_mach_lm32;
|
||||
s.info.print_insn = print_insn_lm32;
|
||||
#endif
|
||||
if (!s.info.print_insn) {
|
||||
monitor_printf(mon, "0x" TARGET_FMT_lx
|
||||
|
||||
@@ -76,6 +76,13 @@ increasing address order, similar to memcpy().
|
||||
|
||||
Selector Register IOport: 0x510
|
||||
Data Register IOport: 0x511
|
||||
DMA Address IOport: 0x514
|
||||
|
||||
=== ARM Register Locations ===
|
||||
|
||||
Selector Register address: Base + 8 (2 bytes)
|
||||
Data Register address: Base + 0 (8 bytes)
|
||||
DMA Address address: Base + 16 (8 bytes)
|
||||
|
||||
== Firmware Configuration Items ==
|
||||
|
||||
@@ -86,11 +93,15 @@ by selecting the "signature" item using key 0x0000 (FW_CFG_SIGNATURE),
|
||||
and reading four bytes from the data register. If the fw_cfg device is
|
||||
present, the four bytes read will contain the characters "QEMU".
|
||||
|
||||
=== Revision (Key 0x0001, FW_CFG_ID) ===
|
||||
If the DMA interface is available, then reading the DMA Address
|
||||
Register returns 0x51454d5520434647 ("QEMU CFG" in big-endian format).
|
||||
|
||||
A 32-bit little-endian unsigned int, this item is used as an interface
|
||||
revision number, and is currently set to 1 by QEMU when fw_cfg is
|
||||
initialized.
|
||||
=== Revision / feature bitmap (Key 0x0001, FW_CFG_ID) ===
|
||||
|
||||
A 32-bit little-endian unsigned int, this item is used to check for enabled
|
||||
features.
|
||||
- Bit 0: traditional interface. Always set.
|
||||
- Bit 1: DMA interface.
|
||||
|
||||
=== File Directory (Key 0x0019, FW_CFG_FILE_DIR) ===
|
||||
|
||||
@@ -132,6 +143,55 @@ Selector Reg. Range Usage
|
||||
In practice, the number of allowed firmware configuration items is given
|
||||
by the value of FW_CFG_MAX_ENTRY (see fw_cfg.h).
|
||||
|
||||
= Guest-side DMA Interface =
|
||||
|
||||
If bit 1 of the feature bitmap is set, the DMA interface is present. This does
|
||||
not replace the existing fw_cfg interface, it is an add-on. This interface
|
||||
can be used through the 64-bit wide address register.
|
||||
|
||||
The address register is in big-endian format. The value for the register is 0
|
||||
at startup and after an operation. A write to the least significant half (at
|
||||
offset 4) triggers an operation. This means that operations with 32-bit
|
||||
addresses can be triggered with just one write, whereas operations with
|
||||
64-bit addresses can be triggered with one 64-bit write or two 32-bit writes,
|
||||
starting with the most significant half (at offset 0).
|
||||
|
||||
In this register, the physical address of a FWCfgDmaAccess structure in RAM
|
||||
should be written. This is the format of the FWCfgDmaAccess structure:
|
||||
|
||||
typedef struct FWCfgDmaAccess {
|
||||
uint32_t control;
|
||||
uint32_t length;
|
||||
uint64_t address;
|
||||
} FWCfgDmaAccess;
|
||||
|
||||
The fields of the structure are in big endian mode, and the field at the lowest
|
||||
address is the "control" field.
|
||||
|
||||
The "control" field has the following bits:
|
||||
- Bit 0: Error
|
||||
- Bit 1: Read
|
||||
- Bit 2: Skip
|
||||
- Bit 3: Select. The upper 16 bits are the selected index.
|
||||
|
||||
When an operation is triggered, if the "control" field has bit 3 set, the
|
||||
upper 16 bits are interpreted as an index of a firmware configuration item.
|
||||
This has the same effect as writing the selector register.
|
||||
|
||||
If the "control" field has bit 1 set, a read operation will be performed.
|
||||
"length" bytes for the current selector and offset will be copied into the
|
||||
physical RAM address specified by the "address" field.
|
||||
|
||||
If the "control" field has bit 2 set (and not bit 1), a skip operation will be
|
||||
performed. The offset for the current selector will be advanced "length" bytes.
|
||||
|
||||
To check the result, read the "control" field:
|
||||
error bit set -> something went wrong.
|
||||
all bits cleared -> transfer finished successfully.
|
||||
otherwise -> transfer still in progress (doesn't happen
|
||||
today due to implementation not being async,
|
||||
but may in the future).
|
||||
|
||||
= Host-side API =
|
||||
|
||||
The following functions are available to the QEMU programmer for adding
|
||||
@@ -159,6 +219,17 @@ will convert a 16-, 32-, or 64-bit integer to little-endian, then add
|
||||
a dynamically allocated copy of the appropriately sized item to fw_cfg
|
||||
under the given selector key value.
|
||||
|
||||
== fw_cfg_modify_iXX() ==
|
||||
|
||||
Modify the value of an XX-bit item (where XX may be 16, 32, or 64).
|
||||
Similarly to the corresponding fw_cfg_add_iXX() function set, convert
|
||||
a 16-, 32-, or 64-bit integer to little endian, create a dynamically
|
||||
allocated copy of the required size, and replace the existing item at
|
||||
the given selector key value with the newly allocated one. The previous
|
||||
item, assumed to have been allocated during an earlier call to
|
||||
fw_cfg_add_iXX() or fw_cfg_modify_iXX() (of the same width XX), is freed
|
||||
before the function returns.
|
||||
|
||||
== fw_cfg_add_file() ==
|
||||
|
||||
Given a filename (i.e., fw_cfg item name), starting pointer, and size,
|
||||
@@ -216,6 +287,21 @@ the following syntax:
|
||||
where <item_name> is the fw_cfg item name, and <path> is the location
|
||||
on the host file system of a file containing the data to be inserted.
|
||||
|
||||
Small enough items may be provided directly as strings on the command
|
||||
line, using the syntax:
|
||||
|
||||
-fw_cfg [name=]<item_name>,string=<string>
|
||||
|
||||
The terminating NUL character of the content <string> will NOT be
|
||||
included as part of the fw_cfg item data, which is consistent with
|
||||
the absence of a NUL terminator for items inserted via the file option.
|
||||
|
||||
Both <item_name> and, if applicable, the content <string> are passed
|
||||
through by QEMU without any interpretation, expansion, or further
|
||||
processing. Any such processing (potentially performed e.g., by the shell)
|
||||
is outside of QEMU's responsibility; as such, using plain ASCII characters
|
||||
is recommended.
|
||||
|
||||
NOTE: Users *SHOULD* choose item names beginning with the prefix "opt/"
|
||||
when using the "-fw_cfg" command line option, to avoid conflicting with
|
||||
item names used internally by QEMU. For instance:
|
||||
|
||||
@@ -115,11 +115,13 @@ the ones that do:
|
||||
* VHOST_GET_FEATURES
|
||||
* VHOST_GET_PROTOCOL_FEATURES
|
||||
* VHOST_GET_VRING_BASE
|
||||
* VHOST_SET_LOG_BASE (if VHOST_USER_PROTOCOL_F_LOG_SHMFD)
|
||||
|
||||
There are several messages that the master sends with file descriptors passed
|
||||
in the ancillary data:
|
||||
|
||||
* VHOST_SET_MEM_TABLE
|
||||
* VHOST_SET_LOG_BASE (if VHOST_USER_PROTOCOL_F_LOG_SHMFD)
|
||||
* VHOST_SET_LOG_FD
|
||||
* VHOST_SET_VRING_KICK
|
||||
* VHOST_SET_VRING_CALL
|
||||
@@ -140,8 +142,7 @@ Multiple queue support
|
||||
|
||||
Multiple queue is treated as a protocol extension, hence the slave has to
|
||||
implement protocol features first. The multiple queues feature is supported
|
||||
only when the protocol feature VHOST_USER_PROTOCOL_F_MQ (bit 0) is set:
|
||||
#define VHOST_USER_PROTOCOL_F_MQ 0
|
||||
only when the protocol feature VHOST_USER_PROTOCOL_F_MQ (bit 0) is set.
|
||||
|
||||
The max number of queues the slave supports can be queried with message
|
||||
VHOST_USER_GET_PROTOCOL_FEATURES. Master should stop when the number of
|
||||
@@ -152,6 +153,49 @@ queue in the sent message to identify a specified queue. One queue pair
|
||||
is enabled initially. More queues are enabled dynamically, by sending
|
||||
message VHOST_USER_SET_VRING_ENABLE.
|
||||
|
||||
Migration
|
||||
---------
|
||||
|
||||
During live migration, the master may need to track the modifications
|
||||
the slave makes to the memory mapped regions. The client should mark
|
||||
the dirty pages in a log. Once it complies to this logging, it may
|
||||
declare the VHOST_F_LOG_ALL vhost feature.
|
||||
|
||||
All the modifications to memory pointed by vring "descriptor" should
|
||||
be marked. Modifications to "used" vring should be marked if
|
||||
VHOST_VRING_F_LOG is part of ring's features.
|
||||
|
||||
Dirty pages are of size:
|
||||
#define VHOST_LOG_PAGE 0x1000
|
||||
|
||||
The log memory fd is provided in the ancillary data of
|
||||
VHOST_USER_SET_LOG_BASE message when the slave has
|
||||
VHOST_USER_PROTOCOL_F_LOG_SHMFD protocol feature.
|
||||
|
||||
The size of the log may be computed by using all the known guest
|
||||
addresses. The log covers from address 0 to the maximum of guest
|
||||
regions. In pseudo-code, to mark page at "addr" as dirty:
|
||||
|
||||
page = addr / VHOST_LOG_PAGE
|
||||
log[page / 8] |= 1 << page % 8
|
||||
|
||||
Use atomic operations, as the log may be concurrently manipulated.
|
||||
|
||||
VHOST_USER_SET_LOG_FD is an optional message with an eventfd in
|
||||
ancillary data, it may be used to inform the master that the log has
|
||||
been modified.
|
||||
|
||||
Once the source has finished migration, VHOST_USER_RESET_OWNER message
|
||||
will be sent by the source. No further update must be done before the
|
||||
destination takes over with new regions & rings.
|
||||
|
||||
Protocol features
|
||||
-----------------
|
||||
|
||||
#define VHOST_USER_PROTOCOL_F_MQ 0
|
||||
#define VHOST_USER_PROTOCOL_F_LOG_SHMFD 1
|
||||
#define VHOST_USER_PROTOCOL_F_RARP 2
|
||||
|
||||
Message types
|
||||
-------------
|
||||
|
||||
@@ -236,6 +280,7 @@ Message types
|
||||
Id: 6
|
||||
Equivalent ioctl: VHOST_SET_LOG_BASE
|
||||
Master payload: u64
|
||||
Slave payload: N/A
|
||||
|
||||
Sets the logging base address.
|
||||
|
||||
@@ -337,3 +382,17 @@ Message types
|
||||
Master payload: vring state description
|
||||
|
||||
Signal slave to enable or disable corresponding vring.
|
||||
|
||||
* VHOST_USER_SEND_RARP
|
||||
|
||||
Id: 19
|
||||
Equivalent ioctl: N/A
|
||||
Master payload: u64
|
||||
|
||||
Ask vhost user backend to broadcast a fake RARP to notify the migration
|
||||
is terminated for guest that does not support GUEST_ANNOUNCE.
|
||||
Only legal if feature bit VHOST_USER_F_PROTOCOL_FEATURES is present in
|
||||
VHOST_USER_GET_FEATURES and protocol feature bit VHOST_USER_PROTOCOL_F_RARP
|
||||
is present in VHOST_USER_GET_PROTOCOL_FEATURES.
|
||||
The first 6 bytes of the payload contain the mac address of the guest to
|
||||
allow the vhost user backend to construct and broadcast the fake RARP.
|
||||
|
||||
106
docs/virtio-migration.txt
Normal file
106
docs/virtio-migration.txt
Normal file
@@ -0,0 +1,106 @@
|
||||
Virtio devices and migration
|
||||
============================
|
||||
|
||||
Copyright 2015 IBM Corp.
|
||||
|
||||
This work is licensed under the terms of the GNU GPL, version 2 or later. See
|
||||
the COPYING file in the top-level directory.
|
||||
|
||||
Saving and restoring the state of virtio devices is a bit of a twisty maze,
|
||||
for several reasons:
|
||||
- state is distributed between several parts:
|
||||
- virtio core, for common fields like features, number of queues, ...
|
||||
- virtio transport (pci, ccw, ...), for the different proxy devices and
|
||||
transport specific state (msix vectors, indicators, ...)
|
||||
- virtio device (net, blk, ...), for the different device types and their
|
||||
state (mac address, request queue, ...)
|
||||
- most fields are saved via the stream interface; subsequently, subsections
|
||||
have been added to make cross-version migration possible
|
||||
|
||||
This file attempts to document the current procedure and point out some
|
||||
caveats.
|
||||
|
||||
|
||||
Save state procedure
|
||||
====================
|
||||
|
||||
virtio core virtio transport virtio device
|
||||
----------- ---------------- -------------
|
||||
|
||||
save() function registered
|
||||
via register_savevm()
|
||||
virtio_save() <----------
|
||||
------> save_config()
|
||||
- save proxy device
|
||||
- save transport-specific
|
||||
device fields
|
||||
- save common device
|
||||
fields
|
||||
- save common virtqueue
|
||||
fields
|
||||
------> save_queue()
|
||||
- save transport-specific
|
||||
virtqueue fields
|
||||
------> save_device()
|
||||
- save device-specific
|
||||
fields
|
||||
- save subsections
|
||||
- device endianness,
|
||||
if changed from
|
||||
default endianness
|
||||
- 64 bit features, if
|
||||
any high feature bit
|
||||
is set
|
||||
- virtio-1 virtqueue
|
||||
fields, if VERSION_1
|
||||
is set
|
||||
|
||||
|
||||
Load state procedure
|
||||
====================
|
||||
|
||||
virtio core virtio transport virtio device
|
||||
----------- ---------------- -------------
|
||||
|
||||
load() function registered
|
||||
via register_savevm()
|
||||
virtio_load() <----------
|
||||
------> load_config()
|
||||
- load proxy device
|
||||
- load transport-specific
|
||||
device fields
|
||||
- load common device
|
||||
fields
|
||||
- load common virtqueue
|
||||
fields
|
||||
------> load_queue()
|
||||
- load transport-specific
|
||||
virtqueue fields
|
||||
- notify guest
|
||||
------> load_device()
|
||||
- load device-specific
|
||||
fields
|
||||
- load subsections
|
||||
- device endianness
|
||||
- 64 bit features
|
||||
- virtio-1 virtqueue
|
||||
fields
|
||||
- sanitize endianness
|
||||
- sanitize features
|
||||
- virtqueue index sanity
|
||||
check
|
||||
- feature-dependent setup
|
||||
|
||||
|
||||
Implications of this setup
|
||||
==========================
|
||||
|
||||
Devices need to be careful in their state processing during load: The
|
||||
load_device() procedure is invoked by the core before subsections have
|
||||
been loaded. Any code that depends on information transmitted in subsections
|
||||
therefore has to be invoked in the device's load() function _after_
|
||||
virtio_load() returned (like e.g. code depending on features).
|
||||
|
||||
Any extension of the state being migrated should be done in subsections
|
||||
added to the core for compatibility reasons. If transport or device specific
|
||||
state is added, core needs to invoke a callback from the new subsection.
|
||||
47
exec.c
47
exec.c
@@ -55,6 +55,9 @@
|
||||
#include "exec/ram_addr.h"
|
||||
|
||||
#include "qemu/range.h"
|
||||
#ifndef _WIN32
|
||||
#include "qemu/mmap-alloc.h"
|
||||
#endif
|
||||
|
||||
//#define DEBUG_SUBPAGE
|
||||
|
||||
@@ -84,9 +87,9 @@ static MemoryRegion io_mem_unassigned;
|
||||
*/
|
||||
#define RAM_RESIZEABLE (1 << 2)
|
||||
|
||||
/* An extra page is mapped on top of this RAM.
|
||||
/* RAM is backed by an mmapped file.
|
||||
*/
|
||||
#define RAM_EXTRA (1 << 3)
|
||||
#define RAM_FILE (1 << 3)
|
||||
#endif
|
||||
|
||||
struct CPUTailQ cpus = QTAILQ_HEAD_INITIALIZER(cpus);
|
||||
@@ -1205,13 +1208,10 @@ static void *file_ram_alloc(RAMBlock *block,
|
||||
char *filename;
|
||||
char *sanitized_name;
|
||||
char *c;
|
||||
void *ptr;
|
||||
void *area = NULL;
|
||||
void *area;
|
||||
int fd;
|
||||
uint64_t hpagesize;
|
||||
uint64_t total;
|
||||
Error *local_err = NULL;
|
||||
size_t offset;
|
||||
|
||||
hpagesize = gethugepagesize(path, &local_err);
|
||||
if (local_err) {
|
||||
@@ -1255,7 +1255,6 @@ static void *file_ram_alloc(RAMBlock *block,
|
||||
g_free(filename);
|
||||
|
||||
memory = ROUND_UP(memory, hpagesize);
|
||||
total = memory + hpagesize;
|
||||
|
||||
/*
|
||||
* ftruncate is not supported by hugetlbfs in older
|
||||
@@ -1267,40 +1266,14 @@ static void *file_ram_alloc(RAMBlock *block,
|
||||
perror("ftruncate");
|
||||
}
|
||||
|
||||
ptr = mmap(0, total, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS,
|
||||
-1, 0);
|
||||
if (ptr == MAP_FAILED) {
|
||||
error_setg_errno(errp, errno,
|
||||
"unable to allocate memory range for hugepages");
|
||||
close(fd);
|
||||
goto error;
|
||||
}
|
||||
|
||||
offset = QEMU_ALIGN_UP((uintptr_t)ptr, hpagesize) - (uintptr_t)ptr;
|
||||
|
||||
area = mmap(ptr + offset, memory, PROT_READ | PROT_WRITE,
|
||||
(block->flags & RAM_SHARED ? MAP_SHARED : MAP_PRIVATE) |
|
||||
MAP_FIXED,
|
||||
fd, 0);
|
||||
area = qemu_ram_mmap(fd, memory, hpagesize, block->flags & RAM_SHARED);
|
||||
if (area == MAP_FAILED) {
|
||||
error_setg_errno(errp, errno,
|
||||
"unable to map backing store for hugepages");
|
||||
munmap(ptr, total);
|
||||
close(fd);
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (offset > 0) {
|
||||
munmap(ptr, offset);
|
||||
}
|
||||
ptr += offset;
|
||||
total -= offset;
|
||||
|
||||
if (total > memory + getpagesize()) {
|
||||
munmap(ptr + memory + getpagesize(),
|
||||
total - memory - getpagesize());
|
||||
}
|
||||
|
||||
if (mem_prealloc) {
|
||||
os_mem_prealloc(fd, area, memory);
|
||||
}
|
||||
@@ -1618,7 +1591,7 @@ ram_addr_t qemu_ram_alloc_from_file(ram_addr_t size, MemoryRegion *mr,
|
||||
new_block->used_length = size;
|
||||
new_block->max_length = size;
|
||||
new_block->flags = share ? RAM_SHARED : 0;
|
||||
new_block->flags |= RAM_EXTRA;
|
||||
new_block->flags |= RAM_FILE;
|
||||
new_block->host = file_ram_alloc(new_block, size,
|
||||
mem_path, errp);
|
||||
if (!new_block->host) {
|
||||
@@ -1720,8 +1693,8 @@ static void reclaim_ramblock(RAMBlock *block)
|
||||
xen_invalidate_map_cache_entry(block->host);
|
||||
#ifndef _WIN32
|
||||
} else if (block->fd >= 0) {
|
||||
if (block->flags & RAM_EXTRA) {
|
||||
munmap(block->host, block->max_length + getpagesize());
|
||||
if (block->flags & RAM_FILE) {
|
||||
qemu_ram_munmap(block->host, block->max_length);
|
||||
} else {
|
||||
munmap(block->host, block->max_length);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "fsdev/qemu-fsdev.h"
|
||||
#include "qemu/thread.h"
|
||||
#include "block/coroutine.h"
|
||||
#include "qemu/coroutine.h"
|
||||
#include "virtio-9p-coth.h"
|
||||
|
||||
int v9fs_co_readdir_r(V9fsPDU *pdu, V9fsFidState *fidp, struct dirent *dent,
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "fsdev/qemu-fsdev.h"
|
||||
#include "qemu/thread.h"
|
||||
#include "block/coroutine.h"
|
||||
#include "qemu/coroutine.h"
|
||||
#include "virtio-9p-coth.h"
|
||||
|
||||
int v9fs_co_st_gen(V9fsPDU *pdu, V9fsPath *path, mode_t st_mode,
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "fsdev/qemu-fsdev.h"
|
||||
#include "qemu/thread.h"
|
||||
#include "block/coroutine.h"
|
||||
#include "qemu/coroutine.h"
|
||||
#include "virtio-9p-coth.h"
|
||||
|
||||
static ssize_t __readlink(V9fsState *s, V9fsPath *path, V9fsString *buf)
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "fsdev/qemu-fsdev.h"
|
||||
#include "qemu/thread.h"
|
||||
#include "block/coroutine.h"
|
||||
#include "qemu/coroutine.h"
|
||||
#include "virtio-9p-coth.h"
|
||||
|
||||
int v9fs_co_llistxattr(V9fsPDU *pdu, V9fsPath *path, void *value, size_t size)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "fsdev/qemu-fsdev.h"
|
||||
#include "qemu/thread.h"
|
||||
#include "qemu/event_notifier.h"
|
||||
#include "block/coroutine.h"
|
||||
#include "qemu/coroutine.h"
|
||||
#include "virtio-9p-coth.h"
|
||||
|
||||
/* v9fs glib thread pool */
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#define _QEMU_VIRTIO_9P_COTH_H
|
||||
|
||||
#include "qemu/thread.h"
|
||||
#include "block/coroutine.h"
|
||||
#include "qemu/coroutine.h"
|
||||
#include "virtio-9p.h"
|
||||
#include <glib.h>
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "fsdev/file-op-9p.h"
|
||||
#include "fsdev/virtio-9p-marshal.h"
|
||||
#include "qemu/thread.h"
|
||||
#include "block/coroutine.h"
|
||||
#include "qemu/coroutine.h"
|
||||
|
||||
enum {
|
||||
P9_TLERROR = 6,
|
||||
|
||||
@@ -119,7 +119,7 @@ static const MemMapEntry a15memmap[] = {
|
||||
[VIRT_GIC_REDIST] = { 0x080A0000, 0x00F60000 },
|
||||
[VIRT_UART] = { 0x09000000, 0x00001000 },
|
||||
[VIRT_RTC] = { 0x09010000, 0x00001000 },
|
||||
[VIRT_FW_CFG] = { 0x09020000, 0x0000000a },
|
||||
[VIRT_FW_CFG] = { 0x09020000, 0x00000018 },
|
||||
[VIRT_MMIO] = { 0x0a000000, 0x00000200 },
|
||||
/* ...repeating for a total of NUM_VIRTIO_TRANSPORTS, each of that size */
|
||||
[VIRT_PLATFORM_BUS] = { 0x0c000000, 0x02000000 },
|
||||
@@ -677,13 +677,13 @@ static void create_flash(const VirtBoardInfo *vbi)
|
||||
g_free(nodename);
|
||||
}
|
||||
|
||||
static void create_fw_cfg(const VirtBoardInfo *vbi)
|
||||
static void create_fw_cfg(const VirtBoardInfo *vbi, AddressSpace *as)
|
||||
{
|
||||
hwaddr base = vbi->memmap[VIRT_FW_CFG].base;
|
||||
hwaddr size = vbi->memmap[VIRT_FW_CFG].size;
|
||||
char *nodename;
|
||||
|
||||
fw_cfg_init_mem_wide(base + 8, base, 8);
|
||||
fw_cfg_init_mem_wide(base + 8, base, 8, base + 16, as);
|
||||
|
||||
nodename = g_strdup_printf("/fw-cfg@%" PRIx64, base);
|
||||
qemu_fdt_add_subnode(vbi->fdt, nodename);
|
||||
@@ -1031,7 +1031,7 @@ static void machvirt_init(MachineState *machine)
|
||||
*/
|
||||
create_virtio_devices(vbi, pic);
|
||||
|
||||
create_fw_cfg(vbi);
|
||||
create_fw_cfg(vbi, &address_space_memory);
|
||||
rom_set_fw(fw_cfg_find());
|
||||
|
||||
guest_info->smp_cpus = smp_cpus;
|
||||
|
||||
@@ -488,10 +488,10 @@ static inline int vmsvga_fill_rect(struct vmsvga_state_s *s,
|
||||
#endif
|
||||
|
||||
struct vmsvga_cursor_definition_s {
|
||||
int width;
|
||||
int height;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
int id;
|
||||
int bpp;
|
||||
uint32_t bpp;
|
||||
int hot_x;
|
||||
int hot_y;
|
||||
uint32_t mask[1024];
|
||||
@@ -658,7 +658,10 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s)
|
||||
cursor.bpp = vmsvga_fifo_read(s);
|
||||
|
||||
args = SVGA_BITMAP_SIZE(x, y) + SVGA_PIXMAP_SIZE(x, y, cursor.bpp);
|
||||
if (SVGA_BITMAP_SIZE(x, y) > sizeof cursor.mask ||
|
||||
if (cursor.width > 256 ||
|
||||
cursor.height > 256 ||
|
||||
cursor.bpp > 32 ||
|
||||
SVGA_BITMAP_SIZE(x, y) > sizeof cursor.mask ||
|
||||
SVGA_PIXMAP_SIZE(x, y, cursor.bpp) > sizeof cursor.image) {
|
||||
goto badcmd;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "hw/sysbus.h"
|
||||
#include "exec/address-spaces.h"
|
||||
#include "intel_iommu_internal.h"
|
||||
#include "hw/pci/pci.h"
|
||||
|
||||
/*#define DEBUG_INTEL_IOMMU*/
|
||||
#ifdef DEBUG_INTEL_IOMMU
|
||||
@@ -166,19 +167,17 @@ static gboolean vtd_hash_remove_by_page(gpointer key, gpointer value,
|
||||
*/
|
||||
static void vtd_reset_context_cache(IntelIOMMUState *s)
|
||||
{
|
||||
VTDAddressSpace **pvtd_as;
|
||||
VTDAddressSpace *vtd_as;
|
||||
uint32_t bus_it;
|
||||
VTDBus *vtd_bus;
|
||||
GHashTableIter bus_it;
|
||||
uint32_t devfn_it;
|
||||
|
||||
g_hash_table_iter_init(&bus_it, s->vtd_as_by_busptr);
|
||||
|
||||
VTD_DPRINTF(CACHE, "global context_cache_gen=1");
|
||||
for (bus_it = 0; bus_it < VTD_PCI_BUS_MAX; ++bus_it) {
|
||||
pvtd_as = s->address_spaces[bus_it];
|
||||
if (!pvtd_as) {
|
||||
continue;
|
||||
}
|
||||
while (g_hash_table_iter_next (&bus_it, NULL, (void**)&vtd_bus)) {
|
||||
for (devfn_it = 0; devfn_it < VTD_PCI_DEVFN_MAX; ++devfn_it) {
|
||||
vtd_as = pvtd_as[devfn_it];
|
||||
vtd_as = vtd_bus->dev_as[devfn_it];
|
||||
if (!vtd_as) {
|
||||
continue;
|
||||
}
|
||||
@@ -754,12 +753,13 @@ static inline bool vtd_is_interrupt_addr(hwaddr addr)
|
||||
* @is_write: The access is a write operation
|
||||
* @entry: IOMMUTLBEntry that contain the addr to be translated and result
|
||||
*/
|
||||
static void vtd_do_iommu_translate(VTDAddressSpace *vtd_as, uint8_t bus_num,
|
||||
static void vtd_do_iommu_translate(VTDAddressSpace *vtd_as, PCIBus *bus,
|
||||
uint8_t devfn, hwaddr addr, bool is_write,
|
||||
IOMMUTLBEntry *entry)
|
||||
{
|
||||
IntelIOMMUState *s = vtd_as->iommu_state;
|
||||
VTDContextEntry ce;
|
||||
uint8_t bus_num = pci_bus_num(bus);
|
||||
VTDContextCacheEntry *cc_entry = &vtd_as->context_cache_entry;
|
||||
uint64_t slpte;
|
||||
uint32_t level;
|
||||
@@ -874,6 +874,29 @@ static void vtd_context_global_invalidate(IntelIOMMUState *s)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Find the VTD address space currently associated with a given bus number,
|
||||
*/
|
||||
static VTDBus *vtd_find_as_from_bus_num(IntelIOMMUState *s, uint8_t bus_num)
|
||||
{
|
||||
VTDBus *vtd_bus = s->vtd_as_by_bus_num[bus_num];
|
||||
if (!vtd_bus) {
|
||||
/* Iterate over the registered buses to find the one
|
||||
* which currently hold this bus number, and update the bus_num lookup table:
|
||||
*/
|
||||
GHashTableIter iter;
|
||||
|
||||
g_hash_table_iter_init(&iter, s->vtd_as_by_busptr);
|
||||
while (g_hash_table_iter_next (&iter, NULL, (void**)&vtd_bus)) {
|
||||
if (pci_bus_num(vtd_bus->bus) == bus_num) {
|
||||
s->vtd_as_by_bus_num[bus_num] = vtd_bus;
|
||||
return vtd_bus;
|
||||
}
|
||||
}
|
||||
}
|
||||
return vtd_bus;
|
||||
}
|
||||
|
||||
/* Do a context-cache device-selective invalidation.
|
||||
* @func_mask: FM field after shifting
|
||||
*/
|
||||
@@ -882,7 +905,7 @@ static void vtd_context_device_invalidate(IntelIOMMUState *s,
|
||||
uint16_t func_mask)
|
||||
{
|
||||
uint16_t mask;
|
||||
VTDAddressSpace **pvtd_as;
|
||||
VTDBus *vtd_bus;
|
||||
VTDAddressSpace *vtd_as;
|
||||
uint16_t devfn;
|
||||
uint16_t devfn_it;
|
||||
@@ -903,11 +926,11 @@ static void vtd_context_device_invalidate(IntelIOMMUState *s,
|
||||
}
|
||||
VTD_DPRINTF(INV, "device-selective invalidation source 0x%"PRIx16
|
||||
" mask %"PRIu16, source_id, mask);
|
||||
pvtd_as = s->address_spaces[VTD_SID_TO_BUS(source_id)];
|
||||
if (pvtd_as) {
|
||||
vtd_bus = vtd_find_as_from_bus_num(s, VTD_SID_TO_BUS(source_id));
|
||||
if (vtd_bus) {
|
||||
devfn = VTD_SID_TO_DEVFN(source_id);
|
||||
for (devfn_it = 0; devfn_it < VTD_PCI_DEVFN_MAX; ++devfn_it) {
|
||||
vtd_as = pvtd_as[devfn_it];
|
||||
vtd_as = vtd_bus->dev_as[devfn_it];
|
||||
if (vtd_as && ((devfn_it & mask) == (devfn & mask))) {
|
||||
VTD_DPRINTF(INV, "invalidate context-cahce of devfn 0x%"PRIx16,
|
||||
devfn_it);
|
||||
@@ -1805,11 +1828,11 @@ static IOMMUTLBEntry vtd_iommu_translate(MemoryRegion *iommu, hwaddr addr,
|
||||
return ret;
|
||||
}
|
||||
|
||||
vtd_do_iommu_translate(vtd_as, vtd_as->bus_num, vtd_as->devfn, addr,
|
||||
vtd_do_iommu_translate(vtd_as, vtd_as->bus, vtd_as->devfn, addr,
|
||||
is_write, &ret);
|
||||
VTD_DPRINTF(MMU,
|
||||
"bus %"PRIu8 " slot %"PRIu8 " func %"PRIu8 " devfn %"PRIu8
|
||||
" gpa 0x%"PRIx64 " hpa 0x%"PRIx64, vtd_as->bus_num,
|
||||
" gpa 0x%"PRIx64 " hpa 0x%"PRIx64, pci_bus_num(vtd_as->bus),
|
||||
VTD_PCI_SLOT(vtd_as->devfn), VTD_PCI_FUNC(vtd_as->devfn),
|
||||
vtd_as->devfn, addr, ret.translated_addr);
|
||||
return ret;
|
||||
@@ -1839,6 +1862,38 @@ static Property vtd_properties[] = {
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
|
||||
VTDAddressSpace *vtd_find_add_as(IntelIOMMUState *s, PCIBus *bus, int devfn)
|
||||
{
|
||||
uintptr_t key = (uintptr_t)bus;
|
||||
VTDBus *vtd_bus = g_hash_table_lookup(s->vtd_as_by_busptr, &key);
|
||||
VTDAddressSpace *vtd_dev_as;
|
||||
|
||||
if (!vtd_bus) {
|
||||
/* No corresponding free() */
|
||||
vtd_bus = g_malloc0(sizeof(VTDBus) + sizeof(VTDAddressSpace *) * VTD_PCI_DEVFN_MAX);
|
||||
vtd_bus->bus = bus;
|
||||
key = (uintptr_t)bus;
|
||||
g_hash_table_insert(s->vtd_as_by_busptr, &key, vtd_bus);
|
||||
}
|
||||
|
||||
vtd_dev_as = vtd_bus->dev_as[devfn];
|
||||
|
||||
if (!vtd_dev_as) {
|
||||
vtd_bus->dev_as[devfn] = vtd_dev_as = g_malloc0(sizeof(VTDAddressSpace));
|
||||
|
||||
vtd_dev_as->bus = bus;
|
||||
vtd_dev_as->devfn = (uint8_t)devfn;
|
||||
vtd_dev_as->iommu_state = s;
|
||||
vtd_dev_as->context_cache_entry.context_cache_gen = 0;
|
||||
memory_region_init_iommu(&vtd_dev_as->iommu, OBJECT(s),
|
||||
&s->iommu_ops, "intel_iommu", UINT64_MAX);
|
||||
address_space_init(&vtd_dev_as->as,
|
||||
&vtd_dev_as->iommu, "intel_iommu");
|
||||
}
|
||||
return vtd_dev_as;
|
||||
}
|
||||
|
||||
/* Do the initialization. It will also be called when reset, so pay
|
||||
* attention when adding new initialization stuff.
|
||||
*/
|
||||
@@ -1931,13 +1986,15 @@ static void vtd_realize(DeviceState *dev, Error **errp)
|
||||
IntelIOMMUState *s = INTEL_IOMMU_DEVICE(dev);
|
||||
|
||||
VTD_DPRINTF(GENERAL, "");
|
||||
memset(s->address_spaces, 0, sizeof(s->address_spaces));
|
||||
memset(s->vtd_as_by_bus_num, 0, sizeof(s->vtd_as_by_bus_num));
|
||||
memory_region_init_io(&s->csrmem, OBJECT(s), &vtd_mem_ops, s,
|
||||
"intel_iommu", DMAR_REG_SIZE);
|
||||
sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->csrmem);
|
||||
/* No corresponding destroy */
|
||||
s->iotlb = g_hash_table_new_full(vtd_uint64_hash, vtd_uint64_equal,
|
||||
g_free, g_free);
|
||||
s->vtd_as_by_busptr = g_hash_table_new_full(vtd_uint64_hash, vtd_uint64_equal,
|
||||
g_free, g_free);
|
||||
vtd_init(s);
|
||||
}
|
||||
|
||||
|
||||
25
hw/i386/pc.c
25
hw/i386/pc.c
@@ -752,14 +752,15 @@ static void pc_build_smbios(FWCfgState *fw_cfg)
|
||||
}
|
||||
}
|
||||
|
||||
static FWCfgState *bochs_bios_init(void)
|
||||
static FWCfgState *bochs_bios_init(AddressSpace *as)
|
||||
{
|
||||
FWCfgState *fw_cfg;
|
||||
uint64_t *numa_fw_cfg;
|
||||
int i, j;
|
||||
unsigned int apic_id_limit = pc_apic_id_limit(max_cpus);
|
||||
|
||||
fw_cfg = fw_cfg_init_io(BIOS_CFG_IOPORT);
|
||||
fw_cfg = fw_cfg_init_io_dma(BIOS_CFG_IOPORT, BIOS_CFG_IOPORT + 4, as);
|
||||
|
||||
/* FW_CFG_MAX_CPUS is a bit confusing/problematic on x86:
|
||||
*
|
||||
* SeaBIOS needs FW_CFG_MAX_CPUS for CPU hotplug, but the CPU hotplug
|
||||
@@ -1077,11 +1078,10 @@ out:
|
||||
return cpu;
|
||||
}
|
||||
|
||||
static const char *current_cpu_model;
|
||||
|
||||
void pc_hot_add_cpu(const int64_t id, Error **errp)
|
||||
{
|
||||
X86CPU *cpu;
|
||||
MachineState *machine = MACHINE(qdev_get_machine());
|
||||
int64_t apic_id = x86_cpu_apic_id_from_index(id);
|
||||
Error *local_err = NULL;
|
||||
|
||||
@@ -1109,7 +1109,7 @@ void pc_hot_add_cpu(const int64_t id, Error **errp)
|
||||
return;
|
||||
}
|
||||
|
||||
cpu = pc_new_cpu(current_cpu_model, apic_id, &local_err);
|
||||
cpu = pc_new_cpu(machine->cpu_model, apic_id, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
return;
|
||||
@@ -1117,22 +1117,22 @@ void pc_hot_add_cpu(const int64_t id, Error **errp)
|
||||
object_unref(OBJECT(cpu));
|
||||
}
|
||||
|
||||
void pc_cpus_init(const char *cpu_model)
|
||||
void pc_cpus_init(PCMachineState *pcms)
|
||||
{
|
||||
int i;
|
||||
X86CPU *cpu = NULL;
|
||||
MachineState *machine = MACHINE(pcms);
|
||||
Error *error = NULL;
|
||||
unsigned long apic_id_limit;
|
||||
|
||||
/* init CPUs */
|
||||
if (cpu_model == NULL) {
|
||||
if (machine->cpu_model == NULL) {
|
||||
#ifdef TARGET_X86_64
|
||||
cpu_model = "qemu64";
|
||||
machine->cpu_model = "qemu64";
|
||||
#else
|
||||
cpu_model = "qemu32";
|
||||
machine->cpu_model = "qemu32";
|
||||
#endif
|
||||
}
|
||||
current_cpu_model = cpu_model;
|
||||
|
||||
apic_id_limit = pc_apic_id_limit(max_cpus);
|
||||
if (apic_id_limit > ACPI_CPU_HOTPLUG_ID_LIMIT) {
|
||||
@@ -1142,7 +1142,7 @@ void pc_cpus_init(const char *cpu_model)
|
||||
}
|
||||
|
||||
for (i = 0; i < smp_cpus; i++) {
|
||||
cpu = pc_new_cpu(cpu_model, x86_cpu_apic_id_from_index(i),
|
||||
cpu = pc_new_cpu(machine->cpu_model, x86_cpu_apic_id_from_index(i),
|
||||
&error);
|
||||
if (error) {
|
||||
error_report_err(error);
|
||||
@@ -1393,7 +1393,8 @@ FWCfgState *pc_memory_init(PCMachineState *pcms,
|
||||
option_rom_mr,
|
||||
1);
|
||||
|
||||
fw_cfg = bochs_bios_init();
|
||||
fw_cfg = bochs_bios_init(&address_space_memory);
|
||||
|
||||
rom_set_fw(fw_cfg);
|
||||
|
||||
if (guest_info->has_reserved_memory && pcms->hotplug_memory.base) {
|
||||
|
||||
@@ -139,7 +139,7 @@ static void pc_init1(MachineState *machine,
|
||||
exit(1);
|
||||
}
|
||||
|
||||
pc_cpus_init(machine->cpu_model);
|
||||
pc_cpus_init(pcms);
|
||||
|
||||
if (kvm_enabled() && kvmclock_enabled) {
|
||||
kvmclock_create();
|
||||
|
||||
@@ -128,7 +128,7 @@ static void pc_q35_init(MachineState *machine)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
pc_cpus_init(machine->cpu_model);
|
||||
pc_cpus_init(pcms);
|
||||
pc_acpi_init("q35-acpi-dsdt.aml");
|
||||
|
||||
kvmclock_create();
|
||||
|
||||
@@ -394,7 +394,7 @@ static void ich9_apm_ctrl_changed(uint32_t val, void *arg)
|
||||
|
||||
/* SMI_EN = PMBASE + 30. SMI control and enable register */
|
||||
if (lpc->pm.smi_en & ICH9_PMIO_SMI_EN_APMC_EN) {
|
||||
cpu_interrupt(first_cpu, CPU_INTERRUPT_SMI);
|
||||
cpu_interrupt(current_cpu, CPU_INTERRUPT_SMI);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "sysemu/numa.h"
|
||||
#include "sysemu/kvm.h"
|
||||
#include "trace.h"
|
||||
#include "hw/virtio/vhost.h"
|
||||
|
||||
typedef struct pc_dimms_capacity {
|
||||
uint64_t size;
|
||||
@@ -96,6 +97,12 @@ void pc_dimm_memory_plug(DeviceState *dev, MemoryHotplugState *hpms,
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!vhost_has_free_slot()) {
|
||||
error_setg(&local_err, "a used vhost backend has no free"
|
||||
" memory slots left");
|
||||
goto out;
|
||||
}
|
||||
|
||||
memory_region_add_subregion(&hpms->mr, addr - hpms->base, mr);
|
||||
vmstate_register_ram(mr, dev);
|
||||
numa_set_mem_node_id(addr, memory_region_size(mr), dimm->node);
|
||||
|
||||
@@ -85,6 +85,8 @@ static const int user_feature_bits[] = {
|
||||
VIRTIO_NET_F_CTRL_MAC_ADDR,
|
||||
VIRTIO_NET_F_CTRL_GUEST_OFFLOADS,
|
||||
|
||||
VIRTIO_NET_F_GUEST_ANNOUNCE,
|
||||
|
||||
VIRTIO_NET_F_MQ,
|
||||
|
||||
VHOST_INVALID_FEATURE_BIT
|
||||
@@ -252,8 +254,7 @@ static int vhost_net_start_one(struct vhost_net *net,
|
||||
file.fd = net->backend;
|
||||
for (file.index = 0; file.index < net->dev.nvqs; ++file.index) {
|
||||
const VhostOps *vhost_ops = net->dev.vhost_ops;
|
||||
r = vhost_ops->vhost_call(&net->dev, VHOST_NET_SET_BACKEND,
|
||||
&file);
|
||||
r = vhost_ops->vhost_net_set_backend(&net->dev, &file);
|
||||
if (r < 0) {
|
||||
r = -errno;
|
||||
goto fail;
|
||||
@@ -266,8 +267,7 @@ fail:
|
||||
if (net->nc->info->type == NET_CLIENT_OPTIONS_KIND_TAP) {
|
||||
while (file.index-- > 0) {
|
||||
const VhostOps *vhost_ops = net->dev.vhost_ops;
|
||||
int r = vhost_ops->vhost_call(&net->dev, VHOST_NET_SET_BACKEND,
|
||||
&file);
|
||||
int r = vhost_ops->vhost_net_set_backend(&net->dev, &file);
|
||||
assert(r >= 0);
|
||||
}
|
||||
}
|
||||
@@ -289,15 +289,13 @@ static void vhost_net_stop_one(struct vhost_net *net,
|
||||
if (net->nc->info->type == NET_CLIENT_OPTIONS_KIND_TAP) {
|
||||
for (file.index = 0; file.index < net->dev.nvqs; ++file.index) {
|
||||
const VhostOps *vhost_ops = net->dev.vhost_ops;
|
||||
int r = vhost_ops->vhost_call(&net->dev, VHOST_NET_SET_BACKEND,
|
||||
&file);
|
||||
int r = vhost_ops->vhost_net_set_backend(&net->dev, &file);
|
||||
assert(r >= 0);
|
||||
}
|
||||
} else if (net->nc->info->type == NET_CLIENT_OPTIONS_KIND_VHOST_USER) {
|
||||
for (file.index = 0; file.index < net->dev.nvqs; ++file.index) {
|
||||
const VhostOps *vhost_ops = net->dev.vhost_ops;
|
||||
int r = vhost_ops->vhost_call(&net->dev, VHOST_RESET_DEVICE,
|
||||
NULL);
|
||||
int r = vhost_ops->vhost_reset_device(&net->dev);
|
||||
assert(r >= 0);
|
||||
}
|
||||
}
|
||||
@@ -390,6 +388,18 @@ void vhost_net_cleanup(struct vhost_net *net)
|
||||
g_free(net);
|
||||
}
|
||||
|
||||
int vhost_net_notify_migration_done(struct vhost_net *net, char* mac_addr)
|
||||
{
|
||||
const VhostOps *vhost_ops = net->dev.vhost_ops;
|
||||
int r = -1;
|
||||
|
||||
if (vhost_ops->vhost_migration_done) {
|
||||
r = vhost_ops->vhost_migration_done(&net->dev, mac_addr);
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
bool vhost_net_virtqueue_pending(VHostNetState *net, int idx)
|
||||
{
|
||||
return vhost_virtqueue_pending(&net->dev, idx);
|
||||
@@ -428,8 +438,8 @@ int vhost_set_vring_enable(NetClientState *nc, int enable)
|
||||
VHostNetState *net = get_vhost_net(nc);
|
||||
const VhostOps *vhost_ops = net->dev.vhost_ops;
|
||||
|
||||
if (vhost_ops->vhost_backend_set_vring_enable) {
|
||||
return vhost_ops->vhost_backend_set_vring_enable(&net->dev, enable);
|
||||
if (vhost_ops->vhost_set_vring_enable) {
|
||||
return vhost_ops->vhost_set_vring_enable(&net->dev, enable);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -481,6 +491,11 @@ void vhost_net_virtqueue_mask(VHostNetState *net, VirtIODevice *dev,
|
||||
{
|
||||
}
|
||||
|
||||
int vhost_net_notify_migration_done(struct vhost_net *net, char* mac_addr)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
VHostNetState *get_vhost_net(NetClientState *nc)
|
||||
{
|
||||
return 0;
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
#include "hw/hw.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
#include "sysemu/dma.h"
|
||||
#include "hw/isa/isa.h"
|
||||
#include "hw/nvram/fw_cfg.h"
|
||||
#include "hw/sysbus.h"
|
||||
@@ -30,7 +31,7 @@
|
||||
#include "qemu/error-report.h"
|
||||
#include "qemu/config-file.h"
|
||||
|
||||
#define FW_CFG_SIZE 2
|
||||
#define FW_CFG_CTL_SIZE 2
|
||||
#define FW_CFG_NAME "fw_cfg"
|
||||
#define FW_CFG_PATH "/machine/" FW_CFG_NAME
|
||||
|
||||
@@ -42,6 +43,18 @@
|
||||
#define FW_CFG_IO(obj) OBJECT_CHECK(FWCfgIoState, (obj), TYPE_FW_CFG_IO)
|
||||
#define FW_CFG_MEM(obj) OBJECT_CHECK(FWCfgMemState, (obj), TYPE_FW_CFG_MEM)
|
||||
|
||||
/* FW_CFG_VERSION bits */
|
||||
#define FW_CFG_VERSION 0x01
|
||||
#define FW_CFG_VERSION_DMA 0x02
|
||||
|
||||
/* FW_CFG_DMA_CONTROL bits */
|
||||
#define FW_CFG_DMA_CTL_ERROR 0x01
|
||||
#define FW_CFG_DMA_CTL_READ 0x02
|
||||
#define FW_CFG_DMA_CTL_SKIP 0x04
|
||||
#define FW_CFG_DMA_CTL_SELECT 0x08
|
||||
|
||||
#define FW_CFG_DMA_SIGNATURE 0x51454d5520434647ULL /* "QEMU CFG" */
|
||||
|
||||
typedef struct FWCfgEntry {
|
||||
uint32_t len;
|
||||
uint8_t *data;
|
||||
@@ -59,6 +72,11 @@ struct FWCfgState {
|
||||
uint16_t cur_entry;
|
||||
uint32_t cur_offset;
|
||||
Notifier machine_ready;
|
||||
|
||||
bool dma_enabled;
|
||||
dma_addr_t dma_addr;
|
||||
AddressSpace *dma_as;
|
||||
MemoryRegion dma_iomem;
|
||||
};
|
||||
|
||||
struct FWCfgIoState {
|
||||
@@ -67,7 +85,7 @@ struct FWCfgIoState {
|
||||
/*< public >*/
|
||||
|
||||
MemoryRegion comb_iomem;
|
||||
uint32_t iobase;
|
||||
uint32_t iobase, dma_iobase;
|
||||
};
|
||||
|
||||
struct FWCfgMemState {
|
||||
@@ -292,6 +310,129 @@ static void fw_cfg_data_mem_write(void *opaque, hwaddr addr,
|
||||
} while (i);
|
||||
}
|
||||
|
||||
static void fw_cfg_dma_transfer(FWCfgState *s)
|
||||
{
|
||||
dma_addr_t len;
|
||||
FWCfgDmaAccess dma;
|
||||
int arch;
|
||||
FWCfgEntry *e;
|
||||
int read;
|
||||
dma_addr_t dma_addr;
|
||||
|
||||
/* Reset the address before the next access */
|
||||
dma_addr = s->dma_addr;
|
||||
s->dma_addr = 0;
|
||||
|
||||
if (dma_memory_read(s->dma_as, dma_addr, &dma, sizeof(dma))) {
|
||||
stl_be_dma(s->dma_as, dma_addr + offsetof(FWCfgDmaAccess, control),
|
||||
FW_CFG_DMA_CTL_ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
dma.address = be64_to_cpu(dma.address);
|
||||
dma.length = be32_to_cpu(dma.length);
|
||||
dma.control = be32_to_cpu(dma.control);
|
||||
|
||||
if (dma.control & FW_CFG_DMA_CTL_SELECT) {
|
||||
fw_cfg_select(s, dma.control >> 16);
|
||||
}
|
||||
|
||||
arch = !!(s->cur_entry & FW_CFG_ARCH_LOCAL);
|
||||
e = &s->entries[arch][s->cur_entry & FW_CFG_ENTRY_MASK];
|
||||
|
||||
if (dma.control & FW_CFG_DMA_CTL_READ) {
|
||||
read = 1;
|
||||
} else if (dma.control & FW_CFG_DMA_CTL_SKIP) {
|
||||
read = 0;
|
||||
} else {
|
||||
dma.length = 0;
|
||||
}
|
||||
|
||||
dma.control = 0;
|
||||
|
||||
while (dma.length > 0 && !(dma.control & FW_CFG_DMA_CTL_ERROR)) {
|
||||
if (s->cur_entry == FW_CFG_INVALID || !e->data ||
|
||||
s->cur_offset >= e->len) {
|
||||
len = dma.length;
|
||||
|
||||
/* If the access is not a read access, it will be a skip access,
|
||||
* tested before.
|
||||
*/
|
||||
if (read) {
|
||||
if (dma_memory_set(s->dma_as, dma.address, 0, len)) {
|
||||
dma.control |= FW_CFG_DMA_CTL_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
if (dma.length <= (e->len - s->cur_offset)) {
|
||||
len = dma.length;
|
||||
} else {
|
||||
len = (e->len - s->cur_offset);
|
||||
}
|
||||
|
||||
if (e->read_callback) {
|
||||
e->read_callback(e->callback_opaque, s->cur_offset);
|
||||
}
|
||||
|
||||
/* If the access is not a read access, it will be a skip access,
|
||||
* tested before.
|
||||
*/
|
||||
if (read) {
|
||||
if (dma_memory_write(s->dma_as, dma.address,
|
||||
&e->data[s->cur_offset], len)) {
|
||||
dma.control |= FW_CFG_DMA_CTL_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
s->cur_offset += len;
|
||||
}
|
||||
|
||||
dma.address += len;
|
||||
dma.length -= len;
|
||||
|
||||
}
|
||||
|
||||
stl_be_dma(s->dma_as, dma_addr + offsetof(FWCfgDmaAccess, control),
|
||||
dma.control);
|
||||
|
||||
trace_fw_cfg_read(s, 0);
|
||||
}
|
||||
|
||||
static uint64_t fw_cfg_dma_mem_read(void *opaque, hwaddr addr,
|
||||
unsigned size)
|
||||
{
|
||||
/* Return a signature value (and handle various read sizes) */
|
||||
return extract64(FW_CFG_DMA_SIGNATURE, (8 - addr - size) * 8, size * 8);
|
||||
}
|
||||
|
||||
static void fw_cfg_dma_mem_write(void *opaque, hwaddr addr,
|
||||
uint64_t value, unsigned size)
|
||||
{
|
||||
FWCfgState *s = opaque;
|
||||
|
||||
if (size == 4) {
|
||||
if (addr == 0) {
|
||||
/* FWCfgDmaAccess high address */
|
||||
s->dma_addr = value << 32;
|
||||
} else if (addr == 4) {
|
||||
/* FWCfgDmaAccess low address */
|
||||
s->dma_addr |= value;
|
||||
fw_cfg_dma_transfer(s);
|
||||
}
|
||||
} else if (size == 8 && addr == 0) {
|
||||
s->dma_addr = value;
|
||||
fw_cfg_dma_transfer(s);
|
||||
}
|
||||
}
|
||||
|
||||
static bool fw_cfg_dma_mem_valid(void *opaque, hwaddr addr,
|
||||
unsigned size, bool is_write)
|
||||
{
|
||||
return !is_write || ((size == 4 && (addr == 0 || addr == 4)) ||
|
||||
(size == 8 && addr == 0));
|
||||
}
|
||||
|
||||
static bool fw_cfg_data_mem_valid(void *opaque, hwaddr addr,
|
||||
unsigned size, bool is_write)
|
||||
{
|
||||
@@ -359,6 +500,15 @@ static const MemoryRegionOps fw_cfg_comb_mem_ops = {
|
||||
.valid.accepts = fw_cfg_comb_valid,
|
||||
};
|
||||
|
||||
static const MemoryRegionOps fw_cfg_dma_mem_ops = {
|
||||
.read = fw_cfg_dma_mem_read,
|
||||
.write = fw_cfg_dma_mem_write,
|
||||
.endianness = DEVICE_BIG_ENDIAN,
|
||||
.valid.accepts = fw_cfg_dma_mem_valid,
|
||||
.valid.max_access_size = 8,
|
||||
.impl.max_access_size = 8,
|
||||
};
|
||||
|
||||
static void fw_cfg_reset(DeviceState *d)
|
||||
{
|
||||
FWCfgState *s = FW_CFG(d);
|
||||
@@ -399,6 +549,22 @@ static bool is_version_1(void *opaque, int version_id)
|
||||
return version_id == 1;
|
||||
}
|
||||
|
||||
static bool fw_cfg_dma_enabled(void *opaque)
|
||||
{
|
||||
FWCfgState *s = opaque;
|
||||
|
||||
return s->dma_enabled;
|
||||
}
|
||||
|
||||
static const VMStateDescription vmstate_fw_cfg_dma = {
|
||||
.name = "fw_cfg/dma",
|
||||
.needed = fw_cfg_dma_enabled,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_UINT64(dma_addr, FWCfgState),
|
||||
VMSTATE_END_OF_LIST()
|
||||
},
|
||||
};
|
||||
|
||||
static const VMStateDescription vmstate_fw_cfg = {
|
||||
.name = "fw_cfg",
|
||||
.version_id = 2,
|
||||
@@ -408,6 +574,10 @@ static const VMStateDescription vmstate_fw_cfg = {
|
||||
VMSTATE_UINT16_HACK(cur_offset, FWCfgState, is_version_1),
|
||||
VMSTATE_UINT32_V(cur_offset, FWCfgState, 2),
|
||||
VMSTATE_END_OF_LIST()
|
||||
},
|
||||
.subsections = (const VMStateDescription*[]) {
|
||||
&vmstate_fw_cfg_dma,
|
||||
NULL,
|
||||
}
|
||||
};
|
||||
|
||||
@@ -593,7 +763,6 @@ static void fw_cfg_init1(DeviceState *dev)
|
||||
qdev_init_nofail(dev);
|
||||
|
||||
fw_cfg_add_bytes(s, FW_CFG_SIGNATURE, (char *)"QEMU", 4);
|
||||
fw_cfg_add_i32(s, FW_CFG_ID, 1);
|
||||
fw_cfg_add_bytes(s, FW_CFG_UUID, qemu_uuid, 16);
|
||||
fw_cfg_add_i16(s, FW_CFG_NOGRAPHIC, (uint16_t)(display_type == DT_NOGRAPHIC));
|
||||
fw_cfg_add_i16(s, FW_CFG_NB_CPUS, (uint16_t)smp_cpus);
|
||||
@@ -605,25 +774,53 @@ static void fw_cfg_init1(DeviceState *dev)
|
||||
qemu_add_machine_init_done_notifier(&s->machine_ready);
|
||||
}
|
||||
|
||||
FWCfgState *fw_cfg_init_io(uint32_t iobase)
|
||||
FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
|
||||
AddressSpace *dma_as)
|
||||
{
|
||||
DeviceState *dev;
|
||||
FWCfgState *s;
|
||||
uint32_t version = FW_CFG_VERSION;
|
||||
bool dma_enabled = dma_iobase && dma_as;
|
||||
|
||||
dev = qdev_create(NULL, TYPE_FW_CFG_IO);
|
||||
qdev_prop_set_uint32(dev, "iobase", iobase);
|
||||
fw_cfg_init1(dev);
|
||||
qdev_prop_set_uint32(dev, "dma_iobase", dma_iobase);
|
||||
qdev_prop_set_bit(dev, "dma_enabled", dma_enabled);
|
||||
|
||||
return FW_CFG(dev);
|
||||
fw_cfg_init1(dev);
|
||||
s = FW_CFG(dev);
|
||||
|
||||
if (dma_enabled) {
|
||||
/* 64 bits for the address field */
|
||||
s->dma_as = dma_as;
|
||||
s->dma_addr = 0;
|
||||
|
||||
version |= FW_CFG_VERSION_DMA;
|
||||
}
|
||||
|
||||
FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr, hwaddr data_addr,
|
||||
uint32_t data_width)
|
||||
fw_cfg_add_i32(s, FW_CFG_ID, version);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
FWCfgState *fw_cfg_init_io(uint32_t iobase)
|
||||
{
|
||||
return fw_cfg_init_io_dma(iobase, 0, NULL);
|
||||
}
|
||||
|
||||
FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
|
||||
hwaddr data_addr, uint32_t data_width,
|
||||
hwaddr dma_addr, AddressSpace *dma_as)
|
||||
{
|
||||
DeviceState *dev;
|
||||
SysBusDevice *sbd;
|
||||
FWCfgState *s;
|
||||
uint32_t version = FW_CFG_VERSION;
|
||||
bool dma_enabled = dma_addr && dma_as;
|
||||
|
||||
dev = qdev_create(NULL, TYPE_FW_CFG_MEM);
|
||||
qdev_prop_set_uint32(dev, "data_width", data_width);
|
||||
qdev_prop_set_bit(dev, "dma_enabled", dma_enabled);
|
||||
|
||||
fw_cfg_init1(dev);
|
||||
|
||||
@@ -631,13 +828,25 @@ FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr, hwaddr data_addr,
|
||||
sysbus_mmio_map(sbd, 0, ctl_addr);
|
||||
sysbus_mmio_map(sbd, 1, data_addr);
|
||||
|
||||
return FW_CFG(dev);
|
||||
s = FW_CFG(dev);
|
||||
|
||||
if (dma_enabled) {
|
||||
s->dma_as = dma_as;
|
||||
s->dma_addr = 0;
|
||||
sysbus_mmio_map(sbd, 2, dma_addr);
|
||||
version |= FW_CFG_VERSION_DMA;
|
||||
}
|
||||
|
||||
fw_cfg_add_i32(s, FW_CFG_ID, version);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
FWCfgState *fw_cfg_init_mem(hwaddr ctl_addr, hwaddr data_addr)
|
||||
{
|
||||
return fw_cfg_init_mem_wide(ctl_addr, data_addr,
|
||||
fw_cfg_data_mem_ops.valid.max_access_size);
|
||||
fw_cfg_data_mem_ops.valid.max_access_size,
|
||||
0, NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -664,6 +873,9 @@ static const TypeInfo fw_cfg_info = {
|
||||
|
||||
static Property fw_cfg_io_properties[] = {
|
||||
DEFINE_PROP_UINT32("iobase", FWCfgIoState, iobase, -1),
|
||||
DEFINE_PROP_UINT32("dma_iobase", FWCfgIoState, dma_iobase, -1),
|
||||
DEFINE_PROP_BOOL("dma_enabled", FWCfgIoState, parent_obj.dma_enabled,
|
||||
false),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
@@ -673,8 +885,15 @@ static void fw_cfg_io_realize(DeviceState *dev, Error **errp)
|
||||
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
|
||||
|
||||
memory_region_init_io(&s->comb_iomem, OBJECT(s), &fw_cfg_comb_mem_ops,
|
||||
FW_CFG(s), "fwcfg", FW_CFG_SIZE);
|
||||
FW_CFG(s), "fwcfg", FW_CFG_CTL_SIZE);
|
||||
sysbus_add_io(sbd, s->iobase, &s->comb_iomem);
|
||||
|
||||
if (FW_CFG(s)->dma_enabled) {
|
||||
memory_region_init_io(&FW_CFG(s)->dma_iomem, OBJECT(s),
|
||||
&fw_cfg_dma_mem_ops, FW_CFG(s), "fwcfg.dma",
|
||||
sizeof(dma_addr_t));
|
||||
sysbus_add_io(sbd, s->dma_iobase, &FW_CFG(s)->dma_iomem);
|
||||
}
|
||||
}
|
||||
|
||||
static void fw_cfg_io_class_init(ObjectClass *klass, void *data)
|
||||
@@ -695,6 +914,8 @@ static const TypeInfo fw_cfg_io_info = {
|
||||
|
||||
static Property fw_cfg_mem_properties[] = {
|
||||
DEFINE_PROP_UINT32("data_width", FWCfgMemState, data_width, -1),
|
||||
DEFINE_PROP_BOOL("dma_enabled", FWCfgMemState, parent_obj.dma_enabled,
|
||||
false),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
@@ -705,7 +926,7 @@ static void fw_cfg_mem_realize(DeviceState *dev, Error **errp)
|
||||
const MemoryRegionOps *data_ops = &fw_cfg_data_mem_ops;
|
||||
|
||||
memory_region_init_io(&s->ctl_iomem, OBJECT(s), &fw_cfg_ctl_mem_ops,
|
||||
FW_CFG(s), "fwcfg.ctl", FW_CFG_SIZE);
|
||||
FW_CFG(s), "fwcfg.ctl", FW_CFG_CTL_SIZE);
|
||||
sysbus_init_mmio(sbd, &s->ctl_iomem);
|
||||
|
||||
if (s->data_width > data_ops->valid.max_access_size) {
|
||||
@@ -723,6 +944,13 @@ static void fw_cfg_mem_realize(DeviceState *dev, Error **errp)
|
||||
memory_region_init_io(&s->data_iomem, OBJECT(s), data_ops, FW_CFG(s),
|
||||
"fwcfg.data", data_ops->valid.max_access_size);
|
||||
sysbus_init_mmio(sbd, &s->data_iomem);
|
||||
|
||||
if (FW_CFG(s)->dma_enabled) {
|
||||
memory_region_init_io(&FW_CFG(s)->dma_iomem, OBJECT(s),
|
||||
&fw_cfg_dma_mem_ops, FW_CFG(s), "fwcfg.dma",
|
||||
sizeof(dma_addr_t));
|
||||
sysbus_init_mmio(sbd, &FW_CFG(s)->dma_iomem);
|
||||
}
|
||||
}
|
||||
|
||||
static void fw_cfg_mem_class_init(ObjectClass *klass, void *data)
|
||||
|
||||
@@ -764,6 +764,7 @@ static int host_pci_config_read(int pos, int len, uint32_t val)
|
||||
/* Access real host bridge. */
|
||||
int rc = snprintf(path, size, "/sys/bus/pci/devices/%04x:%02x:%02x.%d/%s",
|
||||
0, 0, 0, 0, "config");
|
||||
int ret = 0;
|
||||
|
||||
if (rc >= size || rc < 0) {
|
||||
return -ENODEV;
|
||||
@@ -775,16 +776,18 @@ static int host_pci_config_read(int pos, int len, uint32_t val)
|
||||
}
|
||||
|
||||
if (lseek(config_fd, pos, SEEK_SET) != pos) {
|
||||
return -errno;
|
||||
ret = -errno;
|
||||
goto out;
|
||||
}
|
||||
do {
|
||||
rc = read(config_fd, (uint8_t *)&val, len);
|
||||
} while (rc < 0 && (errno == EINTR || errno == EAGAIN));
|
||||
if (rc != len) {
|
||||
return -errno;
|
||||
ret = -errno;
|
||||
}
|
||||
|
||||
return 0;
|
||||
out:
|
||||
close(config_fd);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int igd_pt_i440fx_initfn(struct PCIDevice *pci_dev)
|
||||
|
||||
@@ -426,31 +426,12 @@ static void mch_reset(DeviceState *qdev)
|
||||
static AddressSpace *q35_host_dma_iommu(PCIBus *bus, void *opaque, int devfn)
|
||||
{
|
||||
IntelIOMMUState *s = opaque;
|
||||
VTDAddressSpace **pvtd_as;
|
||||
int bus_num = pci_bus_num(bus);
|
||||
VTDAddressSpace *vtd_as;
|
||||
|
||||
assert(0 <= bus_num && bus_num <= VTD_PCI_BUS_MAX);
|
||||
assert(0 <= devfn && devfn <= VTD_PCI_DEVFN_MAX);
|
||||
|
||||
pvtd_as = s->address_spaces[bus_num];
|
||||
if (!pvtd_as) {
|
||||
/* No corresponding free() */
|
||||
pvtd_as = g_malloc0(sizeof(VTDAddressSpace *) * VTD_PCI_DEVFN_MAX);
|
||||
s->address_spaces[bus_num] = pvtd_as;
|
||||
}
|
||||
if (!pvtd_as[devfn]) {
|
||||
pvtd_as[devfn] = g_malloc0(sizeof(VTDAddressSpace));
|
||||
|
||||
pvtd_as[devfn]->bus_num = (uint8_t)bus_num;
|
||||
pvtd_as[devfn]->devfn = (uint8_t)devfn;
|
||||
pvtd_as[devfn]->iommu_state = s;
|
||||
pvtd_as[devfn]->context_cache_entry.context_cache_gen = 0;
|
||||
memory_region_init_iommu(&pvtd_as[devfn]->iommu, OBJECT(s),
|
||||
&s->iommu_ops, "intel_iommu", UINT64_MAX);
|
||||
address_space_init(&pvtd_as[devfn]->as,
|
||||
&pvtd_as[devfn]->iommu, "intel_iommu");
|
||||
}
|
||||
return &pvtd_as[devfn]->as;
|
||||
vtd_as = vtd_find_add_as(s, bus, devfn);
|
||||
return &vtd_as->as;
|
||||
}
|
||||
|
||||
static void mch_init_dmar(MCHPCIState *mch)
|
||||
|
||||
@@ -1169,6 +1169,7 @@ static int spapr_vga_init(PCIBus *pci_bus)
|
||||
case VGA_DEVICE:
|
||||
return true;
|
||||
case VGA_STD:
|
||||
case VGA_VIRTIO:
|
||||
return pci_vga_init(pci_bus) != NULL;
|
||||
default:
|
||||
fprintf(stderr, "This vga model is not supported,"
|
||||
|
||||
@@ -95,6 +95,11 @@ static const VMStateDescription vmstate_ipl = {
|
||||
}
|
||||
};
|
||||
|
||||
static S390IPLState *get_ipl_device(void)
|
||||
{
|
||||
return S390_IPL(object_resolve_path_type("", TYPE_S390_IPL, NULL));
|
||||
}
|
||||
|
||||
static uint64_t bios_translate_addr(void *opaque, uint64_t srcaddr)
|
||||
{
|
||||
uint64_t dstaddr = *(uint64_t *) opaque;
|
||||
@@ -218,7 +223,7 @@ static Property s390_ipl_properties[] = {
|
||||
* - -1 if no valid boot device was found
|
||||
* - ccw id of the boot device otherwise
|
||||
*/
|
||||
static uint64_t s390_update_iplstate(CPUS390XState *env, S390IPLState *ipl)
|
||||
static uint64_t s390_update_iplstate(S390IPLState *ipl)
|
||||
{
|
||||
DeviceState *dev_st;
|
||||
|
||||
@@ -251,25 +256,19 @@ out:
|
||||
return (uint32_t) (ipl->cssid << 24 | ipl->ssid << 16 | ipl->devno);
|
||||
}
|
||||
|
||||
int s390_ipl_update_diag308(IplParameterBlock *iplb)
|
||||
void s390_ipl_update_diag308(IplParameterBlock *iplb)
|
||||
{
|
||||
S390IPLState *ipl;
|
||||
S390IPLState *ipl = get_ipl_device();
|
||||
|
||||
ipl = S390_IPL(object_resolve_path(TYPE_S390_IPL, NULL));
|
||||
if (ipl) {
|
||||
ipl->iplb = *iplb;
|
||||
ipl->iplb_valid = true;
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
IplParameterBlock *s390_ipl_get_iplb(void)
|
||||
{
|
||||
S390IPLState *ipl;
|
||||
S390IPLState *ipl = get_ipl_device();
|
||||
|
||||
ipl = S390_IPL(object_resolve_path(TYPE_S390_IPL, NULL));
|
||||
if (!ipl || !ipl->iplb_valid) {
|
||||
if (!ipl->iplb_valid) {
|
||||
return NULL;
|
||||
}
|
||||
return &ipl->iplb;
|
||||
@@ -277,33 +276,33 @@ IplParameterBlock *s390_ipl_get_iplb(void)
|
||||
|
||||
void s390_reipl_request(void)
|
||||
{
|
||||
S390IPLState *ipl;
|
||||
S390IPLState *ipl = get_ipl_device();
|
||||
|
||||
ipl = S390_IPL(object_resolve_path(TYPE_S390_IPL, NULL));
|
||||
ipl->reipl_requested = true;
|
||||
qemu_system_reset_request();
|
||||
}
|
||||
|
||||
void s390_ipl_prepare_cpu(S390CPU *cpu)
|
||||
{
|
||||
S390IPLState *ipl = get_ipl_device();
|
||||
|
||||
cpu->env.psw.addr = ipl->start_addr;
|
||||
cpu->env.psw.mask = IPL_PSW_MASK;
|
||||
|
||||
if (!ipl->kernel || ipl->iplb_valid) {
|
||||
cpu->env.psw.addr = ipl->bios_start_addr;
|
||||
cpu->env.regs[7] = s390_update_iplstate(ipl);
|
||||
}
|
||||
}
|
||||
|
||||
static void s390_ipl_reset(DeviceState *dev)
|
||||
{
|
||||
S390IPLState *ipl = S390_IPL(dev);
|
||||
S390CPU *cpu = S390_CPU(qemu_get_cpu(0));
|
||||
CPUS390XState *env = &cpu->env;
|
||||
|
||||
env->psw.addr = ipl->start_addr;
|
||||
env->psw.mask = IPL_PSW_MASK;
|
||||
|
||||
if (!ipl->reipl_requested) {
|
||||
ipl->iplb_valid = false;
|
||||
}
|
||||
ipl->reipl_requested = false;
|
||||
|
||||
if (!ipl->kernel || ipl->iplb_valid) {
|
||||
env->psw.addr = ipl->bios_start_addr;
|
||||
env->regs[7] = s390_update_iplstate(env, ipl);
|
||||
}
|
||||
|
||||
s390_cpu_set_state(CPU_STATE_OPERATING, cpu);
|
||||
}
|
||||
|
||||
static void s390_ipl_class_init(ObjectClass *klass, void *data)
|
||||
|
||||
@@ -12,13 +12,16 @@
|
||||
#ifndef HW_S390_IPL_H
|
||||
#define HW_S390_IPL_H
|
||||
|
||||
#include "cpu.h"
|
||||
|
||||
typedef struct IplParameterBlock {
|
||||
uint8_t reserved1[110];
|
||||
uint16_t devno;
|
||||
uint8_t reserved2[88];
|
||||
} IplParameterBlock;
|
||||
|
||||
int s390_ipl_update_diag308(IplParameterBlock *iplb);
|
||||
void s390_ipl_update_diag308(IplParameterBlock *iplb);
|
||||
void s390_ipl_prepare_cpu(S390CPU *cpu);
|
||||
IplParameterBlock *s390_ipl_get_iplb(void);
|
||||
void s390_reipl_request(void);
|
||||
|
||||
|
||||
@@ -35,26 +35,23 @@ typedef struct S390CcwMachineState {
|
||||
bool dea_key_wrap;
|
||||
} S390CcwMachineState;
|
||||
|
||||
static const char *const reset_dev_types[] = {
|
||||
"virtual-css-bridge",
|
||||
"s390-sclp-event-facility",
|
||||
"s390-flic",
|
||||
"diag288",
|
||||
};
|
||||
|
||||
void subsystem_reset(void)
|
||||
{
|
||||
DeviceState *css, *sclp, *flic, *diag288;
|
||||
DeviceState *dev;
|
||||
int i;
|
||||
|
||||
css = DEVICE(object_resolve_path_type("", "virtual-css-bridge", NULL));
|
||||
if (css) {
|
||||
qdev_reset_all(css);
|
||||
for (i = 0; i < ARRAY_SIZE(reset_dev_types); i++) {
|
||||
dev = DEVICE(object_resolve_path_type("", reset_dev_types[i], NULL));
|
||||
if (dev) {
|
||||
qdev_reset_all(dev);
|
||||
}
|
||||
sclp = DEVICE(object_resolve_path_type("",
|
||||
"s390-sclp-event-facility", NULL));
|
||||
if (sclp) {
|
||||
qdev_reset_all(sclp);
|
||||
}
|
||||
flic = DEVICE(object_resolve_path_type("", "s390-flic", NULL));
|
||||
if (flic) {
|
||||
qdev_reset_all(flic);
|
||||
}
|
||||
diag288 = DEVICE(object_resolve_path_type("", "diag288", NULL));
|
||||
if (diag288) {
|
||||
qdev_reset_all(diag288);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,6 +161,7 @@ static void ccw_machine_class_init(ObjectClass *oc, void *data)
|
||||
NMIClass *nc = NMI_CLASS(oc);
|
||||
|
||||
mc->init = ccw_init;
|
||||
mc->reset = s390_machine_reset;
|
||||
mc->block_default_type = IF_VIRTIO;
|
||||
mc->no_cdrom = 1;
|
||||
mc->no_floppy = 1;
|
||||
@@ -262,6 +260,18 @@ static const TypeInfo ccw_machine_info = {
|
||||
.driver = "virtio-rng-ccw",\
|
||||
.property = "max_revision",\
|
||||
.value = "0",\
|
||||
},{\
|
||||
.driver = "virtio-net-ccw",\
|
||||
.property = "max_revision",\
|
||||
.value = "0",\
|
||||
},{\
|
||||
.driver = "virtio-scsi-ccw",\
|
||||
.property = "max_revision",\
|
||||
.value = "0",\
|
||||
},{\
|
||||
.driver = "vhost-scsi-ccw",\
|
||||
.property = "max_revision",\
|
||||
.value = "0",\
|
||||
},
|
||||
|
||||
static void ccw_machine_2_4_class_init(ObjectClass *oc, void *data)
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "hw/s390x/s390_flic.h"
|
||||
#include "hw/s390x/s390-virtio.h"
|
||||
#include "hw/s390x/storage-keys.h"
|
||||
#include "hw/s390x/ipl.h"
|
||||
#include "cpu.h"
|
||||
|
||||
//#define DEBUG_S390
|
||||
@@ -314,6 +315,19 @@ void s390_nmi(NMIState *n, int cpu_index, Error **errp)
|
||||
}
|
||||
}
|
||||
|
||||
void s390_machine_reset(void)
|
||||
{
|
||||
S390CPU *ipl_cpu = S390_CPU(qemu_get_cpu(0));
|
||||
|
||||
qemu_devices_reset();
|
||||
s390_cmma_reset();
|
||||
s390_crypto_reset();
|
||||
|
||||
/* all cpus are stopped - configure and start the ipl cpu only */
|
||||
s390_ipl_prepare_cpu(ipl_cpu);
|
||||
s390_cpu_set_state(CPU_STATE_OPERATING, ipl_cpu);
|
||||
}
|
||||
|
||||
static void s390_machine_class_init(ObjectClass *oc, void *data)
|
||||
{
|
||||
MachineClass *mc = MACHINE_CLASS(oc);
|
||||
@@ -322,6 +336,7 @@ static void s390_machine_class_init(ObjectClass *oc, void *data)
|
||||
mc->alias = "s390";
|
||||
mc->desc = "VirtIO based S390 machine";
|
||||
mc->init = s390_init;
|
||||
mc->reset = s390_machine_reset;
|
||||
mc->block_default_type = IF_VIRTIO;
|
||||
mc->max_cpus = 255;
|
||||
mc->no_serial = 1;
|
||||
|
||||
@@ -27,5 +27,6 @@ void s390_init_ipl_dev(const char *kernel_filename,
|
||||
bool enforce_bios);
|
||||
void s390_create_virtio_net(BusState *bus, const char *name);
|
||||
void s390_nmi(NMIState *n, int cpu_index, Error **errp);
|
||||
void s390_machine_reset(void);
|
||||
void s390_memory_init(ram_addr_t mem_size);
|
||||
#endif
|
||||
|
||||
@@ -46,7 +46,7 @@ static int vhost_scsi_set_endpoint(VHostSCSI *s)
|
||||
|
||||
memset(&backend, 0, sizeof(backend));
|
||||
pstrcpy(backend.vhost_wwpn, sizeof(backend.vhost_wwpn), vs->conf.wwpn);
|
||||
ret = vhost_ops->vhost_call(&s->dev, VHOST_SCSI_SET_ENDPOINT, &backend);
|
||||
ret = vhost_ops->vhost_scsi_set_endpoint(&s->dev, &backend);
|
||||
if (ret < 0) {
|
||||
return -errno;
|
||||
}
|
||||
@@ -61,7 +61,7 @@ static void vhost_scsi_clear_endpoint(VHostSCSI *s)
|
||||
|
||||
memset(&backend, 0, sizeof(backend));
|
||||
pstrcpy(backend.vhost_wwpn, sizeof(backend.vhost_wwpn), vs->conf.wwpn);
|
||||
vhost_ops->vhost_call(&s->dev, VHOST_SCSI_CLEAR_ENDPOINT, &backend);
|
||||
vhost_ops->vhost_scsi_clear_endpoint(&s->dev, &backend);
|
||||
}
|
||||
|
||||
static int vhost_scsi_start(VHostSCSI *s)
|
||||
@@ -77,8 +77,7 @@ static int vhost_scsi_start(VHostSCSI *s)
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
ret = vhost_ops->vhost_call(&s->dev,
|
||||
VHOST_SCSI_GET_ABI_VERSION, &abi_version);
|
||||
ret = vhost_ops->vhost_scsi_get_abi_version(&s->dev, &abi_version);
|
||||
if (ret < 0) {
|
||||
return -errno;
|
||||
}
|
||||
|
||||
@@ -655,9 +655,12 @@ void hmp_info_usb(Monitor *mon, const QDict *qdict)
|
||||
dev = port->dev;
|
||||
if (!dev)
|
||||
continue;
|
||||
monitor_printf(mon, " Device %d.%d, Port %s, Speed %s Mb/s, Product %s\n",
|
||||
bus->busnr, dev->addr, port->path, usb_speed(dev->speed),
|
||||
dev->product_desc);
|
||||
monitor_printf(mon, " Device %d.%d, Port %s, Speed %s Mb/s, "
|
||||
"Product %s%s%s\n",
|
||||
bus->busnr, dev->addr, port->path,
|
||||
usb_speed(dev->speed), dev->product_desc,
|
||||
dev->qdev.id ? ", ID: " : "",
|
||||
dev->qdev.id ?: "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -664,7 +664,7 @@ static const VMStateDescription vmstate_usb_audio = {
|
||||
static Property usb_audio_properties[] = {
|
||||
DEFINE_PROP_UINT32("debug", USBAudioState, debug, 0),
|
||||
DEFINE_PROP_UINT32("buffer", USBAudioState, buffer,
|
||||
8 * USBAUDIO_PACKET_SIZE),
|
||||
32 * USBAUDIO_PACKET_SIZE),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
|
||||
@@ -451,6 +451,7 @@ static void usb_host_req_complete_iso(struct libusb_transfer *transfer)
|
||||
}
|
||||
if (xfer->ring->ep->pid == USB_TOKEN_IN) {
|
||||
QTAILQ_INSERT_TAIL(&xfer->ring->copy, xfer, next);
|
||||
usb_wakeup(xfer->ring->ep, 0);
|
||||
} else {
|
||||
QTAILQ_INSERT_TAIL(&xfer->ring->unused, xfer, next);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "hw/virtio/vhost.h"
|
||||
#include "hw/virtio/vhost-backend.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "linux/vhost.h"
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
@@ -42,6 +43,122 @@ static int vhost_kernel_cleanup(struct vhost_dev *dev)
|
||||
return close(fd);
|
||||
}
|
||||
|
||||
static int vhost_kernel_memslots_limit(struct vhost_dev *dev)
|
||||
{
|
||||
int limit = 64;
|
||||
char *s;
|
||||
|
||||
if (g_file_get_contents("/sys/module/vhost/parameters/max_mem_regions",
|
||||
&s, NULL, NULL)) {
|
||||
uint64_t val = g_ascii_strtoull(s, NULL, 10);
|
||||
if (!((val == G_MAXUINT64 || !val) && errno)) {
|
||||
return val;
|
||||
}
|
||||
error_report("ignoring invalid max_mem_regions value in vhost module:"
|
||||
" %s", s);
|
||||
}
|
||||
return limit;
|
||||
}
|
||||
|
||||
static int vhost_kernel_net_set_backend(struct vhost_dev *dev,
|
||||
struct vhost_vring_file *file)
|
||||
{
|
||||
return vhost_kernel_call(dev, VHOST_NET_SET_BACKEND, file);
|
||||
}
|
||||
|
||||
static int vhost_kernel_scsi_set_endpoint(struct vhost_dev *dev,
|
||||
struct vhost_scsi_target *target)
|
||||
{
|
||||
return vhost_kernel_call(dev, VHOST_SCSI_SET_ENDPOINT, target);
|
||||
}
|
||||
|
||||
static int vhost_kernel_scsi_clear_endpoint(struct vhost_dev *dev,
|
||||
struct vhost_scsi_target *target)
|
||||
{
|
||||
return vhost_kernel_call(dev, VHOST_SCSI_CLEAR_ENDPOINT, target);
|
||||
}
|
||||
|
||||
static int vhost_kernel_scsi_get_abi_version(struct vhost_dev *dev, int *version)
|
||||
{
|
||||
return vhost_kernel_call(dev, VHOST_SCSI_GET_ABI_VERSION, version);
|
||||
}
|
||||
|
||||
static int vhost_kernel_set_log_base(struct vhost_dev *dev, uint64_t base,
|
||||
struct vhost_log *log)
|
||||
{
|
||||
return vhost_kernel_call(dev, VHOST_SET_LOG_BASE, &base);
|
||||
}
|
||||
|
||||
static int vhost_kernel_set_mem_table(struct vhost_dev *dev,
|
||||
struct vhost_memory *mem)
|
||||
{
|
||||
return vhost_kernel_call(dev, VHOST_SET_MEM_TABLE, mem);
|
||||
}
|
||||
|
||||
static int vhost_kernel_set_vring_addr(struct vhost_dev *dev,
|
||||
struct vhost_vring_addr *addr)
|
||||
{
|
||||
return vhost_kernel_call(dev, VHOST_SET_VRING_ADDR, addr);
|
||||
}
|
||||
|
||||
static int vhost_kernel_set_vring_endian(struct vhost_dev *dev,
|
||||
struct vhost_vring_state *ring)
|
||||
{
|
||||
return vhost_kernel_call(dev, VHOST_SET_VRING_ENDIAN, ring);
|
||||
}
|
||||
|
||||
static int vhost_kernel_set_vring_num(struct vhost_dev *dev,
|
||||
struct vhost_vring_state *ring)
|
||||
{
|
||||
return vhost_kernel_call(dev, VHOST_SET_VRING_NUM, ring);
|
||||
}
|
||||
|
||||
static int vhost_kernel_set_vring_base(struct vhost_dev *dev,
|
||||
struct vhost_vring_state *ring)
|
||||
{
|
||||
return vhost_kernel_call(dev, VHOST_SET_VRING_BASE, ring);
|
||||
}
|
||||
|
||||
static int vhost_kernel_get_vring_base(struct vhost_dev *dev,
|
||||
struct vhost_vring_state *ring)
|
||||
{
|
||||
return vhost_kernel_call(dev, VHOST_GET_VRING_BASE, ring);
|
||||
}
|
||||
|
||||
static int vhost_kernel_set_vring_kick(struct vhost_dev *dev,
|
||||
struct vhost_vring_file *file)
|
||||
{
|
||||
return vhost_kernel_call(dev, VHOST_SET_VRING_KICK, file);
|
||||
}
|
||||
|
||||
static int vhost_kernel_set_vring_call(struct vhost_dev *dev,
|
||||
struct vhost_vring_file *file)
|
||||
{
|
||||
return vhost_kernel_call(dev, VHOST_SET_VRING_CALL, file);
|
||||
}
|
||||
|
||||
static int vhost_kernel_set_features(struct vhost_dev *dev,
|
||||
uint64_t features)
|
||||
{
|
||||
return vhost_kernel_call(dev, VHOST_SET_FEATURES, &features);
|
||||
}
|
||||
|
||||
static int vhost_kernel_get_features(struct vhost_dev *dev,
|
||||
uint64_t *features)
|
||||
{
|
||||
return vhost_kernel_call(dev, VHOST_GET_FEATURES, features);
|
||||
}
|
||||
|
||||
static int vhost_kernel_set_owner(struct vhost_dev *dev)
|
||||
{
|
||||
return vhost_kernel_call(dev, VHOST_SET_OWNER, NULL);
|
||||
}
|
||||
|
||||
static int vhost_kernel_reset_device(struct vhost_dev *dev)
|
||||
{
|
||||
return vhost_kernel_call(dev, VHOST_RESET_DEVICE, NULL);
|
||||
}
|
||||
|
||||
static int vhost_kernel_get_vq_index(struct vhost_dev *dev, int idx)
|
||||
{
|
||||
assert(idx >= dev->vq_index && idx < dev->vq_index + dev->nvqs);
|
||||
@@ -51,10 +168,27 @@ static int vhost_kernel_get_vq_index(struct vhost_dev *dev, int idx)
|
||||
|
||||
static const VhostOps kernel_ops = {
|
||||
.backend_type = VHOST_BACKEND_TYPE_KERNEL,
|
||||
.vhost_call = vhost_kernel_call,
|
||||
.vhost_backend_init = vhost_kernel_init,
|
||||
.vhost_backend_cleanup = vhost_kernel_cleanup,
|
||||
.vhost_backend_get_vq_index = vhost_kernel_get_vq_index,
|
||||
.vhost_backend_memslots_limit = vhost_kernel_memslots_limit,
|
||||
.vhost_net_set_backend = vhost_kernel_net_set_backend,
|
||||
.vhost_scsi_set_endpoint = vhost_kernel_scsi_set_endpoint,
|
||||
.vhost_scsi_clear_endpoint = vhost_kernel_scsi_clear_endpoint,
|
||||
.vhost_scsi_get_abi_version = vhost_kernel_scsi_get_abi_version,
|
||||
.vhost_set_log_base = vhost_kernel_set_log_base,
|
||||
.vhost_set_mem_table = vhost_kernel_set_mem_table,
|
||||
.vhost_set_vring_addr = vhost_kernel_set_vring_addr,
|
||||
.vhost_set_vring_endian = vhost_kernel_set_vring_endian,
|
||||
.vhost_set_vring_num = vhost_kernel_set_vring_num,
|
||||
.vhost_set_vring_base = vhost_kernel_set_vring_base,
|
||||
.vhost_get_vring_base = vhost_kernel_get_vring_base,
|
||||
.vhost_set_vring_kick = vhost_kernel_set_vring_kick,
|
||||
.vhost_set_vring_call = vhost_kernel_set_vring_call,
|
||||
.vhost_set_features = vhost_kernel_set_features,
|
||||
.vhost_get_features = vhost_kernel_get_features,
|
||||
.vhost_set_owner = vhost_kernel_set_owner,
|
||||
.vhost_reset_device = vhost_kernel_reset_device,
|
||||
.vhost_get_vq_index = vhost_kernel_get_vq_index,
|
||||
};
|
||||
|
||||
int vhost_set_backend_type(struct vhost_dev *dev, VhostBackendType backend_type)
|
||||
|
||||
@@ -10,11 +10,13 @@
|
||||
|
||||
#include "hw/virtio/vhost.h"
|
||||
#include "hw/virtio/vhost-backend.h"
|
||||
#include "hw/virtio/virtio-net.h"
|
||||
#include "sysemu/char.h"
|
||||
#include "sysemu/kvm.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qemu/sockets.h"
|
||||
#include "exec/ram_addr.h"
|
||||
#include "migration/migration.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
@@ -25,9 +27,16 @@
|
||||
|
||||
#define VHOST_MEMORY_MAX_NREGIONS 8
|
||||
#define VHOST_USER_F_PROTOCOL_FEATURES 30
|
||||
#define VHOST_USER_PROTOCOL_FEATURE_MASK 0x1ULL
|
||||
|
||||
#define VHOST_USER_PROTOCOL_F_MQ 0
|
||||
enum VhostUserProtocolFeature {
|
||||
VHOST_USER_PROTOCOL_F_MQ = 0,
|
||||
VHOST_USER_PROTOCOL_F_LOG_SHMFD = 1,
|
||||
VHOST_USER_PROTOCOL_F_RARP = 2,
|
||||
|
||||
VHOST_USER_PROTOCOL_F_MAX
|
||||
};
|
||||
|
||||
#define VHOST_USER_PROTOCOL_FEATURE_MASK ((1 << VHOST_USER_PROTOCOL_F_MAX) - 1)
|
||||
|
||||
typedef enum VhostUserRequest {
|
||||
VHOST_USER_NONE = 0,
|
||||
@@ -49,6 +58,7 @@ typedef enum VhostUserRequest {
|
||||
VHOST_USER_SET_PROTOCOL_FEATURES = 16,
|
||||
VHOST_USER_GET_QUEUE_NUM = 17,
|
||||
VHOST_USER_SET_VRING_ENABLE = 18,
|
||||
VHOST_USER_SEND_RARP = 19,
|
||||
VHOST_USER_MAX
|
||||
} VhostUserRequest;
|
||||
|
||||
@@ -97,37 +107,6 @@ static bool ioeventfd_enabled(void)
|
||||
return kvm_enabled() && kvm_eventfds_enabled();
|
||||
}
|
||||
|
||||
static unsigned long int ioctl_to_vhost_user_request[VHOST_USER_MAX] = {
|
||||
-1, /* VHOST_USER_NONE */
|
||||
VHOST_GET_FEATURES, /* VHOST_USER_GET_FEATURES */
|
||||
VHOST_SET_FEATURES, /* VHOST_USER_SET_FEATURES */
|
||||
VHOST_SET_OWNER, /* VHOST_USER_SET_OWNER */
|
||||
VHOST_RESET_DEVICE, /* VHOST_USER_RESET_DEVICE */
|
||||
VHOST_SET_MEM_TABLE, /* VHOST_USER_SET_MEM_TABLE */
|
||||
VHOST_SET_LOG_BASE, /* VHOST_USER_SET_LOG_BASE */
|
||||
VHOST_SET_LOG_FD, /* VHOST_USER_SET_LOG_FD */
|
||||
VHOST_SET_VRING_NUM, /* VHOST_USER_SET_VRING_NUM */
|
||||
VHOST_SET_VRING_ADDR, /* VHOST_USER_SET_VRING_ADDR */
|
||||
VHOST_SET_VRING_BASE, /* VHOST_USER_SET_VRING_BASE */
|
||||
VHOST_GET_VRING_BASE, /* VHOST_USER_GET_VRING_BASE */
|
||||
VHOST_SET_VRING_KICK, /* VHOST_USER_SET_VRING_KICK */
|
||||
VHOST_SET_VRING_CALL, /* VHOST_USER_SET_VRING_CALL */
|
||||
VHOST_SET_VRING_ERR /* VHOST_USER_SET_VRING_ERR */
|
||||
};
|
||||
|
||||
static VhostUserRequest vhost_user_request_translate(unsigned long int request)
|
||||
{
|
||||
VhostUserRequest idx;
|
||||
|
||||
for (idx = 0; idx < VHOST_USER_MAX; idx++) {
|
||||
if (ioctl_to_vhost_user_request[idx] == request) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return (idx == VHOST_USER_MAX) ? VHOST_USER_NONE : idx;
|
||||
}
|
||||
|
||||
static int vhost_user_read(struct vhost_dev *dev, VhostUserMsg *msg)
|
||||
{
|
||||
CharDriverState *chr = dev->opaque;
|
||||
@@ -174,20 +153,6 @@ fail:
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int vhost_user_write(struct vhost_dev *dev, VhostUserMsg *msg,
|
||||
int *fds, int fd_num)
|
||||
{
|
||||
CharDriverState *chr = dev->opaque;
|
||||
int size = VHOST_USER_HDR_SIZE + msg->size;
|
||||
|
||||
if (fd_num) {
|
||||
qemu_chr_fe_set_msgfds(chr, fds, fd_num);
|
||||
}
|
||||
|
||||
return qemu_chr_fe_write_all(chr, (const uint8_t *) msg, size) == size ?
|
||||
0 : -1;
|
||||
}
|
||||
|
||||
static bool vhost_user_one_time_request(VhostUserRequest request)
|
||||
{
|
||||
switch (request) {
|
||||
@@ -201,64 +166,85 @@ static bool vhost_user_one_time_request(VhostUserRequest request)
|
||||
}
|
||||
}
|
||||
|
||||
static int vhost_user_call(struct vhost_dev *dev, unsigned long int request,
|
||||
void *arg)
|
||||
/* most non-init callers ignore the error */
|
||||
static int vhost_user_write(struct vhost_dev *dev, VhostUserMsg *msg,
|
||||
int *fds, int fd_num)
|
||||
{
|
||||
VhostUserMsg msg;
|
||||
VhostUserRequest msg_request;
|
||||
struct vhost_vring_file *file = 0;
|
||||
int need_reply = 0;
|
||||
int fds[VHOST_MEMORY_MAX_NREGIONS];
|
||||
int i, fd;
|
||||
size_t fd_num = 0;
|
||||
|
||||
assert(dev->vhost_ops->backend_type == VHOST_BACKEND_TYPE_USER);
|
||||
|
||||
/* only translate vhost ioctl requests */
|
||||
if (request > VHOST_USER_MAX) {
|
||||
msg_request = vhost_user_request_translate(request);
|
||||
} else {
|
||||
msg_request = request;
|
||||
}
|
||||
CharDriverState *chr = dev->opaque;
|
||||
int size = VHOST_USER_HDR_SIZE + msg->size;
|
||||
|
||||
/*
|
||||
* For non-vring specific requests, like VHOST_USER_SET_MEM_TABLE,
|
||||
* we just need send it once in the first time. For later such
|
||||
* request, we just ignore it.
|
||||
*/
|
||||
if (vhost_user_one_time_request(msg_request) && dev->vq_index != 0) {
|
||||
if (vhost_user_one_time_request(msg->request) && dev->vq_index != 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
msg.request = msg_request;
|
||||
msg.flags = VHOST_USER_VERSION;
|
||||
if (fd_num) {
|
||||
qemu_chr_fe_set_msgfds(chr, fds, fd_num);
|
||||
}
|
||||
|
||||
return qemu_chr_fe_write_all(chr, (const uint8_t *) msg, size) == size ?
|
||||
0 : -1;
|
||||
}
|
||||
|
||||
static int vhost_user_set_log_base(struct vhost_dev *dev, uint64_t base,
|
||||
struct vhost_log *log)
|
||||
{
|
||||
int fds[VHOST_MEMORY_MAX_NREGIONS];
|
||||
size_t fd_num = 0;
|
||||
bool shmfd = virtio_has_feature(dev->protocol_features,
|
||||
VHOST_USER_PROTOCOL_F_LOG_SHMFD);
|
||||
VhostUserMsg msg = {
|
||||
.request = VHOST_USER_SET_LOG_BASE,
|
||||
.flags = VHOST_USER_VERSION,
|
||||
.u64 = base,
|
||||
.size = sizeof(m.u64),
|
||||
};
|
||||
|
||||
if (shmfd && log->fd != -1) {
|
||||
fds[fd_num++] = log->fd;
|
||||
}
|
||||
|
||||
vhost_user_write(dev, &msg, fds, fd_num);
|
||||
|
||||
if (shmfd) {
|
||||
msg.size = 0;
|
||||
if (vhost_user_read(dev, &msg) < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (msg_request) {
|
||||
case VHOST_USER_GET_FEATURES:
|
||||
case VHOST_USER_GET_PROTOCOL_FEATURES:
|
||||
case VHOST_USER_GET_QUEUE_NUM:
|
||||
need_reply = 1;
|
||||
break;
|
||||
if (msg.request != VHOST_USER_SET_LOG_BASE) {
|
||||
error_report("Received unexpected msg type. "
|
||||
"Expected %d received %d",
|
||||
VHOST_USER_SET_LOG_BASE, msg.request);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
case VHOST_USER_SET_FEATURES:
|
||||
case VHOST_USER_SET_LOG_BASE:
|
||||
case VHOST_USER_SET_PROTOCOL_FEATURES:
|
||||
msg.u64 = *((__u64 *) arg);
|
||||
msg.size = sizeof(m.u64);
|
||||
break;
|
||||
return 0;
|
||||
}
|
||||
|
||||
case VHOST_USER_SET_OWNER:
|
||||
case VHOST_USER_RESET_DEVICE:
|
||||
break;
|
||||
static int vhost_user_set_mem_table(struct vhost_dev *dev,
|
||||
struct vhost_memory *mem)
|
||||
{
|
||||
int fds[VHOST_MEMORY_MAX_NREGIONS];
|
||||
int i, fd;
|
||||
size_t fd_num = 0;
|
||||
VhostUserMsg msg = {
|
||||
.request = VHOST_USER_SET_MEM_TABLE,
|
||||
.flags = VHOST_USER_VERSION,
|
||||
};
|
||||
|
||||
case VHOST_USER_SET_MEM_TABLE:
|
||||
for (i = 0; i < dev->mem->nregions; ++i) {
|
||||
struct vhost_memory_region *reg = dev->mem->regions + i;
|
||||
ram_addr_t ram_addr;
|
||||
|
||||
assert((uintptr_t)reg->userspace_addr == reg->userspace_addr);
|
||||
qemu_ram_addr_from_host((void *)(uintptr_t)reg->userspace_addr, &ram_addr);
|
||||
qemu_ram_addr_from_host((void *)(uintptr_t)reg->userspace_addr,
|
||||
&ram_addr);
|
||||
fd = qemu_get_ram_fd(ram_addr);
|
||||
if (fd > 0) {
|
||||
msg.memory.regions[fd_num].userspace_addr = reg->userspace_addr;
|
||||
@@ -283,131 +269,61 @@ static int vhost_user_call(struct vhost_dev *dev, unsigned long int request,
|
||||
msg.size += sizeof(m.memory.padding);
|
||||
msg.size += fd_num * sizeof(VhostUserMemoryRegion);
|
||||
|
||||
break;
|
||||
vhost_user_write(dev, &msg, fds, fd_num);
|
||||
|
||||
case VHOST_USER_SET_LOG_FD:
|
||||
fds[fd_num++] = *((int *) arg);
|
||||
break;
|
||||
|
||||
case VHOST_USER_SET_VRING_NUM:
|
||||
case VHOST_USER_SET_VRING_BASE:
|
||||
case VHOST_USER_SET_VRING_ENABLE:
|
||||
memcpy(&msg.state, arg, sizeof(struct vhost_vring_state));
|
||||
msg.size = sizeof(m.state);
|
||||
break;
|
||||
|
||||
case VHOST_USER_GET_VRING_BASE:
|
||||
memcpy(&msg.state, arg, sizeof(struct vhost_vring_state));
|
||||
msg.size = sizeof(m.state);
|
||||
need_reply = 1;
|
||||
break;
|
||||
|
||||
case VHOST_USER_SET_VRING_ADDR:
|
||||
memcpy(&msg.addr, arg, sizeof(struct vhost_vring_addr));
|
||||
msg.size = sizeof(m.addr);
|
||||
break;
|
||||
|
||||
case VHOST_USER_SET_VRING_KICK:
|
||||
case VHOST_USER_SET_VRING_CALL:
|
||||
case VHOST_USER_SET_VRING_ERR:
|
||||
file = arg;
|
||||
msg.u64 = file->index & VHOST_USER_VRING_IDX_MASK;
|
||||
msg.size = sizeof(m.u64);
|
||||
if (ioeventfd_enabled() && file->fd > 0) {
|
||||
fds[fd_num++] = file->fd;
|
||||
} else {
|
||||
msg.u64 |= VHOST_USER_VRING_NOFD_MASK;
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
static int vhost_user_set_vring_addr(struct vhost_dev *dev,
|
||||
struct vhost_vring_addr *addr)
|
||||
{
|
||||
VhostUserMsg msg = {
|
||||
.request = VHOST_USER_SET_VRING_ADDR,
|
||||
.flags = VHOST_USER_VERSION,
|
||||
.addr = *addr,
|
||||
.size = sizeof(*addr),
|
||||
};
|
||||
|
||||
vhost_user_write(dev, &msg, NULL, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int vhost_user_set_vring_endian(struct vhost_dev *dev,
|
||||
struct vhost_vring_state *ring)
|
||||
{
|
||||
error_report("vhost-user trying to send unhandled ioctl");
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (vhost_user_write(dev, &msg, fds, fd_num) < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (need_reply) {
|
||||
if (vhost_user_read(dev, &msg) < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (msg_request != msg.request) {
|
||||
error_report("Received unexpected msg type."
|
||||
" Expected %d received %d", msg_request, msg.request);
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch (msg_request) {
|
||||
case VHOST_USER_GET_FEATURES:
|
||||
case VHOST_USER_GET_PROTOCOL_FEATURES:
|
||||
case VHOST_USER_GET_QUEUE_NUM:
|
||||
if (msg.size != sizeof(m.u64)) {
|
||||
error_report("Received bad msg size.");
|
||||
return -1;
|
||||
}
|
||||
*((__u64 *) arg) = msg.u64;
|
||||
break;
|
||||
case VHOST_USER_GET_VRING_BASE:
|
||||
if (msg.size != sizeof(m.state)) {
|
||||
error_report("Received bad msg size.");
|
||||
return -1;
|
||||
}
|
||||
memcpy(arg, &msg.state, sizeof(struct vhost_vring_state));
|
||||
break;
|
||||
default:
|
||||
error_report("Received unexpected msg type.");
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int vhost_user_init(struct vhost_dev *dev, void *opaque)
|
||||
static int vhost_set_vring(struct vhost_dev *dev,
|
||||
unsigned long int request,
|
||||
struct vhost_vring_state *ring)
|
||||
{
|
||||
unsigned long long features;
|
||||
int err;
|
||||
VhostUserMsg msg = {
|
||||
.request = request,
|
||||
.flags = VHOST_USER_VERSION,
|
||||
.state = *ring,
|
||||
.size = sizeof(*ring),
|
||||
};
|
||||
|
||||
assert(dev->vhost_ops->backend_type == VHOST_BACKEND_TYPE_USER);
|
||||
|
||||
dev->opaque = opaque;
|
||||
|
||||
err = vhost_user_call(dev, VHOST_USER_GET_FEATURES, &features);
|
||||
if (err < 0) {
|
||||
return err;
|
||||
}
|
||||
|
||||
if (virtio_has_feature(features, VHOST_USER_F_PROTOCOL_FEATURES)) {
|
||||
dev->backend_features |= 1ULL << VHOST_USER_F_PROTOCOL_FEATURES;
|
||||
|
||||
err = vhost_user_call(dev, VHOST_USER_GET_PROTOCOL_FEATURES, &features);
|
||||
if (err < 0) {
|
||||
return err;
|
||||
}
|
||||
|
||||
dev->protocol_features = features & VHOST_USER_PROTOCOL_FEATURE_MASK;
|
||||
err = vhost_user_call(dev, VHOST_USER_SET_PROTOCOL_FEATURES,
|
||||
&dev->protocol_features);
|
||||
if (err < 0) {
|
||||
return err;
|
||||
}
|
||||
|
||||
/* query the max queues we support if backend supports Multiple Queue */
|
||||
if (dev->protocol_features & (1ULL << VHOST_USER_PROTOCOL_F_MQ)) {
|
||||
err = vhost_user_call(dev, VHOST_USER_GET_QUEUE_NUM, &dev->max_queues);
|
||||
if (err < 0) {
|
||||
return err;
|
||||
}
|
||||
}
|
||||
}
|
||||
vhost_user_write(dev, &msg, NULL, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int vhost_user_set_vring_num(struct vhost_dev *dev,
|
||||
struct vhost_vring_state *ring)
|
||||
{
|
||||
return vhost_set_vring(dev, VHOST_USER_SET_VRING_NUM, ring);
|
||||
}
|
||||
|
||||
static int vhost_user_set_vring_base(struct vhost_dev *dev,
|
||||
struct vhost_vring_state *ring)
|
||||
{
|
||||
return vhost_set_vring(dev, VHOST_USER_SET_VRING_BASE, ring);
|
||||
}
|
||||
|
||||
static int vhost_user_set_vring_enable(struct vhost_dev *dev, int enable)
|
||||
{
|
||||
struct vhost_vring_state state = {
|
||||
@@ -415,13 +331,218 @@ static int vhost_user_set_vring_enable(struct vhost_dev *dev, int enable)
|
||||
.num = enable,
|
||||
};
|
||||
|
||||
assert(dev->vhost_ops->backend_type == VHOST_BACKEND_TYPE_USER);
|
||||
|
||||
if (!(dev->protocol_features & (1ULL << VHOST_USER_PROTOCOL_F_MQ))) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return vhost_user_call(dev, VHOST_USER_SET_VRING_ENABLE, &state);
|
||||
return vhost_set_vring(dev, VHOST_USER_SET_VRING_ENABLE, &state);
|
||||
}
|
||||
|
||||
|
||||
static int vhost_user_get_vring_base(struct vhost_dev *dev,
|
||||
struct vhost_vring_state *ring)
|
||||
{
|
||||
VhostUserMsg msg = {
|
||||
.request = VHOST_USER_GET_VRING_BASE,
|
||||
.flags = VHOST_USER_VERSION,
|
||||
.state = *ring,
|
||||
.size = sizeof(*ring),
|
||||
};
|
||||
|
||||
vhost_user_write(dev, &msg, NULL, 0);
|
||||
|
||||
if (vhost_user_read(dev, &msg) < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (msg.request != VHOST_USER_GET_VRING_BASE) {
|
||||
error_report("Received unexpected msg type. Expected %d received %d",
|
||||
VHOST_USER_GET_VRING_BASE, msg.request);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (msg.size != sizeof(m.state)) {
|
||||
error_report("Received bad msg size.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
*ring = msg.state;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int vhost_set_vring_file(struct vhost_dev *dev,
|
||||
VhostUserRequest request,
|
||||
struct vhost_vring_file *file)
|
||||
{
|
||||
int fds[VHOST_MEMORY_MAX_NREGIONS];
|
||||
size_t fd_num = 0;
|
||||
VhostUserMsg msg = {
|
||||
.request = request,
|
||||
.flags = VHOST_USER_VERSION,
|
||||
.u64 = file->index & VHOST_USER_VRING_IDX_MASK,
|
||||
.size = sizeof(m.u64),
|
||||
};
|
||||
|
||||
if (ioeventfd_enabled() && file->fd > 0) {
|
||||
fds[fd_num++] = file->fd;
|
||||
} else {
|
||||
msg.u64 |= VHOST_USER_VRING_NOFD_MASK;
|
||||
}
|
||||
|
||||
vhost_user_write(dev, &msg, fds, fd_num);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int vhost_user_set_vring_kick(struct vhost_dev *dev,
|
||||
struct vhost_vring_file *file)
|
||||
{
|
||||
return vhost_set_vring_file(dev, VHOST_USER_SET_VRING_KICK, file);
|
||||
}
|
||||
|
||||
static int vhost_user_set_vring_call(struct vhost_dev *dev,
|
||||
struct vhost_vring_file *file)
|
||||
{
|
||||
return vhost_set_vring_file(dev, VHOST_USER_SET_VRING_CALL, file);
|
||||
}
|
||||
|
||||
static int vhost_user_set_u64(struct vhost_dev *dev, int request, uint64_t u64)
|
||||
{
|
||||
VhostUserMsg msg = {
|
||||
.request = request,
|
||||
.flags = VHOST_USER_VERSION,
|
||||
.u64 = u64,
|
||||
.size = sizeof(m.u64),
|
||||
};
|
||||
|
||||
vhost_user_write(dev, &msg, NULL, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int vhost_user_set_features(struct vhost_dev *dev,
|
||||
uint64_t features)
|
||||
{
|
||||
return vhost_user_set_u64(dev, VHOST_USER_SET_FEATURES, features);
|
||||
}
|
||||
|
||||
static int vhost_user_set_protocol_features(struct vhost_dev *dev,
|
||||
uint64_t features)
|
||||
{
|
||||
return vhost_user_set_u64(dev, VHOST_USER_SET_PROTOCOL_FEATURES, features);
|
||||
}
|
||||
|
||||
static int vhost_user_get_u64(struct vhost_dev *dev, int request, uint64_t *u64)
|
||||
{
|
||||
VhostUserMsg msg = {
|
||||
.request = request,
|
||||
.flags = VHOST_USER_VERSION,
|
||||
};
|
||||
|
||||
if (vhost_user_one_time_request(request) && dev->vq_index != 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
vhost_user_write(dev, &msg, NULL, 0);
|
||||
|
||||
if (vhost_user_read(dev, &msg) < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (msg.request != request) {
|
||||
error_report("Received unexpected msg type. Expected %d received %d",
|
||||
request, msg.request);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (msg.size != sizeof(m.u64)) {
|
||||
error_report("Received bad msg size.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
*u64 = msg.u64;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int vhost_user_get_features(struct vhost_dev *dev, uint64_t *features)
|
||||
{
|
||||
return vhost_user_get_u64(dev, VHOST_USER_GET_FEATURES, features);
|
||||
}
|
||||
|
||||
static int vhost_user_set_owner(struct vhost_dev *dev)
|
||||
{
|
||||
VhostUserMsg msg = {
|
||||
.request = VHOST_USER_SET_OWNER,
|
||||
.flags = VHOST_USER_VERSION,
|
||||
};
|
||||
|
||||
vhost_user_write(dev, &msg, NULL, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int vhost_user_reset_device(struct vhost_dev *dev)
|
||||
{
|
||||
VhostUserMsg msg = {
|
||||
.request = VHOST_USER_RESET_DEVICE,
|
||||
.flags = VHOST_USER_VERSION,
|
||||
};
|
||||
|
||||
vhost_user_write(dev, &msg, NULL, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int vhost_user_init(struct vhost_dev *dev, void *opaque)
|
||||
{
|
||||
uint64_t features;
|
||||
int err;
|
||||
|
||||
assert(dev->vhost_ops->backend_type == VHOST_BACKEND_TYPE_USER);
|
||||
|
||||
dev->opaque = opaque;
|
||||
|
||||
err = vhost_user_get_features(dev, &features);
|
||||
if (err < 0) {
|
||||
return err;
|
||||
}
|
||||
|
||||
if (virtio_has_feature(features, VHOST_USER_F_PROTOCOL_FEATURES)) {
|
||||
dev->backend_features |= 1ULL << VHOST_USER_F_PROTOCOL_FEATURES;
|
||||
|
||||
err = vhost_user_get_u64(dev, VHOST_USER_GET_PROTOCOL_FEATURES,
|
||||
&features);
|
||||
if (err < 0) {
|
||||
return err;
|
||||
}
|
||||
|
||||
dev->protocol_features = features & VHOST_USER_PROTOCOL_FEATURE_MASK;
|
||||
err = vhost_user_set_protocol_features(dev, dev->protocol_features);
|
||||
if (err < 0) {
|
||||
return err;
|
||||
}
|
||||
|
||||
/* query the max queues we support if backend supports Multiple Queue */
|
||||
if (dev->protocol_features & (1ULL << VHOST_USER_PROTOCOL_F_MQ)) {
|
||||
err = vhost_user_get_u64(dev, VHOST_USER_GET_QUEUE_NUM,
|
||||
&dev->max_queues);
|
||||
if (err < 0) {
|
||||
return err;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (dev->migration_blocker == NULL &&
|
||||
!virtio_has_feature(dev->protocol_features,
|
||||
VHOST_USER_PROTOCOL_F_LOG_SHMFD)) {
|
||||
error_setg(&dev->migration_blocker,
|
||||
"Migration disabled: vhost-user backend lacks "
|
||||
"VHOST_USER_PROTOCOL_F_LOG_SHMFD feature.");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int vhost_user_cleanup(struct vhost_dev *dev)
|
||||
@@ -440,11 +561,65 @@ static int vhost_user_get_vq_index(struct vhost_dev *dev, int idx)
|
||||
return idx;
|
||||
}
|
||||
|
||||
static int vhost_user_memslots_limit(struct vhost_dev *dev)
|
||||
{
|
||||
return VHOST_MEMORY_MAX_NREGIONS;
|
||||
}
|
||||
|
||||
static bool vhost_user_requires_shm_log(struct vhost_dev *dev)
|
||||
{
|
||||
assert(dev->vhost_ops->backend_type == VHOST_BACKEND_TYPE_USER);
|
||||
|
||||
return virtio_has_feature(dev->protocol_features,
|
||||
VHOST_USER_PROTOCOL_F_LOG_SHMFD);
|
||||
}
|
||||
|
||||
static int vhost_user_migration_done(struct vhost_dev *dev, char* mac_addr)
|
||||
{
|
||||
VhostUserMsg msg = { 0 };
|
||||
int err;
|
||||
|
||||
assert(dev->vhost_ops->backend_type == VHOST_BACKEND_TYPE_USER);
|
||||
|
||||
/* If guest supports GUEST_ANNOUNCE do nothing */
|
||||
if (virtio_has_feature(dev->acked_features, VIRTIO_NET_F_GUEST_ANNOUNCE)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* if backend supports VHOST_USER_PROTOCOL_F_RARP ask it to send the RARP */
|
||||
if (virtio_has_feature(dev->protocol_features,
|
||||
VHOST_USER_PROTOCOL_F_RARP)) {
|
||||
msg.request = VHOST_USER_SEND_RARP;
|
||||
msg.flags = VHOST_USER_VERSION;
|
||||
memcpy((char *)&msg.u64, mac_addr, 6);
|
||||
msg.size = sizeof(m.u64);
|
||||
|
||||
err = vhost_user_write(dev, &msg, NULL, 0);
|
||||
return err;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
const VhostOps user_ops = {
|
||||
.backend_type = VHOST_BACKEND_TYPE_USER,
|
||||
.vhost_call = vhost_user_call,
|
||||
.vhost_backend_init = vhost_user_init,
|
||||
.vhost_backend_cleanup = vhost_user_cleanup,
|
||||
.vhost_backend_get_vq_index = vhost_user_get_vq_index,
|
||||
.vhost_backend_set_vring_enable = vhost_user_set_vring_enable,
|
||||
.vhost_backend_memslots_limit = vhost_user_memslots_limit,
|
||||
.vhost_set_log_base = vhost_user_set_log_base,
|
||||
.vhost_set_mem_table = vhost_user_set_mem_table,
|
||||
.vhost_set_vring_addr = vhost_user_set_vring_addr,
|
||||
.vhost_set_vring_endian = vhost_user_set_vring_endian,
|
||||
.vhost_set_vring_num = vhost_user_set_vring_num,
|
||||
.vhost_set_vring_base = vhost_user_set_vring_base,
|
||||
.vhost_get_vring_base = vhost_user_get_vring_base,
|
||||
.vhost_set_vring_kick = vhost_user_set_vring_kick,
|
||||
.vhost_set_vring_call = vhost_user_set_vring_call,
|
||||
.vhost_set_features = vhost_user_set_features,
|
||||
.vhost_get_features = vhost_user_get_features,
|
||||
.vhost_set_owner = vhost_user_set_owner,
|
||||
.vhost_reset_device = vhost_user_reset_device,
|
||||
.vhost_get_vq_index = vhost_user_get_vq_index,
|
||||
.vhost_set_vring_enable = vhost_user_set_vring_enable,
|
||||
.vhost_requires_shm_log = vhost_user_requires_shm_log,
|
||||
.vhost_migration_done = vhost_user_migration_done,
|
||||
};
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "qemu/atomic.h"
|
||||
#include "qemu/range.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qemu/memfd.h"
|
||||
#include <linux/vhost.h>
|
||||
#include "exec/address-spaces.h"
|
||||
#include "hw/virtio/virtio-bus.h"
|
||||
@@ -25,6 +26,23 @@
|
||||
#include "migration/migration.h"
|
||||
|
||||
static struct vhost_log *vhost_log;
|
||||
static struct vhost_log *vhost_log_shm;
|
||||
|
||||
static unsigned int used_memslots;
|
||||
static QLIST_HEAD(, vhost_dev) vhost_devices =
|
||||
QLIST_HEAD_INITIALIZER(vhost_devices);
|
||||
|
||||
bool vhost_has_free_slot(void)
|
||||
{
|
||||
unsigned int slots_limit = ~0U;
|
||||
struct vhost_dev *hdev;
|
||||
|
||||
QLIST_FOREACH(hdev, &vhost_devices, entry) {
|
||||
unsigned int r = hdev->vhost_ops->vhost_backend_memslots_limit(hdev);
|
||||
slots_limit = MIN(slots_limit, r);
|
||||
}
|
||||
return slots_limit > used_memslots;
|
||||
}
|
||||
|
||||
static void vhost_dev_sync_region(struct vhost_dev *dev,
|
||||
MemoryRegionSection *section,
|
||||
@@ -286,25 +304,46 @@ static uint64_t vhost_get_log_size(struct vhost_dev *dev)
|
||||
}
|
||||
return log_size;
|
||||
}
|
||||
static struct vhost_log *vhost_log_alloc(uint64_t size)
|
||||
|
||||
static struct vhost_log *vhost_log_alloc(uint64_t size, bool share)
|
||||
{
|
||||
struct vhost_log *log = g_malloc0(sizeof *log + size * sizeof(*(log->log)));
|
||||
struct vhost_log *log;
|
||||
uint64_t logsize = size * sizeof(*(log->log));
|
||||
int fd = -1;
|
||||
|
||||
log = g_new0(struct vhost_log, 1);
|
||||
if (share) {
|
||||
log->log = qemu_memfd_alloc("vhost-log", logsize,
|
||||
F_SEAL_GROW | F_SEAL_SHRINK | F_SEAL_SEAL,
|
||||
&fd);
|
||||
memset(log->log, 0, logsize);
|
||||
} else {
|
||||
log->log = g_malloc0(logsize);
|
||||
}
|
||||
|
||||
log->size = size;
|
||||
log->refcnt = 1;
|
||||
log->fd = fd;
|
||||
|
||||
return log;
|
||||
}
|
||||
|
||||
static struct vhost_log *vhost_log_get(uint64_t size)
|
||||
static struct vhost_log *vhost_log_get(uint64_t size, bool share)
|
||||
{
|
||||
if (!vhost_log || vhost_log->size != size) {
|
||||
vhost_log = vhost_log_alloc(size);
|
||||
struct vhost_log *log = share ? vhost_log_shm : vhost_log;
|
||||
|
||||
if (!log || log->size != size) {
|
||||
log = vhost_log_alloc(size, share);
|
||||
if (share) {
|
||||
vhost_log_shm = log;
|
||||
} else {
|
||||
++vhost_log->refcnt;
|
||||
vhost_log = log;
|
||||
}
|
||||
} else {
|
||||
++log->refcnt;
|
||||
}
|
||||
|
||||
return vhost_log;
|
||||
return log;
|
||||
}
|
||||
|
||||
static void vhost_log_put(struct vhost_dev *dev, bool sync)
|
||||
@@ -321,20 +360,35 @@ static void vhost_log_put(struct vhost_dev *dev, bool sync)
|
||||
if (dev->log_size && sync) {
|
||||
vhost_log_sync_range(dev, 0, dev->log_size * VHOST_LOG_CHUNK - 1);
|
||||
}
|
||||
|
||||
if (vhost_log == log) {
|
||||
g_free(log->log);
|
||||
vhost_log = NULL;
|
||||
} else if (vhost_log_shm == log) {
|
||||
qemu_memfd_free(log->log, log->size * sizeof(*(log->log)),
|
||||
log->fd);
|
||||
vhost_log_shm = NULL;
|
||||
}
|
||||
|
||||
g_free(log);
|
||||
}
|
||||
}
|
||||
|
||||
static bool vhost_dev_log_is_shared(struct vhost_dev *dev)
|
||||
{
|
||||
return dev->vhost_ops->vhost_requires_shm_log &&
|
||||
dev->vhost_ops->vhost_requires_shm_log(dev);
|
||||
}
|
||||
|
||||
static inline void vhost_dev_log_resize(struct vhost_dev *dev, uint64_t size)
|
||||
{
|
||||
struct vhost_log *log = vhost_log_get(size);
|
||||
struct vhost_log *log = vhost_log_get(size, vhost_dev_log_is_shared(dev));
|
||||
uint64_t log_base = (uintptr_t)log->log;
|
||||
int r;
|
||||
|
||||
r = dev->vhost_ops->vhost_call(dev, VHOST_SET_LOG_BASE, &log_base);
|
||||
/* inform backend of log switching, this must be done before
|
||||
releasing the current log, to ensure no logging is lost */
|
||||
r = dev->vhost_ops->vhost_set_log_base(dev, log_base, log);
|
||||
assert(r >= 0);
|
||||
vhost_log_put(dev, true);
|
||||
dev->log = log;
|
||||
@@ -457,6 +511,7 @@ static void vhost_set_memory(MemoryListener *listener,
|
||||
dev->mem_changed_start_addr = MIN(dev->mem_changed_start_addr, start_addr);
|
||||
dev->mem_changed_end_addr = MAX(dev->mem_changed_end_addr, start_addr + size - 1);
|
||||
dev->memory_changed = true;
|
||||
used_memslots = dev->mem->nregions;
|
||||
}
|
||||
|
||||
static bool vhost_section(MemoryRegionSection *section)
|
||||
@@ -500,7 +555,7 @@ static void vhost_commit(MemoryListener *listener)
|
||||
}
|
||||
|
||||
if (!dev->log_enabled) {
|
||||
r = dev->vhost_ops->vhost_call(dev, VHOST_SET_MEM_TABLE, dev->mem);
|
||||
r = dev->vhost_ops->vhost_set_mem_table(dev, dev->mem);
|
||||
assert(r >= 0);
|
||||
dev->memory_changed = false;
|
||||
return;
|
||||
@@ -513,7 +568,7 @@ static void vhost_commit(MemoryListener *listener)
|
||||
if (dev->log_size < log_size) {
|
||||
vhost_dev_log_resize(dev, log_size + VHOST_LOG_BUFFER);
|
||||
}
|
||||
r = dev->vhost_ops->vhost_call(dev, VHOST_SET_MEM_TABLE, dev->mem);
|
||||
r = dev->vhost_ops->vhost_set_mem_table(dev, dev->mem);
|
||||
assert(r >= 0);
|
||||
/* To log less, can only decrease log size after table update. */
|
||||
if (dev->log_size > log_size + VHOST_LOG_BUFFER) {
|
||||
@@ -581,7 +636,7 @@ static int vhost_virtqueue_set_addr(struct vhost_dev *dev,
|
||||
.log_guest_addr = vq->used_phys,
|
||||
.flags = enable_log ? (1 << VHOST_VRING_F_LOG) : 0,
|
||||
};
|
||||
int r = dev->vhost_ops->vhost_call(dev, VHOST_SET_VRING_ADDR, &addr);
|
||||
int r = dev->vhost_ops->vhost_set_vring_addr(dev, &addr);
|
||||
if (r < 0) {
|
||||
return -errno;
|
||||
}
|
||||
@@ -595,19 +650,20 @@ static int vhost_dev_set_features(struct vhost_dev *dev, bool enable_log)
|
||||
if (enable_log) {
|
||||
features |= 0x1ULL << VHOST_F_LOG_ALL;
|
||||
}
|
||||
r = dev->vhost_ops->vhost_call(dev, VHOST_SET_FEATURES, &features);
|
||||
r = dev->vhost_ops->vhost_set_features(dev, features);
|
||||
return r < 0 ? -errno : 0;
|
||||
}
|
||||
|
||||
static int vhost_dev_set_log(struct vhost_dev *dev, bool enable_log)
|
||||
{
|
||||
int r, t, i;
|
||||
int r, t, i, idx;
|
||||
r = vhost_dev_set_features(dev, enable_log);
|
||||
if (r < 0) {
|
||||
goto err_features;
|
||||
}
|
||||
for (i = 0; i < dev->nvqs; ++i) {
|
||||
r = vhost_virtqueue_set_addr(dev, dev->vqs + i, i,
|
||||
idx = dev->vhost_ops->vhost_get_vq_index(dev, dev->vq_index + i);
|
||||
r = vhost_virtqueue_set_addr(dev, dev->vqs + i, idx,
|
||||
enable_log);
|
||||
if (r < 0) {
|
||||
goto err_vq;
|
||||
@@ -616,7 +672,8 @@ static int vhost_dev_set_log(struct vhost_dev *dev, bool enable_log)
|
||||
return 0;
|
||||
err_vq:
|
||||
for (; i >= 0; --i) {
|
||||
t = vhost_virtqueue_set_addr(dev, dev->vqs + i, i,
|
||||
idx = dev->vhost_ops->vhost_get_vq_index(dev, dev->vq_index + i);
|
||||
t = vhost_virtqueue_set_addr(dev, dev->vqs + i, idx,
|
||||
dev->log_enabled);
|
||||
assert(t >= 0);
|
||||
}
|
||||
@@ -700,7 +757,7 @@ static int vhost_virtqueue_set_vring_endian_legacy(struct vhost_dev *dev,
|
||||
.num = is_big_endian
|
||||
};
|
||||
|
||||
if (!dev->vhost_ops->vhost_call(dev, VHOST_SET_VRING_ENDIAN, &s)) {
|
||||
if (!dev->vhost_ops->vhost_set_vring_endian(dev, &s)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -719,7 +776,7 @@ static int vhost_virtqueue_start(struct vhost_dev *dev,
|
||||
{
|
||||
hwaddr s, l, a;
|
||||
int r;
|
||||
int vhost_vq_index = dev->vhost_ops->vhost_backend_get_vq_index(dev, idx);
|
||||
int vhost_vq_index = dev->vhost_ops->vhost_get_vq_index(dev, idx);
|
||||
struct vhost_vring_file file = {
|
||||
.index = vhost_vq_index
|
||||
};
|
||||
@@ -730,13 +787,13 @@ static int vhost_virtqueue_start(struct vhost_dev *dev,
|
||||
|
||||
|
||||
vq->num = state.num = virtio_queue_get_num(vdev, idx);
|
||||
r = dev->vhost_ops->vhost_call(dev, VHOST_SET_VRING_NUM, &state);
|
||||
r = dev->vhost_ops->vhost_set_vring_num(dev, &state);
|
||||
if (r) {
|
||||
return -errno;
|
||||
}
|
||||
|
||||
state.num = virtio_queue_get_last_avail_idx(vdev, idx);
|
||||
r = dev->vhost_ops->vhost_call(dev, VHOST_SET_VRING_BASE, &state);
|
||||
r = dev->vhost_ops->vhost_set_vring_base(dev, &state);
|
||||
if (r) {
|
||||
return -errno;
|
||||
}
|
||||
@@ -788,7 +845,7 @@ static int vhost_virtqueue_start(struct vhost_dev *dev,
|
||||
}
|
||||
|
||||
file.fd = event_notifier_get_fd(virtio_queue_get_host_notifier(vvq));
|
||||
r = dev->vhost_ops->vhost_call(dev, VHOST_SET_VRING_KICK, &file);
|
||||
r = dev->vhost_ops->vhost_set_vring_kick(dev, &file);
|
||||
if (r) {
|
||||
r = -errno;
|
||||
goto fail_kick;
|
||||
@@ -821,13 +878,13 @@ static void vhost_virtqueue_stop(struct vhost_dev *dev,
|
||||
struct vhost_virtqueue *vq,
|
||||
unsigned idx)
|
||||
{
|
||||
int vhost_vq_index = dev->vhost_ops->vhost_backend_get_vq_index(dev, idx);
|
||||
int vhost_vq_index = dev->vhost_ops->vhost_get_vq_index(dev, idx);
|
||||
struct vhost_vring_state state = {
|
||||
.index = vhost_vq_index,
|
||||
};
|
||||
int r;
|
||||
|
||||
r = dev->vhost_ops->vhost_call(dev, VHOST_GET_VRING_BASE, &state);
|
||||
r = dev->vhost_ops->vhost_get_vring_base(dev, &state);
|
||||
if (r < 0) {
|
||||
fprintf(stderr, "vhost VQ %d ring restore failed: %d\n", idx, r);
|
||||
fflush(stderr);
|
||||
@@ -874,7 +931,7 @@ static void vhost_eventfd_del(MemoryListener *listener,
|
||||
static int vhost_virtqueue_init(struct vhost_dev *dev,
|
||||
struct vhost_virtqueue *vq, int n)
|
||||
{
|
||||
int vhost_vq_index = dev->vhost_ops->vhost_backend_get_vq_index(dev, n);
|
||||
int vhost_vq_index = dev->vhost_ops->vhost_get_vq_index(dev, n);
|
||||
struct vhost_vring_file file = {
|
||||
.index = vhost_vq_index,
|
||||
};
|
||||
@@ -884,7 +941,7 @@ static int vhost_virtqueue_init(struct vhost_dev *dev,
|
||||
}
|
||||
|
||||
file.fd = event_notifier_get_fd(&vq->masked_notifier);
|
||||
r = dev->vhost_ops->vhost_call(dev, VHOST_SET_VRING_CALL, &file);
|
||||
r = dev->vhost_ops->vhost_set_vring_call(dev, &file);
|
||||
if (r) {
|
||||
r = -errno;
|
||||
goto fail_call;
|
||||
@@ -906,6 +963,8 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
|
||||
uint64_t features;
|
||||
int i, r;
|
||||
|
||||
hdev->migration_blocker = NULL;
|
||||
|
||||
if (vhost_set_backend_type(hdev, backend_type) < 0) {
|
||||
close((uintptr_t)opaque);
|
||||
return -1;
|
||||
@@ -916,12 +975,20 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
|
||||
return -errno;
|
||||
}
|
||||
|
||||
r = hdev->vhost_ops->vhost_call(hdev, VHOST_SET_OWNER, NULL);
|
||||
if (used_memslots > hdev->vhost_ops->vhost_backend_memslots_limit(hdev)) {
|
||||
fprintf(stderr, "vhost backend memory slots limit is less"
|
||||
" than current number of present memory slots\n");
|
||||
close((uintptr_t)opaque);
|
||||
return -1;
|
||||
}
|
||||
QLIST_INSERT_HEAD(&vhost_devices, hdev, entry);
|
||||
|
||||
r = hdev->vhost_ops->vhost_set_owner(hdev);
|
||||
if (r < 0) {
|
||||
goto fail;
|
||||
}
|
||||
|
||||
r = hdev->vhost_ops->vhost_call(hdev, VHOST_GET_FEATURES, &features);
|
||||
r = hdev->vhost_ops->vhost_get_features(hdev, &features);
|
||||
if (r < 0) {
|
||||
goto fail;
|
||||
}
|
||||
@@ -949,12 +1016,21 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
|
||||
.eventfd_del = vhost_eventfd_del,
|
||||
.priority = 10
|
||||
};
|
||||
hdev->migration_blocker = NULL;
|
||||
|
||||
if (hdev->migration_blocker == NULL) {
|
||||
if (!(hdev->features & (0x1ULL << VHOST_F_LOG_ALL))) {
|
||||
error_setg(&hdev->migration_blocker,
|
||||
"Migration disabled: vhost lacks VHOST_F_LOG_ALL feature.");
|
||||
} else if (!qemu_memfd_check()) {
|
||||
error_setg(&hdev->migration_blocker,
|
||||
"Migration disabled: failed to allocate shared memory");
|
||||
}
|
||||
}
|
||||
|
||||
if (hdev->migration_blocker != NULL) {
|
||||
migrate_add_blocker(hdev->migration_blocker);
|
||||
}
|
||||
|
||||
hdev->mem = g_malloc0(offsetof(struct vhost_memory, regions));
|
||||
hdev->n_mem_sections = 0;
|
||||
hdev->mem_sections = NULL;
|
||||
@@ -972,6 +1048,7 @@ fail_vq:
|
||||
fail:
|
||||
r = -errno;
|
||||
hdev->vhost_ops->vhost_backend_cleanup(hdev);
|
||||
QLIST_REMOVE(hdev, entry);
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -989,6 +1066,7 @@ void vhost_dev_cleanup(struct vhost_dev *hdev)
|
||||
g_free(hdev->mem);
|
||||
g_free(hdev->mem_sections);
|
||||
hdev->vhost_ops->vhost_backend_cleanup(hdev);
|
||||
QLIST_REMOVE(hdev, entry);
|
||||
}
|
||||
|
||||
/* Stop processing guest IO notifications in qemu.
|
||||
@@ -1074,8 +1152,8 @@ void vhost_virtqueue_mask(struct vhost_dev *hdev, VirtIODevice *vdev, int n,
|
||||
file.fd = event_notifier_get_fd(virtio_queue_get_guest_notifier(vvq));
|
||||
}
|
||||
|
||||
file.index = hdev->vhost_ops->vhost_backend_get_vq_index(hdev, n);
|
||||
r = hdev->vhost_ops->vhost_call(hdev, VHOST_SET_VRING_CALL, &file);
|
||||
file.index = hdev->vhost_ops->vhost_get_vq_index(hdev, n);
|
||||
r = hdev->vhost_ops->vhost_set_vring_call(hdev, &file);
|
||||
assert(r >= 0);
|
||||
}
|
||||
|
||||
@@ -1117,7 +1195,7 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice *vdev)
|
||||
if (r < 0) {
|
||||
goto fail_features;
|
||||
}
|
||||
r = hdev->vhost_ops->vhost_call(hdev, VHOST_SET_MEM_TABLE, hdev->mem);
|
||||
r = hdev->vhost_ops->vhost_set_mem_table(hdev, hdev->mem);
|
||||
if (r < 0) {
|
||||
r = -errno;
|
||||
goto fail_mem;
|
||||
@@ -1136,10 +1214,12 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice *vdev)
|
||||
uint64_t log_base;
|
||||
|
||||
hdev->log_size = vhost_get_log_size(hdev);
|
||||
hdev->log = vhost_log_get(hdev->log_size);
|
||||
hdev->log = vhost_log_get(hdev->log_size,
|
||||
vhost_dev_log_is_shared(hdev));
|
||||
log_base = (uintptr_t)hdev->log->log;
|
||||
r = hdev->vhost_ops->vhost_call(hdev, VHOST_SET_LOG_BASE,
|
||||
hdev->log_size ? &log_base : NULL);
|
||||
r = hdev->vhost_ops->vhost_set_log_base(hdev,
|
||||
hdev->log_size ? log_base : 0,
|
||||
hdev->log);
|
||||
if (r < 0) {
|
||||
r = -errno;
|
||||
goto fail_log;
|
||||
|
||||
@@ -149,6 +149,28 @@ static void lx60_net_init(MemoryRegion *address_space,
|
||||
memory_region_add_subregion(address_space, buffers, ram);
|
||||
}
|
||||
|
||||
static pflash_t *xtfpga_flash_init(MemoryRegion *address_space,
|
||||
const LxBoardDesc *board,
|
||||
DriveInfo *dinfo, int be)
|
||||
{
|
||||
SysBusDevice *s;
|
||||
DeviceState *dev = qdev_create(NULL, "cfi.pflash01");
|
||||
|
||||
qdev_prop_set_drive(dev, "drive", blk_by_legacy_dinfo(dinfo),
|
||||
&error_abort);
|
||||
qdev_prop_set_uint32(dev, "num-blocks",
|
||||
board->flash_size / board->flash_sector_size);
|
||||
qdev_prop_set_uint64(dev, "sector-length", board->flash_sector_size);
|
||||
qdev_prop_set_uint8(dev, "width", 4);
|
||||
qdev_prop_set_bit(dev, "big-endian", be);
|
||||
qdev_prop_set_string(dev, "name", "lx60.io.flash");
|
||||
qdev_init_nofail(dev);
|
||||
s = SYS_BUS_DEVICE(dev);
|
||||
memory_region_add_subregion(address_space, board->flash_base,
|
||||
sysbus_mmio_get_region(s, 0));
|
||||
return OBJECT_CHECK(pflash_t, (dev), "cfi.pflash01");
|
||||
}
|
||||
|
||||
static uint64_t translate_phys_addr(void *opaque, uint64_t addr)
|
||||
{
|
||||
XtensaCPU *cpu = opaque;
|
||||
@@ -247,16 +269,7 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine)
|
||||
|
||||
dinfo = drive_get(IF_PFLASH, 0, 0);
|
||||
if (dinfo) {
|
||||
flash = pflash_cfi01_register(board->flash_base,
|
||||
NULL, "lx60.io.flash", board->flash_size,
|
||||
blk_by_legacy_dinfo(dinfo),
|
||||
board->flash_sector_size,
|
||||
board->flash_size / board->flash_sector_size,
|
||||
4, 0x0000, 0x0000, 0x0000, 0x0000, be);
|
||||
if (flash == NULL) {
|
||||
error_report("unable to mount pflash");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
flash = xtfpga_flash_init(system_io, board, dinfo, be);
|
||||
}
|
||||
|
||||
/* Use presence of kernel file name as 'boot from SRAM' switch. */
|
||||
@@ -386,7 +399,7 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine)
|
||||
static void xtensa_lx60_init(MachineState *machine)
|
||||
{
|
||||
static const LxBoardDesc lx60_board = {
|
||||
.flash_base = 0xf8000000,
|
||||
.flash_base = 0x08000000,
|
||||
.flash_size = 0x00400000,
|
||||
.flash_sector_size = 0x10000,
|
||||
.sram_size = 0x20000,
|
||||
@@ -397,7 +410,7 @@ static void xtensa_lx60_init(MachineState *machine)
|
||||
static void xtensa_lx200_init(MachineState *machine)
|
||||
{
|
||||
static const LxBoardDesc lx200_board = {
|
||||
.flash_base = 0xf8000000,
|
||||
.flash_base = 0x08000000,
|
||||
.flash_size = 0x01000000,
|
||||
.flash_sector_size = 0x20000,
|
||||
.sram_size = 0x2000000,
|
||||
@@ -408,7 +421,7 @@ static void xtensa_lx200_init(MachineState *machine)
|
||||
static void xtensa_ml605_init(MachineState *machine)
|
||||
{
|
||||
static const LxBoardDesc ml605_board = {
|
||||
.flash_base = 0xf8000000,
|
||||
.flash_base = 0x08000000,
|
||||
.flash_size = 0x01000000,
|
||||
.flash_sector_size = 0x20000,
|
||||
.sram_size = 0x2000000,
|
||||
@@ -419,7 +432,7 @@ static void xtensa_ml605_init(MachineState *machine)
|
||||
static void xtensa_kc705_init(MachineState *machine)
|
||||
{
|
||||
static const LxBoardDesc kc705_board = {
|
||||
.flash_base = 0xf0000000,
|
||||
.flash_base = 0x00000000,
|
||||
.flash_size = 0x08000000,
|
||||
.flash_boot_base = 0x06000000,
|
||||
.flash_sector_size = 0x20000,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "block/aio.h"
|
||||
#include "qemu-common.h"
|
||||
#include "qemu/option.h"
|
||||
#include "block/coroutine.h"
|
||||
#include "qemu/coroutine.h"
|
||||
#include "block/accounting.h"
|
||||
#include "qapi/qmp/qobject.h"
|
||||
#include "qapi-types.h"
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "block/block.h"
|
||||
#include "qemu/option.h"
|
||||
#include "qemu/queue.h"
|
||||
#include "block/coroutine.h"
|
||||
#include "qemu/coroutine.h"
|
||||
#include "qemu/timer.h"
|
||||
#include "qapi-types.h"
|
||||
#include "qemu/hbitmap.h"
|
||||
|
||||
@@ -165,4 +165,65 @@ static inline GThread *g_thread_new(const char *name,
|
||||
#define CompatGCond GCond
|
||||
#endif /* glib 2.31 */
|
||||
|
||||
#ifndef g_assert_true
|
||||
#define g_assert_true(expr) \
|
||||
do { \
|
||||
if (G_LIKELY(expr)) { \
|
||||
} else { \
|
||||
g_assertion_message(G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
|
||||
"'" #expr "' should be TRUE"); \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#ifndef g_assert_false
|
||||
#define g_assert_false(expr) \
|
||||
do { \
|
||||
if (G_LIKELY(!(expr))) { \
|
||||
} else { \
|
||||
g_assertion_message(G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
|
||||
"'" #expr "' should be FALSE"); \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#ifndef g_assert_null
|
||||
#define g_assert_null(expr) \
|
||||
do { \
|
||||
if (G_LIKELY((expr) == NULL)) { \
|
||||
} else { \
|
||||
g_assertion_message(G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
|
||||
"'" #expr "' should be NULL"); \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#ifndef g_assert_nonnull
|
||||
#define g_assert_nonnull(expr) \
|
||||
do { \
|
||||
if (G_LIKELY((expr) != NULL)) { \
|
||||
} else { \
|
||||
g_assertion_message(G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
|
||||
"'" #expr "' should not be NULL"); \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#ifndef g_assert_cmpmem
|
||||
#define g_assert_cmpmem(m1, l1, m2, l2) \
|
||||
do { \
|
||||
gconstpointer __m1 = m1, __m2 = m2; \
|
||||
int __l1 = l1, __l2 = l2; \
|
||||
if (__l1 != __l2) { \
|
||||
g_assertion_message_cmpnum( \
|
||||
G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
|
||||
#l1 " (len(" #m1 ")) == " #l2 " (len(" #m2 "))", __l1, "==", \
|
||||
__l2, 'i'); \
|
||||
} else if (memcmp(__m1, __m2, __l1) != 0) { \
|
||||
g_assertion_message(G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
|
||||
"assertion failed (" #m1 " == " #m2 ")"); \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -49,6 +49,7 @@ typedef struct VTDContextCacheEntry VTDContextCacheEntry;
|
||||
typedef struct IntelIOMMUState IntelIOMMUState;
|
||||
typedef struct VTDAddressSpace VTDAddressSpace;
|
||||
typedef struct VTDIOTLBEntry VTDIOTLBEntry;
|
||||
typedef struct VTDBus VTDBus;
|
||||
|
||||
/* Context-Entry */
|
||||
struct VTDContextEntry {
|
||||
@@ -65,7 +66,7 @@ struct VTDContextCacheEntry {
|
||||
};
|
||||
|
||||
struct VTDAddressSpace {
|
||||
uint8_t bus_num;
|
||||
PCIBus *bus;
|
||||
uint8_t devfn;
|
||||
AddressSpace as;
|
||||
MemoryRegion iommu;
|
||||
@@ -73,6 +74,11 @@ struct VTDAddressSpace {
|
||||
VTDContextCacheEntry context_cache_entry;
|
||||
};
|
||||
|
||||
struct VTDBus {
|
||||
PCIBus* bus; /* A reference to the bus to provide translation for */
|
||||
VTDAddressSpace *dev_as[0]; /* A table of VTDAddressSpace objects indexed by devfn */
|
||||
};
|
||||
|
||||
struct VTDIOTLBEntry {
|
||||
uint64_t gfn;
|
||||
uint16_t domain_id;
|
||||
@@ -114,7 +120,13 @@ struct IntelIOMMUState {
|
||||
GHashTable *iotlb; /* IOTLB */
|
||||
|
||||
MemoryRegionIOMMUOps iommu_ops;
|
||||
VTDAddressSpace **address_spaces[VTD_PCI_BUS_MAX];
|
||||
GHashTable *vtd_as_by_busptr; /* VTDBus objects indexed by PCIBus* reference */
|
||||
VTDBus *vtd_as_by_bus_num[VTD_PCI_BUS_MAX]; /* VTDBus objects indexed by bus number */
|
||||
};
|
||||
|
||||
/* Find the VTD Address space associated with the given bus pointer,
|
||||
* create a new one if none exists
|
||||
*/
|
||||
VTDAddressSpace *vtd_find_add_as(IntelIOMMUState *s, PCIBus *bus, int devfn);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -168,7 +168,7 @@ bool pc_machine_is_smm_enabled(PCMachineState *pcms);
|
||||
void pc_register_ferr_irq(qemu_irq irq);
|
||||
void pc_acpi_smi_interrupt(void *opaque, int irq, int level);
|
||||
|
||||
void pc_cpus_init(const char *cpu_model);
|
||||
void pc_cpus_init(PCMachineState *pcms);
|
||||
void pc_hot_add_cpu(const int64_t id, Error **errp);
|
||||
void pc_acpi_init(const char *default_dsdt);
|
||||
|
||||
|
||||
@@ -61,6 +61,15 @@ typedef struct FWCfgFiles {
|
||||
FWCfgFile f[];
|
||||
} FWCfgFiles;
|
||||
|
||||
/* Control as first field allows for different structures selected by this
|
||||
* field, which might be useful in the future
|
||||
*/
|
||||
typedef struct FWCfgDmaAccess {
|
||||
uint32_t control;
|
||||
uint32_t length;
|
||||
uint64_t address;
|
||||
} QEMU_PACKED FWCfgDmaAccess;
|
||||
|
||||
typedef void (*FWCfgCallback)(void *opaque, uint8_t *data);
|
||||
typedef void (*FWCfgReadCallback)(void *opaque, uint32_t offset);
|
||||
|
||||
@@ -77,10 +86,13 @@ void fw_cfg_add_file_callback(FWCfgState *s, const char *filename,
|
||||
void *data, size_t len);
|
||||
void *fw_cfg_modify_file(FWCfgState *s, const char *filename, void *data,
|
||||
size_t len);
|
||||
FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
|
||||
AddressSpace *dma_as);
|
||||
FWCfgState *fw_cfg_init_io(uint32_t iobase);
|
||||
FWCfgState *fw_cfg_init_mem(hwaddr ctl_addr, hwaddr data_addr);
|
||||
FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr, hwaddr data_addr,
|
||||
uint32_t data_width);
|
||||
FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
|
||||
hwaddr data_addr, uint32_t data_width,
|
||||
hwaddr dma_addr, AddressSpace *dma_as);
|
||||
|
||||
FWCfgState *fw_cfg_find(void);
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
#ifndef VHOST_BACKEND_H_
|
||||
#define VHOST_BACKEND_H_
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef enum VhostBackendType {
|
||||
VHOST_BACKEND_TYPE_NONE = 0,
|
||||
VHOST_BACKEND_TYPE_KERNEL = 1,
|
||||
@@ -19,21 +21,82 @@ typedef enum VhostBackendType {
|
||||
} VhostBackendType;
|
||||
|
||||
struct vhost_dev;
|
||||
struct vhost_log;
|
||||
struct vhost_memory;
|
||||
struct vhost_vring_file;
|
||||
struct vhost_vring_state;
|
||||
struct vhost_vring_addr;
|
||||
struct vhost_scsi_target;
|
||||
|
||||
typedef int (*vhost_call)(struct vhost_dev *dev, unsigned long int request,
|
||||
void *arg);
|
||||
typedef int (*vhost_backend_init)(struct vhost_dev *dev, void *opaque);
|
||||
typedef int (*vhost_backend_cleanup)(struct vhost_dev *dev);
|
||||
typedef int (*vhost_backend_get_vq_index)(struct vhost_dev *dev, int idx);
|
||||
typedef int (*vhost_backend_set_vring_enable)(struct vhost_dev *dev, int enable);
|
||||
typedef int (*vhost_backend_memslots_limit)(struct vhost_dev *dev);
|
||||
|
||||
typedef int (*vhost_net_set_backend_op)(struct vhost_dev *dev,
|
||||
struct vhost_vring_file *file);
|
||||
typedef int (*vhost_scsi_set_endpoint_op)(struct vhost_dev *dev,
|
||||
struct vhost_scsi_target *target);
|
||||
typedef int (*vhost_scsi_clear_endpoint_op)(struct vhost_dev *dev,
|
||||
struct vhost_scsi_target *target);
|
||||
typedef int (*vhost_scsi_get_abi_version_op)(struct vhost_dev *dev,
|
||||
int *version);
|
||||
typedef int (*vhost_set_log_base_op)(struct vhost_dev *dev, uint64_t base,
|
||||
struct vhost_log *log);
|
||||
typedef int (*vhost_set_mem_table_op)(struct vhost_dev *dev,
|
||||
struct vhost_memory *mem);
|
||||
typedef int (*vhost_set_vring_addr_op)(struct vhost_dev *dev,
|
||||
struct vhost_vring_addr *addr);
|
||||
typedef int (*vhost_set_vring_endian_op)(struct vhost_dev *dev,
|
||||
struct vhost_vring_state *ring);
|
||||
typedef int (*vhost_set_vring_num_op)(struct vhost_dev *dev,
|
||||
struct vhost_vring_state *ring);
|
||||
typedef int (*vhost_set_vring_base_op)(struct vhost_dev *dev,
|
||||
struct vhost_vring_state *ring);
|
||||
typedef int (*vhost_get_vring_base_op)(struct vhost_dev *dev,
|
||||
struct vhost_vring_state *ring);
|
||||
typedef int (*vhost_set_vring_kick_op)(struct vhost_dev *dev,
|
||||
struct vhost_vring_file *file);
|
||||
typedef int (*vhost_set_vring_call_op)(struct vhost_dev *dev,
|
||||
struct vhost_vring_file *file);
|
||||
typedef int (*vhost_set_features_op)(struct vhost_dev *dev,
|
||||
uint64_t features);
|
||||
typedef int (*vhost_get_features_op)(struct vhost_dev *dev,
|
||||
uint64_t *features);
|
||||
typedef int (*vhost_set_owner_op)(struct vhost_dev *dev);
|
||||
typedef int (*vhost_reset_device_op)(struct vhost_dev *dev);
|
||||
typedef int (*vhost_get_vq_index_op)(struct vhost_dev *dev, int idx);
|
||||
typedef int (*vhost_set_vring_enable_op)(struct vhost_dev *dev,
|
||||
int enable);
|
||||
typedef bool (*vhost_requires_shm_log_op)(struct vhost_dev *dev);
|
||||
typedef int (*vhost_migration_done_op)(struct vhost_dev *dev,
|
||||
char *mac_addr);
|
||||
|
||||
typedef struct VhostOps {
|
||||
VhostBackendType backend_type;
|
||||
vhost_call vhost_call;
|
||||
vhost_backend_init vhost_backend_init;
|
||||
vhost_backend_cleanup vhost_backend_cleanup;
|
||||
vhost_backend_get_vq_index vhost_backend_get_vq_index;
|
||||
vhost_backend_set_vring_enable vhost_backend_set_vring_enable;
|
||||
vhost_backend_memslots_limit vhost_backend_memslots_limit;
|
||||
vhost_net_set_backend_op vhost_net_set_backend;
|
||||
vhost_scsi_set_endpoint_op vhost_scsi_set_endpoint;
|
||||
vhost_scsi_clear_endpoint_op vhost_scsi_clear_endpoint;
|
||||
vhost_scsi_get_abi_version_op vhost_scsi_get_abi_version;
|
||||
vhost_set_log_base_op vhost_set_log_base;
|
||||
vhost_set_mem_table_op vhost_set_mem_table;
|
||||
vhost_set_vring_addr_op vhost_set_vring_addr;
|
||||
vhost_set_vring_endian_op vhost_set_vring_endian;
|
||||
vhost_set_vring_num_op vhost_set_vring_num;
|
||||
vhost_set_vring_base_op vhost_set_vring_base;
|
||||
vhost_get_vring_base_op vhost_get_vring_base;
|
||||
vhost_set_vring_kick_op vhost_set_vring_kick;
|
||||
vhost_set_vring_call_op vhost_set_vring_call;
|
||||
vhost_set_features_op vhost_set_features;
|
||||
vhost_get_features_op vhost_get_features;
|
||||
vhost_set_owner_op vhost_set_owner;
|
||||
vhost_reset_device_op vhost_reset_device;
|
||||
vhost_get_vq_index_op vhost_get_vq_index;
|
||||
vhost_set_vring_enable_op vhost_set_vring_enable;
|
||||
vhost_requires_shm_log_op vhost_requires_shm_log;
|
||||
vhost_migration_done_op vhost_migration_done;
|
||||
} VhostOps;
|
||||
|
||||
extern const VhostOps user_ops;
|
||||
|
||||
@@ -31,7 +31,8 @@ typedef unsigned long vhost_log_chunk_t;
|
||||
struct vhost_log {
|
||||
unsigned long long size;
|
||||
int refcnt;
|
||||
vhost_log_chunk_t log[0];
|
||||
int fd;
|
||||
vhost_log_chunk_t *log;
|
||||
};
|
||||
|
||||
struct vhost_memory;
|
||||
@@ -44,14 +45,14 @@ struct vhost_dev {
|
||||
int nvqs;
|
||||
/* the first virtqueue which would be used by this vhost dev */
|
||||
int vq_index;
|
||||
unsigned long long features;
|
||||
unsigned long long acked_features;
|
||||
unsigned long long backend_features;
|
||||
unsigned long long protocol_features;
|
||||
unsigned long long max_queues;
|
||||
uint64_t features;
|
||||
uint64_t acked_features;
|
||||
uint64_t backend_features;
|
||||
uint64_t protocol_features;
|
||||
uint64_t max_queues;
|
||||
bool started;
|
||||
bool log_enabled;
|
||||
unsigned long long log_size;
|
||||
uint64_t log_size;
|
||||
Error *migration_blocker;
|
||||
bool memory_changed;
|
||||
hwaddr mem_changed_start_addr;
|
||||
@@ -59,6 +60,7 @@ struct vhost_dev {
|
||||
const VhostOps *vhost_ops;
|
||||
void *opaque;
|
||||
struct vhost_log *log;
|
||||
QLIST_ENTRY(vhost_dev) entry;
|
||||
};
|
||||
|
||||
int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
|
||||
@@ -83,4 +85,5 @@ uint64_t vhost_get_features(struct vhost_dev *hdev, const int *feature_bits,
|
||||
uint64_t features);
|
||||
void vhost_ack_features(struct vhost_dev *hdev, const int *feature_bits,
|
||||
uint64_t features);
|
||||
bool vhost_has_free_slot(void);
|
||||
#endif
|
||||
|
||||
@@ -27,6 +27,7 @@ void vhost_net_ack_features(VHostNetState *net, uint64_t features);
|
||||
bool vhost_net_virtqueue_pending(VHostNetState *net, int n);
|
||||
void vhost_net_virtqueue_mask(VHostNetState *net, VirtIODevice *dev,
|
||||
int idx, bool mask);
|
||||
int vhost_net_notify_migration_done(VHostNetState *net, char* mac_addr);
|
||||
VHostNetState *get_vhost_net(NetClientState *nc);
|
||||
|
||||
int vhost_set_vring_enable(NetClientState * nc, int enable);
|
||||
|
||||
118
include/qemu/buffer.h
Normal file
118
include/qemu/buffer.h
Normal file
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* QEMU generic buffers
|
||||
*
|
||||
* Copyright (c) 2015 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef QEMU_BUFFER_H__
|
||||
#define QEMU_BUFFER_H__
|
||||
|
||||
#include "qemu-common.h"
|
||||
|
||||
typedef struct Buffer Buffer;
|
||||
|
||||
/**
|
||||
* Buffer:
|
||||
*
|
||||
* The Buffer object provides a simple dynamically resizing
|
||||
* array, with separate tracking of capacity and usage. This
|
||||
* is typically useful when buffering I/O or processing data.
|
||||
*/
|
||||
|
||||
struct Buffer {
|
||||
size_t capacity;
|
||||
size_t offset;
|
||||
uint8_t *buffer;
|
||||
};
|
||||
|
||||
/**
|
||||
* buffer_reserve:
|
||||
* @buffer: the buffer object
|
||||
* @len: the minimum required free space
|
||||
*
|
||||
* Ensure that the buffer has space allocated for at least
|
||||
* @len bytes. If the current buffer is too small, it will
|
||||
* be reallocated, possibly to a larger size than requested.
|
||||
*/
|
||||
void buffer_reserve(Buffer *buffer, size_t len);
|
||||
|
||||
/**
|
||||
* buffer_reset:
|
||||
* @buffer: the buffer object
|
||||
*
|
||||
* Reset the length of the stored data to zero, but do
|
||||
* not free / reallocate the memory buffer
|
||||
*/
|
||||
void buffer_reset(Buffer *buffer);
|
||||
|
||||
/**
|
||||
* buffer_free:
|
||||
* @buffer: the buffer object
|
||||
*
|
||||
* Reset the length of the stored data to zero and also
|
||||
* free the internal memory buffer
|
||||
*/
|
||||
void buffer_free(Buffer *buffer);
|
||||
|
||||
/**
|
||||
* buffer_append:
|
||||
* @buffer: the buffer object
|
||||
* @data: the data block to append
|
||||
* @len: the length of @data in bytes
|
||||
*
|
||||
* Append the contents of @data to the end of the buffer.
|
||||
* The caller must ensure that the buffer has sufficient
|
||||
* free space for @len bytes, typically by calling the
|
||||
* buffer_reserve() method prior to appending.
|
||||
*/
|
||||
void buffer_append(Buffer *buffer, const void *data, size_t len);
|
||||
|
||||
/**
|
||||
* buffer_advance:
|
||||
* @buffer: the buffer object
|
||||
* @len: the number of bytes to skip
|
||||
*
|
||||
* Remove @len bytes of data from the head of the buffer.
|
||||
* The internal buffer will not be reallocated, so will
|
||||
* have at least @len bytes of free space after this
|
||||
* call completes
|
||||
*/
|
||||
void buffer_advance(Buffer *buffer, size_t len);
|
||||
|
||||
/**
|
||||
* buffer_end:
|
||||
* @buffer: the buffer object
|
||||
*
|
||||
* Get a pointer to the tail end of the internal buffer
|
||||
* The returned pointer is only valid until the next
|
||||
* call to buffer_reserve().
|
||||
*
|
||||
* Returns: the tail of the buffer
|
||||
*/
|
||||
uint8_t *buffer_end(Buffer *buffer);
|
||||
|
||||
/**
|
||||
* buffer_empty:
|
||||
* @buffer: the buffer object
|
||||
*
|
||||
* Determine if the buffer contains any current data
|
||||
*
|
||||
* Returns: true if the buffer holds data, false otherwise
|
||||
*/
|
||||
gboolean buffer_empty(Buffer *buffer);
|
||||
|
||||
#endif /* QEMU_BUFFER_H__ */
|
||||
@@ -26,7 +26,7 @@
|
||||
#define QEMU_COROUTINE_INT_H
|
||||
|
||||
#include "qemu/queue.h"
|
||||
#include "block/coroutine.h"
|
||||
#include "qemu/coroutine.h"
|
||||
|
||||
typedef enum {
|
||||
COROUTINE_YIELD = 1,
|
||||
26
include/qemu/memfd.h
Normal file
26
include/qemu/memfd.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef QEMU_MEMFD_H
|
||||
#define QEMU_MEMFD_H
|
||||
|
||||
#include "config-host.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifndef F_LINUX_SPECIFIC_BASE
|
||||
#define F_LINUX_SPECIFIC_BASE 1024
|
||||
#endif
|
||||
|
||||
#ifndef F_ADD_SEALS
|
||||
#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9)
|
||||
#define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10)
|
||||
|
||||
#define F_SEAL_SEAL 0x0001 /* prevent further seals from being set */
|
||||
#define F_SEAL_SHRINK 0x0002 /* prevent file from shrinking */
|
||||
#define F_SEAL_GROW 0x0004 /* prevent file from growing */
|
||||
#define F_SEAL_WRITE 0x0008 /* prevent writes */
|
||||
#endif
|
||||
|
||||
void *qemu_memfd_alloc(const char *name, size_t size, unsigned int seals,
|
||||
int *fd);
|
||||
void qemu_memfd_free(void *ptr, size_t size, int fd);
|
||||
bool qemu_memfd_check(void);
|
||||
|
||||
#endif /* QEMU_MEMFD_H */
|
||||
10
include/qemu/mmap-alloc.h
Normal file
10
include/qemu/mmap-alloc.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef QEMU_MMAP_ALLOC
|
||||
#define QEMU_MMAP_ALLOC
|
||||
|
||||
#include "qemu-common.h"
|
||||
|
||||
void *qemu_ram_mmap(int fd, size_t size, size_t align, bool shared);
|
||||
|
||||
void qemu_ram_munmap(void *ptr, size_t size);
|
||||
|
||||
#endif
|
||||
@@ -69,6 +69,8 @@
|
||||
#include "sysemu/os-posix.h"
|
||||
#endif
|
||||
|
||||
#include "qapi/error.h"
|
||||
|
||||
#if defined(CONFIG_SOLARIS) && CONFIG_SOLARIS_VERSION < 10
|
||||
/* [u]int_fast*_t not in <sys/int_types.h> */
|
||||
typedef unsigned char uint_fast8_t;
|
||||
@@ -286,4 +288,18 @@ void os_mem_prealloc(int fd, char *area, size_t sz);
|
||||
|
||||
int qemu_read_password(char *buf, int buf_size);
|
||||
|
||||
/**
|
||||
* qemu_fork:
|
||||
*
|
||||
* A version of fork that avoids signal handler race
|
||||
* conditions that can lead to child process getting
|
||||
* signals that are otherwise only expected by the
|
||||
* parent. It also resets all signal handlers to the
|
||||
* default settings.
|
||||
*
|
||||
* Returns 0 to child process, pid number to parent
|
||||
* or -1 on failure.
|
||||
*/
|
||||
pid_t qemu_fork(Error **errp);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -88,4 +88,38 @@ int socket_dgram(SocketAddress *remote, SocketAddress *local, Error **errp);
|
||||
int parse_host_port(struct sockaddr_in *saddr, const char *str);
|
||||
int socket_init(void);
|
||||
|
||||
/**
|
||||
* socket_local_address:
|
||||
* @fd: the socket file handle
|
||||
* @errp: pointer to uninitialized error object
|
||||
*
|
||||
* Get the string representation of the local socket
|
||||
* address. A pointer to the allocated address information
|
||||
* struct will be returned, which the caller is required to
|
||||
* release with a call qapi_free_SocketAddress when no
|
||||
* longer required.
|
||||
*
|
||||
* Returns: the socket address struct, or NULL on error
|
||||
*/
|
||||
SocketAddress *socket_local_address(int fd, Error **errp);
|
||||
|
||||
/**
|
||||
* socket_remote_address:
|
||||
* @fd: the socket file handle
|
||||
* @errp: pointer to uninitialized error object
|
||||
*
|
||||
* Get the string representation of the remote socket
|
||||
* address. A pointer to the allocated address information
|
||||
* struct will be returned, which the caller is required to
|
||||
* release with a call qapi_free_SocketAddress when no
|
||||
* longer required.
|
||||
*
|
||||
* Returns: the socket address struct, or NULL on error
|
||||
*/
|
||||
SocketAddress *socket_remote_address(int fd, Error **errp);
|
||||
|
||||
|
||||
void qapi_copy_SocketAddress(SocketAddress **p_dest,
|
||||
SocketAddress *src);
|
||||
|
||||
#endif /* QEMU_SOCKET_H */
|
||||
|
||||
448
linux-headers/asm-arm/unistd.h
Normal file
448
linux-headers/asm-arm/unistd.h
Normal file
@@ -0,0 +1,448 @@
|
||||
/*
|
||||
* arch/arm/include/asm/unistd.h
|
||||
*
|
||||
* Copyright (C) 2001-2005 Russell King
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Please forward _all_ changes to this file to rmk@arm.linux.org.uk,
|
||||
* no matter what the change is. Thanks!
|
||||
*/
|
||||
#ifndef __ASM_ARM_UNISTD_H
|
||||
#define __ASM_ARM_UNISTD_H
|
||||
|
||||
#define __NR_OABI_SYSCALL_BASE 0x900000
|
||||
|
||||
#if defined(__thumb__) || defined(__ARM_EABI__)
|
||||
#define __NR_SYSCALL_BASE 0
|
||||
#else
|
||||
#define __NR_SYSCALL_BASE __NR_OABI_SYSCALL_BASE
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This file contains the system call numbers.
|
||||
*/
|
||||
|
||||
#define __NR_restart_syscall (__NR_SYSCALL_BASE+ 0)
|
||||
#define __NR_exit (__NR_SYSCALL_BASE+ 1)
|
||||
#define __NR_fork (__NR_SYSCALL_BASE+ 2)
|
||||
#define __NR_read (__NR_SYSCALL_BASE+ 3)
|
||||
#define __NR_write (__NR_SYSCALL_BASE+ 4)
|
||||
#define __NR_open (__NR_SYSCALL_BASE+ 5)
|
||||
#define __NR_close (__NR_SYSCALL_BASE+ 6)
|
||||
/* 7 was sys_waitpid */
|
||||
#define __NR_creat (__NR_SYSCALL_BASE+ 8)
|
||||
#define __NR_link (__NR_SYSCALL_BASE+ 9)
|
||||
#define __NR_unlink (__NR_SYSCALL_BASE+ 10)
|
||||
#define __NR_execve (__NR_SYSCALL_BASE+ 11)
|
||||
#define __NR_chdir (__NR_SYSCALL_BASE+ 12)
|
||||
#define __NR_time (__NR_SYSCALL_BASE+ 13)
|
||||
#define __NR_mknod (__NR_SYSCALL_BASE+ 14)
|
||||
#define __NR_chmod (__NR_SYSCALL_BASE+ 15)
|
||||
#define __NR_lchown (__NR_SYSCALL_BASE+ 16)
|
||||
/* 17 was sys_break */
|
||||
/* 18 was sys_stat */
|
||||
#define __NR_lseek (__NR_SYSCALL_BASE+ 19)
|
||||
#define __NR_getpid (__NR_SYSCALL_BASE+ 20)
|
||||
#define __NR_mount (__NR_SYSCALL_BASE+ 21)
|
||||
#define __NR_umount (__NR_SYSCALL_BASE+ 22)
|
||||
#define __NR_setuid (__NR_SYSCALL_BASE+ 23)
|
||||
#define __NR_getuid (__NR_SYSCALL_BASE+ 24)
|
||||
#define __NR_stime (__NR_SYSCALL_BASE+ 25)
|
||||
#define __NR_ptrace (__NR_SYSCALL_BASE+ 26)
|
||||
#define __NR_alarm (__NR_SYSCALL_BASE+ 27)
|
||||
/* 28 was sys_fstat */
|
||||
#define __NR_pause (__NR_SYSCALL_BASE+ 29)
|
||||
#define __NR_utime (__NR_SYSCALL_BASE+ 30)
|
||||
/* 31 was sys_stty */
|
||||
/* 32 was sys_gtty */
|
||||
#define __NR_access (__NR_SYSCALL_BASE+ 33)
|
||||
#define __NR_nice (__NR_SYSCALL_BASE+ 34)
|
||||
/* 35 was sys_ftime */
|
||||
#define __NR_sync (__NR_SYSCALL_BASE+ 36)
|
||||
#define __NR_kill (__NR_SYSCALL_BASE+ 37)
|
||||
#define __NR_rename (__NR_SYSCALL_BASE+ 38)
|
||||
#define __NR_mkdir (__NR_SYSCALL_BASE+ 39)
|
||||
#define __NR_rmdir (__NR_SYSCALL_BASE+ 40)
|
||||
#define __NR_dup (__NR_SYSCALL_BASE+ 41)
|
||||
#define __NR_pipe (__NR_SYSCALL_BASE+ 42)
|
||||
#define __NR_times (__NR_SYSCALL_BASE+ 43)
|
||||
/* 44 was sys_prof */
|
||||
#define __NR_brk (__NR_SYSCALL_BASE+ 45)
|
||||
#define __NR_setgid (__NR_SYSCALL_BASE+ 46)
|
||||
#define __NR_getgid (__NR_SYSCALL_BASE+ 47)
|
||||
/* 48 was sys_signal */
|
||||
#define __NR_geteuid (__NR_SYSCALL_BASE+ 49)
|
||||
#define __NR_getegid (__NR_SYSCALL_BASE+ 50)
|
||||
#define __NR_acct (__NR_SYSCALL_BASE+ 51)
|
||||
#define __NR_umount2 (__NR_SYSCALL_BASE+ 52)
|
||||
/* 53 was sys_lock */
|
||||
#define __NR_ioctl (__NR_SYSCALL_BASE+ 54)
|
||||
#define __NR_fcntl (__NR_SYSCALL_BASE+ 55)
|
||||
/* 56 was sys_mpx */
|
||||
#define __NR_setpgid (__NR_SYSCALL_BASE+ 57)
|
||||
/* 58 was sys_ulimit */
|
||||
/* 59 was sys_olduname */
|
||||
#define __NR_umask (__NR_SYSCALL_BASE+ 60)
|
||||
#define __NR_chroot (__NR_SYSCALL_BASE+ 61)
|
||||
#define __NR_ustat (__NR_SYSCALL_BASE+ 62)
|
||||
#define __NR_dup2 (__NR_SYSCALL_BASE+ 63)
|
||||
#define __NR_getppid (__NR_SYSCALL_BASE+ 64)
|
||||
#define __NR_getpgrp (__NR_SYSCALL_BASE+ 65)
|
||||
#define __NR_setsid (__NR_SYSCALL_BASE+ 66)
|
||||
#define __NR_sigaction (__NR_SYSCALL_BASE+ 67)
|
||||
/* 68 was sys_sgetmask */
|
||||
/* 69 was sys_ssetmask */
|
||||
#define __NR_setreuid (__NR_SYSCALL_BASE+ 70)
|
||||
#define __NR_setregid (__NR_SYSCALL_BASE+ 71)
|
||||
#define __NR_sigsuspend (__NR_SYSCALL_BASE+ 72)
|
||||
#define __NR_sigpending (__NR_SYSCALL_BASE+ 73)
|
||||
#define __NR_sethostname (__NR_SYSCALL_BASE+ 74)
|
||||
#define __NR_setrlimit (__NR_SYSCALL_BASE+ 75)
|
||||
#define __NR_getrlimit (__NR_SYSCALL_BASE+ 76) /* Back compat 2GB limited rlimit */
|
||||
#define __NR_getrusage (__NR_SYSCALL_BASE+ 77)
|
||||
#define __NR_gettimeofday (__NR_SYSCALL_BASE+ 78)
|
||||
#define __NR_settimeofday (__NR_SYSCALL_BASE+ 79)
|
||||
#define __NR_getgroups (__NR_SYSCALL_BASE+ 80)
|
||||
#define __NR_setgroups (__NR_SYSCALL_BASE+ 81)
|
||||
#define __NR_select (__NR_SYSCALL_BASE+ 82)
|
||||
#define __NR_symlink (__NR_SYSCALL_BASE+ 83)
|
||||
/* 84 was sys_lstat */
|
||||
#define __NR_readlink (__NR_SYSCALL_BASE+ 85)
|
||||
#define __NR_uselib (__NR_SYSCALL_BASE+ 86)
|
||||
#define __NR_swapon (__NR_SYSCALL_BASE+ 87)
|
||||
#define __NR_reboot (__NR_SYSCALL_BASE+ 88)
|
||||
#define __NR_readdir (__NR_SYSCALL_BASE+ 89)
|
||||
#define __NR_mmap (__NR_SYSCALL_BASE+ 90)
|
||||
#define __NR_munmap (__NR_SYSCALL_BASE+ 91)
|
||||
#define __NR_truncate (__NR_SYSCALL_BASE+ 92)
|
||||
#define __NR_ftruncate (__NR_SYSCALL_BASE+ 93)
|
||||
#define __NR_fchmod (__NR_SYSCALL_BASE+ 94)
|
||||
#define __NR_fchown (__NR_SYSCALL_BASE+ 95)
|
||||
#define __NR_getpriority (__NR_SYSCALL_BASE+ 96)
|
||||
#define __NR_setpriority (__NR_SYSCALL_BASE+ 97)
|
||||
/* 98 was sys_profil */
|
||||
#define __NR_statfs (__NR_SYSCALL_BASE+ 99)
|
||||
#define __NR_fstatfs (__NR_SYSCALL_BASE+100)
|
||||
/* 101 was sys_ioperm */
|
||||
#define __NR_socketcall (__NR_SYSCALL_BASE+102)
|
||||
#define __NR_syslog (__NR_SYSCALL_BASE+103)
|
||||
#define __NR_setitimer (__NR_SYSCALL_BASE+104)
|
||||
#define __NR_getitimer (__NR_SYSCALL_BASE+105)
|
||||
#define __NR_stat (__NR_SYSCALL_BASE+106)
|
||||
#define __NR_lstat (__NR_SYSCALL_BASE+107)
|
||||
#define __NR_fstat (__NR_SYSCALL_BASE+108)
|
||||
/* 109 was sys_uname */
|
||||
/* 110 was sys_iopl */
|
||||
#define __NR_vhangup (__NR_SYSCALL_BASE+111)
|
||||
/* 112 was sys_idle */
|
||||
#define __NR_syscall (__NR_SYSCALL_BASE+113) /* syscall to call a syscall! */
|
||||
#define __NR_wait4 (__NR_SYSCALL_BASE+114)
|
||||
#define __NR_swapoff (__NR_SYSCALL_BASE+115)
|
||||
#define __NR_sysinfo (__NR_SYSCALL_BASE+116)
|
||||
#define __NR_ipc (__NR_SYSCALL_BASE+117)
|
||||
#define __NR_fsync (__NR_SYSCALL_BASE+118)
|
||||
#define __NR_sigreturn (__NR_SYSCALL_BASE+119)
|
||||
#define __NR_clone (__NR_SYSCALL_BASE+120)
|
||||
#define __NR_setdomainname (__NR_SYSCALL_BASE+121)
|
||||
#define __NR_uname (__NR_SYSCALL_BASE+122)
|
||||
/* 123 was sys_modify_ldt */
|
||||
#define __NR_adjtimex (__NR_SYSCALL_BASE+124)
|
||||
#define __NR_mprotect (__NR_SYSCALL_BASE+125)
|
||||
#define __NR_sigprocmask (__NR_SYSCALL_BASE+126)
|
||||
/* 127 was sys_create_module */
|
||||
#define __NR_init_module (__NR_SYSCALL_BASE+128)
|
||||
#define __NR_delete_module (__NR_SYSCALL_BASE+129)
|
||||
/* 130 was sys_get_kernel_syms */
|
||||
#define __NR_quotactl (__NR_SYSCALL_BASE+131)
|
||||
#define __NR_getpgid (__NR_SYSCALL_BASE+132)
|
||||
#define __NR_fchdir (__NR_SYSCALL_BASE+133)
|
||||
#define __NR_bdflush (__NR_SYSCALL_BASE+134)
|
||||
#define __NR_sysfs (__NR_SYSCALL_BASE+135)
|
||||
#define __NR_personality (__NR_SYSCALL_BASE+136)
|
||||
/* 137 was sys_afs_syscall */
|
||||
#define __NR_setfsuid (__NR_SYSCALL_BASE+138)
|
||||
#define __NR_setfsgid (__NR_SYSCALL_BASE+139)
|
||||
#define __NR__llseek (__NR_SYSCALL_BASE+140)
|
||||
#define __NR_getdents (__NR_SYSCALL_BASE+141)
|
||||
#define __NR__newselect (__NR_SYSCALL_BASE+142)
|
||||
#define __NR_flock (__NR_SYSCALL_BASE+143)
|
||||
#define __NR_msync (__NR_SYSCALL_BASE+144)
|
||||
#define __NR_readv (__NR_SYSCALL_BASE+145)
|
||||
#define __NR_writev (__NR_SYSCALL_BASE+146)
|
||||
#define __NR_getsid (__NR_SYSCALL_BASE+147)
|
||||
#define __NR_fdatasync (__NR_SYSCALL_BASE+148)
|
||||
#define __NR__sysctl (__NR_SYSCALL_BASE+149)
|
||||
#define __NR_mlock (__NR_SYSCALL_BASE+150)
|
||||
#define __NR_munlock (__NR_SYSCALL_BASE+151)
|
||||
#define __NR_mlockall (__NR_SYSCALL_BASE+152)
|
||||
#define __NR_munlockall (__NR_SYSCALL_BASE+153)
|
||||
#define __NR_sched_setparam (__NR_SYSCALL_BASE+154)
|
||||
#define __NR_sched_getparam (__NR_SYSCALL_BASE+155)
|
||||
#define __NR_sched_setscheduler (__NR_SYSCALL_BASE+156)
|
||||
#define __NR_sched_getscheduler (__NR_SYSCALL_BASE+157)
|
||||
#define __NR_sched_yield (__NR_SYSCALL_BASE+158)
|
||||
#define __NR_sched_get_priority_max (__NR_SYSCALL_BASE+159)
|
||||
#define __NR_sched_get_priority_min (__NR_SYSCALL_BASE+160)
|
||||
#define __NR_sched_rr_get_interval (__NR_SYSCALL_BASE+161)
|
||||
#define __NR_nanosleep (__NR_SYSCALL_BASE+162)
|
||||
#define __NR_mremap (__NR_SYSCALL_BASE+163)
|
||||
#define __NR_setresuid (__NR_SYSCALL_BASE+164)
|
||||
#define __NR_getresuid (__NR_SYSCALL_BASE+165)
|
||||
/* 166 was sys_vm86 */
|
||||
/* 167 was sys_query_module */
|
||||
#define __NR_poll (__NR_SYSCALL_BASE+168)
|
||||
#define __NR_nfsservctl (__NR_SYSCALL_BASE+169)
|
||||
#define __NR_setresgid (__NR_SYSCALL_BASE+170)
|
||||
#define __NR_getresgid (__NR_SYSCALL_BASE+171)
|
||||
#define __NR_prctl (__NR_SYSCALL_BASE+172)
|
||||
#define __NR_rt_sigreturn (__NR_SYSCALL_BASE+173)
|
||||
#define __NR_rt_sigaction (__NR_SYSCALL_BASE+174)
|
||||
#define __NR_rt_sigprocmask (__NR_SYSCALL_BASE+175)
|
||||
#define __NR_rt_sigpending (__NR_SYSCALL_BASE+176)
|
||||
#define __NR_rt_sigtimedwait (__NR_SYSCALL_BASE+177)
|
||||
#define __NR_rt_sigqueueinfo (__NR_SYSCALL_BASE+178)
|
||||
#define __NR_rt_sigsuspend (__NR_SYSCALL_BASE+179)
|
||||
#define __NR_pread64 (__NR_SYSCALL_BASE+180)
|
||||
#define __NR_pwrite64 (__NR_SYSCALL_BASE+181)
|
||||
#define __NR_chown (__NR_SYSCALL_BASE+182)
|
||||
#define __NR_getcwd (__NR_SYSCALL_BASE+183)
|
||||
#define __NR_capget (__NR_SYSCALL_BASE+184)
|
||||
#define __NR_capset (__NR_SYSCALL_BASE+185)
|
||||
#define __NR_sigaltstack (__NR_SYSCALL_BASE+186)
|
||||
#define __NR_sendfile (__NR_SYSCALL_BASE+187)
|
||||
/* 188 reserved */
|
||||
/* 189 reserved */
|
||||
#define __NR_vfork (__NR_SYSCALL_BASE+190)
|
||||
#define __NR_ugetrlimit (__NR_SYSCALL_BASE+191) /* SuS compliant getrlimit */
|
||||
#define __NR_mmap2 (__NR_SYSCALL_BASE+192)
|
||||
#define __NR_truncate64 (__NR_SYSCALL_BASE+193)
|
||||
#define __NR_ftruncate64 (__NR_SYSCALL_BASE+194)
|
||||
#define __NR_stat64 (__NR_SYSCALL_BASE+195)
|
||||
#define __NR_lstat64 (__NR_SYSCALL_BASE+196)
|
||||
#define __NR_fstat64 (__NR_SYSCALL_BASE+197)
|
||||
#define __NR_lchown32 (__NR_SYSCALL_BASE+198)
|
||||
#define __NR_getuid32 (__NR_SYSCALL_BASE+199)
|
||||
#define __NR_getgid32 (__NR_SYSCALL_BASE+200)
|
||||
#define __NR_geteuid32 (__NR_SYSCALL_BASE+201)
|
||||
#define __NR_getegid32 (__NR_SYSCALL_BASE+202)
|
||||
#define __NR_setreuid32 (__NR_SYSCALL_BASE+203)
|
||||
#define __NR_setregid32 (__NR_SYSCALL_BASE+204)
|
||||
#define __NR_getgroups32 (__NR_SYSCALL_BASE+205)
|
||||
#define __NR_setgroups32 (__NR_SYSCALL_BASE+206)
|
||||
#define __NR_fchown32 (__NR_SYSCALL_BASE+207)
|
||||
#define __NR_setresuid32 (__NR_SYSCALL_BASE+208)
|
||||
#define __NR_getresuid32 (__NR_SYSCALL_BASE+209)
|
||||
#define __NR_setresgid32 (__NR_SYSCALL_BASE+210)
|
||||
#define __NR_getresgid32 (__NR_SYSCALL_BASE+211)
|
||||
#define __NR_chown32 (__NR_SYSCALL_BASE+212)
|
||||
#define __NR_setuid32 (__NR_SYSCALL_BASE+213)
|
||||
#define __NR_setgid32 (__NR_SYSCALL_BASE+214)
|
||||
#define __NR_setfsuid32 (__NR_SYSCALL_BASE+215)
|
||||
#define __NR_setfsgid32 (__NR_SYSCALL_BASE+216)
|
||||
#define __NR_getdents64 (__NR_SYSCALL_BASE+217)
|
||||
#define __NR_pivot_root (__NR_SYSCALL_BASE+218)
|
||||
#define __NR_mincore (__NR_SYSCALL_BASE+219)
|
||||
#define __NR_madvise (__NR_SYSCALL_BASE+220)
|
||||
#define __NR_fcntl64 (__NR_SYSCALL_BASE+221)
|
||||
/* 222 for tux */
|
||||
/* 223 is unused */
|
||||
#define __NR_gettid (__NR_SYSCALL_BASE+224)
|
||||
#define __NR_readahead (__NR_SYSCALL_BASE+225)
|
||||
#define __NR_setxattr (__NR_SYSCALL_BASE+226)
|
||||
#define __NR_lsetxattr (__NR_SYSCALL_BASE+227)
|
||||
#define __NR_fsetxattr (__NR_SYSCALL_BASE+228)
|
||||
#define __NR_getxattr (__NR_SYSCALL_BASE+229)
|
||||
#define __NR_lgetxattr (__NR_SYSCALL_BASE+230)
|
||||
#define __NR_fgetxattr (__NR_SYSCALL_BASE+231)
|
||||
#define __NR_listxattr (__NR_SYSCALL_BASE+232)
|
||||
#define __NR_llistxattr (__NR_SYSCALL_BASE+233)
|
||||
#define __NR_flistxattr (__NR_SYSCALL_BASE+234)
|
||||
#define __NR_removexattr (__NR_SYSCALL_BASE+235)
|
||||
#define __NR_lremovexattr (__NR_SYSCALL_BASE+236)
|
||||
#define __NR_fremovexattr (__NR_SYSCALL_BASE+237)
|
||||
#define __NR_tkill (__NR_SYSCALL_BASE+238)
|
||||
#define __NR_sendfile64 (__NR_SYSCALL_BASE+239)
|
||||
#define __NR_futex (__NR_SYSCALL_BASE+240)
|
||||
#define __NR_sched_setaffinity (__NR_SYSCALL_BASE+241)
|
||||
#define __NR_sched_getaffinity (__NR_SYSCALL_BASE+242)
|
||||
#define __NR_io_setup (__NR_SYSCALL_BASE+243)
|
||||
#define __NR_io_destroy (__NR_SYSCALL_BASE+244)
|
||||
#define __NR_io_getevents (__NR_SYSCALL_BASE+245)
|
||||
#define __NR_io_submit (__NR_SYSCALL_BASE+246)
|
||||
#define __NR_io_cancel (__NR_SYSCALL_BASE+247)
|
||||
#define __NR_exit_group (__NR_SYSCALL_BASE+248)
|
||||
#define __NR_lookup_dcookie (__NR_SYSCALL_BASE+249)
|
||||
#define __NR_epoll_create (__NR_SYSCALL_BASE+250)
|
||||
#define __NR_epoll_ctl (__NR_SYSCALL_BASE+251)
|
||||
#define __NR_epoll_wait (__NR_SYSCALL_BASE+252)
|
||||
#define __NR_remap_file_pages (__NR_SYSCALL_BASE+253)
|
||||
/* 254 for set_thread_area */
|
||||
/* 255 for get_thread_area */
|
||||
#define __NR_set_tid_address (__NR_SYSCALL_BASE+256)
|
||||
#define __NR_timer_create (__NR_SYSCALL_BASE+257)
|
||||
#define __NR_timer_settime (__NR_SYSCALL_BASE+258)
|
||||
#define __NR_timer_gettime (__NR_SYSCALL_BASE+259)
|
||||
#define __NR_timer_getoverrun (__NR_SYSCALL_BASE+260)
|
||||
#define __NR_timer_delete (__NR_SYSCALL_BASE+261)
|
||||
#define __NR_clock_settime (__NR_SYSCALL_BASE+262)
|
||||
#define __NR_clock_gettime (__NR_SYSCALL_BASE+263)
|
||||
#define __NR_clock_getres (__NR_SYSCALL_BASE+264)
|
||||
#define __NR_clock_nanosleep (__NR_SYSCALL_BASE+265)
|
||||
#define __NR_statfs64 (__NR_SYSCALL_BASE+266)
|
||||
#define __NR_fstatfs64 (__NR_SYSCALL_BASE+267)
|
||||
#define __NR_tgkill (__NR_SYSCALL_BASE+268)
|
||||
#define __NR_utimes (__NR_SYSCALL_BASE+269)
|
||||
#define __NR_arm_fadvise64_64 (__NR_SYSCALL_BASE+270)
|
||||
#define __NR_pciconfig_iobase (__NR_SYSCALL_BASE+271)
|
||||
#define __NR_pciconfig_read (__NR_SYSCALL_BASE+272)
|
||||
#define __NR_pciconfig_write (__NR_SYSCALL_BASE+273)
|
||||
#define __NR_mq_open (__NR_SYSCALL_BASE+274)
|
||||
#define __NR_mq_unlink (__NR_SYSCALL_BASE+275)
|
||||
#define __NR_mq_timedsend (__NR_SYSCALL_BASE+276)
|
||||
#define __NR_mq_timedreceive (__NR_SYSCALL_BASE+277)
|
||||
#define __NR_mq_notify (__NR_SYSCALL_BASE+278)
|
||||
#define __NR_mq_getsetattr (__NR_SYSCALL_BASE+279)
|
||||
#define __NR_waitid (__NR_SYSCALL_BASE+280)
|
||||
#define __NR_socket (__NR_SYSCALL_BASE+281)
|
||||
#define __NR_bind (__NR_SYSCALL_BASE+282)
|
||||
#define __NR_connect (__NR_SYSCALL_BASE+283)
|
||||
#define __NR_listen (__NR_SYSCALL_BASE+284)
|
||||
#define __NR_accept (__NR_SYSCALL_BASE+285)
|
||||
#define __NR_getsockname (__NR_SYSCALL_BASE+286)
|
||||
#define __NR_getpeername (__NR_SYSCALL_BASE+287)
|
||||
#define __NR_socketpair (__NR_SYSCALL_BASE+288)
|
||||
#define __NR_send (__NR_SYSCALL_BASE+289)
|
||||
#define __NR_sendto (__NR_SYSCALL_BASE+290)
|
||||
#define __NR_recv (__NR_SYSCALL_BASE+291)
|
||||
#define __NR_recvfrom (__NR_SYSCALL_BASE+292)
|
||||
#define __NR_shutdown (__NR_SYSCALL_BASE+293)
|
||||
#define __NR_setsockopt (__NR_SYSCALL_BASE+294)
|
||||
#define __NR_getsockopt (__NR_SYSCALL_BASE+295)
|
||||
#define __NR_sendmsg (__NR_SYSCALL_BASE+296)
|
||||
#define __NR_recvmsg (__NR_SYSCALL_BASE+297)
|
||||
#define __NR_semop (__NR_SYSCALL_BASE+298)
|
||||
#define __NR_semget (__NR_SYSCALL_BASE+299)
|
||||
#define __NR_semctl (__NR_SYSCALL_BASE+300)
|
||||
#define __NR_msgsnd (__NR_SYSCALL_BASE+301)
|
||||
#define __NR_msgrcv (__NR_SYSCALL_BASE+302)
|
||||
#define __NR_msgget (__NR_SYSCALL_BASE+303)
|
||||
#define __NR_msgctl (__NR_SYSCALL_BASE+304)
|
||||
#define __NR_shmat (__NR_SYSCALL_BASE+305)
|
||||
#define __NR_shmdt (__NR_SYSCALL_BASE+306)
|
||||
#define __NR_shmget (__NR_SYSCALL_BASE+307)
|
||||
#define __NR_shmctl (__NR_SYSCALL_BASE+308)
|
||||
#define __NR_add_key (__NR_SYSCALL_BASE+309)
|
||||
#define __NR_request_key (__NR_SYSCALL_BASE+310)
|
||||
#define __NR_keyctl (__NR_SYSCALL_BASE+311)
|
||||
#define __NR_semtimedop (__NR_SYSCALL_BASE+312)
|
||||
#define __NR_vserver (__NR_SYSCALL_BASE+313)
|
||||
#define __NR_ioprio_set (__NR_SYSCALL_BASE+314)
|
||||
#define __NR_ioprio_get (__NR_SYSCALL_BASE+315)
|
||||
#define __NR_inotify_init (__NR_SYSCALL_BASE+316)
|
||||
#define __NR_inotify_add_watch (__NR_SYSCALL_BASE+317)
|
||||
#define __NR_inotify_rm_watch (__NR_SYSCALL_BASE+318)
|
||||
#define __NR_mbind (__NR_SYSCALL_BASE+319)
|
||||
#define __NR_get_mempolicy (__NR_SYSCALL_BASE+320)
|
||||
#define __NR_set_mempolicy (__NR_SYSCALL_BASE+321)
|
||||
#define __NR_openat (__NR_SYSCALL_BASE+322)
|
||||
#define __NR_mkdirat (__NR_SYSCALL_BASE+323)
|
||||
#define __NR_mknodat (__NR_SYSCALL_BASE+324)
|
||||
#define __NR_fchownat (__NR_SYSCALL_BASE+325)
|
||||
#define __NR_futimesat (__NR_SYSCALL_BASE+326)
|
||||
#define __NR_fstatat64 (__NR_SYSCALL_BASE+327)
|
||||
#define __NR_unlinkat (__NR_SYSCALL_BASE+328)
|
||||
#define __NR_renameat (__NR_SYSCALL_BASE+329)
|
||||
#define __NR_linkat (__NR_SYSCALL_BASE+330)
|
||||
#define __NR_symlinkat (__NR_SYSCALL_BASE+331)
|
||||
#define __NR_readlinkat (__NR_SYSCALL_BASE+332)
|
||||
#define __NR_fchmodat (__NR_SYSCALL_BASE+333)
|
||||
#define __NR_faccessat (__NR_SYSCALL_BASE+334)
|
||||
#define __NR_pselect6 (__NR_SYSCALL_BASE+335)
|
||||
#define __NR_ppoll (__NR_SYSCALL_BASE+336)
|
||||
#define __NR_unshare (__NR_SYSCALL_BASE+337)
|
||||
#define __NR_set_robust_list (__NR_SYSCALL_BASE+338)
|
||||
#define __NR_get_robust_list (__NR_SYSCALL_BASE+339)
|
||||
#define __NR_splice (__NR_SYSCALL_BASE+340)
|
||||
#define __NR_arm_sync_file_range (__NR_SYSCALL_BASE+341)
|
||||
#define __NR_sync_file_range2 __NR_arm_sync_file_range
|
||||
#define __NR_tee (__NR_SYSCALL_BASE+342)
|
||||
#define __NR_vmsplice (__NR_SYSCALL_BASE+343)
|
||||
#define __NR_move_pages (__NR_SYSCALL_BASE+344)
|
||||
#define __NR_getcpu (__NR_SYSCALL_BASE+345)
|
||||
#define __NR_epoll_pwait (__NR_SYSCALL_BASE+346)
|
||||
#define __NR_kexec_load (__NR_SYSCALL_BASE+347)
|
||||
#define __NR_utimensat (__NR_SYSCALL_BASE+348)
|
||||
#define __NR_signalfd (__NR_SYSCALL_BASE+349)
|
||||
#define __NR_timerfd_create (__NR_SYSCALL_BASE+350)
|
||||
#define __NR_eventfd (__NR_SYSCALL_BASE+351)
|
||||
#define __NR_fallocate (__NR_SYSCALL_BASE+352)
|
||||
#define __NR_timerfd_settime (__NR_SYSCALL_BASE+353)
|
||||
#define __NR_timerfd_gettime (__NR_SYSCALL_BASE+354)
|
||||
#define __NR_signalfd4 (__NR_SYSCALL_BASE+355)
|
||||
#define __NR_eventfd2 (__NR_SYSCALL_BASE+356)
|
||||
#define __NR_epoll_create1 (__NR_SYSCALL_BASE+357)
|
||||
#define __NR_dup3 (__NR_SYSCALL_BASE+358)
|
||||
#define __NR_pipe2 (__NR_SYSCALL_BASE+359)
|
||||
#define __NR_inotify_init1 (__NR_SYSCALL_BASE+360)
|
||||
#define __NR_preadv (__NR_SYSCALL_BASE+361)
|
||||
#define __NR_pwritev (__NR_SYSCALL_BASE+362)
|
||||
#define __NR_rt_tgsigqueueinfo (__NR_SYSCALL_BASE+363)
|
||||
#define __NR_perf_event_open (__NR_SYSCALL_BASE+364)
|
||||
#define __NR_recvmmsg (__NR_SYSCALL_BASE+365)
|
||||
#define __NR_accept4 (__NR_SYSCALL_BASE+366)
|
||||
#define __NR_fanotify_init (__NR_SYSCALL_BASE+367)
|
||||
#define __NR_fanotify_mark (__NR_SYSCALL_BASE+368)
|
||||
#define __NR_prlimit64 (__NR_SYSCALL_BASE+369)
|
||||
#define __NR_name_to_handle_at (__NR_SYSCALL_BASE+370)
|
||||
#define __NR_open_by_handle_at (__NR_SYSCALL_BASE+371)
|
||||
#define __NR_clock_adjtime (__NR_SYSCALL_BASE+372)
|
||||
#define __NR_syncfs (__NR_SYSCALL_BASE+373)
|
||||
#define __NR_sendmmsg (__NR_SYSCALL_BASE+374)
|
||||
#define __NR_setns (__NR_SYSCALL_BASE+375)
|
||||
#define __NR_process_vm_readv (__NR_SYSCALL_BASE+376)
|
||||
#define __NR_process_vm_writev (__NR_SYSCALL_BASE+377)
|
||||
#define __NR_kcmp (__NR_SYSCALL_BASE+378)
|
||||
#define __NR_finit_module (__NR_SYSCALL_BASE+379)
|
||||
#define __NR_sched_setattr (__NR_SYSCALL_BASE+380)
|
||||
#define __NR_sched_getattr (__NR_SYSCALL_BASE+381)
|
||||
#define __NR_renameat2 (__NR_SYSCALL_BASE+382)
|
||||
#define __NR_seccomp (__NR_SYSCALL_BASE+383)
|
||||
#define __NR_getrandom (__NR_SYSCALL_BASE+384)
|
||||
#define __NR_memfd_create (__NR_SYSCALL_BASE+385)
|
||||
#define __NR_bpf (__NR_SYSCALL_BASE+386)
|
||||
#define __NR_execveat (__NR_SYSCALL_BASE+387)
|
||||
#define __NR_userfaultfd (__NR_SYSCALL_BASE+388)
|
||||
#define __NR_membarrier (__NR_SYSCALL_BASE+389)
|
||||
|
||||
/*
|
||||
* The following SWIs are ARM private.
|
||||
*/
|
||||
#define __ARM_NR_BASE (__NR_SYSCALL_BASE+0x0f0000)
|
||||
#define __ARM_NR_breakpoint (__ARM_NR_BASE+1)
|
||||
#define __ARM_NR_cacheflush (__ARM_NR_BASE+2)
|
||||
#define __ARM_NR_usr26 (__ARM_NR_BASE+3)
|
||||
#define __ARM_NR_usr32 (__ARM_NR_BASE+4)
|
||||
#define __ARM_NR_set_tls (__ARM_NR_BASE+5)
|
||||
|
||||
/*
|
||||
* The following syscalls are obsolete and no longer available for EABI.
|
||||
*/
|
||||
#if defined(__ARM_EABI__)
|
||||
#undef __NR_time
|
||||
#undef __NR_umount
|
||||
#undef __NR_stime
|
||||
#undef __NR_alarm
|
||||
#undef __NR_utime
|
||||
#undef __NR_getrlimit
|
||||
#undef __NR_select
|
||||
#undef __NR_readdir
|
||||
#undef __NR_mmap
|
||||
#undef __NR_socketcall
|
||||
#undef __NR_syscall
|
||||
#undef __NR_ipc
|
||||
#endif
|
||||
|
||||
#endif /* __ASM_ARM_UNISTD_H */
|
||||
16
linux-headers/asm-arm64/unistd.h
Normal file
16
linux-headers/asm-arm64/unistd.h
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Copyright (C) 2012 ARM Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <asm-generic/unistd.h>
|
||||
1063
linux-headers/asm-mips/unistd.h
Normal file
1063
linux-headers/asm-mips/unistd.h
Normal file
File diff suppressed because it is too large
Load Diff
392
linux-headers/asm-powerpc/unistd.h
Normal file
392
linux-headers/asm-powerpc/unistd.h
Normal file
@@ -0,0 +1,392 @@
|
||||
/*
|
||||
* This file contains the system call numbers.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
#ifndef _ASM_POWERPC_UNISTD_H_
|
||||
#define _ASM_POWERPC_UNISTD_H_
|
||||
|
||||
|
||||
#define __NR_restart_syscall 0
|
||||
#define __NR_exit 1
|
||||
#define __NR_fork 2
|
||||
#define __NR_read 3
|
||||
#define __NR_write 4
|
||||
#define __NR_open 5
|
||||
#define __NR_close 6
|
||||
#define __NR_waitpid 7
|
||||
#define __NR_creat 8
|
||||
#define __NR_link 9
|
||||
#define __NR_unlink 10
|
||||
#define __NR_execve 11
|
||||
#define __NR_chdir 12
|
||||
#define __NR_time 13
|
||||
#define __NR_mknod 14
|
||||
#define __NR_chmod 15
|
||||
#define __NR_lchown 16
|
||||
#define __NR_break 17
|
||||
#define __NR_oldstat 18
|
||||
#define __NR_lseek 19
|
||||
#define __NR_getpid 20
|
||||
#define __NR_mount 21
|
||||
#define __NR_umount 22
|
||||
#define __NR_setuid 23
|
||||
#define __NR_getuid 24
|
||||
#define __NR_stime 25
|
||||
#define __NR_ptrace 26
|
||||
#define __NR_alarm 27
|
||||
#define __NR_oldfstat 28
|
||||
#define __NR_pause 29
|
||||
#define __NR_utime 30
|
||||
#define __NR_stty 31
|
||||
#define __NR_gtty 32
|
||||
#define __NR_access 33
|
||||
#define __NR_nice 34
|
||||
#define __NR_ftime 35
|
||||
#define __NR_sync 36
|
||||
#define __NR_kill 37
|
||||
#define __NR_rename 38
|
||||
#define __NR_mkdir 39
|
||||
#define __NR_rmdir 40
|
||||
#define __NR_dup 41
|
||||
#define __NR_pipe 42
|
||||
#define __NR_times 43
|
||||
#define __NR_prof 44
|
||||
#define __NR_brk 45
|
||||
#define __NR_setgid 46
|
||||
#define __NR_getgid 47
|
||||
#define __NR_signal 48
|
||||
#define __NR_geteuid 49
|
||||
#define __NR_getegid 50
|
||||
#define __NR_acct 51
|
||||
#define __NR_umount2 52
|
||||
#define __NR_lock 53
|
||||
#define __NR_ioctl 54
|
||||
#define __NR_fcntl 55
|
||||
#define __NR_mpx 56
|
||||
#define __NR_setpgid 57
|
||||
#define __NR_ulimit 58
|
||||
#define __NR_oldolduname 59
|
||||
#define __NR_umask 60
|
||||
#define __NR_chroot 61
|
||||
#define __NR_ustat 62
|
||||
#define __NR_dup2 63
|
||||
#define __NR_getppid 64
|
||||
#define __NR_getpgrp 65
|
||||
#define __NR_setsid 66
|
||||
#define __NR_sigaction 67
|
||||
#define __NR_sgetmask 68
|
||||
#define __NR_ssetmask 69
|
||||
#define __NR_setreuid 70
|
||||
#define __NR_setregid 71
|
||||
#define __NR_sigsuspend 72
|
||||
#define __NR_sigpending 73
|
||||
#define __NR_sethostname 74
|
||||
#define __NR_setrlimit 75
|
||||
#define __NR_getrlimit 76
|
||||
#define __NR_getrusage 77
|
||||
#define __NR_gettimeofday 78
|
||||
#define __NR_settimeofday 79
|
||||
#define __NR_getgroups 80
|
||||
#define __NR_setgroups 81
|
||||
#define __NR_select 82
|
||||
#define __NR_symlink 83
|
||||
#define __NR_oldlstat 84
|
||||
#define __NR_readlink 85
|
||||
#define __NR_uselib 86
|
||||
#define __NR_swapon 87
|
||||
#define __NR_reboot 88
|
||||
#define __NR_readdir 89
|
||||
#define __NR_mmap 90
|
||||
#define __NR_munmap 91
|
||||
#define __NR_truncate 92
|
||||
#define __NR_ftruncate 93
|
||||
#define __NR_fchmod 94
|
||||
#define __NR_fchown 95
|
||||
#define __NR_getpriority 96
|
||||
#define __NR_setpriority 97
|
||||
#define __NR_profil 98
|
||||
#define __NR_statfs 99
|
||||
#define __NR_fstatfs 100
|
||||
#define __NR_ioperm 101
|
||||
#define __NR_socketcall 102
|
||||
#define __NR_syslog 103
|
||||
#define __NR_setitimer 104
|
||||
#define __NR_getitimer 105
|
||||
#define __NR_stat 106
|
||||
#define __NR_lstat 107
|
||||
#define __NR_fstat 108
|
||||
#define __NR_olduname 109
|
||||
#define __NR_iopl 110
|
||||
#define __NR_vhangup 111
|
||||
#define __NR_idle 112
|
||||
#define __NR_vm86 113
|
||||
#define __NR_wait4 114
|
||||
#define __NR_swapoff 115
|
||||
#define __NR_sysinfo 116
|
||||
#define __NR_ipc 117
|
||||
#define __NR_fsync 118
|
||||
#define __NR_sigreturn 119
|
||||
#define __NR_clone 120
|
||||
#define __NR_setdomainname 121
|
||||
#define __NR_uname 122
|
||||
#define __NR_modify_ldt 123
|
||||
#define __NR_adjtimex 124
|
||||
#define __NR_mprotect 125
|
||||
#define __NR_sigprocmask 126
|
||||
#define __NR_create_module 127
|
||||
#define __NR_init_module 128
|
||||
#define __NR_delete_module 129
|
||||
#define __NR_get_kernel_syms 130
|
||||
#define __NR_quotactl 131
|
||||
#define __NR_getpgid 132
|
||||
#define __NR_fchdir 133
|
||||
#define __NR_bdflush 134
|
||||
#define __NR_sysfs 135
|
||||
#define __NR_personality 136
|
||||
#define __NR_afs_syscall 137 /* Syscall for Andrew File System */
|
||||
#define __NR_setfsuid 138
|
||||
#define __NR_setfsgid 139
|
||||
#define __NR__llseek 140
|
||||
#define __NR_getdents 141
|
||||
#define __NR__newselect 142
|
||||
#define __NR_flock 143
|
||||
#define __NR_msync 144
|
||||
#define __NR_readv 145
|
||||
#define __NR_writev 146
|
||||
#define __NR_getsid 147
|
||||
#define __NR_fdatasync 148
|
||||
#define __NR__sysctl 149
|
||||
#define __NR_mlock 150
|
||||
#define __NR_munlock 151
|
||||
#define __NR_mlockall 152
|
||||
#define __NR_munlockall 153
|
||||
#define __NR_sched_setparam 154
|
||||
#define __NR_sched_getparam 155
|
||||
#define __NR_sched_setscheduler 156
|
||||
#define __NR_sched_getscheduler 157
|
||||
#define __NR_sched_yield 158
|
||||
#define __NR_sched_get_priority_max 159
|
||||
#define __NR_sched_get_priority_min 160
|
||||
#define __NR_sched_rr_get_interval 161
|
||||
#define __NR_nanosleep 162
|
||||
#define __NR_mremap 163
|
||||
#define __NR_setresuid 164
|
||||
#define __NR_getresuid 165
|
||||
#define __NR_query_module 166
|
||||
#define __NR_poll 167
|
||||
#define __NR_nfsservctl 168
|
||||
#define __NR_setresgid 169
|
||||
#define __NR_getresgid 170
|
||||
#define __NR_prctl 171
|
||||
#define __NR_rt_sigreturn 172
|
||||
#define __NR_rt_sigaction 173
|
||||
#define __NR_rt_sigprocmask 174
|
||||
#define __NR_rt_sigpending 175
|
||||
#define __NR_rt_sigtimedwait 176
|
||||
#define __NR_rt_sigqueueinfo 177
|
||||
#define __NR_rt_sigsuspend 178
|
||||
#define __NR_pread64 179
|
||||
#define __NR_pwrite64 180
|
||||
#define __NR_chown 181
|
||||
#define __NR_getcwd 182
|
||||
#define __NR_capget 183
|
||||
#define __NR_capset 184
|
||||
#define __NR_sigaltstack 185
|
||||
#define __NR_sendfile 186
|
||||
#define __NR_getpmsg 187 /* some people actually want streams */
|
||||
#define __NR_putpmsg 188 /* some people actually want streams */
|
||||
#define __NR_vfork 189
|
||||
#define __NR_ugetrlimit 190 /* SuS compliant getrlimit */
|
||||
#define __NR_readahead 191
|
||||
#ifndef __powerpc64__ /* these are 32-bit only */
|
||||
#define __NR_mmap2 192
|
||||
#define __NR_truncate64 193
|
||||
#define __NR_ftruncate64 194
|
||||
#define __NR_stat64 195
|
||||
#define __NR_lstat64 196
|
||||
#define __NR_fstat64 197
|
||||
#endif
|
||||
#define __NR_pciconfig_read 198
|
||||
#define __NR_pciconfig_write 199
|
||||
#define __NR_pciconfig_iobase 200
|
||||
#define __NR_multiplexer 201
|
||||
#define __NR_getdents64 202
|
||||
#define __NR_pivot_root 203
|
||||
#ifndef __powerpc64__
|
||||
#define __NR_fcntl64 204
|
||||
#endif
|
||||
#define __NR_madvise 205
|
||||
#define __NR_mincore 206
|
||||
#define __NR_gettid 207
|
||||
#define __NR_tkill 208
|
||||
#define __NR_setxattr 209
|
||||
#define __NR_lsetxattr 210
|
||||
#define __NR_fsetxattr 211
|
||||
#define __NR_getxattr 212
|
||||
#define __NR_lgetxattr 213
|
||||
#define __NR_fgetxattr 214
|
||||
#define __NR_listxattr 215
|
||||
#define __NR_llistxattr 216
|
||||
#define __NR_flistxattr 217
|
||||
#define __NR_removexattr 218
|
||||
#define __NR_lremovexattr 219
|
||||
#define __NR_fremovexattr 220
|
||||
#define __NR_futex 221
|
||||
#define __NR_sched_setaffinity 222
|
||||
#define __NR_sched_getaffinity 223
|
||||
/* 224 currently unused */
|
||||
#define __NR_tuxcall 225
|
||||
#ifndef __powerpc64__
|
||||
#define __NR_sendfile64 226
|
||||
#endif
|
||||
#define __NR_io_setup 227
|
||||
#define __NR_io_destroy 228
|
||||
#define __NR_io_getevents 229
|
||||
#define __NR_io_submit 230
|
||||
#define __NR_io_cancel 231
|
||||
#define __NR_set_tid_address 232
|
||||
#define __NR_fadvise64 233
|
||||
#define __NR_exit_group 234
|
||||
#define __NR_lookup_dcookie 235
|
||||
#define __NR_epoll_create 236
|
||||
#define __NR_epoll_ctl 237
|
||||
#define __NR_epoll_wait 238
|
||||
#define __NR_remap_file_pages 239
|
||||
#define __NR_timer_create 240
|
||||
#define __NR_timer_settime 241
|
||||
#define __NR_timer_gettime 242
|
||||
#define __NR_timer_getoverrun 243
|
||||
#define __NR_timer_delete 244
|
||||
#define __NR_clock_settime 245
|
||||
#define __NR_clock_gettime 246
|
||||
#define __NR_clock_getres 247
|
||||
#define __NR_clock_nanosleep 248
|
||||
#define __NR_swapcontext 249
|
||||
#define __NR_tgkill 250
|
||||
#define __NR_utimes 251
|
||||
#define __NR_statfs64 252
|
||||
#define __NR_fstatfs64 253
|
||||
#ifndef __powerpc64__
|
||||
#define __NR_fadvise64_64 254
|
||||
#endif
|
||||
#define __NR_rtas 255
|
||||
#define __NR_sys_debug_setcontext 256
|
||||
/* Number 257 is reserved for vserver */
|
||||
#define __NR_migrate_pages 258
|
||||
#define __NR_mbind 259
|
||||
#define __NR_get_mempolicy 260
|
||||
#define __NR_set_mempolicy 261
|
||||
#define __NR_mq_open 262
|
||||
#define __NR_mq_unlink 263
|
||||
#define __NR_mq_timedsend 264
|
||||
#define __NR_mq_timedreceive 265
|
||||
#define __NR_mq_notify 266
|
||||
#define __NR_mq_getsetattr 267
|
||||
#define __NR_kexec_load 268
|
||||
#define __NR_add_key 269
|
||||
#define __NR_request_key 270
|
||||
#define __NR_keyctl 271
|
||||
#define __NR_waitid 272
|
||||
#define __NR_ioprio_set 273
|
||||
#define __NR_ioprio_get 274
|
||||
#define __NR_inotify_init 275
|
||||
#define __NR_inotify_add_watch 276
|
||||
#define __NR_inotify_rm_watch 277
|
||||
#define __NR_spu_run 278
|
||||
#define __NR_spu_create 279
|
||||
#define __NR_pselect6 280
|
||||
#define __NR_ppoll 281
|
||||
#define __NR_unshare 282
|
||||
#define __NR_splice 283
|
||||
#define __NR_tee 284
|
||||
#define __NR_vmsplice 285
|
||||
#define __NR_openat 286
|
||||
#define __NR_mkdirat 287
|
||||
#define __NR_mknodat 288
|
||||
#define __NR_fchownat 289
|
||||
#define __NR_futimesat 290
|
||||
#ifdef __powerpc64__
|
||||
#define __NR_newfstatat 291
|
||||
#else
|
||||
#define __NR_fstatat64 291
|
||||
#endif
|
||||
#define __NR_unlinkat 292
|
||||
#define __NR_renameat 293
|
||||
#define __NR_linkat 294
|
||||
#define __NR_symlinkat 295
|
||||
#define __NR_readlinkat 296
|
||||
#define __NR_fchmodat 297
|
||||
#define __NR_faccessat 298
|
||||
#define __NR_get_robust_list 299
|
||||
#define __NR_set_robust_list 300
|
||||
#define __NR_move_pages 301
|
||||
#define __NR_getcpu 302
|
||||
#define __NR_epoll_pwait 303
|
||||
#define __NR_utimensat 304
|
||||
#define __NR_signalfd 305
|
||||
#define __NR_timerfd_create 306
|
||||
#define __NR_eventfd 307
|
||||
#define __NR_sync_file_range2 308
|
||||
#define __NR_fallocate 309
|
||||
#define __NR_subpage_prot 310
|
||||
#define __NR_timerfd_settime 311
|
||||
#define __NR_timerfd_gettime 312
|
||||
#define __NR_signalfd4 313
|
||||
#define __NR_eventfd2 314
|
||||
#define __NR_epoll_create1 315
|
||||
#define __NR_dup3 316
|
||||
#define __NR_pipe2 317
|
||||
#define __NR_inotify_init1 318
|
||||
#define __NR_perf_event_open 319
|
||||
#define __NR_preadv 320
|
||||
#define __NR_pwritev 321
|
||||
#define __NR_rt_tgsigqueueinfo 322
|
||||
#define __NR_fanotify_init 323
|
||||
#define __NR_fanotify_mark 324
|
||||
#define __NR_prlimit64 325
|
||||
#define __NR_socket 326
|
||||
#define __NR_bind 327
|
||||
#define __NR_connect 328
|
||||
#define __NR_listen 329
|
||||
#define __NR_accept 330
|
||||
#define __NR_getsockname 331
|
||||
#define __NR_getpeername 332
|
||||
#define __NR_socketpair 333
|
||||
#define __NR_send 334
|
||||
#define __NR_sendto 335
|
||||
#define __NR_recv 336
|
||||
#define __NR_recvfrom 337
|
||||
#define __NR_shutdown 338
|
||||
#define __NR_setsockopt 339
|
||||
#define __NR_getsockopt 340
|
||||
#define __NR_sendmsg 341
|
||||
#define __NR_recvmsg 342
|
||||
#define __NR_recvmmsg 343
|
||||
#define __NR_accept4 344
|
||||
#define __NR_name_to_handle_at 345
|
||||
#define __NR_open_by_handle_at 346
|
||||
#define __NR_clock_adjtime 347
|
||||
#define __NR_syncfs 348
|
||||
#define __NR_sendmmsg 349
|
||||
#define __NR_setns 350
|
||||
#define __NR_process_vm_readv 351
|
||||
#define __NR_process_vm_writev 352
|
||||
#define __NR_finit_module 353
|
||||
#define __NR_kcmp 354
|
||||
#define __NR_sched_setattr 355
|
||||
#define __NR_sched_getattr 356
|
||||
#define __NR_renameat2 357
|
||||
#define __NR_seccomp 358
|
||||
#define __NR_getrandom 359
|
||||
#define __NR_memfd_create 360
|
||||
#define __NR_bpf 361
|
||||
#define __NR_execveat 362
|
||||
#define __NR_switch_endian 363
|
||||
#define __NR_userfaultfd 364
|
||||
#define __NR_membarrier 365
|
||||
|
||||
#endif /* _ASM_POWERPC_UNISTD_H_ */
|
||||
404
linux-headers/asm-s390/unistd.h
Normal file
404
linux-headers/asm-s390/unistd.h
Normal file
@@ -0,0 +1,404 @@
|
||||
/*
|
||||
* S390 version
|
||||
*
|
||||
* Derived from "include/asm-i386/unistd.h"
|
||||
*/
|
||||
|
||||
#ifndef _ASM_S390_UNISTD_H_
|
||||
#define _ASM_S390_UNISTD_H_
|
||||
|
||||
/*
|
||||
* This file contains the system call numbers.
|
||||
*/
|
||||
|
||||
#define __NR_exit 1
|
||||
#define __NR_fork 2
|
||||
#define __NR_read 3
|
||||
#define __NR_write 4
|
||||
#define __NR_open 5
|
||||
#define __NR_close 6
|
||||
#define __NR_restart_syscall 7
|
||||
#define __NR_creat 8
|
||||
#define __NR_link 9
|
||||
#define __NR_unlink 10
|
||||
#define __NR_execve 11
|
||||
#define __NR_chdir 12
|
||||
#define __NR_mknod 14
|
||||
#define __NR_chmod 15
|
||||
#define __NR_lseek 19
|
||||
#define __NR_getpid 20
|
||||
#define __NR_mount 21
|
||||
#define __NR_umount 22
|
||||
#define __NR_ptrace 26
|
||||
#define __NR_alarm 27
|
||||
#define __NR_pause 29
|
||||
#define __NR_utime 30
|
||||
#define __NR_access 33
|
||||
#define __NR_nice 34
|
||||
#define __NR_sync 36
|
||||
#define __NR_kill 37
|
||||
#define __NR_rename 38
|
||||
#define __NR_mkdir 39
|
||||
#define __NR_rmdir 40
|
||||
#define __NR_dup 41
|
||||
#define __NR_pipe 42
|
||||
#define __NR_times 43
|
||||
#define __NR_brk 45
|
||||
#define __NR_signal 48
|
||||
#define __NR_acct 51
|
||||
#define __NR_umount2 52
|
||||
#define __NR_ioctl 54
|
||||
#define __NR_fcntl 55
|
||||
#define __NR_setpgid 57
|
||||
#define __NR_umask 60
|
||||
#define __NR_chroot 61
|
||||
#define __NR_ustat 62
|
||||
#define __NR_dup2 63
|
||||
#define __NR_getppid 64
|
||||
#define __NR_getpgrp 65
|
||||
#define __NR_setsid 66
|
||||
#define __NR_sigaction 67
|
||||
#define __NR_sigsuspend 72
|
||||
#define __NR_sigpending 73
|
||||
#define __NR_sethostname 74
|
||||
#define __NR_setrlimit 75
|
||||
#define __NR_getrusage 77
|
||||
#define __NR_gettimeofday 78
|
||||
#define __NR_settimeofday 79
|
||||
#define __NR_symlink 83
|
||||
#define __NR_readlink 85
|
||||
#define __NR_uselib 86
|
||||
#define __NR_swapon 87
|
||||
#define __NR_reboot 88
|
||||
#define __NR_readdir 89
|
||||
#define __NR_mmap 90
|
||||
#define __NR_munmap 91
|
||||
#define __NR_truncate 92
|
||||
#define __NR_ftruncate 93
|
||||
#define __NR_fchmod 94
|
||||
#define __NR_getpriority 96
|
||||
#define __NR_setpriority 97
|
||||
#define __NR_statfs 99
|
||||
#define __NR_fstatfs 100
|
||||
#define __NR_socketcall 102
|
||||
#define __NR_syslog 103
|
||||
#define __NR_setitimer 104
|
||||
#define __NR_getitimer 105
|
||||
#define __NR_stat 106
|
||||
#define __NR_lstat 107
|
||||
#define __NR_fstat 108
|
||||
#define __NR_lookup_dcookie 110
|
||||
#define __NR_vhangup 111
|
||||
#define __NR_idle 112
|
||||
#define __NR_wait4 114
|
||||
#define __NR_swapoff 115
|
||||
#define __NR_sysinfo 116
|
||||
#define __NR_ipc 117
|
||||
#define __NR_fsync 118
|
||||
#define __NR_sigreturn 119
|
||||
#define __NR_clone 120
|
||||
#define __NR_setdomainname 121
|
||||
#define __NR_uname 122
|
||||
#define __NR_adjtimex 124
|
||||
#define __NR_mprotect 125
|
||||
#define __NR_sigprocmask 126
|
||||
#define __NR_create_module 127
|
||||
#define __NR_init_module 128
|
||||
#define __NR_delete_module 129
|
||||
#define __NR_get_kernel_syms 130
|
||||
#define __NR_quotactl 131
|
||||
#define __NR_getpgid 132
|
||||
#define __NR_fchdir 133
|
||||
#define __NR_bdflush 134
|
||||
#define __NR_sysfs 135
|
||||
#define __NR_personality 136
|
||||
#define __NR_afs_syscall 137 /* Syscall for Andrew File System */
|
||||
#define __NR_getdents 141
|
||||
#define __NR_flock 143
|
||||
#define __NR_msync 144
|
||||
#define __NR_readv 145
|
||||
#define __NR_writev 146
|
||||
#define __NR_getsid 147
|
||||
#define __NR_fdatasync 148
|
||||
#define __NR__sysctl 149
|
||||
#define __NR_mlock 150
|
||||
#define __NR_munlock 151
|
||||
#define __NR_mlockall 152
|
||||
#define __NR_munlockall 153
|
||||
#define __NR_sched_setparam 154
|
||||
#define __NR_sched_getparam 155
|
||||
#define __NR_sched_setscheduler 156
|
||||
#define __NR_sched_getscheduler 157
|
||||
#define __NR_sched_yield 158
|
||||
#define __NR_sched_get_priority_max 159
|
||||
#define __NR_sched_get_priority_min 160
|
||||
#define __NR_sched_rr_get_interval 161
|
||||
#define __NR_nanosleep 162
|
||||
#define __NR_mremap 163
|
||||
#define __NR_query_module 167
|
||||
#define __NR_poll 168
|
||||
#define __NR_nfsservctl 169
|
||||
#define __NR_prctl 172
|
||||
#define __NR_rt_sigreturn 173
|
||||
#define __NR_rt_sigaction 174
|
||||
#define __NR_rt_sigprocmask 175
|
||||
#define __NR_rt_sigpending 176
|
||||
#define __NR_rt_sigtimedwait 177
|
||||
#define __NR_rt_sigqueueinfo 178
|
||||
#define __NR_rt_sigsuspend 179
|
||||
#define __NR_pread64 180
|
||||
#define __NR_pwrite64 181
|
||||
#define __NR_getcwd 183
|
||||
#define __NR_capget 184
|
||||
#define __NR_capset 185
|
||||
#define __NR_sigaltstack 186
|
||||
#define __NR_sendfile 187
|
||||
#define __NR_getpmsg 188
|
||||
#define __NR_putpmsg 189
|
||||
#define __NR_vfork 190
|
||||
#define __NR_pivot_root 217
|
||||
#define __NR_mincore 218
|
||||
#define __NR_madvise 219
|
||||
#define __NR_getdents64 220
|
||||
#define __NR_readahead 222
|
||||
#define __NR_setxattr 224
|
||||
#define __NR_lsetxattr 225
|
||||
#define __NR_fsetxattr 226
|
||||
#define __NR_getxattr 227
|
||||
#define __NR_lgetxattr 228
|
||||
#define __NR_fgetxattr 229
|
||||
#define __NR_listxattr 230
|
||||
#define __NR_llistxattr 231
|
||||
#define __NR_flistxattr 232
|
||||
#define __NR_removexattr 233
|
||||
#define __NR_lremovexattr 234
|
||||
#define __NR_fremovexattr 235
|
||||
#define __NR_gettid 236
|
||||
#define __NR_tkill 237
|
||||
#define __NR_futex 238
|
||||
#define __NR_sched_setaffinity 239
|
||||
#define __NR_sched_getaffinity 240
|
||||
#define __NR_tgkill 241
|
||||
/* Number 242 is reserved for tux */
|
||||
#define __NR_io_setup 243
|
||||
#define __NR_io_destroy 244
|
||||
#define __NR_io_getevents 245
|
||||
#define __NR_io_submit 246
|
||||
#define __NR_io_cancel 247
|
||||
#define __NR_exit_group 248
|
||||
#define __NR_epoll_create 249
|
||||
#define __NR_epoll_ctl 250
|
||||
#define __NR_epoll_wait 251
|
||||
#define __NR_set_tid_address 252
|
||||
#define __NR_fadvise64 253
|
||||
#define __NR_timer_create 254
|
||||
#define __NR_timer_settime (__NR_timer_create+1)
|
||||
#define __NR_timer_gettime (__NR_timer_create+2)
|
||||
#define __NR_timer_getoverrun (__NR_timer_create+3)
|
||||
#define __NR_timer_delete (__NR_timer_create+4)
|
||||
#define __NR_clock_settime (__NR_timer_create+5)
|
||||
#define __NR_clock_gettime (__NR_timer_create+6)
|
||||
#define __NR_clock_getres (__NR_timer_create+7)
|
||||
#define __NR_clock_nanosleep (__NR_timer_create+8)
|
||||
/* Number 263 is reserved for vserver */
|
||||
#define __NR_statfs64 265
|
||||
#define __NR_fstatfs64 266
|
||||
#define __NR_remap_file_pages 267
|
||||
#define __NR_mbind 268
|
||||
#define __NR_get_mempolicy 269
|
||||
#define __NR_set_mempolicy 270
|
||||
#define __NR_mq_open 271
|
||||
#define __NR_mq_unlink 272
|
||||
#define __NR_mq_timedsend 273
|
||||
#define __NR_mq_timedreceive 274
|
||||
#define __NR_mq_notify 275
|
||||
#define __NR_mq_getsetattr 276
|
||||
#define __NR_kexec_load 277
|
||||
#define __NR_add_key 278
|
||||
#define __NR_request_key 279
|
||||
#define __NR_keyctl 280
|
||||
#define __NR_waitid 281
|
||||
#define __NR_ioprio_set 282
|
||||
#define __NR_ioprio_get 283
|
||||
#define __NR_inotify_init 284
|
||||
#define __NR_inotify_add_watch 285
|
||||
#define __NR_inotify_rm_watch 286
|
||||
#define __NR_migrate_pages 287
|
||||
#define __NR_openat 288
|
||||
#define __NR_mkdirat 289
|
||||
#define __NR_mknodat 290
|
||||
#define __NR_fchownat 291
|
||||
#define __NR_futimesat 292
|
||||
#define __NR_unlinkat 294
|
||||
#define __NR_renameat 295
|
||||
#define __NR_linkat 296
|
||||
#define __NR_symlinkat 297
|
||||
#define __NR_readlinkat 298
|
||||
#define __NR_fchmodat 299
|
||||
#define __NR_faccessat 300
|
||||
#define __NR_pselect6 301
|
||||
#define __NR_ppoll 302
|
||||
#define __NR_unshare 303
|
||||
#define __NR_set_robust_list 304
|
||||
#define __NR_get_robust_list 305
|
||||
#define __NR_splice 306
|
||||
#define __NR_sync_file_range 307
|
||||
#define __NR_tee 308
|
||||
#define __NR_vmsplice 309
|
||||
#define __NR_move_pages 310
|
||||
#define __NR_getcpu 311
|
||||
#define __NR_epoll_pwait 312
|
||||
#define __NR_utimes 313
|
||||
#define __NR_fallocate 314
|
||||
#define __NR_utimensat 315
|
||||
#define __NR_signalfd 316
|
||||
#define __NR_timerfd 317
|
||||
#define __NR_eventfd 318
|
||||
#define __NR_timerfd_create 319
|
||||
#define __NR_timerfd_settime 320
|
||||
#define __NR_timerfd_gettime 321
|
||||
#define __NR_signalfd4 322
|
||||
#define __NR_eventfd2 323
|
||||
#define __NR_inotify_init1 324
|
||||
#define __NR_pipe2 325
|
||||
#define __NR_dup3 326
|
||||
#define __NR_epoll_create1 327
|
||||
#define __NR_preadv 328
|
||||
#define __NR_pwritev 329
|
||||
#define __NR_rt_tgsigqueueinfo 330
|
||||
#define __NR_perf_event_open 331
|
||||
#define __NR_fanotify_init 332
|
||||
#define __NR_fanotify_mark 333
|
||||
#define __NR_prlimit64 334
|
||||
#define __NR_name_to_handle_at 335
|
||||
#define __NR_open_by_handle_at 336
|
||||
#define __NR_clock_adjtime 337
|
||||
#define __NR_syncfs 338
|
||||
#define __NR_setns 339
|
||||
#define __NR_process_vm_readv 340
|
||||
#define __NR_process_vm_writev 341
|
||||
#define __NR_s390_runtime_instr 342
|
||||
#define __NR_kcmp 343
|
||||
#define __NR_finit_module 344
|
||||
#define __NR_sched_setattr 345
|
||||
#define __NR_sched_getattr 346
|
||||
#define __NR_renameat2 347
|
||||
#define __NR_seccomp 348
|
||||
#define __NR_getrandom 349
|
||||
#define __NR_memfd_create 350
|
||||
#define __NR_bpf 351
|
||||
#define __NR_s390_pci_mmio_write 352
|
||||
#define __NR_s390_pci_mmio_read 353
|
||||
#define __NR_execveat 354
|
||||
#define __NR_userfaultfd 355
|
||||
#define __NR_membarrier 356
|
||||
#define __NR_recvmmsg 357
|
||||
#define __NR_sendmmsg 358
|
||||
#define __NR_socket 359
|
||||
#define __NR_socketpair 360
|
||||
#define __NR_bind 361
|
||||
#define __NR_connect 362
|
||||
#define __NR_listen 363
|
||||
#define __NR_accept4 364
|
||||
#define __NR_getsockopt 365
|
||||
#define __NR_setsockopt 366
|
||||
#define __NR_getsockname 367
|
||||
#define __NR_getpeername 368
|
||||
#define __NR_sendto 369
|
||||
#define __NR_sendmsg 370
|
||||
#define __NR_recvfrom 371
|
||||
#define __NR_recvmsg 372
|
||||
#define __NR_shutdown 373
|
||||
#define NR_syscalls 374
|
||||
|
||||
/*
|
||||
* There are some system calls that are not present on 64 bit, some
|
||||
* have a different name although they do the same (e.g. __NR_chown32
|
||||
* is __NR_chown on 64 bit).
|
||||
*/
|
||||
#ifndef __s390x__
|
||||
|
||||
#define __NR_time 13
|
||||
#define __NR_lchown 16
|
||||
#define __NR_setuid 23
|
||||
#define __NR_getuid 24
|
||||
#define __NR_stime 25
|
||||
#define __NR_setgid 46
|
||||
#define __NR_getgid 47
|
||||
#define __NR_geteuid 49
|
||||
#define __NR_getegid 50
|
||||
#define __NR_setreuid 70
|
||||
#define __NR_setregid 71
|
||||
#define __NR_getrlimit 76
|
||||
#define __NR_getgroups 80
|
||||
#define __NR_setgroups 81
|
||||
#define __NR_fchown 95
|
||||
#define __NR_ioperm 101
|
||||
#define __NR_setfsuid 138
|
||||
#define __NR_setfsgid 139
|
||||
#define __NR__llseek 140
|
||||
#define __NR__newselect 142
|
||||
#define __NR_setresuid 164
|
||||
#define __NR_getresuid 165
|
||||
#define __NR_setresgid 170
|
||||
#define __NR_getresgid 171
|
||||
#define __NR_chown 182
|
||||
#define __NR_ugetrlimit 191 /* SuS compliant getrlimit */
|
||||
#define __NR_mmap2 192
|
||||
#define __NR_truncate64 193
|
||||
#define __NR_ftruncate64 194
|
||||
#define __NR_stat64 195
|
||||
#define __NR_lstat64 196
|
||||
#define __NR_fstat64 197
|
||||
#define __NR_lchown32 198
|
||||
#define __NR_getuid32 199
|
||||
#define __NR_getgid32 200
|
||||
#define __NR_geteuid32 201
|
||||
#define __NR_getegid32 202
|
||||
#define __NR_setreuid32 203
|
||||
#define __NR_setregid32 204
|
||||
#define __NR_getgroups32 205
|
||||
#define __NR_setgroups32 206
|
||||
#define __NR_fchown32 207
|
||||
#define __NR_setresuid32 208
|
||||
#define __NR_getresuid32 209
|
||||
#define __NR_setresgid32 210
|
||||
#define __NR_getresgid32 211
|
||||
#define __NR_chown32 212
|
||||
#define __NR_setuid32 213
|
||||
#define __NR_setgid32 214
|
||||
#define __NR_setfsuid32 215
|
||||
#define __NR_setfsgid32 216
|
||||
#define __NR_fcntl64 221
|
||||
#define __NR_sendfile64 223
|
||||
#define __NR_fadvise64_64 264
|
||||
#define __NR_fstatat64 293
|
||||
|
||||
#else
|
||||
|
||||
#define __NR_select 142
|
||||
#define __NR_getrlimit 191 /* SuS compliant getrlimit */
|
||||
#define __NR_lchown 198
|
||||
#define __NR_getuid 199
|
||||
#define __NR_getgid 200
|
||||
#define __NR_geteuid 201
|
||||
#define __NR_getegid 202
|
||||
#define __NR_setreuid 203
|
||||
#define __NR_setregid 204
|
||||
#define __NR_getgroups 205
|
||||
#define __NR_setgroups 206
|
||||
#define __NR_fchown 207
|
||||
#define __NR_setresuid 208
|
||||
#define __NR_getresuid 209
|
||||
#define __NR_setresgid 210
|
||||
#define __NR_getresgid 211
|
||||
#define __NR_chown 212
|
||||
#define __NR_setuid 213
|
||||
#define __NR_setgid 214
|
||||
#define __NR_setfsuid 215
|
||||
#define __NR_setfsgid 216
|
||||
#define __NR_newfstatat 293
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_S390_UNISTD_H_ */
|
||||
15
linux-headers/asm-x86/unistd.h
Normal file
15
linux-headers/asm-x86/unistd.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#ifndef _ASM_X86_UNISTD_H
|
||||
#define _ASM_X86_UNISTD_H
|
||||
|
||||
/* x32 syscall flag bit */
|
||||
#define __X32_SYSCALL_BIT 0x40000000
|
||||
|
||||
# ifdef __i386__
|
||||
# include <asm/unistd_32.h>
|
||||
# elif defined(__ILP32__)
|
||||
# include <asm/unistd_x32.h>
|
||||
# else
|
||||
# include <asm/unistd_64.h>
|
||||
# endif
|
||||
|
||||
#endif /* _ASM_X86_UNISTD_H */
|
||||
377
linux-headers/asm-x86/unistd_32.h
Normal file
377
linux-headers/asm-x86/unistd_32.h
Normal file
@@ -0,0 +1,377 @@
|
||||
#ifndef _ASM_X86_UNISTD_32_H
|
||||
#define _ASM_X86_UNISTD_32_H 1
|
||||
|
||||
#define __NR_restart_syscall 0
|
||||
#define __NR_exit 1
|
||||
#define __NR_fork 2
|
||||
#define __NR_read 3
|
||||
#define __NR_write 4
|
||||
#define __NR_open 5
|
||||
#define __NR_close 6
|
||||
#define __NR_waitpid 7
|
||||
#define __NR_creat 8
|
||||
#define __NR_link 9
|
||||
#define __NR_unlink 10
|
||||
#define __NR_execve 11
|
||||
#define __NR_chdir 12
|
||||
#define __NR_time 13
|
||||
#define __NR_mknod 14
|
||||
#define __NR_chmod 15
|
||||
#define __NR_lchown 16
|
||||
#define __NR_break 17
|
||||
#define __NR_oldstat 18
|
||||
#define __NR_lseek 19
|
||||
#define __NR_getpid 20
|
||||
#define __NR_mount 21
|
||||
#define __NR_umount 22
|
||||
#define __NR_setuid 23
|
||||
#define __NR_getuid 24
|
||||
#define __NR_stime 25
|
||||
#define __NR_ptrace 26
|
||||
#define __NR_alarm 27
|
||||
#define __NR_oldfstat 28
|
||||
#define __NR_pause 29
|
||||
#define __NR_utime 30
|
||||
#define __NR_stty 31
|
||||
#define __NR_gtty 32
|
||||
#define __NR_access 33
|
||||
#define __NR_nice 34
|
||||
#define __NR_ftime 35
|
||||
#define __NR_sync 36
|
||||
#define __NR_kill 37
|
||||
#define __NR_rename 38
|
||||
#define __NR_mkdir 39
|
||||
#define __NR_rmdir 40
|
||||
#define __NR_dup 41
|
||||
#define __NR_pipe 42
|
||||
#define __NR_times 43
|
||||
#define __NR_prof 44
|
||||
#define __NR_brk 45
|
||||
#define __NR_setgid 46
|
||||
#define __NR_getgid 47
|
||||
#define __NR_signal 48
|
||||
#define __NR_geteuid 49
|
||||
#define __NR_getegid 50
|
||||
#define __NR_acct 51
|
||||
#define __NR_umount2 52
|
||||
#define __NR_lock 53
|
||||
#define __NR_ioctl 54
|
||||
#define __NR_fcntl 55
|
||||
#define __NR_mpx 56
|
||||
#define __NR_setpgid 57
|
||||
#define __NR_ulimit 58
|
||||
#define __NR_oldolduname 59
|
||||
#define __NR_umask 60
|
||||
#define __NR_chroot 61
|
||||
#define __NR_ustat 62
|
||||
#define __NR_dup2 63
|
||||
#define __NR_getppid 64
|
||||
#define __NR_getpgrp 65
|
||||
#define __NR_setsid 66
|
||||
#define __NR_sigaction 67
|
||||
#define __NR_sgetmask 68
|
||||
#define __NR_ssetmask 69
|
||||
#define __NR_setreuid 70
|
||||
#define __NR_setregid 71
|
||||
#define __NR_sigsuspend 72
|
||||
#define __NR_sigpending 73
|
||||
#define __NR_sethostname 74
|
||||
#define __NR_setrlimit 75
|
||||
#define __NR_getrlimit 76
|
||||
#define __NR_getrusage 77
|
||||
#define __NR_gettimeofday 78
|
||||
#define __NR_settimeofday 79
|
||||
#define __NR_getgroups 80
|
||||
#define __NR_setgroups 81
|
||||
#define __NR_select 82
|
||||
#define __NR_symlink 83
|
||||
#define __NR_oldlstat 84
|
||||
#define __NR_readlink 85
|
||||
#define __NR_uselib 86
|
||||
#define __NR_swapon 87
|
||||
#define __NR_reboot 88
|
||||
#define __NR_readdir 89
|
||||
#define __NR_mmap 90
|
||||
#define __NR_munmap 91
|
||||
#define __NR_truncate 92
|
||||
#define __NR_ftruncate 93
|
||||
#define __NR_fchmod 94
|
||||
#define __NR_fchown 95
|
||||
#define __NR_getpriority 96
|
||||
#define __NR_setpriority 97
|
||||
#define __NR_profil 98
|
||||
#define __NR_statfs 99
|
||||
#define __NR_fstatfs 100
|
||||
#define __NR_ioperm 101
|
||||
#define __NR_socketcall 102
|
||||
#define __NR_syslog 103
|
||||
#define __NR_setitimer 104
|
||||
#define __NR_getitimer 105
|
||||
#define __NR_stat 106
|
||||
#define __NR_lstat 107
|
||||
#define __NR_fstat 108
|
||||
#define __NR_olduname 109
|
||||
#define __NR_iopl 110
|
||||
#define __NR_vhangup 111
|
||||
#define __NR_idle 112
|
||||
#define __NR_vm86old 113
|
||||
#define __NR_wait4 114
|
||||
#define __NR_swapoff 115
|
||||
#define __NR_sysinfo 116
|
||||
#define __NR_ipc 117
|
||||
#define __NR_fsync 118
|
||||
#define __NR_sigreturn 119
|
||||
#define __NR_clone 120
|
||||
#define __NR_setdomainname 121
|
||||
#define __NR_uname 122
|
||||
#define __NR_modify_ldt 123
|
||||
#define __NR_adjtimex 124
|
||||
#define __NR_mprotect 125
|
||||
#define __NR_sigprocmask 126
|
||||
#define __NR_create_module 127
|
||||
#define __NR_init_module 128
|
||||
#define __NR_delete_module 129
|
||||
#define __NR_get_kernel_syms 130
|
||||
#define __NR_quotactl 131
|
||||
#define __NR_getpgid 132
|
||||
#define __NR_fchdir 133
|
||||
#define __NR_bdflush 134
|
||||
#define __NR_sysfs 135
|
||||
#define __NR_personality 136
|
||||
#define __NR_afs_syscall 137
|
||||
#define __NR_setfsuid 138
|
||||
#define __NR_setfsgid 139
|
||||
#define __NR__llseek 140
|
||||
#define __NR_getdents 141
|
||||
#define __NR__newselect 142
|
||||
#define __NR_flock 143
|
||||
#define __NR_msync 144
|
||||
#define __NR_readv 145
|
||||
#define __NR_writev 146
|
||||
#define __NR_getsid 147
|
||||
#define __NR_fdatasync 148
|
||||
#define __NR__sysctl 149
|
||||
#define __NR_mlock 150
|
||||
#define __NR_munlock 151
|
||||
#define __NR_mlockall 152
|
||||
#define __NR_munlockall 153
|
||||
#define __NR_sched_setparam 154
|
||||
#define __NR_sched_getparam 155
|
||||
#define __NR_sched_setscheduler 156
|
||||
#define __NR_sched_getscheduler 157
|
||||
#define __NR_sched_yield 158
|
||||
#define __NR_sched_get_priority_max 159
|
||||
#define __NR_sched_get_priority_min 160
|
||||
#define __NR_sched_rr_get_interval 161
|
||||
#define __NR_nanosleep 162
|
||||
#define __NR_mremap 163
|
||||
#define __NR_setresuid 164
|
||||
#define __NR_getresuid 165
|
||||
#define __NR_vm86 166
|
||||
#define __NR_query_module 167
|
||||
#define __NR_poll 168
|
||||
#define __NR_nfsservctl 169
|
||||
#define __NR_setresgid 170
|
||||
#define __NR_getresgid 171
|
||||
#define __NR_prctl 172
|
||||
#define __NR_rt_sigreturn 173
|
||||
#define __NR_rt_sigaction 174
|
||||
#define __NR_rt_sigprocmask 175
|
||||
#define __NR_rt_sigpending 176
|
||||
#define __NR_rt_sigtimedwait 177
|
||||
#define __NR_rt_sigqueueinfo 178
|
||||
#define __NR_rt_sigsuspend 179
|
||||
#define __NR_pread64 180
|
||||
#define __NR_pwrite64 181
|
||||
#define __NR_chown 182
|
||||
#define __NR_getcwd 183
|
||||
#define __NR_capget 184
|
||||
#define __NR_capset 185
|
||||
#define __NR_sigaltstack 186
|
||||
#define __NR_sendfile 187
|
||||
#define __NR_getpmsg 188
|
||||
#define __NR_putpmsg 189
|
||||
#define __NR_vfork 190
|
||||
#define __NR_ugetrlimit 191
|
||||
#define __NR_mmap2 192
|
||||
#define __NR_truncate64 193
|
||||
#define __NR_ftruncate64 194
|
||||
#define __NR_stat64 195
|
||||
#define __NR_lstat64 196
|
||||
#define __NR_fstat64 197
|
||||
#define __NR_lchown32 198
|
||||
#define __NR_getuid32 199
|
||||
#define __NR_getgid32 200
|
||||
#define __NR_geteuid32 201
|
||||
#define __NR_getegid32 202
|
||||
#define __NR_setreuid32 203
|
||||
#define __NR_setregid32 204
|
||||
#define __NR_getgroups32 205
|
||||
#define __NR_setgroups32 206
|
||||
#define __NR_fchown32 207
|
||||
#define __NR_setresuid32 208
|
||||
#define __NR_getresuid32 209
|
||||
#define __NR_setresgid32 210
|
||||
#define __NR_getresgid32 211
|
||||
#define __NR_chown32 212
|
||||
#define __NR_setuid32 213
|
||||
#define __NR_setgid32 214
|
||||
#define __NR_setfsuid32 215
|
||||
#define __NR_setfsgid32 216
|
||||
#define __NR_pivot_root 217
|
||||
#define __NR_mincore 218
|
||||
#define __NR_madvise 219
|
||||
#define __NR_getdents64 220
|
||||
#define __NR_fcntl64 221
|
||||
#define __NR_gettid 224
|
||||
#define __NR_readahead 225
|
||||
#define __NR_setxattr 226
|
||||
#define __NR_lsetxattr 227
|
||||
#define __NR_fsetxattr 228
|
||||
#define __NR_getxattr 229
|
||||
#define __NR_lgetxattr 230
|
||||
#define __NR_fgetxattr 231
|
||||
#define __NR_listxattr 232
|
||||
#define __NR_llistxattr 233
|
||||
#define __NR_flistxattr 234
|
||||
#define __NR_removexattr 235
|
||||
#define __NR_lremovexattr 236
|
||||
#define __NR_fremovexattr 237
|
||||
#define __NR_tkill 238
|
||||
#define __NR_sendfile64 239
|
||||
#define __NR_futex 240
|
||||
#define __NR_sched_setaffinity 241
|
||||
#define __NR_sched_getaffinity 242
|
||||
#define __NR_set_thread_area 243
|
||||
#define __NR_get_thread_area 244
|
||||
#define __NR_io_setup 245
|
||||
#define __NR_io_destroy 246
|
||||
#define __NR_io_getevents 247
|
||||
#define __NR_io_submit 248
|
||||
#define __NR_io_cancel 249
|
||||
#define __NR_fadvise64 250
|
||||
#define __NR_exit_group 252
|
||||
#define __NR_lookup_dcookie 253
|
||||
#define __NR_epoll_create 254
|
||||
#define __NR_epoll_ctl 255
|
||||
#define __NR_epoll_wait 256
|
||||
#define __NR_remap_file_pages 257
|
||||
#define __NR_set_tid_address 258
|
||||
#define __NR_timer_create 259
|
||||
#define __NR_timer_settime 260
|
||||
#define __NR_timer_gettime 261
|
||||
#define __NR_timer_getoverrun 262
|
||||
#define __NR_timer_delete 263
|
||||
#define __NR_clock_settime 264
|
||||
#define __NR_clock_gettime 265
|
||||
#define __NR_clock_getres 266
|
||||
#define __NR_clock_nanosleep 267
|
||||
#define __NR_statfs64 268
|
||||
#define __NR_fstatfs64 269
|
||||
#define __NR_tgkill 270
|
||||
#define __NR_utimes 271
|
||||
#define __NR_fadvise64_64 272
|
||||
#define __NR_vserver 273
|
||||
#define __NR_mbind 274
|
||||
#define __NR_get_mempolicy 275
|
||||
#define __NR_set_mempolicy 276
|
||||
#define __NR_mq_open 277
|
||||
#define __NR_mq_unlink 278
|
||||
#define __NR_mq_timedsend 279
|
||||
#define __NR_mq_timedreceive 280
|
||||
#define __NR_mq_notify 281
|
||||
#define __NR_mq_getsetattr 282
|
||||
#define __NR_kexec_load 283
|
||||
#define __NR_waitid 284
|
||||
#define __NR_add_key 286
|
||||
#define __NR_request_key 287
|
||||
#define __NR_keyctl 288
|
||||
#define __NR_ioprio_set 289
|
||||
#define __NR_ioprio_get 290
|
||||
#define __NR_inotify_init 291
|
||||
#define __NR_inotify_add_watch 292
|
||||
#define __NR_inotify_rm_watch 293
|
||||
#define __NR_migrate_pages 294
|
||||
#define __NR_openat 295
|
||||
#define __NR_mkdirat 296
|
||||
#define __NR_mknodat 297
|
||||
#define __NR_fchownat 298
|
||||
#define __NR_futimesat 299
|
||||
#define __NR_fstatat64 300
|
||||
#define __NR_unlinkat 301
|
||||
#define __NR_renameat 302
|
||||
#define __NR_linkat 303
|
||||
#define __NR_symlinkat 304
|
||||
#define __NR_readlinkat 305
|
||||
#define __NR_fchmodat 306
|
||||
#define __NR_faccessat 307
|
||||
#define __NR_pselect6 308
|
||||
#define __NR_ppoll 309
|
||||
#define __NR_unshare 310
|
||||
#define __NR_set_robust_list 311
|
||||
#define __NR_get_robust_list 312
|
||||
#define __NR_splice 313
|
||||
#define __NR_sync_file_range 314
|
||||
#define __NR_tee 315
|
||||
#define __NR_vmsplice 316
|
||||
#define __NR_move_pages 317
|
||||
#define __NR_getcpu 318
|
||||
#define __NR_epoll_pwait 319
|
||||
#define __NR_utimensat 320
|
||||
#define __NR_signalfd 321
|
||||
#define __NR_timerfd_create 322
|
||||
#define __NR_eventfd 323
|
||||
#define __NR_fallocate 324
|
||||
#define __NR_timerfd_settime 325
|
||||
#define __NR_timerfd_gettime 326
|
||||
#define __NR_signalfd4 327
|
||||
#define __NR_eventfd2 328
|
||||
#define __NR_epoll_create1 329
|
||||
#define __NR_dup3 330
|
||||
#define __NR_pipe2 331
|
||||
#define __NR_inotify_init1 332
|
||||
#define __NR_preadv 333
|
||||
#define __NR_pwritev 334
|
||||
#define __NR_rt_tgsigqueueinfo 335
|
||||
#define __NR_perf_event_open 336
|
||||
#define __NR_recvmmsg 337
|
||||
#define __NR_fanotify_init 338
|
||||
#define __NR_fanotify_mark 339
|
||||
#define __NR_prlimit64 340
|
||||
#define __NR_name_to_handle_at 341
|
||||
#define __NR_open_by_handle_at 342
|
||||
#define __NR_clock_adjtime 343
|
||||
#define __NR_syncfs 344
|
||||
#define __NR_sendmmsg 345
|
||||
#define __NR_setns 346
|
||||
#define __NR_process_vm_readv 347
|
||||
#define __NR_process_vm_writev 348
|
||||
#define __NR_kcmp 349
|
||||
#define __NR_finit_module 350
|
||||
#define __NR_sched_setattr 351
|
||||
#define __NR_sched_getattr 352
|
||||
#define __NR_renameat2 353
|
||||
#define __NR_seccomp 354
|
||||
#define __NR_getrandom 355
|
||||
#define __NR_memfd_create 356
|
||||
#define __NR_bpf 357
|
||||
#define __NR_execveat 358
|
||||
#define __NR_socket 359
|
||||
#define __NR_socketpair 360
|
||||
#define __NR_bind 361
|
||||
#define __NR_connect 362
|
||||
#define __NR_listen 363
|
||||
#define __NR_accept4 364
|
||||
#define __NR_getsockopt 365
|
||||
#define __NR_setsockopt 366
|
||||
#define __NR_getsockname 367
|
||||
#define __NR_getpeername 368
|
||||
#define __NR_sendto 369
|
||||
#define __NR_sendmsg 370
|
||||
#define __NR_recvfrom 371
|
||||
#define __NR_recvmsg 372
|
||||
#define __NR_shutdown 373
|
||||
#define __NR_userfaultfd 374
|
||||
#define __NR_membarrier 375
|
||||
|
||||
#endif /* _ASM_X86_UNISTD_32_H */
|
||||
330
linux-headers/asm-x86/unistd_64.h
Normal file
330
linux-headers/asm-x86/unistd_64.h
Normal file
@@ -0,0 +1,330 @@
|
||||
#ifndef _ASM_X86_UNISTD_64_H
|
||||
#define _ASM_X86_UNISTD_64_H 1
|
||||
|
||||
#define __NR_read 0
|
||||
#define __NR_write 1
|
||||
#define __NR_open 2
|
||||
#define __NR_close 3
|
||||
#define __NR_stat 4
|
||||
#define __NR_fstat 5
|
||||
#define __NR_lstat 6
|
||||
#define __NR_poll 7
|
||||
#define __NR_lseek 8
|
||||
#define __NR_mmap 9
|
||||
#define __NR_mprotect 10
|
||||
#define __NR_munmap 11
|
||||
#define __NR_brk 12
|
||||
#define __NR_rt_sigaction 13
|
||||
#define __NR_rt_sigprocmask 14
|
||||
#define __NR_rt_sigreturn 15
|
||||
#define __NR_ioctl 16
|
||||
#define __NR_pread64 17
|
||||
#define __NR_pwrite64 18
|
||||
#define __NR_readv 19
|
||||
#define __NR_writev 20
|
||||
#define __NR_access 21
|
||||
#define __NR_pipe 22
|
||||
#define __NR_select 23
|
||||
#define __NR_sched_yield 24
|
||||
#define __NR_mremap 25
|
||||
#define __NR_msync 26
|
||||
#define __NR_mincore 27
|
||||
#define __NR_madvise 28
|
||||
#define __NR_shmget 29
|
||||
#define __NR_shmat 30
|
||||
#define __NR_shmctl 31
|
||||
#define __NR_dup 32
|
||||
#define __NR_dup2 33
|
||||
#define __NR_pause 34
|
||||
#define __NR_nanosleep 35
|
||||
#define __NR_getitimer 36
|
||||
#define __NR_alarm 37
|
||||
#define __NR_setitimer 38
|
||||
#define __NR_getpid 39
|
||||
#define __NR_sendfile 40
|
||||
#define __NR_socket 41
|
||||
#define __NR_connect 42
|
||||
#define __NR_accept 43
|
||||
#define __NR_sendto 44
|
||||
#define __NR_recvfrom 45
|
||||
#define __NR_sendmsg 46
|
||||
#define __NR_recvmsg 47
|
||||
#define __NR_shutdown 48
|
||||
#define __NR_bind 49
|
||||
#define __NR_listen 50
|
||||
#define __NR_getsockname 51
|
||||
#define __NR_getpeername 52
|
||||
#define __NR_socketpair 53
|
||||
#define __NR_setsockopt 54
|
||||
#define __NR_getsockopt 55
|
||||
#define __NR_clone 56
|
||||
#define __NR_fork 57
|
||||
#define __NR_vfork 58
|
||||
#define __NR_execve 59
|
||||
#define __NR_exit 60
|
||||
#define __NR_wait4 61
|
||||
#define __NR_kill 62
|
||||
#define __NR_uname 63
|
||||
#define __NR_semget 64
|
||||
#define __NR_semop 65
|
||||
#define __NR_semctl 66
|
||||
#define __NR_shmdt 67
|
||||
#define __NR_msgget 68
|
||||
#define __NR_msgsnd 69
|
||||
#define __NR_msgrcv 70
|
||||
#define __NR_msgctl 71
|
||||
#define __NR_fcntl 72
|
||||
#define __NR_flock 73
|
||||
#define __NR_fsync 74
|
||||
#define __NR_fdatasync 75
|
||||
#define __NR_truncate 76
|
||||
#define __NR_ftruncate 77
|
||||
#define __NR_getdents 78
|
||||
#define __NR_getcwd 79
|
||||
#define __NR_chdir 80
|
||||
#define __NR_fchdir 81
|
||||
#define __NR_rename 82
|
||||
#define __NR_mkdir 83
|
||||
#define __NR_rmdir 84
|
||||
#define __NR_creat 85
|
||||
#define __NR_link 86
|
||||
#define __NR_unlink 87
|
||||
#define __NR_symlink 88
|
||||
#define __NR_readlink 89
|
||||
#define __NR_chmod 90
|
||||
#define __NR_fchmod 91
|
||||
#define __NR_chown 92
|
||||
#define __NR_fchown 93
|
||||
#define __NR_lchown 94
|
||||
#define __NR_umask 95
|
||||
#define __NR_gettimeofday 96
|
||||
#define __NR_getrlimit 97
|
||||
#define __NR_getrusage 98
|
||||
#define __NR_sysinfo 99
|
||||
#define __NR_times 100
|
||||
#define __NR_ptrace 101
|
||||
#define __NR_getuid 102
|
||||
#define __NR_syslog 103
|
||||
#define __NR_getgid 104
|
||||
#define __NR_setuid 105
|
||||
#define __NR_setgid 106
|
||||
#define __NR_geteuid 107
|
||||
#define __NR_getegid 108
|
||||
#define __NR_setpgid 109
|
||||
#define __NR_getppid 110
|
||||
#define __NR_getpgrp 111
|
||||
#define __NR_setsid 112
|
||||
#define __NR_setreuid 113
|
||||
#define __NR_setregid 114
|
||||
#define __NR_getgroups 115
|
||||
#define __NR_setgroups 116
|
||||
#define __NR_setresuid 117
|
||||
#define __NR_getresuid 118
|
||||
#define __NR_setresgid 119
|
||||
#define __NR_getresgid 120
|
||||
#define __NR_getpgid 121
|
||||
#define __NR_setfsuid 122
|
||||
#define __NR_setfsgid 123
|
||||
#define __NR_getsid 124
|
||||
#define __NR_capget 125
|
||||
#define __NR_capset 126
|
||||
#define __NR_rt_sigpending 127
|
||||
#define __NR_rt_sigtimedwait 128
|
||||
#define __NR_rt_sigqueueinfo 129
|
||||
#define __NR_rt_sigsuspend 130
|
||||
#define __NR_sigaltstack 131
|
||||
#define __NR_utime 132
|
||||
#define __NR_mknod 133
|
||||
#define __NR_uselib 134
|
||||
#define __NR_personality 135
|
||||
#define __NR_ustat 136
|
||||
#define __NR_statfs 137
|
||||
#define __NR_fstatfs 138
|
||||
#define __NR_sysfs 139
|
||||
#define __NR_getpriority 140
|
||||
#define __NR_setpriority 141
|
||||
#define __NR_sched_setparam 142
|
||||
#define __NR_sched_getparam 143
|
||||
#define __NR_sched_setscheduler 144
|
||||
#define __NR_sched_getscheduler 145
|
||||
#define __NR_sched_get_priority_max 146
|
||||
#define __NR_sched_get_priority_min 147
|
||||
#define __NR_sched_rr_get_interval 148
|
||||
#define __NR_mlock 149
|
||||
#define __NR_munlock 150
|
||||
#define __NR_mlockall 151
|
||||
#define __NR_munlockall 152
|
||||
#define __NR_vhangup 153
|
||||
#define __NR_modify_ldt 154
|
||||
#define __NR_pivot_root 155
|
||||
#define __NR__sysctl 156
|
||||
#define __NR_prctl 157
|
||||
#define __NR_arch_prctl 158
|
||||
#define __NR_adjtimex 159
|
||||
#define __NR_setrlimit 160
|
||||
#define __NR_chroot 161
|
||||
#define __NR_sync 162
|
||||
#define __NR_acct 163
|
||||
#define __NR_settimeofday 164
|
||||
#define __NR_mount 165
|
||||
#define __NR_umount2 166
|
||||
#define __NR_swapon 167
|
||||
#define __NR_swapoff 168
|
||||
#define __NR_reboot 169
|
||||
#define __NR_sethostname 170
|
||||
#define __NR_setdomainname 171
|
||||
#define __NR_iopl 172
|
||||
#define __NR_ioperm 173
|
||||
#define __NR_create_module 174
|
||||
#define __NR_init_module 175
|
||||
#define __NR_delete_module 176
|
||||
#define __NR_get_kernel_syms 177
|
||||
#define __NR_query_module 178
|
||||
#define __NR_quotactl 179
|
||||
#define __NR_nfsservctl 180
|
||||
#define __NR_getpmsg 181
|
||||
#define __NR_putpmsg 182
|
||||
#define __NR_afs_syscall 183
|
||||
#define __NR_tuxcall 184
|
||||
#define __NR_security 185
|
||||
#define __NR_gettid 186
|
||||
#define __NR_readahead 187
|
||||
#define __NR_setxattr 188
|
||||
#define __NR_lsetxattr 189
|
||||
#define __NR_fsetxattr 190
|
||||
#define __NR_getxattr 191
|
||||
#define __NR_lgetxattr 192
|
||||
#define __NR_fgetxattr 193
|
||||
#define __NR_listxattr 194
|
||||
#define __NR_llistxattr 195
|
||||
#define __NR_flistxattr 196
|
||||
#define __NR_removexattr 197
|
||||
#define __NR_lremovexattr 198
|
||||
#define __NR_fremovexattr 199
|
||||
#define __NR_tkill 200
|
||||
#define __NR_time 201
|
||||
#define __NR_futex 202
|
||||
#define __NR_sched_setaffinity 203
|
||||
#define __NR_sched_getaffinity 204
|
||||
#define __NR_set_thread_area 205
|
||||
#define __NR_io_setup 206
|
||||
#define __NR_io_destroy 207
|
||||
#define __NR_io_getevents 208
|
||||
#define __NR_io_submit 209
|
||||
#define __NR_io_cancel 210
|
||||
#define __NR_get_thread_area 211
|
||||
#define __NR_lookup_dcookie 212
|
||||
#define __NR_epoll_create 213
|
||||
#define __NR_epoll_ctl_old 214
|
||||
#define __NR_epoll_wait_old 215
|
||||
#define __NR_remap_file_pages 216
|
||||
#define __NR_getdents64 217
|
||||
#define __NR_set_tid_address 218
|
||||
#define __NR_restart_syscall 219
|
||||
#define __NR_semtimedop 220
|
||||
#define __NR_fadvise64 221
|
||||
#define __NR_timer_create 222
|
||||
#define __NR_timer_settime 223
|
||||
#define __NR_timer_gettime 224
|
||||
#define __NR_timer_getoverrun 225
|
||||
#define __NR_timer_delete 226
|
||||
#define __NR_clock_settime 227
|
||||
#define __NR_clock_gettime 228
|
||||
#define __NR_clock_getres 229
|
||||
#define __NR_clock_nanosleep 230
|
||||
#define __NR_exit_group 231
|
||||
#define __NR_epoll_wait 232
|
||||
#define __NR_epoll_ctl 233
|
||||
#define __NR_tgkill 234
|
||||
#define __NR_utimes 235
|
||||
#define __NR_vserver 236
|
||||
#define __NR_mbind 237
|
||||
#define __NR_set_mempolicy 238
|
||||
#define __NR_get_mempolicy 239
|
||||
#define __NR_mq_open 240
|
||||
#define __NR_mq_unlink 241
|
||||
#define __NR_mq_timedsend 242
|
||||
#define __NR_mq_timedreceive 243
|
||||
#define __NR_mq_notify 244
|
||||
#define __NR_mq_getsetattr 245
|
||||
#define __NR_kexec_load 246
|
||||
#define __NR_waitid 247
|
||||
#define __NR_add_key 248
|
||||
#define __NR_request_key 249
|
||||
#define __NR_keyctl 250
|
||||
#define __NR_ioprio_set 251
|
||||
#define __NR_ioprio_get 252
|
||||
#define __NR_inotify_init 253
|
||||
#define __NR_inotify_add_watch 254
|
||||
#define __NR_inotify_rm_watch 255
|
||||
#define __NR_migrate_pages 256
|
||||
#define __NR_openat 257
|
||||
#define __NR_mkdirat 258
|
||||
#define __NR_mknodat 259
|
||||
#define __NR_fchownat 260
|
||||
#define __NR_futimesat 261
|
||||
#define __NR_newfstatat 262
|
||||
#define __NR_unlinkat 263
|
||||
#define __NR_renameat 264
|
||||
#define __NR_linkat 265
|
||||
#define __NR_symlinkat 266
|
||||
#define __NR_readlinkat 267
|
||||
#define __NR_fchmodat 268
|
||||
#define __NR_faccessat 269
|
||||
#define __NR_pselect6 270
|
||||
#define __NR_ppoll 271
|
||||
#define __NR_unshare 272
|
||||
#define __NR_set_robust_list 273
|
||||
#define __NR_get_robust_list 274
|
||||
#define __NR_splice 275
|
||||
#define __NR_tee 276
|
||||
#define __NR_sync_file_range 277
|
||||
#define __NR_vmsplice 278
|
||||
#define __NR_move_pages 279
|
||||
#define __NR_utimensat 280
|
||||
#define __NR_epoll_pwait 281
|
||||
#define __NR_signalfd 282
|
||||
#define __NR_timerfd_create 283
|
||||
#define __NR_eventfd 284
|
||||
#define __NR_fallocate 285
|
||||
#define __NR_timerfd_settime 286
|
||||
#define __NR_timerfd_gettime 287
|
||||
#define __NR_accept4 288
|
||||
#define __NR_signalfd4 289
|
||||
#define __NR_eventfd2 290
|
||||
#define __NR_epoll_create1 291
|
||||
#define __NR_dup3 292
|
||||
#define __NR_pipe2 293
|
||||
#define __NR_inotify_init1 294
|
||||
#define __NR_preadv 295
|
||||
#define __NR_pwritev 296
|
||||
#define __NR_rt_tgsigqueueinfo 297
|
||||
#define __NR_perf_event_open 298
|
||||
#define __NR_recvmmsg 299
|
||||
#define __NR_fanotify_init 300
|
||||
#define __NR_fanotify_mark 301
|
||||
#define __NR_prlimit64 302
|
||||
#define __NR_name_to_handle_at 303
|
||||
#define __NR_open_by_handle_at 304
|
||||
#define __NR_clock_adjtime 305
|
||||
#define __NR_syncfs 306
|
||||
#define __NR_sendmmsg 307
|
||||
#define __NR_setns 308
|
||||
#define __NR_getcpu 309
|
||||
#define __NR_process_vm_readv 310
|
||||
#define __NR_process_vm_writev 311
|
||||
#define __NR_kcmp 312
|
||||
#define __NR_finit_module 313
|
||||
#define __NR_sched_setattr 314
|
||||
#define __NR_sched_getattr 315
|
||||
#define __NR_renameat2 316
|
||||
#define __NR_seccomp 317
|
||||
#define __NR_getrandom 318
|
||||
#define __NR_memfd_create 319
|
||||
#define __NR_kexec_file_load 320
|
||||
#define __NR_bpf 321
|
||||
#define __NR_execveat 322
|
||||
#define __NR_userfaultfd 323
|
||||
#define __NR_membarrier 324
|
||||
|
||||
#endif /* _ASM_X86_UNISTD_64_H */
|
||||
319
linux-headers/asm-x86/unistd_x32.h
Normal file
319
linux-headers/asm-x86/unistd_x32.h
Normal file
@@ -0,0 +1,319 @@
|
||||
#ifndef _ASM_X86_UNISTD_X32_H
|
||||
#define _ASM_X86_UNISTD_X32_H 1
|
||||
|
||||
#define __NR_read (__X32_SYSCALL_BIT + 0)
|
||||
#define __NR_write (__X32_SYSCALL_BIT + 1)
|
||||
#define __NR_open (__X32_SYSCALL_BIT + 2)
|
||||
#define __NR_close (__X32_SYSCALL_BIT + 3)
|
||||
#define __NR_stat (__X32_SYSCALL_BIT + 4)
|
||||
#define __NR_fstat (__X32_SYSCALL_BIT + 5)
|
||||
#define __NR_lstat (__X32_SYSCALL_BIT + 6)
|
||||
#define __NR_poll (__X32_SYSCALL_BIT + 7)
|
||||
#define __NR_lseek (__X32_SYSCALL_BIT + 8)
|
||||
#define __NR_mmap (__X32_SYSCALL_BIT + 9)
|
||||
#define __NR_mprotect (__X32_SYSCALL_BIT + 10)
|
||||
#define __NR_munmap (__X32_SYSCALL_BIT + 11)
|
||||
#define __NR_brk (__X32_SYSCALL_BIT + 12)
|
||||
#define __NR_rt_sigprocmask (__X32_SYSCALL_BIT + 14)
|
||||
#define __NR_pread64 (__X32_SYSCALL_BIT + 17)
|
||||
#define __NR_pwrite64 (__X32_SYSCALL_BIT + 18)
|
||||
#define __NR_access (__X32_SYSCALL_BIT + 21)
|
||||
#define __NR_pipe (__X32_SYSCALL_BIT + 22)
|
||||
#define __NR_select (__X32_SYSCALL_BIT + 23)
|
||||
#define __NR_sched_yield (__X32_SYSCALL_BIT + 24)
|
||||
#define __NR_mremap (__X32_SYSCALL_BIT + 25)
|
||||
#define __NR_msync (__X32_SYSCALL_BIT + 26)
|
||||
#define __NR_mincore (__X32_SYSCALL_BIT + 27)
|
||||
#define __NR_madvise (__X32_SYSCALL_BIT + 28)
|
||||
#define __NR_shmget (__X32_SYSCALL_BIT + 29)
|
||||
#define __NR_shmat (__X32_SYSCALL_BIT + 30)
|
||||
#define __NR_shmctl (__X32_SYSCALL_BIT + 31)
|
||||
#define __NR_dup (__X32_SYSCALL_BIT + 32)
|
||||
#define __NR_dup2 (__X32_SYSCALL_BIT + 33)
|
||||
#define __NR_pause (__X32_SYSCALL_BIT + 34)
|
||||
#define __NR_nanosleep (__X32_SYSCALL_BIT + 35)
|
||||
#define __NR_getitimer (__X32_SYSCALL_BIT + 36)
|
||||
#define __NR_alarm (__X32_SYSCALL_BIT + 37)
|
||||
#define __NR_setitimer (__X32_SYSCALL_BIT + 38)
|
||||
#define __NR_getpid (__X32_SYSCALL_BIT + 39)
|
||||
#define __NR_sendfile (__X32_SYSCALL_BIT + 40)
|
||||
#define __NR_socket (__X32_SYSCALL_BIT + 41)
|
||||
#define __NR_connect (__X32_SYSCALL_BIT + 42)
|
||||
#define __NR_accept (__X32_SYSCALL_BIT + 43)
|
||||
#define __NR_sendto (__X32_SYSCALL_BIT + 44)
|
||||
#define __NR_shutdown (__X32_SYSCALL_BIT + 48)
|
||||
#define __NR_bind (__X32_SYSCALL_BIT + 49)
|
||||
#define __NR_listen (__X32_SYSCALL_BIT + 50)
|
||||
#define __NR_getsockname (__X32_SYSCALL_BIT + 51)
|
||||
#define __NR_getpeername (__X32_SYSCALL_BIT + 52)
|
||||
#define __NR_socketpair (__X32_SYSCALL_BIT + 53)
|
||||
#define __NR_clone (__X32_SYSCALL_BIT + 56)
|
||||
#define __NR_fork (__X32_SYSCALL_BIT + 57)
|
||||
#define __NR_vfork (__X32_SYSCALL_BIT + 58)
|
||||
#define __NR_exit (__X32_SYSCALL_BIT + 60)
|
||||
#define __NR_wait4 (__X32_SYSCALL_BIT + 61)
|
||||
#define __NR_kill (__X32_SYSCALL_BIT + 62)
|
||||
#define __NR_uname (__X32_SYSCALL_BIT + 63)
|
||||
#define __NR_semget (__X32_SYSCALL_BIT + 64)
|
||||
#define __NR_semop (__X32_SYSCALL_BIT + 65)
|
||||
#define __NR_semctl (__X32_SYSCALL_BIT + 66)
|
||||
#define __NR_shmdt (__X32_SYSCALL_BIT + 67)
|
||||
#define __NR_msgget (__X32_SYSCALL_BIT + 68)
|
||||
#define __NR_msgsnd (__X32_SYSCALL_BIT + 69)
|
||||
#define __NR_msgrcv (__X32_SYSCALL_BIT + 70)
|
||||
#define __NR_msgctl (__X32_SYSCALL_BIT + 71)
|
||||
#define __NR_fcntl (__X32_SYSCALL_BIT + 72)
|
||||
#define __NR_flock (__X32_SYSCALL_BIT + 73)
|
||||
#define __NR_fsync (__X32_SYSCALL_BIT + 74)
|
||||
#define __NR_fdatasync (__X32_SYSCALL_BIT + 75)
|
||||
#define __NR_truncate (__X32_SYSCALL_BIT + 76)
|
||||
#define __NR_ftruncate (__X32_SYSCALL_BIT + 77)
|
||||
#define __NR_getdents (__X32_SYSCALL_BIT + 78)
|
||||
#define __NR_getcwd (__X32_SYSCALL_BIT + 79)
|
||||
#define __NR_chdir (__X32_SYSCALL_BIT + 80)
|
||||
#define __NR_fchdir (__X32_SYSCALL_BIT + 81)
|
||||
#define __NR_rename (__X32_SYSCALL_BIT + 82)
|
||||
#define __NR_mkdir (__X32_SYSCALL_BIT + 83)
|
||||
#define __NR_rmdir (__X32_SYSCALL_BIT + 84)
|
||||
#define __NR_creat (__X32_SYSCALL_BIT + 85)
|
||||
#define __NR_link (__X32_SYSCALL_BIT + 86)
|
||||
#define __NR_unlink (__X32_SYSCALL_BIT + 87)
|
||||
#define __NR_symlink (__X32_SYSCALL_BIT + 88)
|
||||
#define __NR_readlink (__X32_SYSCALL_BIT + 89)
|
||||
#define __NR_chmod (__X32_SYSCALL_BIT + 90)
|
||||
#define __NR_fchmod (__X32_SYSCALL_BIT + 91)
|
||||
#define __NR_chown (__X32_SYSCALL_BIT + 92)
|
||||
#define __NR_fchown (__X32_SYSCALL_BIT + 93)
|
||||
#define __NR_lchown (__X32_SYSCALL_BIT + 94)
|
||||
#define __NR_umask (__X32_SYSCALL_BIT + 95)
|
||||
#define __NR_gettimeofday (__X32_SYSCALL_BIT + 96)
|
||||
#define __NR_getrlimit (__X32_SYSCALL_BIT + 97)
|
||||
#define __NR_getrusage (__X32_SYSCALL_BIT + 98)
|
||||
#define __NR_sysinfo (__X32_SYSCALL_BIT + 99)
|
||||
#define __NR_times (__X32_SYSCALL_BIT + 100)
|
||||
#define __NR_getuid (__X32_SYSCALL_BIT + 102)
|
||||
#define __NR_syslog (__X32_SYSCALL_BIT + 103)
|
||||
#define __NR_getgid (__X32_SYSCALL_BIT + 104)
|
||||
#define __NR_setuid (__X32_SYSCALL_BIT + 105)
|
||||
#define __NR_setgid (__X32_SYSCALL_BIT + 106)
|
||||
#define __NR_geteuid (__X32_SYSCALL_BIT + 107)
|
||||
#define __NR_getegid (__X32_SYSCALL_BIT + 108)
|
||||
#define __NR_setpgid (__X32_SYSCALL_BIT + 109)
|
||||
#define __NR_getppid (__X32_SYSCALL_BIT + 110)
|
||||
#define __NR_getpgrp (__X32_SYSCALL_BIT + 111)
|
||||
#define __NR_setsid (__X32_SYSCALL_BIT + 112)
|
||||
#define __NR_setreuid (__X32_SYSCALL_BIT + 113)
|
||||
#define __NR_setregid (__X32_SYSCALL_BIT + 114)
|
||||
#define __NR_getgroups (__X32_SYSCALL_BIT + 115)
|
||||
#define __NR_setgroups (__X32_SYSCALL_BIT + 116)
|
||||
#define __NR_setresuid (__X32_SYSCALL_BIT + 117)
|
||||
#define __NR_getresuid (__X32_SYSCALL_BIT + 118)
|
||||
#define __NR_setresgid (__X32_SYSCALL_BIT + 119)
|
||||
#define __NR_getresgid (__X32_SYSCALL_BIT + 120)
|
||||
#define __NR_getpgid (__X32_SYSCALL_BIT + 121)
|
||||
#define __NR_setfsuid (__X32_SYSCALL_BIT + 122)
|
||||
#define __NR_setfsgid (__X32_SYSCALL_BIT + 123)
|
||||
#define __NR_getsid (__X32_SYSCALL_BIT + 124)
|
||||
#define __NR_capget (__X32_SYSCALL_BIT + 125)
|
||||
#define __NR_capset (__X32_SYSCALL_BIT + 126)
|
||||
#define __NR_rt_sigsuspend (__X32_SYSCALL_BIT + 130)
|
||||
#define __NR_utime (__X32_SYSCALL_BIT + 132)
|
||||
#define __NR_mknod (__X32_SYSCALL_BIT + 133)
|
||||
#define __NR_personality (__X32_SYSCALL_BIT + 135)
|
||||
#define __NR_ustat (__X32_SYSCALL_BIT + 136)
|
||||
#define __NR_statfs (__X32_SYSCALL_BIT + 137)
|
||||
#define __NR_fstatfs (__X32_SYSCALL_BIT + 138)
|
||||
#define __NR_sysfs (__X32_SYSCALL_BIT + 139)
|
||||
#define __NR_getpriority (__X32_SYSCALL_BIT + 140)
|
||||
#define __NR_setpriority (__X32_SYSCALL_BIT + 141)
|
||||
#define __NR_sched_setparam (__X32_SYSCALL_BIT + 142)
|
||||
#define __NR_sched_getparam (__X32_SYSCALL_BIT + 143)
|
||||
#define __NR_sched_setscheduler (__X32_SYSCALL_BIT + 144)
|
||||
#define __NR_sched_getscheduler (__X32_SYSCALL_BIT + 145)
|
||||
#define __NR_sched_get_priority_max (__X32_SYSCALL_BIT + 146)
|
||||
#define __NR_sched_get_priority_min (__X32_SYSCALL_BIT + 147)
|
||||
#define __NR_sched_rr_get_interval (__X32_SYSCALL_BIT + 148)
|
||||
#define __NR_mlock (__X32_SYSCALL_BIT + 149)
|
||||
#define __NR_munlock (__X32_SYSCALL_BIT + 150)
|
||||
#define __NR_mlockall (__X32_SYSCALL_BIT + 151)
|
||||
#define __NR_munlockall (__X32_SYSCALL_BIT + 152)
|
||||
#define __NR_vhangup (__X32_SYSCALL_BIT + 153)
|
||||
#define __NR_modify_ldt (__X32_SYSCALL_BIT + 154)
|
||||
#define __NR_pivot_root (__X32_SYSCALL_BIT + 155)
|
||||
#define __NR_prctl (__X32_SYSCALL_BIT + 157)
|
||||
#define __NR_arch_prctl (__X32_SYSCALL_BIT + 158)
|
||||
#define __NR_adjtimex (__X32_SYSCALL_BIT + 159)
|
||||
#define __NR_setrlimit (__X32_SYSCALL_BIT + 160)
|
||||
#define __NR_chroot (__X32_SYSCALL_BIT + 161)
|
||||
#define __NR_sync (__X32_SYSCALL_BIT + 162)
|
||||
#define __NR_acct (__X32_SYSCALL_BIT + 163)
|
||||
#define __NR_settimeofday (__X32_SYSCALL_BIT + 164)
|
||||
#define __NR_mount (__X32_SYSCALL_BIT + 165)
|
||||
#define __NR_umount2 (__X32_SYSCALL_BIT + 166)
|
||||
#define __NR_swapon (__X32_SYSCALL_BIT + 167)
|
||||
#define __NR_swapoff (__X32_SYSCALL_BIT + 168)
|
||||
#define __NR_reboot (__X32_SYSCALL_BIT + 169)
|
||||
#define __NR_sethostname (__X32_SYSCALL_BIT + 170)
|
||||
#define __NR_setdomainname (__X32_SYSCALL_BIT + 171)
|
||||
#define __NR_iopl (__X32_SYSCALL_BIT + 172)
|
||||
#define __NR_ioperm (__X32_SYSCALL_BIT + 173)
|
||||
#define __NR_init_module (__X32_SYSCALL_BIT + 175)
|
||||
#define __NR_delete_module (__X32_SYSCALL_BIT + 176)
|
||||
#define __NR_quotactl (__X32_SYSCALL_BIT + 179)
|
||||
#define __NR_getpmsg (__X32_SYSCALL_BIT + 181)
|
||||
#define __NR_putpmsg (__X32_SYSCALL_BIT + 182)
|
||||
#define __NR_afs_syscall (__X32_SYSCALL_BIT + 183)
|
||||
#define __NR_tuxcall (__X32_SYSCALL_BIT + 184)
|
||||
#define __NR_security (__X32_SYSCALL_BIT + 185)
|
||||
#define __NR_gettid (__X32_SYSCALL_BIT + 186)
|
||||
#define __NR_readahead (__X32_SYSCALL_BIT + 187)
|
||||
#define __NR_setxattr (__X32_SYSCALL_BIT + 188)
|
||||
#define __NR_lsetxattr (__X32_SYSCALL_BIT + 189)
|
||||
#define __NR_fsetxattr (__X32_SYSCALL_BIT + 190)
|
||||
#define __NR_getxattr (__X32_SYSCALL_BIT + 191)
|
||||
#define __NR_lgetxattr (__X32_SYSCALL_BIT + 192)
|
||||
#define __NR_fgetxattr (__X32_SYSCALL_BIT + 193)
|
||||
#define __NR_listxattr (__X32_SYSCALL_BIT + 194)
|
||||
#define __NR_llistxattr (__X32_SYSCALL_BIT + 195)
|
||||
#define __NR_flistxattr (__X32_SYSCALL_BIT + 196)
|
||||
#define __NR_removexattr (__X32_SYSCALL_BIT + 197)
|
||||
#define __NR_lremovexattr (__X32_SYSCALL_BIT + 198)
|
||||
#define __NR_fremovexattr (__X32_SYSCALL_BIT + 199)
|
||||
#define __NR_tkill (__X32_SYSCALL_BIT + 200)
|
||||
#define __NR_time (__X32_SYSCALL_BIT + 201)
|
||||
#define __NR_futex (__X32_SYSCALL_BIT + 202)
|
||||
#define __NR_sched_setaffinity (__X32_SYSCALL_BIT + 203)
|
||||
#define __NR_sched_getaffinity (__X32_SYSCALL_BIT + 204)
|
||||
#define __NR_io_destroy (__X32_SYSCALL_BIT + 207)
|
||||
#define __NR_io_getevents (__X32_SYSCALL_BIT + 208)
|
||||
#define __NR_io_cancel (__X32_SYSCALL_BIT + 210)
|
||||
#define __NR_lookup_dcookie (__X32_SYSCALL_BIT + 212)
|
||||
#define __NR_epoll_create (__X32_SYSCALL_BIT + 213)
|
||||
#define __NR_remap_file_pages (__X32_SYSCALL_BIT + 216)
|
||||
#define __NR_getdents64 (__X32_SYSCALL_BIT + 217)
|
||||
#define __NR_set_tid_address (__X32_SYSCALL_BIT + 218)
|
||||
#define __NR_restart_syscall (__X32_SYSCALL_BIT + 219)
|
||||
#define __NR_semtimedop (__X32_SYSCALL_BIT + 220)
|
||||
#define __NR_fadvise64 (__X32_SYSCALL_BIT + 221)
|
||||
#define __NR_timer_settime (__X32_SYSCALL_BIT + 223)
|
||||
#define __NR_timer_gettime (__X32_SYSCALL_BIT + 224)
|
||||
#define __NR_timer_getoverrun (__X32_SYSCALL_BIT + 225)
|
||||
#define __NR_timer_delete (__X32_SYSCALL_BIT + 226)
|
||||
#define __NR_clock_settime (__X32_SYSCALL_BIT + 227)
|
||||
#define __NR_clock_gettime (__X32_SYSCALL_BIT + 228)
|
||||
#define __NR_clock_getres (__X32_SYSCALL_BIT + 229)
|
||||
#define __NR_clock_nanosleep (__X32_SYSCALL_BIT + 230)
|
||||
#define __NR_exit_group (__X32_SYSCALL_BIT + 231)
|
||||
#define __NR_epoll_wait (__X32_SYSCALL_BIT + 232)
|
||||
#define __NR_epoll_ctl (__X32_SYSCALL_BIT + 233)
|
||||
#define __NR_tgkill (__X32_SYSCALL_BIT + 234)
|
||||
#define __NR_utimes (__X32_SYSCALL_BIT + 235)
|
||||
#define __NR_mbind (__X32_SYSCALL_BIT + 237)
|
||||
#define __NR_set_mempolicy (__X32_SYSCALL_BIT + 238)
|
||||
#define __NR_get_mempolicy (__X32_SYSCALL_BIT + 239)
|
||||
#define __NR_mq_open (__X32_SYSCALL_BIT + 240)
|
||||
#define __NR_mq_unlink (__X32_SYSCALL_BIT + 241)
|
||||
#define __NR_mq_timedsend (__X32_SYSCALL_BIT + 242)
|
||||
#define __NR_mq_timedreceive (__X32_SYSCALL_BIT + 243)
|
||||
#define __NR_mq_getsetattr (__X32_SYSCALL_BIT + 245)
|
||||
#define __NR_add_key (__X32_SYSCALL_BIT + 248)
|
||||
#define __NR_request_key (__X32_SYSCALL_BIT + 249)
|
||||
#define __NR_keyctl (__X32_SYSCALL_BIT + 250)
|
||||
#define __NR_ioprio_set (__X32_SYSCALL_BIT + 251)
|
||||
#define __NR_ioprio_get (__X32_SYSCALL_BIT + 252)
|
||||
#define __NR_inotify_init (__X32_SYSCALL_BIT + 253)
|
||||
#define __NR_inotify_add_watch (__X32_SYSCALL_BIT + 254)
|
||||
#define __NR_inotify_rm_watch (__X32_SYSCALL_BIT + 255)
|
||||
#define __NR_migrate_pages (__X32_SYSCALL_BIT + 256)
|
||||
#define __NR_openat (__X32_SYSCALL_BIT + 257)
|
||||
#define __NR_mkdirat (__X32_SYSCALL_BIT + 258)
|
||||
#define __NR_mknodat (__X32_SYSCALL_BIT + 259)
|
||||
#define __NR_fchownat (__X32_SYSCALL_BIT + 260)
|
||||
#define __NR_futimesat (__X32_SYSCALL_BIT + 261)
|
||||
#define __NR_newfstatat (__X32_SYSCALL_BIT + 262)
|
||||
#define __NR_unlinkat (__X32_SYSCALL_BIT + 263)
|
||||
#define __NR_renameat (__X32_SYSCALL_BIT + 264)
|
||||
#define __NR_linkat (__X32_SYSCALL_BIT + 265)
|
||||
#define __NR_symlinkat (__X32_SYSCALL_BIT + 266)
|
||||
#define __NR_readlinkat (__X32_SYSCALL_BIT + 267)
|
||||
#define __NR_fchmodat (__X32_SYSCALL_BIT + 268)
|
||||
#define __NR_faccessat (__X32_SYSCALL_BIT + 269)
|
||||
#define __NR_pselect6 (__X32_SYSCALL_BIT + 270)
|
||||
#define __NR_ppoll (__X32_SYSCALL_BIT + 271)
|
||||
#define __NR_unshare (__X32_SYSCALL_BIT + 272)
|
||||
#define __NR_splice (__X32_SYSCALL_BIT + 275)
|
||||
#define __NR_tee (__X32_SYSCALL_BIT + 276)
|
||||
#define __NR_sync_file_range (__X32_SYSCALL_BIT + 277)
|
||||
#define __NR_utimensat (__X32_SYSCALL_BIT + 280)
|
||||
#define __NR_epoll_pwait (__X32_SYSCALL_BIT + 281)
|
||||
#define __NR_signalfd (__X32_SYSCALL_BIT + 282)
|
||||
#define __NR_timerfd_create (__X32_SYSCALL_BIT + 283)
|
||||
#define __NR_eventfd (__X32_SYSCALL_BIT + 284)
|
||||
#define __NR_fallocate (__X32_SYSCALL_BIT + 285)
|
||||
#define __NR_timerfd_settime (__X32_SYSCALL_BIT + 286)
|
||||
#define __NR_timerfd_gettime (__X32_SYSCALL_BIT + 287)
|
||||
#define __NR_accept4 (__X32_SYSCALL_BIT + 288)
|
||||
#define __NR_signalfd4 (__X32_SYSCALL_BIT + 289)
|
||||
#define __NR_eventfd2 (__X32_SYSCALL_BIT + 290)
|
||||
#define __NR_epoll_create1 (__X32_SYSCALL_BIT + 291)
|
||||
#define __NR_dup3 (__X32_SYSCALL_BIT + 292)
|
||||
#define __NR_pipe2 (__X32_SYSCALL_BIT + 293)
|
||||
#define __NR_inotify_init1 (__X32_SYSCALL_BIT + 294)
|
||||
#define __NR_perf_event_open (__X32_SYSCALL_BIT + 298)
|
||||
#define __NR_fanotify_init (__X32_SYSCALL_BIT + 300)
|
||||
#define __NR_fanotify_mark (__X32_SYSCALL_BIT + 301)
|
||||
#define __NR_prlimit64 (__X32_SYSCALL_BIT + 302)
|
||||
#define __NR_name_to_handle_at (__X32_SYSCALL_BIT + 303)
|
||||
#define __NR_open_by_handle_at (__X32_SYSCALL_BIT + 304)
|
||||
#define __NR_clock_adjtime (__X32_SYSCALL_BIT + 305)
|
||||
#define __NR_syncfs (__X32_SYSCALL_BIT + 306)
|
||||
#define __NR_setns (__X32_SYSCALL_BIT + 308)
|
||||
#define __NR_getcpu (__X32_SYSCALL_BIT + 309)
|
||||
#define __NR_kcmp (__X32_SYSCALL_BIT + 312)
|
||||
#define __NR_finit_module (__X32_SYSCALL_BIT + 313)
|
||||
#define __NR_sched_setattr (__X32_SYSCALL_BIT + 314)
|
||||
#define __NR_sched_getattr (__X32_SYSCALL_BIT + 315)
|
||||
#define __NR_renameat2 (__X32_SYSCALL_BIT + 316)
|
||||
#define __NR_seccomp (__X32_SYSCALL_BIT + 317)
|
||||
#define __NR_getrandom (__X32_SYSCALL_BIT + 318)
|
||||
#define __NR_memfd_create (__X32_SYSCALL_BIT + 319)
|
||||
#define __NR_kexec_file_load (__X32_SYSCALL_BIT + 320)
|
||||
#define __NR_bpf (__X32_SYSCALL_BIT + 321)
|
||||
#define __NR_userfaultfd (__X32_SYSCALL_BIT + 323)
|
||||
#define __NR_membarrier (__X32_SYSCALL_BIT + 324)
|
||||
#define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512)
|
||||
#define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513)
|
||||
#define __NR_ioctl (__X32_SYSCALL_BIT + 514)
|
||||
#define __NR_readv (__X32_SYSCALL_BIT + 515)
|
||||
#define __NR_writev (__X32_SYSCALL_BIT + 516)
|
||||
#define __NR_recvfrom (__X32_SYSCALL_BIT + 517)
|
||||
#define __NR_sendmsg (__X32_SYSCALL_BIT + 518)
|
||||
#define __NR_recvmsg (__X32_SYSCALL_BIT + 519)
|
||||
#define __NR_execve (__X32_SYSCALL_BIT + 520)
|
||||
#define __NR_ptrace (__X32_SYSCALL_BIT + 521)
|
||||
#define __NR_rt_sigpending (__X32_SYSCALL_BIT + 522)
|
||||
#define __NR_rt_sigtimedwait (__X32_SYSCALL_BIT + 523)
|
||||
#define __NR_rt_sigqueueinfo (__X32_SYSCALL_BIT + 524)
|
||||
#define __NR_sigaltstack (__X32_SYSCALL_BIT + 525)
|
||||
#define __NR_timer_create (__X32_SYSCALL_BIT + 526)
|
||||
#define __NR_mq_notify (__X32_SYSCALL_BIT + 527)
|
||||
#define __NR_kexec_load (__X32_SYSCALL_BIT + 528)
|
||||
#define __NR_waitid (__X32_SYSCALL_BIT + 529)
|
||||
#define __NR_set_robust_list (__X32_SYSCALL_BIT + 530)
|
||||
#define __NR_get_robust_list (__X32_SYSCALL_BIT + 531)
|
||||
#define __NR_vmsplice (__X32_SYSCALL_BIT + 532)
|
||||
#define __NR_move_pages (__X32_SYSCALL_BIT + 533)
|
||||
#define __NR_preadv (__X32_SYSCALL_BIT + 534)
|
||||
#define __NR_pwritev (__X32_SYSCALL_BIT + 535)
|
||||
#define __NR_rt_tgsigqueueinfo (__X32_SYSCALL_BIT + 536)
|
||||
#define __NR_recvmmsg (__X32_SYSCALL_BIT + 537)
|
||||
#define __NR_sendmmsg (__X32_SYSCALL_BIT + 538)
|
||||
#define __NR_process_vm_readv (__X32_SYSCALL_BIT + 539)
|
||||
#define __NR_process_vm_writev (__X32_SYSCALL_BIT + 540)
|
||||
#define __NR_setsockopt (__X32_SYSCALL_BIT + 541)
|
||||
#define __NR_getsockopt (__X32_SYSCALL_BIT + 542)
|
||||
#define __NR_io_setup (__X32_SYSCALL_BIT + 543)
|
||||
#define __NR_io_submit (__X32_SYSCALL_BIT + 544)
|
||||
#define __NR_execveat (__X32_SYSCALL_BIT + 545)
|
||||
|
||||
#endif /* _ASM_X86_UNISTD_X32_H */
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "qemu/error-report.h"
|
||||
#include "qemu/iov.h"
|
||||
#include "qemu/sockets.h"
|
||||
#include "block/coroutine.h"
|
||||
#include "qemu/coroutine.h"
|
||||
#include "migration/migration.h"
|
||||
#include "migration/qemu-file.h"
|
||||
#include "migration/qemu-file-internal.h"
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
#include "qemu-common.h"
|
||||
#include "block/coroutine.h"
|
||||
#include "qemu/coroutine.h"
|
||||
#include "migration/qemu-file.h"
|
||||
|
||||
typedef struct QEMUFileStdio {
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "qemu-common.h"
|
||||
#include "qemu/iov.h"
|
||||
#include "qemu/sockets.h"
|
||||
#include "block/coroutine.h"
|
||||
#include "qemu/coroutine.h"
|
||||
#include "migration/qemu-file.h"
|
||||
#include "migration/qemu-file-internal.h"
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "qemu/error-report.h"
|
||||
#include "qemu/iov.h"
|
||||
#include "qemu/sockets.h"
|
||||
#include "block/coroutine.h"
|
||||
#include "qemu/coroutine.h"
|
||||
#include "migration/migration.h"
|
||||
#include "migration/qemu-file.h"
|
||||
#include "migration/qemu-file-internal.h"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "qemu/main-loop.h"
|
||||
#include "qemu/sockets.h"
|
||||
#include "qemu/bitmap.h"
|
||||
#include "block/coroutine.h"
|
||||
#include "qemu/coroutine.h"
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
2
nbd.c
2
nbd.c
@@ -19,7 +19,7 @@
|
||||
#include "block/nbd.h"
|
||||
#include "sysemu/block-backend.h"
|
||||
|
||||
#include "block/coroutine.h"
|
||||
#include "qemu/coroutine.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -524,20 +524,28 @@ void qemu_set_vnet_hdr_len(NetClientState *nc, int len)
|
||||
|
||||
int qemu_set_vnet_le(NetClientState *nc, bool is_le)
|
||||
{
|
||||
#ifdef HOST_WORDS_BIGENDIAN
|
||||
if (!nc || !nc->info->set_vnet_le) {
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
return nc->info->set_vnet_le(nc, is_le);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int qemu_set_vnet_be(NetClientState *nc, bool is_be)
|
||||
{
|
||||
#ifdef HOST_WORDS_BIGENDIAN
|
||||
return 0;
|
||||
#else
|
||||
if (!nc || !nc->info->set_vnet_be) {
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
return nc->info->set_vnet_be(nc, is_be);
|
||||
#endif
|
||||
}
|
||||
|
||||
int qemu_can_send_packet(NetClientState *sender)
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "qemu/config-file.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qmp-commands.h"
|
||||
#include "trace.h"
|
||||
|
||||
typedef struct VhostUserState {
|
||||
NetClientState nc;
|
||||
@@ -102,6 +103,35 @@ err:
|
||||
return -1;
|
||||
}
|
||||
|
||||
static ssize_t vhost_user_receive(NetClientState *nc, const uint8_t *buf,
|
||||
size_t size)
|
||||
{
|
||||
/* In case of RARP (message size is 60) notify backup to send a fake RARP.
|
||||
This fake RARP will be sent by backend only for guest
|
||||
without GUEST_ANNOUNCE capability.
|
||||
*/
|
||||
if (size == 60) {
|
||||
VhostUserState *s = DO_UPCAST(VhostUserState, nc, nc);
|
||||
int r;
|
||||
static int display_rarp_failure = 1;
|
||||
char mac_addr[6];
|
||||
|
||||
/* extract guest mac address from the RARP message */
|
||||
memcpy(mac_addr, &buf[6], 6);
|
||||
|
||||
r = vhost_net_notify_migration_done(s->vhost_net, mac_addr);
|
||||
|
||||
if ((r != 0) && (display_rarp_failure)) {
|
||||
fprintf(stderr,
|
||||
"Vhost user backend fails to broadcast fake RARP\n");
|
||||
fflush(stderr);
|
||||
display_rarp_failure = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
static void vhost_user_cleanup(NetClientState *nc)
|
||||
{
|
||||
VhostUserState *s = DO_UPCAST(VhostUserState, nc, nc);
|
||||
@@ -131,6 +161,7 @@ static bool vhost_user_has_ufo(NetClientState *nc)
|
||||
static NetClientInfo net_vhost_user_info = {
|
||||
.type = NET_CLIENT_OPTIONS_KIND_VHOST_USER,
|
||||
.size = sizeof(VhostUserState),
|
||||
.receive = vhost_user_receive,
|
||||
.cleanup = vhost_user_cleanup,
|
||||
.has_vnet_hdr = vhost_user_has_vnet_hdr,
|
||||
.has_ufo = vhost_user_has_ufo,
|
||||
@@ -148,18 +179,17 @@ static void net_vhost_user_event(void *opaque, int event)
|
||||
NET_CLIENT_OPTIONS_KIND_NIC,
|
||||
MAX_QUEUE_NUM);
|
||||
s = DO_UPCAST(VhostUserState, nc, ncs[0]);
|
||||
trace_vhost_user_event(s->chr->label, event);
|
||||
switch (event) {
|
||||
case CHR_EVENT_OPENED:
|
||||
if (vhost_user_start(queues, ncs) < 0) {
|
||||
exit(1);
|
||||
}
|
||||
qmp_set_link(name, true, &err);
|
||||
error_report("chardev \"%s\" went up", s->chr->label);
|
||||
break;
|
||||
case CHR_EVENT_CLOSED:
|
||||
qmp_set_link(name, true, &err);
|
||||
vhost_user_stop(queues, ncs);
|
||||
error_report("chardev \"%s\" went down", s->chr->label);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -182,8 +212,6 @@ static int net_vhost_user_init(NetClientState *peer, const char *device,
|
||||
snprintf(nc->info_str, sizeof(nc->info_str), "vhost-user%d to %s",
|
||||
i, chr->label);
|
||||
|
||||
/* We don't provide a receive callback */
|
||||
nc->receive_disabled = 1;
|
||||
nc->queue_index = i;
|
||||
|
||||
s = DO_UPCAST(VhostUserState, nc, nc);
|
||||
|
||||
@@ -2614,7 +2614,9 @@
|
||||
#
|
||||
# @host: host part of the address
|
||||
#
|
||||
# @port: port part of the address, or lowest port if @to is present
|
||||
# @port: port part of the address, or lowest port if @to is present.
|
||||
# Kernel selects a free port if omitted for listener addresses.
|
||||
# #optional
|
||||
#
|
||||
# @to: highest port to try
|
||||
#
|
||||
@@ -2629,7 +2631,7 @@
|
||||
{ 'struct': 'InetSocketAddress',
|
||||
'data': {
|
||||
'host': 'str',
|
||||
'port': 'str',
|
||||
'*port': 'str',
|
||||
'*to': 'uint16',
|
||||
'*ipv4': 'bool',
|
||||
'*ipv6': 'bool' } }
|
||||
|
||||
25
qemu-char.c
25
qemu-char.c
@@ -92,31 +92,6 @@
|
||||
|
||||
/***********************************************************/
|
||||
/* Socket address helpers */
|
||||
static void qapi_copy_SocketAddress(SocketAddress **p_dest,
|
||||
SocketAddress *src)
|
||||
{
|
||||
QmpOutputVisitor *qov;
|
||||
QmpInputVisitor *qiv;
|
||||
Visitor *ov, *iv;
|
||||
QObject *obj;
|
||||
|
||||
*p_dest = NULL;
|
||||
|
||||
qov = qmp_output_visitor_new();
|
||||
ov = qmp_output_get_visitor(qov);
|
||||
visit_type_SocketAddress(ov, &src, NULL, &error_abort);
|
||||
obj = qmp_output_get_qobject(qov);
|
||||
qmp_output_visitor_cleanup(qov);
|
||||
if (!obj) {
|
||||
return;
|
||||
}
|
||||
|
||||
qiv = qmp_input_visitor_new(obj);
|
||||
iv = qmp_input_get_visitor(qiv);
|
||||
visit_type_SocketAddress(iv, p_dest, NULL, &error_abort);
|
||||
qmp_input_visitor_cleanup(qiv);
|
||||
qobject_decref(obj);
|
||||
}
|
||||
|
||||
static int SocketAddress_to_str(char *dest, int max_len,
|
||||
const char *prefix, SocketAddress *addr,
|
||||
|
||||
@@ -2724,13 +2724,18 @@ ETEXI
|
||||
|
||||
DEF("fw_cfg", HAS_ARG, QEMU_OPTION_fwcfg,
|
||||
"-fw_cfg [name=]<name>,file=<file>\n"
|
||||
" add named fw_cfg entry from file\n",
|
||||
" add named fw_cfg entry from file\n"
|
||||
"-fw_cfg [name=]<name>,string=<str>\n"
|
||||
" add named fw_cfg entry from string\n",
|
||||
QEMU_ARCH_ALL)
|
||||
STEXI
|
||||
@item -fw_cfg [name=]@var{name},file=@var{file}
|
||||
@findex -fw_cfg
|
||||
Add named fw_cfg entry from file. @var{name} determines the name of
|
||||
the entry in the fw_cfg file directory exposed to the guest.
|
||||
|
||||
@item -fw_cfg [name=]@var{name},string=@var{str}
|
||||
Add named fw_cfg entry from string.
|
||||
ETEXI
|
||||
|
||||
DEF("serial", HAS_ARG, QEMU_OPTION_serial, \
|
||||
|
||||
@@ -237,7 +237,8 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
|
||||
{ SCMP_SYS(fadvise64), 240 },
|
||||
{ SCMP_SYS(inotify_init1), 240 },
|
||||
{ SCMP_SYS(inotify_add_watch), 240 },
|
||||
{ SCMP_SYS(mbind), 240 }
|
||||
{ SCMP_SYS(mbind), 240 },
|
||||
{ SCMP_SYS(memfd_create), 240 }
|
||||
};
|
||||
|
||||
int seccomp_start(void)
|
||||
|
||||
@@ -217,25 +217,24 @@ GIOStatus ga_channel_write_all(GAChannel *c, const gchar *buf, gsize size)
|
||||
GIOStatus status = G_IO_STATUS_NORMAL;
|
||||
|
||||
while (size) {
|
||||
g_debug("sending data, count: %d", (int)size);
|
||||
status = g_io_channel_write_chars(c->client_channel, buf, size,
|
||||
&written, &err);
|
||||
g_debug("sending data, count: %d", (int)size);
|
||||
if (err != NULL) {
|
||||
g_warning("error writing to channel: %s", err->message);
|
||||
return G_IO_STATUS_ERROR;
|
||||
}
|
||||
if (status != G_IO_STATUS_NORMAL) {
|
||||
break;
|
||||
}
|
||||
if (status == G_IO_STATUS_NORMAL) {
|
||||
size -= written;
|
||||
buf += written;
|
||||
} else if (status != G_IO_STATUS_AGAIN) {
|
||||
g_warning("error writing to channel: %s", err->message);
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
if (status == G_IO_STATUS_NORMAL) {
|
||||
do {
|
||||
status = g_io_channel_flush(c->client_channel, &err);
|
||||
if (err != NULL) {
|
||||
} while (status == G_IO_STATUS_AGAIN);
|
||||
|
||||
if (status != G_IO_STATUS_NORMAL) {
|
||||
g_warning("error flushing channel: %s", err->message);
|
||||
return G_IO_STATUS_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
@@ -249,7 +248,7 @@ GIOStatus ga_channel_read(GAChannel *c, gchar *buf, gsize size, gsize *count)
|
||||
GAChannel *ga_channel_new(GAChannelMethod method, const gchar *path,
|
||||
GAChannelCallback cb, gpointer opaque)
|
||||
{
|
||||
GAChannel *c = g_malloc0(sizeof(GAChannel));
|
||||
GAChannel *c = g_new0(GAChannel, 1);
|
||||
c->event_cb = cb;
|
||||
c->user_data = opaque;
|
||||
|
||||
|
||||
@@ -269,7 +269,7 @@ static GIOStatus ga_channel_write(GAChannel *c, const char *buf, size_t size,
|
||||
GIOStatus ga_channel_write_all(GAChannel *c, const char *buf, size_t size)
|
||||
{
|
||||
GIOStatus status = G_IO_STATUS_NORMAL;
|
||||
size_t count;
|
||||
size_t count = 0;
|
||||
|
||||
while (size) {
|
||||
status = ga_channel_write(c, buf, size, &count);
|
||||
@@ -322,7 +322,7 @@ static gboolean ga_channel_open(GAChannel *c, GAChannelMethod method,
|
||||
GAChannel *ga_channel_new(GAChannelMethod method, const gchar *path,
|
||||
GAChannelCallback cb, gpointer opaque)
|
||||
{
|
||||
GAChannel *c = g_malloc0(sizeof(GAChannel));
|
||||
GAChannel *c = g_new0(GAChannel, 1);
|
||||
SECURITY_ATTRIBUTES sec_attrs;
|
||||
|
||||
if (!ga_channel_open(c, method, path)) {
|
||||
|
||||
@@ -223,7 +223,9 @@ typedef struct GuestFileHandle {
|
||||
|
||||
static struct {
|
||||
QTAILQ_HEAD(, GuestFileHandle) filehandles;
|
||||
} guest_file_state;
|
||||
} guest_file_state = {
|
||||
.filehandles = QTAILQ_HEAD_INITIALIZER(guest_file_state.filehandles),
|
||||
};
|
||||
|
||||
static int64_t guest_file_handle_add(FILE *fh, Error **errp)
|
||||
{
|
||||
@@ -235,7 +237,7 @@ static int64_t guest_file_handle_add(FILE *fh, Error **errp)
|
||||
return -1;
|
||||
}
|
||||
|
||||
gfh = g_malloc0(sizeof(GuestFileHandle));
|
||||
gfh = g_new0(GuestFileHandle, 1);
|
||||
gfh->id = handle;
|
||||
gfh->fh = fh;
|
||||
QTAILQ_INSERT_TAIL(&guest_file_state.filehandles, gfh, next);
|
||||
@@ -488,7 +490,7 @@ struct GuestFileRead *qmp_guest_file_read(int64_t handle, bool has_count,
|
||||
slog("guest-file-read failed, handle: %" PRId64, handle);
|
||||
} else {
|
||||
buf[read_count] = 0;
|
||||
read_data = g_malloc0(sizeof(GuestFileRead));
|
||||
read_data = g_new0(GuestFileRead, 1);
|
||||
read_data->count = read_count;
|
||||
read_data->eof = feof(fh);
|
||||
if (read_count) {
|
||||
@@ -533,7 +535,7 @@ GuestFileWrite *qmp_guest_file_write(int64_t handle, const char *buf_b64,
|
||||
error_setg_errno(errp, errno, "failed to write to file");
|
||||
slog("guest-file-write failed, handle: %" PRId64, handle);
|
||||
} else {
|
||||
write_data = g_malloc0(sizeof(GuestFileWrite));
|
||||
write_data = g_new0(GuestFileWrite, 1);
|
||||
write_data->count = write_count;
|
||||
write_data->eof = feof(fh);
|
||||
}
|
||||
@@ -586,11 +588,6 @@ void qmp_guest_file_flush(int64_t handle, Error **errp)
|
||||
}
|
||||
}
|
||||
|
||||
static void guest_file_init(void)
|
||||
{
|
||||
QTAILQ_INIT(&guest_file_state.filehandles);
|
||||
}
|
||||
|
||||
/* linux-specific implementations. avoid this if at all possible. */
|
||||
#if defined(__linux__)
|
||||
|
||||
@@ -678,7 +675,7 @@ static void build_fs_mount_list_from_mtab(FsMountList *mounts, Error **errp)
|
||||
continue;
|
||||
}
|
||||
|
||||
mount = g_malloc0(sizeof(FsMount));
|
||||
mount = g_new0(FsMount, 1);
|
||||
mount->dirname = g_strdup(ment->mnt_dir);
|
||||
mount->devtype = g_strdup(ment->mnt_type);
|
||||
mount->devmajor = devmajor;
|
||||
@@ -757,7 +754,7 @@ static void build_fs_mount_list(FsMountList *mounts, Error **errp)
|
||||
}
|
||||
}
|
||||
|
||||
mount = g_malloc0(sizeof(FsMount));
|
||||
mount = g_new0(FsMount, 1);
|
||||
mount->dirname = g_strdup(line + dir_s);
|
||||
mount->devtype = g_strdup(dash + type_s);
|
||||
mount->devmajor = devmajor;
|
||||
@@ -2213,8 +2210,14 @@ GuestMemoryBlockList *qmp_guest_get_memory_blocks(Error **errp)
|
||||
|
||||
dp = opendir("/sys/devices/system/memory/");
|
||||
if (!dp) {
|
||||
/* it's ok if this happens to be a system that doesn't expose
|
||||
* memory blocks via sysfs, but otherwise we should report
|
||||
* an error
|
||||
*/
|
||||
if (errno != ENOENT) {
|
||||
error_setg_errno(errp, errno, "Can't open directory"
|
||||
"\"/sys/devices/system/memory/\"\n");
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -2486,5 +2489,4 @@ void ga_command_state_init(GAState *s, GACommandState *cs)
|
||||
#if defined(CONFIG_FSFREEZE)
|
||||
ga_command_state_add(cs, NULL, guest_fsfreeze_cleanup);
|
||||
#endif
|
||||
ga_command_state_add(cs, guest_file_init, NULL);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,9 @@ typedef struct GuestFileHandle {
|
||||
|
||||
static struct {
|
||||
QTAILQ_HEAD(, GuestFileHandle) filehandles;
|
||||
} guest_file_state;
|
||||
} guest_file_state = {
|
||||
.filehandles = QTAILQ_HEAD_INITIALIZER(guest_file_state.filehandles),
|
||||
};
|
||||
|
||||
|
||||
typedef struct OpenFlags {
|
||||
@@ -106,7 +108,7 @@ static int64_t guest_file_handle_add(HANDLE fh, Error **errp)
|
||||
if (handle < 0) {
|
||||
return -1;
|
||||
}
|
||||
gfh = g_malloc0(sizeof(GuestFileHandle));
|
||||
gfh = g_new0(GuestFileHandle, 1);
|
||||
gfh->id = handle;
|
||||
gfh->fh = fh;
|
||||
QTAILQ_INSERT_TAIL(&guest_file_state.filehandles, gfh, next);
|
||||
@@ -298,7 +300,7 @@ GuestFileRead *qmp_guest_file_read(int64_t handle, bool has_count,
|
||||
slog("guest-file-read failed, handle %" PRId64, handle);
|
||||
} else {
|
||||
buf[read_count] = 0;
|
||||
read_data = g_malloc0(sizeof(GuestFileRead));
|
||||
read_data = g_new0(GuestFileRead, 1);
|
||||
read_data->count = (size_t)read_count;
|
||||
read_data->eof = read_count == 0;
|
||||
|
||||
@@ -342,7 +344,7 @@ GuestFileWrite *qmp_guest_file_write(int64_t handle, const char *buf_b64,
|
||||
error_setg_win32(errp, GetLastError(), "failed to write to file");
|
||||
slog("guest-file-write-failed, handle: %" PRId64, handle);
|
||||
} else {
|
||||
write_data = g_malloc0(sizeof(GuestFileWrite));
|
||||
write_data = g_new0(GuestFileWrite, 1);
|
||||
write_data->count = (size_t) write_count;
|
||||
}
|
||||
|
||||
@@ -390,11 +392,6 @@ void qmp_guest_file_flush(int64_t handle, Error **errp)
|
||||
}
|
||||
}
|
||||
|
||||
static void guest_file_init(void)
|
||||
{
|
||||
QTAILQ_INIT(&guest_file_state.filehandles);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_QGA_NTDDSCSI
|
||||
|
||||
static STORAGE_BUS_TYPE win2qemu[] = {
|
||||
@@ -865,7 +862,7 @@ static DWORD WINAPI do_suspend(LPVOID opaque)
|
||||
void qmp_guest_suspend_disk(Error **errp)
|
||||
{
|
||||
Error *local_err = NULL;
|
||||
GuestSuspendMode *mode = g_malloc(sizeof(GuestSuspendMode));
|
||||
GuestSuspendMode *mode = g_new(GuestSuspendMode, 1);
|
||||
|
||||
*mode = GUEST_SUSPEND_MODE_DISK;
|
||||
check_suspend_mode(*mode, &local_err);
|
||||
@@ -881,7 +878,7 @@ void qmp_guest_suspend_disk(Error **errp)
|
||||
void qmp_guest_suspend_ram(Error **errp)
|
||||
{
|
||||
Error *local_err = NULL;
|
||||
GuestSuspendMode *mode = g_malloc(sizeof(GuestSuspendMode));
|
||||
GuestSuspendMode *mode = g_new(GuestSuspendMode, 1);
|
||||
|
||||
*mode = GUEST_SUSPEND_MODE_RAM;
|
||||
check_suspend_mode(*mode, &local_err);
|
||||
@@ -1330,5 +1327,4 @@ void ga_command_state_init(GAState *s, GACommandState *cs)
|
||||
if (!vss_initialized()) {
|
||||
ga_command_state_add(cs, NULL, guest_fsfreeze_cleanup);
|
||||
}
|
||||
ga_command_state_add(cs, guest_file_init, NULL);
|
||||
}
|
||||
|
||||
394
qga/commands.c
394
qga/commands.c
@@ -15,6 +15,11 @@
|
||||
#include "qga-qmp-commands.h"
|
||||
#include "qapi/qmp/qerror.h"
|
||||
|
||||
/* Maximum captured guest-exec out_data/err_data - 16MB */
|
||||
#define GUEST_EXEC_MAX_OUTPUT (16*1024*1024)
|
||||
/* Allocation and I/O buffer for reading guest-exec out_data/err_data - 4KB */
|
||||
#define GUEST_EXEC_IO_SIZE (4*1024)
|
||||
|
||||
/* Note: in some situations, like with the fsfreeze, logging may be
|
||||
* temporarilly disabled. if it is necessary that a command be able
|
||||
* to log for accounting purposes, check ga_logging_enabled() beforehand,
|
||||
@@ -51,12 +56,12 @@ static void qmp_command_info(QmpCommand *cmd, void *opaque)
|
||||
GuestAgentCommandInfo *cmd_info;
|
||||
GuestAgentCommandInfoList *cmd_info_list;
|
||||
|
||||
cmd_info = g_malloc0(sizeof(GuestAgentCommandInfo));
|
||||
cmd_info = g_new0(GuestAgentCommandInfo, 1);
|
||||
cmd_info->name = g_strdup(qmp_command_name(cmd));
|
||||
cmd_info->enabled = qmp_command_is_enabled(cmd);
|
||||
cmd_info->success_response = qmp_has_success_response(cmd);
|
||||
|
||||
cmd_info_list = g_malloc0(sizeof(GuestAgentCommandInfoList));
|
||||
cmd_info_list = g_new0(GuestAgentCommandInfoList, 1);
|
||||
cmd_info_list->value = cmd_info;
|
||||
cmd_info_list->next = info->supported_commands;
|
||||
info->supported_commands = cmd_info_list;
|
||||
@@ -64,9 +69,392 @@ static void qmp_command_info(QmpCommand *cmd, void *opaque)
|
||||
|
||||
struct GuestAgentInfo *qmp_guest_info(Error **errp)
|
||||
{
|
||||
GuestAgentInfo *info = g_malloc0(sizeof(GuestAgentInfo));
|
||||
GuestAgentInfo *info = g_new0(GuestAgentInfo, 1);
|
||||
|
||||
info->version = g_strdup(QEMU_VERSION);
|
||||
qmp_for_each_command(qmp_command_info, info);
|
||||
return info;
|
||||
}
|
||||
|
||||
struct GuestExecIOData {
|
||||
guchar *data;
|
||||
gsize size;
|
||||
gsize length;
|
||||
gint closed;
|
||||
bool truncated;
|
||||
const char *name;
|
||||
};
|
||||
typedef struct GuestExecIOData GuestExecIOData;
|
||||
|
||||
struct GuestExecInfo {
|
||||
GPid pid;
|
||||
int64_t pid_numeric;
|
||||
gint status;
|
||||
bool has_output;
|
||||
gint finished;
|
||||
GuestExecIOData in;
|
||||
GuestExecIOData out;
|
||||
GuestExecIOData err;
|
||||
QTAILQ_ENTRY(GuestExecInfo) next;
|
||||
};
|
||||
typedef struct GuestExecInfo GuestExecInfo;
|
||||
|
||||
static struct {
|
||||
QTAILQ_HEAD(, GuestExecInfo) processes;
|
||||
} guest_exec_state = {
|
||||
.processes = QTAILQ_HEAD_INITIALIZER(guest_exec_state.processes),
|
||||
};
|
||||
|
||||
static int64_t gpid_to_int64(GPid pid)
|
||||
{
|
||||
#ifdef G_OS_WIN32
|
||||
return GetProcessId(pid);
|
||||
#else
|
||||
return (int64_t)pid;
|
||||
#endif
|
||||
}
|
||||
|
||||
static GuestExecInfo *guest_exec_info_add(GPid pid)
|
||||
{
|
||||
GuestExecInfo *gei;
|
||||
|
||||
gei = g_new0(GuestExecInfo, 1);
|
||||
gei->pid = pid;
|
||||
gei->pid_numeric = gpid_to_int64(pid);
|
||||
QTAILQ_INSERT_TAIL(&guest_exec_state.processes, gei, next);
|
||||
|
||||
return gei;
|
||||
}
|
||||
|
||||
static GuestExecInfo *guest_exec_info_find(int64_t pid_numeric)
|
||||
{
|
||||
GuestExecInfo *gei;
|
||||
|
||||
QTAILQ_FOREACH(gei, &guest_exec_state.processes, next) {
|
||||
if (gei->pid_numeric == pid_numeric) {
|
||||
return gei;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GuestExecStatus *qmp_guest_exec_status(int64_t pid, Error **err)
|
||||
{
|
||||
GuestExecInfo *gei;
|
||||
GuestExecStatus *ges;
|
||||
|
||||
slog("guest-exec-status called, pid: %u", (uint32_t)pid);
|
||||
|
||||
gei = guest_exec_info_find(pid);
|
||||
if (gei == NULL) {
|
||||
error_setg(err, QERR_INVALID_PARAMETER, "pid");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ges = g_new0(GuestExecStatus, 1);
|
||||
|
||||
bool finished = g_atomic_int_get(&gei->finished);
|
||||
|
||||
/* need to wait till output channels are closed
|
||||
* to be sure we captured all output at this point */
|
||||
if (gei->has_output) {
|
||||
finished = finished && g_atomic_int_get(&gei->out.closed);
|
||||
finished = finished && g_atomic_int_get(&gei->err.closed);
|
||||
}
|
||||
|
||||
ges->exited = finished;
|
||||
if (finished) {
|
||||
/* Glib has no portable way to parse exit status.
|
||||
* On UNIX, we can get either exit code from normal termination
|
||||
* or signal number.
|
||||
* On Windows, it is either the same exit code or the exception
|
||||
* value for an unhandled exception that caused the process
|
||||
* to terminate.
|
||||
* See MSDN for GetExitCodeProcess() and ntstatus.h for possible
|
||||
* well-known codes, e.g. C0000005 ACCESS_DENIED - analog of SIGSEGV
|
||||
* References:
|
||||
* https://msdn.microsoft.com/en-us/library/windows/desktop/ms683189(v=vs.85).aspx
|
||||
* https://msdn.microsoft.com/en-us/library/aa260331(v=vs.60).aspx
|
||||
*/
|
||||
#ifdef G_OS_WIN32
|
||||
/* Additionally WIN32 does not provide any additional information
|
||||
* on whetherthe child exited or terminated via signal.
|
||||
* We use this simple range check to distingish application exit code
|
||||
* (usually value less then 256) and unhandled exception code with
|
||||
* ntstatus (always value greater then 0xC0000005). */
|
||||
if ((uint32_t)gei->status < 0xC0000000U) {
|
||||
ges->has_exitcode = true;
|
||||
ges->exitcode = gei->status;
|
||||
} else {
|
||||
ges->has_signal = true;
|
||||
ges->signal = gei->status;
|
||||
}
|
||||
#else
|
||||
if (WIFEXITED(gei->status)) {
|
||||
ges->has_exitcode = true;
|
||||
ges->exitcode = WEXITSTATUS(gei->status);
|
||||
} else if (WIFSIGNALED(gei->status)) {
|
||||
ges->has_signal = true;
|
||||
ges->signal = WTERMSIG(gei->status);
|
||||
}
|
||||
#endif
|
||||
if (gei->out.length > 0) {
|
||||
ges->has_out_data = true;
|
||||
ges->out_data = g_base64_encode(gei->out.data, gei->out.length);
|
||||
g_free(gei->out.data);
|
||||
ges->has_out_truncated = gei->out.truncated;
|
||||
}
|
||||
|
||||
if (gei->err.length > 0) {
|
||||
ges->has_err_data = true;
|
||||
ges->err_data = g_base64_encode(gei->err.data, gei->err.length);
|
||||
g_free(gei->err.data);
|
||||
ges->has_err_truncated = gei->err.truncated;
|
||||
}
|
||||
|
||||
QTAILQ_REMOVE(&guest_exec_state.processes, gei, next);
|
||||
g_free(gei);
|
||||
}
|
||||
|
||||
return ges;
|
||||
}
|
||||
|
||||
/* Get environment variables or arguments array for execve(). */
|
||||
static char **guest_exec_get_args(const strList *entry, bool log)
|
||||
{
|
||||
const strList *it;
|
||||
int count = 1, i = 0; /* reserve for NULL terminator */
|
||||
char **args;
|
||||
char *str; /* for logging array of arguments */
|
||||
size_t str_size = 1;
|
||||
|
||||
for (it = entry; it != NULL; it = it->next) {
|
||||
count++;
|
||||
str_size += 1 + strlen(it->value);
|
||||
}
|
||||
|
||||
str = g_malloc(str_size);
|
||||
*str = 0;
|
||||
args = g_malloc(count * sizeof(char *));
|
||||
for (it = entry; it != NULL; it = it->next) {
|
||||
args[i++] = it->value;
|
||||
pstrcat(str, str_size, it->value);
|
||||
if (it->next) {
|
||||
pstrcat(str, str_size, " ");
|
||||
}
|
||||
}
|
||||
args[i] = NULL;
|
||||
|
||||
if (log) {
|
||||
slog("guest-exec called: \"%s\"", str);
|
||||
}
|
||||
g_free(str);
|
||||
|
||||
return args;
|
||||
}
|
||||
|
||||
static void guest_exec_child_watch(GPid pid, gint status, gpointer data)
|
||||
{
|
||||
GuestExecInfo *gei = (GuestExecInfo *)data;
|
||||
|
||||
g_debug("guest_exec_child_watch called, pid: %d, status: %u",
|
||||
(int32_t)gpid_to_int64(pid), (uint32_t)status);
|
||||
|
||||
gei->status = status;
|
||||
gei->finished = true;
|
||||
|
||||
g_spawn_close_pid(pid);
|
||||
}
|
||||
|
||||
/** Reset ignored signals back to default. */
|
||||
static void guest_exec_task_setup(gpointer data)
|
||||
{
|
||||
#if !defined(G_OS_WIN32)
|
||||
struct sigaction sigact;
|
||||
|
||||
memset(&sigact, 0, sizeof(struct sigaction));
|
||||
sigact.sa_handler = SIG_DFL;
|
||||
|
||||
if (sigaction(SIGPIPE, &sigact, NULL) != 0) {
|
||||
slog("sigaction() failed to reset child process's SIGPIPE: %s",
|
||||
strerror(errno));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static gboolean guest_exec_input_watch(GIOChannel *ch,
|
||||
GIOCondition cond, gpointer p_)
|
||||
{
|
||||
GuestExecIOData *p = (GuestExecIOData *)p_;
|
||||
gsize bytes_written = 0;
|
||||
GIOStatus status;
|
||||
GError *gerr = NULL;
|
||||
|
||||
/* nothing left to write */
|
||||
if (p->size == p->length) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
status = g_io_channel_write_chars(ch, (gchar *)p->data + p->length,
|
||||
p->size - p->length, &bytes_written, &gerr);
|
||||
|
||||
/* can be not 0 even if not G_IO_STATUS_NORMAL */
|
||||
if (bytes_written != 0) {
|
||||
p->length += bytes_written;
|
||||
}
|
||||
|
||||
/* continue write, our callback will be called again */
|
||||
if (status == G_IO_STATUS_NORMAL || status == G_IO_STATUS_AGAIN) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (gerr) {
|
||||
g_warning("qga: i/o error writing to input_data channel: %s",
|
||||
gerr->message);
|
||||
g_error_free(gerr);
|
||||
}
|
||||
|
||||
done:
|
||||
g_io_channel_shutdown(ch, true, NULL);
|
||||
g_io_channel_unref(ch);
|
||||
g_atomic_int_set(&p->closed, 1);
|
||||
g_free(p->data);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static gboolean guest_exec_output_watch(GIOChannel *ch,
|
||||
GIOCondition cond, gpointer p_)
|
||||
{
|
||||
GuestExecIOData *p = (GuestExecIOData *)p_;
|
||||
gsize bytes_read;
|
||||
GIOStatus gstatus;
|
||||
|
||||
if (cond == G_IO_HUP || cond == G_IO_ERR) {
|
||||
goto close;
|
||||
}
|
||||
|
||||
if (p->size == p->length) {
|
||||
gpointer t = NULL;
|
||||
if (!p->truncated && p->size < GUEST_EXEC_MAX_OUTPUT) {
|
||||
t = g_try_realloc(p->data, p->size + GUEST_EXEC_IO_SIZE);
|
||||
}
|
||||
if (t == NULL) {
|
||||
/* ignore truncated output */
|
||||
gchar buf[GUEST_EXEC_IO_SIZE];
|
||||
|
||||
p->truncated = true;
|
||||
gstatus = g_io_channel_read_chars(ch, buf, sizeof(buf),
|
||||
&bytes_read, NULL);
|
||||
if (gstatus == G_IO_STATUS_EOF || gstatus == G_IO_STATUS_ERROR) {
|
||||
goto close;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
p->size += GUEST_EXEC_IO_SIZE;
|
||||
p->data = t;
|
||||
}
|
||||
|
||||
/* Calling read API once.
|
||||
* On next available data our callback will be called again */
|
||||
gstatus = g_io_channel_read_chars(ch, (gchar *)p->data + p->length,
|
||||
p->size - p->length, &bytes_read, NULL);
|
||||
if (gstatus == G_IO_STATUS_EOF || gstatus == G_IO_STATUS_ERROR) {
|
||||
goto close;
|
||||
}
|
||||
|
||||
p->length += bytes_read;
|
||||
|
||||
return true;
|
||||
|
||||
close:
|
||||
g_io_channel_unref(ch);
|
||||
g_atomic_int_set(&p->closed, 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
GuestExec *qmp_guest_exec(const char *path,
|
||||
bool has_arg, strList *arg,
|
||||
bool has_env, strList *env,
|
||||
bool has_input_data, const char *input_data,
|
||||
bool has_capture_output, bool capture_output,
|
||||
Error **err)
|
||||
{
|
||||
GPid pid;
|
||||
GuestExec *ge = NULL;
|
||||
GuestExecInfo *gei;
|
||||
char **argv, **envp;
|
||||
strList arglist;
|
||||
gboolean ret;
|
||||
GError *gerr = NULL;
|
||||
gint in_fd, out_fd, err_fd;
|
||||
GIOChannel *in_ch, *out_ch, *err_ch;
|
||||
GSpawnFlags flags;
|
||||
bool has_output = (has_capture_output && capture_output);
|
||||
|
||||
arglist.value = (char *)path;
|
||||
arglist.next = has_arg ? arg : NULL;
|
||||
|
||||
argv = guest_exec_get_args(&arglist, true);
|
||||
envp = guest_exec_get_args(has_env ? env : NULL, false);
|
||||
|
||||
flags = G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD;
|
||||
if (!has_output) {
|
||||
flags |= G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL;
|
||||
}
|
||||
|
||||
ret = g_spawn_async_with_pipes(NULL, argv, envp, flags,
|
||||
guest_exec_task_setup, NULL, &pid, has_input_data ? &in_fd : NULL,
|
||||
has_output ? &out_fd : NULL, has_output ? &err_fd : NULL, &gerr);
|
||||
if (!ret) {
|
||||
error_setg(err, QERR_QGA_COMMAND_FAILED, gerr->message);
|
||||
g_error_free(gerr);
|
||||
goto done;
|
||||
}
|
||||
|
||||
ge = g_new0(GuestExec, 1);
|
||||
ge->pid = gpid_to_int64(pid);
|
||||
|
||||
gei = guest_exec_info_add(pid);
|
||||
gei->has_output = has_output;
|
||||
g_child_watch_add(pid, guest_exec_child_watch, gei);
|
||||
|
||||
if (has_input_data) {
|
||||
gei->in.data = g_base64_decode(input_data, &gei->in.size);
|
||||
#ifdef G_OS_WIN32
|
||||
in_ch = g_io_channel_win32_new_fd(in_fd);
|
||||
#else
|
||||
in_ch = g_io_channel_unix_new(in_fd);
|
||||
#endif
|
||||
g_io_channel_set_encoding(in_ch, NULL, NULL);
|
||||
g_io_channel_set_buffered(in_ch, false);
|
||||
g_io_channel_set_flags(in_ch, G_IO_FLAG_NONBLOCK, NULL);
|
||||
g_io_add_watch(in_ch, G_IO_OUT, guest_exec_input_watch, &gei->in);
|
||||
}
|
||||
|
||||
if (has_output) {
|
||||
#ifdef G_OS_WIN32
|
||||
out_ch = g_io_channel_win32_new_fd(out_fd);
|
||||
err_ch = g_io_channel_win32_new_fd(err_fd);
|
||||
#else
|
||||
out_ch = g_io_channel_unix_new(out_fd);
|
||||
err_ch = g_io_channel_unix_new(err_fd);
|
||||
#endif
|
||||
g_io_channel_set_encoding(out_ch, NULL, NULL);
|
||||
g_io_channel_set_encoding(err_ch, NULL, NULL);
|
||||
g_io_channel_set_buffered(out_ch, false);
|
||||
g_io_channel_set_buffered(err_ch, false);
|
||||
g_io_add_watch(out_ch, G_IO_IN | G_IO_HUP,
|
||||
guest_exec_output_watch, &gei->out);
|
||||
g_io_add_watch(err_ch, G_IO_IN | G_IO_HUP,
|
||||
guest_exec_output_watch, &gei->err);
|
||||
}
|
||||
|
||||
done:
|
||||
g_free(argv);
|
||||
g_free(envp);
|
||||
|
||||
return ge;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void ga_command_state_add(GACommandState *cs,
|
||||
void (*init)(void),
|
||||
void (*cleanup)(void))
|
||||
{
|
||||
GACommandGroup *cg = g_malloc0(sizeof(GACommandGroup));
|
||||
GACommandGroup *cg = g_new0(GACommandGroup, 1);
|
||||
cg->init = init;
|
||||
cg->cleanup = cleanup;
|
||||
cs->groups = g_slist_append(cs->groups, cg);
|
||||
@@ -67,7 +67,7 @@ void ga_command_state_cleanup_all(GACommandState *cs)
|
||||
|
||||
GACommandState *ga_command_state_new(void)
|
||||
{
|
||||
GACommandState *cs = g_malloc0(sizeof(GACommandState));
|
||||
GACommandState *cs = g_new0(GACommandState, 1);
|
||||
cs->groups = NULL;
|
||||
return cs;
|
||||
}
|
||||
|
||||
13
qga/main.c
13
qga/main.c
@@ -161,6 +161,12 @@ static gboolean register_signal_handlers(void)
|
||||
g_error("error configuring signal handler: %s", strerror(errno));
|
||||
}
|
||||
|
||||
sigact.sa_handler = SIG_IGN;
|
||||
if (sigaction(SIGPIPE, &sigact, NULL) != 0) {
|
||||
g_error("error configuring SIGPIPE signal handler: %s",
|
||||
strerror(errno));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -945,10 +951,11 @@ static void config_load(GAConfig *config)
|
||||
{
|
||||
GError *gerr = NULL;
|
||||
GKeyFile *keyfile;
|
||||
const char *conf = g_getenv("QGA_CONF") ?: QGA_CONF_DEFAULT;
|
||||
|
||||
/* read system config */
|
||||
keyfile = g_key_file_new();
|
||||
if (!g_key_file_load_from_file(keyfile, QGA_CONF_DEFAULT, 0, &gerr)) {
|
||||
if (!g_key_file_load_from_file(keyfile, conf, 0, &gerr)) {
|
||||
goto end;
|
||||
}
|
||||
if (g_key_file_has_key(keyfile, "general", "daemon", NULL)) {
|
||||
@@ -1082,8 +1089,6 @@ static void config_parse(GAConfig *config, int argc, char **argv)
|
||||
{ NULL, 0, NULL, 0 }
|
||||
};
|
||||
|
||||
config->log_level = G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL;
|
||||
|
||||
while ((ch = getopt_long(argc, argv, sopt, lopt, &opt_ind)) != -1) {
|
||||
switch (ch) {
|
||||
case 'm':
|
||||
@@ -1331,6 +1336,8 @@ int main(int argc, char **argv)
|
||||
GAState *s = g_new0(GAState, 1);
|
||||
GAConfig *config = g_new0(GAConfig, 1);
|
||||
|
||||
config->log_level = G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL;
|
||||
|
||||
module_call_init(MODULE_INIT_QAPI);
|
||||
|
||||
init_dfl_pathnames();
|
||||
|
||||
@@ -930,3 +930,70 @@
|
||||
##
|
||||
{ 'command': 'guest-get-memory-block-info',
|
||||
'returns': 'GuestMemoryBlockInfo' }
|
||||
|
||||
# @GuestExecStatus:
|
||||
#
|
||||
# @exited: true if process has already terminated.
|
||||
# @exitcode: #optional process exit code if it was normally terminated.
|
||||
# @signal: #optional signal number (linux) or unhandled exception code
|
||||
# (windows) if the process was abnormally terminated.
|
||||
# @out-data: #optional base64-encoded stdout of the process
|
||||
# @err-data: #optional base64-encoded stderr of the process
|
||||
# Note: @out-data and @err-data are present only
|
||||
# if 'capture-output' was specified for 'guest-exec'
|
||||
# @out-truncated: #optional true if stdout was not fully captured
|
||||
# due to size limitation.
|
||||
# @err-truncated: #optional true if stderr was not fully captured
|
||||
# due to size limitation.
|
||||
#
|
||||
# Since: 2.5
|
||||
##
|
||||
{ 'struct': 'GuestExecStatus',
|
||||
'data': { 'exited': 'bool', '*exitcode': 'int', '*signal': 'int',
|
||||
'*out-data': 'str', '*err-data': 'str',
|
||||
'*out-truncated': 'bool', '*err-truncated': 'bool' }}
|
||||
##
|
||||
# @guest-exec-status
|
||||
#
|
||||
# Check status of process associated with PID retrieved via guest-exec.
|
||||
# Reap the process and associated metadata if it has exited.
|
||||
#
|
||||
# @pid: pid returned from guest-exec
|
||||
#
|
||||
# Returns: GuestExecStatus on success.
|
||||
#
|
||||
# Since 2.5
|
||||
##
|
||||
{ 'command': 'guest-exec-status',
|
||||
'data': { 'pid': 'int' },
|
||||
'returns': 'GuestExecStatus' }
|
||||
|
||||
##
|
||||
# @GuestExec:
|
||||
# @pid: pid of child process in guest OS
|
||||
#
|
||||
#Since: 2.5
|
||||
##
|
||||
{ 'struct': 'GuestExec',
|
||||
'data': { 'pid': 'int'} }
|
||||
|
||||
##
|
||||
# @guest-exec:
|
||||
#
|
||||
# Execute a command in the guest
|
||||
#
|
||||
# @path: path or executable name to execute
|
||||
# @arg: #optional argument list to pass to executable
|
||||
# @env: #optional environment variables to pass to executable
|
||||
# @input-data: #optional data to be passed to process stdin (base64 encoded)
|
||||
# @capture-output: #optional bool flag to enable capture of
|
||||
# stdout/stderr of running process. defaults to false.
|
||||
#
|
||||
# Returns: PID on success.
|
||||
#
|
||||
# Since: 2.5
|
||||
##
|
||||
{ 'command': 'guest-exec',
|
||||
'data': { 'path': 'str', '*arg': ['str'], '*env': ['str'],
|
||||
'*input-data': 'str', '*capture-output': 'bool' },
|
||||
'returns': 'GuestExec' }
|
||||
|
||||
@@ -69,7 +69,7 @@ for arch in $ARCHLIST; do
|
||||
fi
|
||||
|
||||
# Blacklist architectures which have KVM headers but are actually dead
|
||||
if [ "$arch" = "ia64" ]; then
|
||||
if [ "$arch" = "ia64" -o "$arch" = "mips" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
@@ -77,7 +77,7 @@ for arch in $ARCHLIST; do
|
||||
|
||||
rm -rf "$output/linux-headers/asm-$arch"
|
||||
mkdir -p "$output/linux-headers/asm-$arch"
|
||||
for header in kvm.h kvm_para.h; do
|
||||
for header in kvm.h kvm_para.h unistd.h; do
|
||||
cp "$tmpdir/include/asm/$header" "$output/linux-headers/asm-$arch"
|
||||
done
|
||||
if [ $arch = powerpc ]; then
|
||||
@@ -92,6 +92,9 @@ for arch in $ARCHLIST; do
|
||||
fi
|
||||
if [ $arch = x86 ]; then
|
||||
cp_portable "$tmpdir/include/asm/hyperv.h" "$output/include/standard-headers/asm-x86/"
|
||||
cp "$tmpdir/include/asm/unistd_32.h" "$output/linux-headers/asm-x86/"
|
||||
cp "$tmpdir/include/asm/unistd_x32.h" "$output/linux-headers/asm-x86/"
|
||||
cp "$tmpdir/include/asm/unistd_64.h" "$output/linux-headers/asm-x86/"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
@@ -34,3 +34,4 @@ stub-obj-y += cpus.o
|
||||
stub-obj-y += kvm.o
|
||||
stub-obj-y += qmp_pc_dimm_device_list.o
|
||||
stub-obj-y += target-monitor-defs.o
|
||||
stub-obj-y += vhost.o
|
||||
|
||||
6
stubs/vhost.c
Normal file
6
stubs/vhost.c
Normal file
@@ -0,0 +1,6 @@
|
||||
#include "hw/virtio/vhost.h"
|
||||
|
||||
bool vhost_has_free_slot(void)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -46,6 +46,12 @@ static bool alpha_cpu_has_work(CPUState *cs)
|
||||
| CPU_INTERRUPT_MCHK);
|
||||
}
|
||||
|
||||
static void alpha_cpu_disas_set_info(CPUState *cpu, disassemble_info *info)
|
||||
{
|
||||
info->mach = bfd_mach_alpha_ev6;
|
||||
info->print_insn = print_insn_alpha;
|
||||
}
|
||||
|
||||
static void alpha_cpu_realizefn(DeviceState *dev, Error **errp)
|
||||
{
|
||||
CPUState *cs = CPU(dev);
|
||||
@@ -297,6 +303,8 @@ static void alpha_cpu_class_init(ObjectClass *oc, void *data)
|
||||
cc->get_phys_page_debug = alpha_cpu_get_phys_page_debug;
|
||||
dc->vmsd = &vmstate_alpha_cpu;
|
||||
#endif
|
||||
cc->disas_set_info = alpha_cpu_disas_set_info;
|
||||
|
||||
cc->gdb_num_core_regs = 67;
|
||||
|
||||
/*
|
||||
|
||||
@@ -131,6 +131,12 @@ static void lm32_cpu_reset(CPUState *s)
|
||||
tlb_flush(s, 1);
|
||||
}
|
||||
|
||||
static void lm32_cpu_disas_set_info(CPUState *cpu, disassemble_info *info)
|
||||
{
|
||||
info->mach = bfd_mach_lm32;
|
||||
info->print_insn = print_insn_lm32;
|
||||
}
|
||||
|
||||
static void lm32_cpu_realizefn(DeviceState *dev, Error **errp)
|
||||
{
|
||||
CPUState *cs = CPU(dev);
|
||||
@@ -275,6 +281,7 @@ static void lm32_cpu_class_init(ObjectClass *oc, void *data)
|
||||
cc->gdb_num_core_regs = 32 + 7;
|
||||
cc->gdb_stop_before_watchpoint = true;
|
||||
cc->debug_excp_handler = lm32_debug_excp_handler;
|
||||
cc->disas_set_info = lm32_cpu_disas_set_info;
|
||||
|
||||
/*
|
||||
* Reason: lm32_cpu_initfn() calls cpu_exec_init(), which saves
|
||||
|
||||
@@ -61,6 +61,11 @@ static void m68k_cpu_reset(CPUState *s)
|
||||
tlb_flush(s, 1);
|
||||
}
|
||||
|
||||
static void m68k_cpu_disas_set_info(CPUState *cpu, disassemble_info *info)
|
||||
{
|
||||
info->print_insn = print_insn_m68k;
|
||||
}
|
||||
|
||||
/* CPU models */
|
||||
|
||||
static ObjectClass *m68k_cpu_class_by_name(const char *cpu_model)
|
||||
@@ -208,11 +213,13 @@ static void m68k_cpu_class_init(ObjectClass *c, void *data)
|
||||
#endif
|
||||
cc->cpu_exec_enter = m68k_cpu_exec_enter;
|
||||
cc->cpu_exec_exit = m68k_cpu_exec_exit;
|
||||
cc->disas_set_info = m68k_cpu_disas_set_info;
|
||||
|
||||
dc->vmsd = &vmstate_m68k_cpu;
|
||||
cc->gdb_num_core_regs = 18;
|
||||
cc->gdb_core_xml_file = "cf-core.xml";
|
||||
|
||||
dc->vmsd = &vmstate_m68k_cpu;
|
||||
|
||||
/*
|
||||
* Reason: m68k_cpu_initfn() calls cpu_exec_init(), which saves
|
||||
* the object in cpus -> dangling pointer after final
|
||||
|
||||
@@ -97,6 +97,14 @@ static void mips_cpu_reset(CPUState *s)
|
||||
#endif
|
||||
}
|
||||
|
||||
static void mips_cpu_disas_set_info(CPUState *s, disassemble_info *info) {
|
||||
#ifdef TARGET_WORDS_BIGENDIAN
|
||||
info->print_insn = print_insn_big_mips;
|
||||
#else
|
||||
info->print_insn = print_insn_little_mips;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void mips_cpu_realizefn(DeviceState *dev, Error **errp)
|
||||
{
|
||||
CPUState *cs = CPU(dev);
|
||||
@@ -150,6 +158,7 @@ static void mips_cpu_class_init(ObjectClass *c, void *data)
|
||||
cc->get_phys_page_debug = mips_cpu_get_phys_page_debug;
|
||||
cc->vmsd = &vmstate_mips_cpu;
|
||||
#endif
|
||||
cc->disas_set_info = mips_cpu_disas_set_info;
|
||||
|
||||
cc->gdb_num_core_regs = 73;
|
||||
cc->gdb_stop_before_watchpoint = true;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user