@@ -371,6 +371,16 @@ static inline void *do_lock_user(int type, abi_ulong guest_addr, long len, int c
host area will have the same contents as the guest. */
static inline void *lock_user(int type, abi_ulong guest_addr, long len, int copy)
{
+ if (type == VERIFY_WRITE) {
+ if (copy) {
+ /* 'VERIFY_WRITE' implies read, but only with 'copy' */
+ trace_guest_vmem_user_syscall(current_cpu, guest_addr, len, false);
+ }
+ trace_guest_vmem_user_syscall(current_cpu, guest_addr, len, true);
+ } else {
+ /* should actually read only with 'copy', but a few places do without */
+ trace_guest_vmem_user_syscall(current_cpu, guest_addr, len, false);
+ }
return do_lock_user(type, guest_addr, len, copy);
}
@@ -395,6 +395,16 @@ static inline void *do_lock_user(int type, abi_ulong guest_addr, long len, int c
host area will have the same contents as the guest. */
static inline void *lock_user(int type, abi_ulong guest_addr, long len, int copy)
{
+ if (type == VERIFY_WRITE) {
+ if (copy) {
+ /* 'VERIFY_WRITE' implies read, but only with 'copy' */
+ trace_guest_vmem_user_syscall(current_cpu, guest_addr, len, false);
+ }
+ trace_guest_vmem_user_syscall(current_cpu, guest_addr, len, true);
+ } else {
+ /* should actually read only with 'copy', but a few places do without */
+ trace_guest_vmem_user_syscall(current_cpu, guest_addr, len, false);
+ }
return do_lock_user(type, guest_addr, len, copy);
}
@@ -1903,3 +1903,13 @@ qio_channel_command_wait(void *ioc, int pid, int ret, int status) "Command abort
#
# Targets: TCG(all)
disable vcpu tcg guest_vmem(TCGv vaddr, uint8_t size, uint8_t store) "size=%d store=%d", "vaddr=0x%016"PRIx64" size=%d store=%d"
+
+# @vaddr: Access' virtual address.
+# @size : Access' size (bytes).
+# @store: Whether the access is a store.
+#
+# Similar to 'guest_vmem' event, but raised inside syscall emulation code when
+# running in user-mode.
+#
+# Targets: TCG(all)
+disable vcpu guest_vmem_user_syscall(uint64_t vaddr, uint64_t size, uint8_t store) "vaddr=0x%016"PRIx64" size=%"PRIu64" store=%d"
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> --- bsd-user/qemu.h | 10 ++++++++++ linux-user/qemu.h | 10 ++++++++++ trace-events | 10 ++++++++++ 3 files changed, 30 insertions(+)