mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.1-pull-request' into staging
linux-user 20200728 Fix "pgb_reserved_va: Assertion `guest_base != 0' failed." error Fix rt_sigtimedwait() errno Fix getcwd() errno # gpg: Signature made Tue 28 Jul 2020 13:34:11 BST # gpg: using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C # gpg: issuer "laurent@vivier.eu" # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full] # gpg: aka "Laurent Vivier <laurent@vivier.eu>" [full] # gpg: aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full] # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F 5173 F30C 38BD 3F2F BE3C * remotes/vivier2/tags/linux-user-for-5.1-pull-request: linux-user: Use getcwd syscall directly linux-user: Fix syscall rt_sigtimedwait() implementation linux-user: Ensure mmap_min_addr is non-zero Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
+14
-2
@@ -758,14 +758,26 @@ int main(int argc, char **argv, char **envp)
|
||||
|
||||
if ((fp = fopen("/proc/sys/vm/mmap_min_addr", "r")) != NULL) {
|
||||
unsigned long tmp;
|
||||
if (fscanf(fp, "%lu", &tmp) == 1) {
|
||||
if (fscanf(fp, "%lu", &tmp) == 1 && tmp != 0) {
|
||||
mmap_min_addr = tmp;
|
||||
qemu_log_mask(CPU_LOG_PAGE, "host mmap_min_addr=0x%lx\n", mmap_min_addr);
|
||||
qemu_log_mask(CPU_LOG_PAGE, "host mmap_min_addr=0x%lx\n",
|
||||
mmap_min_addr);
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* We prefer to not make NULL pointers accessible to QEMU.
|
||||
* If we're in a chroot with no /proc, fall back to 1 page.
|
||||
*/
|
||||
if (mmap_min_addr == 0) {
|
||||
mmap_min_addr = qemu_host_page_size;
|
||||
qemu_log_mask(CPU_LOG_PAGE,
|
||||
"host mmap_min_addr=0x%lx (fallback)\n",
|
||||
mmap_min_addr);
|
||||
}
|
||||
|
||||
/*
|
||||
* Prepare copy of argv vector for target.
|
||||
*/
|
||||
|
||||
@@ -388,14 +388,7 @@ static bitmask_transtbl fcntl_flags_tbl[] = {
|
||||
{ 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static int sys_getcwd1(char *buf, size_t size)
|
||||
{
|
||||
if (getcwd(buf, size) == NULL) {
|
||||
/* getcwd() sets errno */
|
||||
return (-1);
|
||||
}
|
||||
return strlen(buf)+1;
|
||||
}
|
||||
_syscall2(int, sys_getcwd1, char *, buf, size_t, size)
|
||||
|
||||
#ifdef TARGET_NR_utimensat
|
||||
#if defined(__NR_utimensat)
|
||||
@@ -8868,7 +8861,9 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
|
||||
unlock_user(p, arg1, 0);
|
||||
if (arg3) {
|
||||
puts = &uts;
|
||||
target_to_host_timespec(puts, arg3);
|
||||
if (target_to_host_timespec(puts, arg3)) {
|
||||
return -TARGET_EFAULT;
|
||||
}
|
||||
} else {
|
||||
puts = NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user