qemu linux-user doesn't translate host/target data for iovec I/O
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Expired
|
Undecided
|
Unassigned |
Bug Description
When using iovec I/O functions (like `readv`), no data translation happens. I'm hitting this issue with libevent upon constructing a bufferevent over an inotify descriptor, and then building for either ppc64 or s390x (both big-endian) on x86_64 (little-endian) and running resulting code with qemu-ppc64 or qemu-s390x on Gentoo using latest QEMU version available (5.0.0-r2).
The code in question is in https:/
While `read` syscall is handled properly, `readv` (which libevent is using in my case) doesn't have any logic to call `host_to_
---8<---begin---
case TARGET_NR_read:
if (arg2 == 0 && arg3 == 0) {
return get_errno(
} else {
if (!(p = lock_user(
ret = get_errno(
if (ret >= 0 &&
ret = fd_trans_
}
}
return ret;
...
case TARGET_NR_readv:
{
struct iovec *vec = lock_iovec(
if (vec != NULL) {
ret = get_errno(
} else {
ret = -host_to_
}
}
return ret;
---8<---end---
To reiterate, the issue is not only with `readv` but with other iovec functions as well.
summary: |
- qemu-user doesn't translate host/target data for iovec I/O + qemu linux-user doesn't translate host/target data for iovec I/O |
tags: | added: linux-user |
tags: | added: ppc s390x |
The attached patch fixes the issue for me, but is incomplete (and not thoroughly tested) as I've only implemented inotify data translation for readv syscall.