From patchwork Wed Oct 18 12:33:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 116281 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp6015227qgn; Wed, 18 Oct 2017 05:36:53 -0700 (PDT) X-Received: by 10.55.157.78 with SMTP id g75mr1962739qke.347.1508330213053; Wed, 18 Oct 2017 05:36:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508330213; cv=none; d=google.com; s=arc-20160816; b=uqdnk6tRDeY7TnfkNb1fQ60eFCp/xE4uaYxhU7eKlcUI4mkywBwFLpUUkjLnNVfc39 /Ds6ZPBM3QNBhH8+RW4bhiHqHR4JGpT72i/qU1z7QoVwlg9AiauKNh4oA/lxbi/MzAcu mr9NkGVz9iEBmXze5o00FGaMymzGRAHWAr0Ca7y4tQyH3RUPSjpfvTTSHVETbeO1iIV6 RPU3Qx2L3N4gOgZO/SsIaK1ZG1OfRmKAmq3GasIzH7qRq2Knqhi4ixR61L4V5iRjjLf+ AuMcF3H6eBUKid/+wootrm5UJ1H5Oq4opK8DiIajR4TqC+BRDIYIlVPr+DWpp6Hqnx3k eu5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=db+Q/UGdtGY7xkcnoAu57nku9CX0VOQRh3/g7TLmeDk=; b=iFjY0jErLBhFGHFwZL9+N4Sk/Go/UfXYydRk9LkByoT/ewNmnjrqG0T1u7xdUBGi+D 5inxFPIpLutosUWbFwcsbKjJiOMjJ5OCN/58tu+WgDUEdTGu7T2DEi4ew0G7UlvY3t9K X4C696/Z6G9hqQiTtuIXZJFexTq33dYHvgi+v2H7W0SvsQRliVRe8rmPrFITlv2tjgWo v+q41j7+KCft+eoiDwQ7myCMwwZVcVZY0mwjnKWuXOOmhx3lodlI1izbAxCYhPA6BuYX RSBO8fr3YpaNunkVRdH9mEM4HTSiwRMfwryQeL5DvD4UHBNWD9c9fgxuQPfFaDrOWfz3 gwOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jfpyZ1fH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id c49si3718917qta.389.2017.10.18.05.36.52 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 18 Oct 2017 05:36:53 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jfpyZ1fH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44443 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nad-0007Rw-29 for patch@linaro.org; Wed, 18 Oct 2017 08:36:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nXU-0005C6-HZ for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4nXO-0003ss-Mj for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:35 -0400 Received: from mail-lf0-x22c.google.com ([2a00:1450:4010:c07::22c]:44717) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4nXO-0003sM-FB for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:30 -0400 Received: by mail-lf0-x22c.google.com with SMTP id 75so5619267lfx.1 for ; Wed, 18 Oct 2017 05:33:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=db+Q/UGdtGY7xkcnoAu57nku9CX0VOQRh3/g7TLmeDk=; b=jfpyZ1fH3ax9Y+ALwWgUTdhPbuzkOP7THR0Vmzoy+YIqP7604LX4PlbFm8WInywTSJ 2KXc+EtKfAlOV3+K6hvCvVIUc85E7E9UXDeEBzkHQbdwv5kzqXDgvhRx/GoCW4zxs8Hy O/f2hAyHNec6vBMrmFl0RGlxh26TFvDTyPU7k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=db+Q/UGdtGY7xkcnoAu57nku9CX0VOQRh3/g7TLmeDk=; b=IryG2XSxC6Gxu/stm5SKaQUiwLSJP91fXCy4F0giirxaH4txI2bbZ23oRmo+VU8JeX tkRUozNNMJD9mmT8oF1wQiC9hUMQyH9w+AnbnuJzp2SnTRM+IUfD8Krc7SSRz37TNqFF m5fbzgYpIYp/PQZmdSR4aK+wmEwc4qwcpjfiZ9FBhWU7WRshPgUL4Q7X+OMclXdjrrM0 Aowsxbsp3DgrRxeBfvajaNxX4rbzdE/cr5V1JfV3jzirXK5584HyTxz7kYNkayYizz6t 0VR0R+47l6HbUozG8+kOv5DJ8kSQS7rZA9qNcMsIVUkyb+EKyBDoXoLuROZ1tIg+eRhk 6pPA== X-Gm-Message-State: AMCzsaUGMHnRWT8FGdxW7vOs2b9B5Z+5c8lFva3Z16ObrDPtu6zxzS/v jB3yMgSwEpMv1DkplVcY06IWDtKmpBk= X-Google-Smtp-Source: ABhQp+TFvTU0y1AXHgtn2HchclQq9vidvgNha8IEALeyp5aUPa3o63sv4uSCcyFYfXXVe9LGynSrNA== X-Received: by 10.46.92.199 with SMTP id q190mr2404874ljb.88.1508330008846; Wed, 18 Oct 2017 05:33:28 -0700 (PDT) Received: from berserk.kos.to (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id j71sm2590718lfk.6.2017.10.18.05.33.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Oct 2017 05:33:27 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 18 Oct 2017 15:33:15 +0300 Message-Id: <5f9cee46cd4ec4600e1a2fdcca20adcf30348f9e.1508329282.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::22c Subject: [Qemu-devel] [PULL 01/10] linux-user: fix O_TMPFILE handling X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Riku Voipio Since O_TMPFILE might differ between guest and host, add it to the bitmask_transtbl. While at it, fix the definitions of O_DIRECTORY etc which should arm32 according to kernel sources. This fixes open14 and openat03 ltp testcases. Fixes: https://bugs.launchpad.net/qemu/+bug/1709170 --- linux-user/strace.c | 4 ++++ linux-user/syscall.c | 3 +++ linux-user/syscall_defs.h | 8 +++++++- 3 files changed, 14 insertions(+), 1 deletion(-) -- 2.14.2 diff --git a/linux-user/strace.c b/linux-user/strace.c index d821d165ff..bd897a3f20 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -837,6 +837,10 @@ UNUSED static struct flags open_flags[] = { #endif #ifdef O_PATH FLAG_TARGET(O_PATH), +#endif +#ifdef O_TMPFILE + FLAG_TARGET(O_TMPFILE), + FLAG_TARGET(__O_TMPFILE), #endif FLAG_END, }; diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 9b6364a266..08fbc4d5f7 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -341,6 +341,9 @@ static bitmask_transtbl fcntl_flags_tbl[] = { #endif #if defined(O_PATH) { TARGET_O_PATH, TARGET_O_PATH, O_PATH, O_PATH }, +#endif +#if defined(O_TMPFILE) + { TARGET_O_TMPFILE, TARGET_O_TMPFILE, O_TMPFILE, O_TMPFILE }, #endif /* Don't terminate the list prematurely on 64-bit host+guest. */ #if TARGET_O_LARGEFILE != 0 || O_LARGEFILE != 0 diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 40c5027e93..6e2287e918 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -2416,7 +2416,7 @@ struct target_statfs64 { #define TARGET_O_CLOEXEC 010000000 #define TARGET___O_SYNC 000100000 #define TARGET_O_PATH 020000000 -#elif defined(TARGET_ARM) || defined(TARGET_M68K) +#elif defined(TARGET_ARM) || defined(TARGET_M68K) || defined(TARGET_AARCH64) #define TARGET_O_DIRECTORY 040000 /* must be a directory */ #define TARGET_O_NOFOLLOW 0100000 /* don't follow links */ #define TARGET_O_DIRECT 0200000 /* direct disk access hint */ @@ -2513,6 +2513,12 @@ struct target_statfs64 { #ifndef TARGET_O_PATH #define TARGET_O_PATH 010000000 #endif +#ifndef TARGET___O_TMPFILE +#define TARGET___O_TMPFILE 020000000 +#endif +#ifndef TARGET_O_TMPFILE +#define TARGET_O_TMPFILE (TARGET___O_TMPFILE | TARGET_O_DIRECTORY) +#endif #ifndef TARGET_O_NDELAY #define TARGET_O_NDELAY TARGET_O_NONBLOCK #endif From patchwork Wed Oct 18 12:33:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 116282 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp6015324qgn; Wed, 18 Oct 2017 05:36:58 -0700 (PDT) X-Received: by 10.237.34.201 with SMTP id q9mr2774112qtc.198.1508330218724; Wed, 18 Oct 2017 05:36:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508330218; cv=none; d=google.com; s=arc-20160816; b=lFpoy0J+cVEQ/AXty1+qIYDCvMJNtDQNlPEr2GVXfVhi/kzfvMsw3Og+yLGAGJGiup Zf8xZuHcQOvzf6oUsC0HFn+p4ZxE3qmW9mGZXDJ8u9hjh0L3DjyK8k2rrThHfRkhE/zT O1HavPVhDt8l12SZud+0Qs2D0aSD8iadlhSwoNtTTE3q84DkmQZzWZXyLU8pAwq7JfHb QexIcMJNA9WQCsd5Ex/u38Jrzp0tNYook/lahILHujcq67qKq2tFKeCOmlXYyQRDLpbP nHOmf7dJhcdVBYdj8atmMb32uXE0F+tPTVp9W85SeHyruZ4Xj5MpcV5MQ7z8PWLWe/B2 z7xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=bUXOiLG8Tv+ZHWbTyJCUj0N5aeCUWKqiqSz0cVZvEfs=; b=Yk+BRBI81QGn38n8G6ftfW4+sO8DSUaASljWkFL+KvoHBa3R8LrNmDfKI556a6F37a 2riesHTuczyrIWqUdsnbdhGyuj9IW9Mu1dE8r7ZNvzUFpqJJi3BAKRDzgH7v+rICYGy6 E9zlWe88rAVskownhmaUZGzishZbEYRL4BuyIsC7koiAG6VdSL0bBjZKI9/xmK1eOjYu pDcvNBjedM2Nve8g9Wng+gYtCZhQP8iLUL2sSnghbLRAH8vY2lOf+1O23fQAt2QX9MV4 dAWMPysFWNa3k3HL5j6pCYdhQ9dJfgJ1RV8XxqGeMXKyHfKW6AtTJK5ko3YpUrri7yVt IKDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=QkktoTJn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id x28si4189810qtx.41.2017.10.18.05.36.58 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 18 Oct 2017 05:36:58 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=QkktoTJn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44441 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nai-0007Gq-Lf for patch@linaro.org; Wed, 18 Oct 2017 08:36:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nXU-0005C7-Hb for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4nXQ-0003tU-6S for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:35 -0400 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]:49430) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4nXP-0003t2-Uv for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:32 -0400 Received: by mail-lf0-x243.google.com with SMTP id w21so5625554lfc.6 for ; Wed, 18 Oct 2017 05:33:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bUXOiLG8Tv+ZHWbTyJCUj0N5aeCUWKqiqSz0cVZvEfs=; b=QkktoTJnsPxjdn619RDOksfDL4kYXwawZHriGHiv3RbGLEq9NipaaglUZJqzqdJBAa Lap2n6wx0hwk94jZwWD+qxMGhPLk585Ivi6tEghus4SELuv6mWMmeE42S4dMpkuvtuJn w+h/nndeoSS93IMXx+lJKSYQ5257Nli6cSH6c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bUXOiLG8Tv+ZHWbTyJCUj0N5aeCUWKqiqSz0cVZvEfs=; b=emjMJPia0UGvNQQiUa3MUBJ9k4ZbyHeGYcJpnrkZ97B+v69s6XMt8qOwTZDn1Dtm8s ARWviZGB0o4SIn5V6lCeOi45jFcIecauCd71qSa/tsKeSns5pz8a7JlxIr/BPGXG12SA /W5nCja9HfV9qLoN7pbiS0xGYYQcrmJVez3gIyRKEaXAbpFhS5mbyDl4V6iuBfXOScED +92lgszKts0jNDQfh1dfkzlxDsCbrx38Do5j+6l0nT2ov+Jr6QDenZH09XFz9QMvd8Y3 SYgdZtjo87Xnw6Ay+ZW191TsjwgI7I0eBUAqN8j7MO1B30OM/w2WHSOLtlMB0JOBVP4O i9Gw== X-Gm-Message-State: AMCzsaVIlFbsi2TIcj7FNAhWT04BWL6LrYG35htxXIKgwcECf9TniHbB b4bcjymUQ6ficcxnpL15Az0oHFc3yMg= X-Google-Smtp-Source: ABhQp+Qb5A4VCx6afPqRAaGjQ7FjzOEELCRQ9YVL4Uola/qVJ5twDeRGyAfRPFcVTEy6x9vVMakngw== X-Received: by 10.46.69.6 with SMTP id s6mr2327366lja.76.1508330010399; Wed, 18 Oct 2017 05:33:30 -0700 (PDT) Received: from berserk.kos.to (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id j71sm2590718lfk.6.2017.10.18.05.33.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Oct 2017 05:33:29 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 18 Oct 2017 15:33:16 +0300 Message-Id: X-Mailer: git-send-email 2.14.2 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::243 Subject: [Qemu-devel] [PULL 02/10] target/m68k, linux-user: manage FP registers in ucontext X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Laurent Vivier Signed-off-by: Laurent Vivier Reviewed-by: Richard Henderson Signed-off-by: Riku Voipio --- linux-user/signal.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) -- 2.14.2 diff --git a/linux-user/signal.c b/linux-user/signal.c index cc0c3fcee9..7a238aaea1 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -5704,6 +5704,24 @@ give_sigsegv: force_sigsegv(sig); } +static inline void target_rt_save_fpu_state(struct target_ucontext *uc, + CPUM68KState *env) +{ + int i; + target_fpregset_t *fpregs = &uc->tuc_mcontext.fpregs; + + __put_user(env->fpcr, &fpregs->f_fpcntl[0]); + __put_user(env->fpsr, &fpregs->f_fpcntl[1]); + /* fpiar is not emulated */ + + for (i = 0; i < 8; i++) { + uint32_t high = env->fregs[i].d.high << 16; + __put_user(high, &fpregs->f_fpregs[i * 3]); + __put_user(env->fregs[i].d.low, + (uint64_t *)&fpregs->f_fpregs[i * 3 + 1]); + } +} + static inline int target_rt_setup_ucontext(struct target_ucontext *uc, CPUM68KState *env) { @@ -5730,9 +5748,32 @@ static inline int target_rt_setup_ucontext(struct target_ucontext *uc, __put_user(env->pc, &gregs[16]); __put_user(sr, &gregs[17]); + target_rt_save_fpu_state(uc, env); + return 0; } +static inline void target_rt_restore_fpu_state(CPUM68KState *env, + struct target_ucontext *uc) +{ + int i; + target_fpregset_t *fpregs = &uc->tuc_mcontext.fpregs; + uint32_t fpcr; + + __get_user(fpcr, &fpregs->f_fpcntl[0]); + cpu_m68k_set_fpcr(env, fpcr); + __get_user(env->fpsr, &fpregs->f_fpcntl[1]); + /* fpiar is not emulated */ + + for (i = 0; i < 8; i++) { + uint32_t high; + __get_user(high, &fpregs->f_fpregs[i * 3]); + env->fregs[i].d.high = high >> 16; + __get_user(env->fregs[i].d.low, + (uint64_t *)&fpregs->f_fpregs[i * 3 + 1]); + } +} + static inline int target_rt_restore_ucontext(CPUM68KState *env, struct target_ucontext *uc) { @@ -5764,6 +5805,8 @@ static inline int target_rt_restore_ucontext(CPUM68KState *env, __get_user(temp, &gregs[17]); cpu_m68k_set_ccr(env, temp); + target_rt_restore_fpu_state(env, uc); + return 0; badframe: From patchwork Wed Oct 18 12:33:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 116279 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp6012422qgn; Wed, 18 Oct 2017 05:34:05 -0700 (PDT) X-Received: by 10.200.63.167 with SMTP id d36mr2898120qtk.7.1508330045871; Wed, 18 Oct 2017 05:34:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508330045; cv=none; d=google.com; s=arc-20160816; b=aVkwiKfVEi4RCcuUhPx0m6f8ZRYkulIo1NHLTnqe/xF3lSGQnUtdqF5ebwPbJUMZ6u EI5l1T4HByxiYAdhSgWxaxW7P/bWwzuFmWrLOKwb+5i64y9vNAZjyafuqAScw9iRa8qT VCENPfQ6KsD5y62mvcydEkePaaVqQDW7VowX/ySbGDHfrARR4r//GWzqLm9mJNGSr8it ChPaQurDd9fHsHEYH8POkpEoA7QyDVtVC1I7ToWN+Q6IO3UIoicnSn5zgaKc4GFICZBA uEIzCdLcbhy+P0Bz7KwV1kdzvMCpbUdTaOge08JmnROQ+V1w6Vc5A+rtVk+ldQin5GNH r/7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=+ic+fN5ueOJRZSfSeYN5dPa9ZrESi0KlL6vl+G8U2pY=; b=dulJvQFwTY7BE3TCACn04XFUbkPAA3N9PCsSoZtXBqf+TK1hn08qZeQ5jaf7w5H0Z5 n18mCe0r0s6BANiUnUFOO4t+IBY1RXWJDB3MSRh/Xdor5LwpFX+7M3EPqHzjGmrUbyKV CmqYNfbjl6GXgwWPX9sbLKqPdDArcY3FfuDQsObmAcnU25t9UzZE+ej/56Jcb+3Kxasu qwl1K/CXLP65Pu3kVMk7T0XbAdgUjxZT1tntXa6pE7F/R4kOlwFvOoWfYr86EO0iHtqf dwE6TQTP7OWixKngFRDwG3EuUQE3nJtUW0Yd5WzXMcRTCUhW/f67pXn7y9hDSagmDjuE rXdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SONW3G0S; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id i48si6650244qta.66.2017.10.18.05.34.05 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 18 Oct 2017 05:34:05 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SONW3G0S; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44429 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nXv-0005EK-Nv for patch@linaro.org; Wed, 18 Oct 2017 08:34:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nXU-0005C9-Hm for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4nXR-0003uJ-Di for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:35 -0400 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:49430) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4nXR-0003te-6m for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:33 -0400 Received: by mail-lf0-x244.google.com with SMTP id w21so5625622lfc.6 for ; Wed, 18 Oct 2017 05:33:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+ic+fN5ueOJRZSfSeYN5dPa9ZrESi0KlL6vl+G8U2pY=; b=SONW3G0So/MHLy1ZMHsbmYd+EW08drGQStRw+U8Y/ZoQnPcjfme0aSCAcsFLfEiH1o 2HuFTk8jKZI9sPfsv3fogiTpHIdacrkx7pEd/ni+yKTwb/HKnG5VEBJTHW9BjpuJslwl ysj7D2g+pX0Xz88+u1QqFaE6enoSjiuV+6vf0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+ic+fN5ueOJRZSfSeYN5dPa9ZrESi0KlL6vl+G8U2pY=; b=t8qdZJrA7aQ8Q4NFbyyLfw9HZ124/bYuAHJYAUv6QF1JXmk0Z5H7cFW+MgpRBA1NSV DEI6u5rx41BUOXyAvvVkyXw1ShgcEjGkplLec6F5NnKTrD3XPbAsk2fsOLnHUhEmeT8M PXEk5Le5UbJNiTQeflTpv+U2+CokWRFnfI6YSLkVTZBjF3CIWKiU0nBsWECR7N0cSnVm sn5tQFKXCf0sL7u3CyF7m0PesArOwEfJqdUtvsbWFtLiz9+br56BsAmTPZ5NwcIzF5sJ FppxHFa38Iti+iI6C0vc9ic9u92ob8Y4uyyn2XBj2OAtsFS16CfqZ+Wu5ZeRDmNyu0Es bK1Q== X-Gm-Message-State: AMCzsaUIrHOfgO8yFJjclq9gqSNIlxDpKek42Uot6pQpNL8G8rjQ5NMj 75nocQ1tMjLXeMuJtLU1jWXGBHCaH+o= X-Google-Smtp-Source: ABhQp+TfusgxD8NUmmMEf+2YmK8+rLzbuxv5Lcfqad5rpYgTlu9+cJoa1sXtKFNAJ0GbaJUSvP1QJw== X-Received: by 10.46.95.19 with SMTP id t19mr2479392ljb.2.1508330011740; Wed, 18 Oct 2017 05:33:31 -0700 (PDT) Received: from berserk.kos.to (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id j71sm2590718lfk.6.2017.10.18.05.33.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Oct 2017 05:33:30 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 18 Oct 2017 15:33:17 +0300 Message-Id: X-Mailer: git-send-email 2.14.2 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::244 Subject: [Qemu-devel] [PULL 03/10] linux-user: remove duplicate break in syscall X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Carlo Marcelo Arenas Belón likely introduced in 3532fa7402cda16f7b95261b0339c58630051f0b Signed-off-by: Carlo Marcelo Arenas Belón Reviewed-by: Laurent Vivier Signed-off-by: Riku Voipio --- linux-user/syscall.c | 1 - 1 file changed, 1 deletion(-) -- 2.14.2 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 08fbc4d5f7..a25bbffd16 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -3134,7 +3134,6 @@ set_timeout: case TARGET_SO_RCVLOWAT: optname = SO_RCVLOWAT; break; - break; default: goto unimplemented; } From patchwork Wed Oct 18 12:33:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 116284 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp6017010qgn; Wed, 18 Oct 2017 05:38:54 -0700 (PDT) X-Received: by 10.55.17.33 with SMTP id b33mr2195137qkh.58.1508330334575; Wed, 18 Oct 2017 05:38:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508330334; cv=none; d=google.com; s=arc-20160816; b=SP36+kbEpBYTNJM9tRDbtpE+c31cRxz9ur8GoedL2pRbn8RO9aRk6pjbuGX8/8jSqb rOS77gb5dkHWEARmoM3+XF/QWHMDJWI61yTY5BIJqYt1TU/nselW24LtJqKFpJDivW13 pOXvK/IMg9BVYQPG7/ceNbD7X+FlTEfsoU5fP8+XPogH0BgdSgvh3vvY701Dpiubl/SH K/pewkcgT0OQDzzj2lqyGYGPKahTe3+04yDihCdIw9bMXuNfiY9alrDWdhfoLPQC/jV5 Okm0QIZICGwrcfJvp/9RY/c9TOoXNfXKdlW99hPsFYLA/9XJHaqK8kbax+T1xhWZTO3x TtDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=gUAeEh9wE+ojaTv6GqbhCwzU/vQr1pJisavwD3/RGww=; b=cG4i/bLFFR+xodRe35SveOMWPpBL15Witeb7w+2qG9XqF12jltuEF4pezuQeMw7SKl gdv8ykHh2lF66zJbhrL66d4E8Hi+sTjt+nHRa1UzOPypIZAdPbRNTs6FfKfuO+GOUPUf iy2F7fEXSv9TNh0VsrMsstJAnrvGk9WeG5Gjq8VnfGVyITg6jugTSoRz1DuS5+8QpB3q e2Pgz7t6ps5sFnDej03foY1hHkmFDTjOGFNYBPtqmOkwQ5GB4RrLFcY8CC3cweTH8zlS WrEWncvAhk4X9lccsbxzI4SRrhhW0Gut7kb4K2LokTb1eCTs5p4BtnFUbeVoxWgK2N57 3vsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=VaHAXOwS; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id b29si3988165qta.377.2017.10.18.05.38.54 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 18 Oct 2017 05:38:54 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=VaHAXOwS; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44447 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nca-0000Mj-Ga for patch@linaro.org; Wed, 18 Oct 2017 08:38:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nXW-0005Do-TA for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4nXS-0003vp-UP for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:38 -0400 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]:52727) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4nXS-0003vB-N5 for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:34 -0400 Received: by mail-lf0-x243.google.com with SMTP id b190so5601045lfg.9 for ; Wed, 18 Oct 2017 05:33:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gUAeEh9wE+ojaTv6GqbhCwzU/vQr1pJisavwD3/RGww=; b=VaHAXOwSxhRWFO4I8wLlFPLJLzaRpVAdUEgN2ZJ6H5GOa3moYx5DPEPtLi3ZdBaUxR Ft7XHi8+zcJTRjLHPxTv54FUtKo6B7k6blx0jXbFwxop4i+43IpLx8BRZhT6bh2SiyOx IfJzH0sXyUo4GWIWf7SUmeS5efkDN7fWCwtSA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gUAeEh9wE+ojaTv6GqbhCwzU/vQr1pJisavwD3/RGww=; b=g21f2WCsmHDsHneuW/pbUsMqCrz0zQf3GGbwQB33YDGw75ErdiYMngm0Ed/QS2Y0E8 zXYKqe7qCgnSaXNE3EeO3UV6gx5xkGDGTyjqpvBYVkgE5+IZOm8w06b2xIqnoHJ2Zy/3 kGhhA4vh/E3EilP8Ka3cmo6jPNqeFaEtig0XAwlP/o/UnVTCD8Va0EZF0i3fd1J2FVvd bC4abjdiuTxC1ThERKfdH/dncKYwdEEFUJWm3y/OCowJRhOeVO1qTbDy920i8C6/1iq7 BqTsUPx8jBkmbhJhYgqI9Qas6tg133F/7CmH4SwYIuD1E9NbvJV+gl57r/cuGv6Nb35p AyHg== X-Gm-Message-State: AMCzsaWQbwECUJ8oY7HbO1zWHFRC5TIxO6qIM5i1klgX8cRt1jWKgnPt tYTTZaJg/INmmYDXYSx+awy5rxnxikE= X-Google-Smtp-Source: ABhQp+TafHsnVMH5jKGZzpKy9S5u/cXt0NbT38oQQsvIjHwmSvAIY3I1BKBTb9kBcOlqaZv6IwMgRw== X-Received: by 10.46.70.18 with SMTP id t18mr2346143lja.148.1508330013238; Wed, 18 Oct 2017 05:33:33 -0700 (PDT) Received: from berserk.kos.to (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id j71sm2590718lfk.6.2017.10.18.05.33.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Oct 2017 05:33:31 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 18 Oct 2017 15:33:18 +0300 Message-Id: X-Mailer: git-send-email 2.14.2 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::243 Subject: [Qemu-devel] [PULL 04/10] linux-user: Allow -R values up to 0xffff0000 for 32-bit ARM guests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell The 32-bit ARM validate_guest_space() check tests whether the specified -R value leaves enough space for us to put the commpage in at 0xffff0f00. However it was incorrectly doing a <= check for the check against (guest_base + guest_size), which meant that it wasn't permitting the guest space to butt right up against the commpage. Fix the comparison, so that -R values all the way up to 0xffff0000 work correctly. Reviewed-by: Emilio G. Cota Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- linux-user/elfload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.14.2 diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 79062882ba..3b857fbc9c 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -377,7 +377,7 @@ static int validate_guest_space(unsigned long guest_base, * then there is no way we can allocate it. */ if (test_page_addr >= guest_base - && test_page_addr <= (guest_base + guest_size)) { + && test_page_addr < (guest_base + guest_size)) { return -1; } From patchwork Wed Oct 18 12:33:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 116283 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp6016130qgn; Wed, 18 Oct 2017 05:37:54 -0700 (PDT) X-Received: by 10.200.48.103 with SMTP id g36mr2718514qte.289.1508330274865; Wed, 18 Oct 2017 05:37:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508330274; cv=none; d=google.com; s=arc-20160816; b=uNURSNjuJna011frgXeLnsmYlrya2VM5arI4t4BdiAVWWUtM0baB+oHFhoIySg2SDh Ev2VoCwXqVyzIPwAIWp6rkPFNqMvgyDBSN6TulQZQbEleM29cZ55G0h8HjjJECe2jAM7 2qomRta0fR5GLWJdpsoNds+2/MXmaytQEuRqpkHkV6mgxhtVw+7uQgNsAqPhJVSxnmPz +CVPzvwyd8Nhh97Ov4uCGpS4KN/3iBKgKStxN7Kh0P2dynUdi5h5T6HbjD79TMyz7pJn pXoclRLsmyja/+lFJrkvL9X0N0J+TwxNaBoK37QoOarKXh3j0kFmgD0zCAQcsDww7V7z /gzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=/g52S3gQHjUWSaEKKe6eKfm3KBTEVMilKCG42SLZ9IY=; b=UD/stFS3AEbH0CFi0fTBY1IjO9TpeB0F0niiN6cWLDKOW+FfqP3X1PbnMTecJ0W0ze FLeGxTwoC/nWDNWwsRiQaOrMteR6Eqm9LwpL20km2GwRMa49pZd5JN5OA0JuzCHJ5KTj T2tzyGD82zUNFjPYsCN5p/JOBHWTMLrHR6DqZSu9UlerbLX99lgYi/5d1G7L2Byinonx xNG28iFNL+4f/wdJmBIOlYsJZRH19BOM3m1wkbtO5Tkud+QQNYgVZo6Tqusi3BPfsfTD uAO4TUTj4I0WxWnfnPtMohsJEvo8XVAoIG3t0VqO2d6Gq6ANt7YwIMm9rBJSJF/+Njen NNag== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iolxd6Ki; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id h42si10751440qta.91.2017.10.18.05.37.54 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 18 Oct 2017 05:37:54 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iolxd6Ki; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44445 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nbc-0008Df-Pw for patch@linaro.org; Wed, 18 Oct 2017 08:37:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nXV-0005Cq-F7 for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4nXU-0003wR-JL for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:37 -0400 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]:48470) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4nXU-0003w8-BB for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:36 -0400 Received: by mail-lf0-x243.google.com with SMTP id a69so5627118lfe.5 for ; Wed, 18 Oct 2017 05:33:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/g52S3gQHjUWSaEKKe6eKfm3KBTEVMilKCG42SLZ9IY=; b=iolxd6KiEKBM1O8tzHZkMijJHN/TVPgv7cFZyCkhFSM1nghPKsHD/Bbjgm3EAtvQrE nMS+5ZgRI6Da7SkFhDumwf7A88IqusdUD7hyRauKMfvFJn9Eigyd9gv6gMrRrvhubmnW h0RmdMylsa76MixQg7gEgKzKST1YfdPVeC5Ic= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/g52S3gQHjUWSaEKKe6eKfm3KBTEVMilKCG42SLZ9IY=; b=OmDfzpnjRqkFJYx70WG3FbgvJzUyp4m5989H5BdE7zlAjcqZaKk168iyTfoNHE2x/i 3D6P8qVhdgDmjlBEzU8Pc7jmdC7z6mlTIa3xDjgHZMbYgNpHmgeV6nGuuJEC3XcoesY3 L8WVSvna5Q2ZsKtkb3vHISbDJVji6XmvImiO8vRfgQ3om5xmkAOx3Wr6mUBM3p4n6zax RskkY6nvsyGcvi/e9y5plt4vv03oONpeCj0a0ZPmTseFAnpnAoFbyvMF+qVOeqOdX8c9 wZUO7iwLjUZQc6bhJGHgjetkHt99HfdiW9zCECvM4vRQM3l+lzra2w01i2aWwKSNwc/e m0oA== X-Gm-Message-State: AMCzsaVaQc1r4N/yTIsWx9CcZQA4pHUupoEOePasTV/OGfI9v2aj5hqS J1gp/c30CEirWDFh9z3iKIeJ9JbZxdg= X-Google-Smtp-Source: ABhQp+RbptEvSMg1e3lkJogwcqnnEAbnuAfVR3XMUD4sxWU0XE2PuccvGye2VioRCm4bmxtpm11DeQ== X-Received: by 10.46.19.18 with SMTP id 18mr2630918ljt.141.1508330014639; Wed, 18 Oct 2017 05:33:34 -0700 (PDT) Received: from berserk.kos.to (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id j71sm2590718lfk.6.2017.10.18.05.33.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Oct 2017 05:33:33 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 18 Oct 2017 15:33:19 +0300 Message-Id: X-Mailer: git-send-email 2.14.2 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::243 Subject: [Qemu-devel] [PULL 05/10] tcg: Fix off-by-one in assert in page_set_flags X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Most of the users of page_set_flags offset (page, page + len) as the end points. One might consider this an error, since the other users do supply an endpoint as the last byte of the region. However, the first thing that page_set_flags does is round end UP to the start of the next page. Which means computing page + len - 1 is in the end pointless. Therefore, accept this usage and do not assert when given the exact size of the vm as the endpoint. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20170708025030.15845-2-rth@twiddle.net> Signed-off-by: Riku Voipio --- accel/tcg/translate-all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.14.2 diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index c5ce99d549..1b43deb0cd 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -2114,7 +2114,7 @@ void page_set_flags(target_ulong start, target_ulong end, int flags) guest address space. If this assert fires, it probably indicates a missing call to h2g_valid. */ #if TARGET_ABI_BITS > L1_MAP_ADDR_SPACE_BITS - assert(end < ((target_ulong)1 << L1_MAP_ADDR_SPACE_BITS)); + assert(end <= ((target_ulong)1 << L1_MAP_ADDR_SPACE_BITS)); #endif assert(start < end); assert_memory_lock(); From patchwork Wed Oct 18 12:33:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 116287 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp6019452qgn; Wed, 18 Oct 2017 05:41:33 -0700 (PDT) X-Received: by 10.200.28.70 with SMTP id j6mr2708429qtk.78.1508330493297; Wed, 18 Oct 2017 05:41:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508330493; cv=none; d=google.com; s=arc-20160816; b=IbbeXHFBifCQHCuxt/2rYKrawtPGoK0nxPS+Qna0zBrwqXOb6E1zDOcVxrfADPUsW3 I6eUag24KUmJZ3QfqNSeGOmH8/O/MjIwwFBWjZNqTeWRfXWW/J+f10wu1i5N0h7PNeBu WGALYKgpZ1YLCJW231S94xuEwZ8Jjy1krrGTRAuxXwfBIM35ybnYK1pHvr1MoHJ/8BGv jIJeO5S3O9+1yiboZwTUDLjSOf1i6EmDjAnNeGHj2etPjwBwvPHg8vmQyPq6qgn2+V8+ jVJ6HAOPY9BnXgywkMHM53MFW3fqrioaaYvjb0/Rzi0EtUPB3q1j9PEkb4II0RtSb7NB JoKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=GKYDmvBRv2sgM615HmP1smpEB09rZHtGpRvAoSBBWqs=; b=QC696U1Gxs0frD2DsnAtihC/ngl86JZVcpUBL0uE+YnkRLs9CGDA077dlpWLliC62E za6V8ZYbVHgJ3lheL0d8MGlzVVPCsfrY7jgyyQjeZk1Z7lSnII/QtzbdRD6zo5F5gIaG izN2m4en+x0upIP3hSooGp2TVBYHgPDmi7Q+fKkX7H5VXKFFm4pa+vVTZXbR+P2Yn0BG bB9LKgT1M0v2+SzXLDYBQsb9S31dYhBRzzOLGTnIWXsGnV1HwQ8tdaYWlAs2uzFVJJnT nwwudjTiSRmgDfZQFRt8//snNMnhUQ9vO8uarcIwt1+nmDE7QHNG02c6O4gR6iFeG6Fy M8Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=cgGms+gI; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id c29si2621230qtb.372.2017.10.18.05.41.32 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 18 Oct 2017 05:41:33 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=cgGms+gI; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44459 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nf9-0002Pi-3t for patch@linaro.org; Wed, 18 Oct 2017 08:41:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58639) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nXa-0005Gr-KB for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4nXW-0003xF-Cf for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:42 -0400 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]:50978) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4nXW-0003wh-1O for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:38 -0400 Received: by mail-lf0-x242.google.com with SMTP id a132so5618370lfa.7 for ; Wed, 18 Oct 2017 05:33:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GKYDmvBRv2sgM615HmP1smpEB09rZHtGpRvAoSBBWqs=; b=cgGms+gIcP5ldah9UoEvBHV5GOl4gggNTGcJXQxF0HdwTN0MZ2AifEzhMQqFrMe54f ZSq8tLMCjThoxa2WFAxWUNgsg0C3M/+r2UN5jzNwwMMWVOtnM5HPMXh4XCCDtxcRmIsP 3bGS7quVNpZA6RqpA/kUZUuTEqUp3uONdcUak= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GKYDmvBRv2sgM615HmP1smpEB09rZHtGpRvAoSBBWqs=; b=MQnZgCf8DRAxjJAyT+kTr3exw6QGZ/u6O4OZ9oxZtkrYZFMSjRMKfNKpJTEpld+C1L jNNfP8gkurvhi7tWUFsfQSibETt6hIrTViHri2T4CbsuvdhIWTEcBi6o+7FaceqTQeg+ +AoxlRQbleyHzBaOyxiUtVAFqedmDiHv7POR8Cz+Hg9wzF6DC6SKk+8fXTTluGNYNoZI 7IfarXD4xTA56ZApXEOD/tZYBzmw6vp9WD43RxI2R7ScxpBfWAh41Envl84HhPx6C4hG 4je13HD9UL5WOzH0D/ENcm5SjnjzLPjsHWI8JmxN42T074rBFBbdgICusbftt35IJVdi JjPw== X-Gm-Message-State: AMCzsaWZOV2bJWwK7UXssQWOQSTCSXCZalCSuWu4Y/SxBXeIkQXFtaX9 UF0MFRknsi/FoJ9w73QgIgvsJEFbwuE= X-Google-Smtp-Source: ABhQp+RVEQtB8s6sU6RW7vBcMjVMHDdN1KSjAhLdp5R4qMMjBm8/6Vl+ni4a4kjzqgw7lEgLZe+z+w== X-Received: by 10.25.17.21 with SMTP id g21mr5129335lfi.170.1508330016401; Wed, 18 Oct 2017 05:33:36 -0700 (PDT) Received: from berserk.kos.to (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id j71sm2590718lfk.6.2017.10.18.05.33.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Oct 2017 05:33:34 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 18 Oct 2017 15:33:20 +0300 Message-Id: <18e80c55bb6ec17c05ec0ba717ec83933c2bfc07.1508329282.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::242 Subject: [Qemu-devel] [PULL 06/10] linux-user: Tidy and enforce reserved_va initialization X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson We had a check using TARGET_VIRT_ADDR_SPACE_BITS to make sure that the allocation coming in from the command-line option was not too large, but that didn't include target-specific knowledge about other restrictions on user-space. Remove several target-specific hacks in linux-user/main.c. For MIPS and Nios, we can replace them with proper adjustments to the respective target's TARGET_VIRT_ADDR_SPACE_BITS definition. For ARM, we had no existing ifdef but I suspect that the current default value of 0xf7000000 was chosen with this in mind. Define a workable value in linux-user/arm/, and also document why the special case is required. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Message-Id: <20170708025030.15845-3-rth@twiddle.net> Signed-off-by: Riku Voipio --- linux-user/arm/target_cpu.h | 4 ++++ linux-user/main.c | 38 +++++++++++++++++++++++++------------- target/mips/mips-defs.h | 6 +++++- target/nios2/cpu.h | 6 +++++- 4 files changed, 39 insertions(+), 15 deletions(-) -- 2.14.2 diff --git a/linux-user/arm/target_cpu.h b/linux-user/arm/target_cpu.h index d888219150..c3eb4b243d 100644 --- a/linux-user/arm/target_cpu.h +++ b/linux-user/arm/target_cpu.h @@ -19,6 +19,10 @@ #ifndef ARM_TARGET_CPU_H #define ARM_TARGET_CPU_H +/* We need to be able to map the commpage. + See validate_guest_space in linux-user/elfload.c. */ +#define MAX_RESERVED_VA 0xffff0000ul + static inline void cpu_clone_regs(CPUARMState *env, target_ulong newsp) { if (newsp) { diff --git a/linux-user/main.c b/linux-user/main.c index 829f974662..fd54d344bb 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -60,23 +60,38 @@ do { \ } \ } while (0) -#if (TARGET_LONG_BITS == 32) && (HOST_LONG_BITS == 64) /* * When running 32-on-64 we should make sure we can fit all of the possible * guest address space into a contiguous chunk of virtual host memory. * * This way we will never overlap with our own libraries or binaries or stack * or anything else that QEMU maps. + * + * Many cpus reserve the high bit (or more than one for some 64-bit cpus) + * of the address for the kernel. Some cpus rely on this and user space + * uses the high bit(s) for pointer tagging and the like. For them, we + * must preserve the expected address space. */ -# if defined(TARGET_MIPS) || defined(TARGET_NIOS2) -/* - * MIPS only supports 31 bits of virtual address space for user space. - * Nios2 also only supports 31 bits. - */ -unsigned long reserved_va = 0x77000000; +#ifndef MAX_RESERVED_VA +# if HOST_LONG_BITS > TARGET_VIRT_ADDR_SPACE_BITS +# if TARGET_VIRT_ADDR_SPACE_BITS == 32 && \ + (TARGET_LONG_BITS == 32 || defined(TARGET_ABI32)) +/* There are a number of places where we assign reserved_va to a variable + of type abi_ulong and expect it to fit. Avoid the last page. */ +# define MAX_RESERVED_VA (0xfffffffful & TARGET_PAGE_MASK) +# else +# define MAX_RESERVED_VA (1ul << TARGET_VIRT_ADDR_SPACE_BITS) +# endif # else -unsigned long reserved_va = 0xf7000000; +# define MAX_RESERVED_VA 0 # endif +#endif + +/* That said, reserving *too* much vm space via mmap can run into problems + with rlimits, oom due to page table creation, etc. We will still try it, + if directed by the command-line option, but not by default. */ +#if HOST_LONG_BITS == 64 && TARGET_VIRT_ADDR_SPACE_BITS <= 32 +unsigned long reserved_va = MAX_RESERVED_VA; #else unsigned long reserved_va; #endif @@ -3978,11 +3993,8 @@ static void handle_arg_reserved_va(const char *arg) unsigned long unshifted = reserved_va; p++; reserved_va <<= shift; - if (((reserved_va >> shift) != unshifted) -#if HOST_LONG_BITS > TARGET_VIRT_ADDR_SPACE_BITS - || (reserved_va > (1ul << TARGET_VIRT_ADDR_SPACE_BITS)) -#endif - ) { + if (reserved_va >> shift != unshifted + || (MAX_RESERVED_VA && reserved_va > MAX_RESERVED_VA)) { fprintf(stderr, "Reserved virtual address too big\n"); exit(EXIT_FAILURE); } diff --git a/target/mips/mips-defs.h b/target/mips/mips-defs.h index 047554ee45..d239069975 100644 --- a/target/mips/mips-defs.h +++ b/target/mips/mips-defs.h @@ -15,7 +15,11 @@ #else #define TARGET_LONG_BITS 32 #define TARGET_PHYS_ADDR_SPACE_BITS 40 -#define TARGET_VIRT_ADDR_SPACE_BITS 32 +# ifdef CONFIG_USER_ONLY +# define TARGET_VIRT_ADDR_SPACE_BITS 31 +# else +# define TARGET_VIRT_ADDR_SPACE_BITS 32 +#endif #endif /* Masks used to mark instructions to indicate which ISA level they diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index 50d803a217..9119eee587 100644 --- a/target/nios2/cpu.h +++ b/target/nios2/cpu.h @@ -226,7 +226,11 @@ qemu_irq *nios2_cpu_pic_init(Nios2CPU *cpu); void nios2_check_interrupts(CPUNios2State *env); #define TARGET_PHYS_ADDR_SPACE_BITS 32 -#define TARGET_VIRT_ADDR_SPACE_BITS 32 +#ifdef CONFIG_USER_ONLY +# define TARGET_VIRT_ADDR_SPACE_BITS 31 +#else +# define TARGET_VIRT_ADDR_SPACE_BITS 32 +#endif #define cpu_init(cpu_model) cpu_generic_init(TYPE_NIOS2_CPU, cpu_model) From patchwork Wed Oct 18 12:33:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 116285 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp6017265qgn; Wed, 18 Oct 2017 05:39:10 -0700 (PDT) X-Received: by 10.55.215.220 with SMTP id t89mr2259041qkt.34.1508330350720; Wed, 18 Oct 2017 05:39:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508330350; cv=none; d=google.com; s=arc-20160816; b=ieqOpO4Elf8Gsn8prvBU7os25wiQBL9xhuhJH0ITvELpi9e7TtaSZJCYHnBtvsgmxQ D4x+m+627uNGLHgjoDbYBdMN2E2bXBrNRDyfcsAQ3qoF4hp2jhfC4HA17+SX/RKcYlPi 2nkayovAtP6gG3PEA5jAkrxw4RZRXot65+0aNWiZKW0c/RAXfqaFW6FSATW6c5jLNEFp JpsJF9qUXoFvS97lmVi3l3WX7RVqr7EikkMi3jFyea0OsCfXbMZpi7THMzlLiLnJem3/ SzjDPaaUwAep4zaniw3jrfO5xtBNHfuMq3VsR6fors7czx1X4eQhegHmLGGJymK3KlDl /ECA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=D15kYJ1dQaoRtaovaOvhZvcW056wbKjMMHwChxXqABc=; b=NmUNTPuNFNEW2675DM/XreEf2tVzjjbxWaSEt0nxUuvnQfmEVFQsBz0CEhem2PEWWD DHis8SzZ7jXzaitmO2B+jPOh20HhjNFAm68OHf8O2Au83D1r+eeFlIqdc6L2yVyUUkTt UswmimZgovFDJGQ52KgOLIJEnfDS+qAOZVihFfz91uPJ4yjJEq4vh3HiPBzPXwGz8WJ+ 145x2dmVolImk70utG6P8f7IA6DgC1xufyC+mp81GeuiLS5FxvqWf8w65zBZKULuK7Qj vzTV8eV/AJygY1W96ANvQagYz+9ibhH7v4P76lv8VUIH9GAqdBMn47rjvdJRpn4axF2L GEfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=gZVyQdi+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 31si7917024qty.256.2017.10.18.05.39.10 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 18 Oct 2017 05:39:10 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=gZVyQdi+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44449 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4ncq-0000jl-I4 for patch@linaro.org; Wed, 18 Oct 2017 08:39:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58625) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nXY-0005F0-Br for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4nXX-0003yp-HA for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:40 -0400 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]:53466) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4nXX-0003xc-AW for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:39 -0400 Received: by mail-lf0-x242.google.com with SMTP id l23so5613147lfk.10 for ; Wed, 18 Oct 2017 05:33:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=D15kYJ1dQaoRtaovaOvhZvcW056wbKjMMHwChxXqABc=; b=gZVyQdi+dctcQMZa1/vYJCrXy2Z+wLNvRbwIhoBpHL5KKX1mdwi9Czg2QnOe9RmW+l u5dn3Ht70wZ4g91OXjM/5LP5T8YZkKDzabtDPtxwzZjqTX/e0JVp5R08s8YGQ0iLKt4h 2EF+BqkVNJ8MZ4eyp56TwaZzYey8axEqcbYw0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=D15kYJ1dQaoRtaovaOvhZvcW056wbKjMMHwChxXqABc=; b=f++xa3khCJHmf7cMRcJMxkvX7nY9yaw6B9LrIwcLAVLLLdG5KvHMDNLf/mI3GAVP0V 7Ej4UzCz2cjHjNHG3bBCazlOXcDeC5tjE4vt7E+vR2hx23bPaQb3UlQKngzCbi4asnVg tteUeTi+ohjM+zT6c++By4urJBhNHbDod6z97NhP12eItJzZL0PPwfanw0O3XHVK78q3 mlNdMSxjtrHnIL/QkymvwlsNXCGGDGoSLeRVrtKPZuoDLIbmhPSvruURre++3QHhI8Nz qMa1zgwXM+mvI03rh43y5k7FtVoxaWbEgJG3+XpXFJ6xv6vRMiptmcxcGVhFjP9iekur St6A== X-Gm-Message-State: AMCzsaVLcYuJw7I4Uijb2KpCekN+KuWLWSh0swdMoqkSEeWyDnaKKFz0 R9Uc9QC2dymK5v3WSCFLwcGIhkoCjrg= X-Google-Smtp-Source: ABhQp+SuGyufGjKD9BHh7TY9jlG72oIxoagSsvYrzs4QAtMxQ0YFpF1aF3fmkTolfmsXCdyrir9tlQ== X-Received: by 10.25.99.208 with SMTP id v77mr5715237lfi.108.1508330017889; Wed, 18 Oct 2017 05:33:37 -0700 (PDT) Received: from berserk.kos.to (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id j71sm2590718lfk.6.2017.10.18.05.33.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Oct 2017 05:33:36 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 18 Oct 2017 15:33:21 +0300 Message-Id: X-Mailer: git-send-email 2.14.2 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::242 Subject: [Qemu-devel] [PULL 07/10] linux-user/sh4: Reduce TARGET_VIRT_ADDR_SPACE_BITS to 31 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson The real kernel has TASK_SIZE as 0x7c000000, due to quirks with a couple of SH parts. But nominally user-space is limited to 2GB. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20170708025030.15845-4-rth@twiddle.net> Signed-off-by: Riku Voipio --- target/sh4/cpu.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.14.2 diff --git a/target/sh4/cpu.h b/target/sh4/cpu.h index 79f85d3365..123f34783a 100644 --- a/target/sh4/cpu.h +++ b/target/sh4/cpu.h @@ -45,7 +45,11 @@ #define TARGET_PAGE_BITS 12 /* 4k XXXXX */ #define TARGET_PHYS_ADDR_SPACE_BITS 32 -#define TARGET_VIRT_ADDR_SPACE_BITS 32 +#ifdef CONFIG_USER_ONLY +# define TARGET_VIRT_ADDR_SPACE_BITS 31 +#else +# define TARGET_VIRT_ADDR_SPACE_BITS 32 +#endif #define SR_MD 30 #define SR_RB 29 From patchwork Wed Oct 18 12:33:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 116289 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp6020218qgn; Wed, 18 Oct 2017 05:42:24 -0700 (PDT) X-Received: by 10.55.45.67 with SMTP id t64mr2163486qkh.267.1508330544549; Wed, 18 Oct 2017 05:42:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508330544; cv=none; d=google.com; s=arc-20160816; b=UA+didIt/7YjgEAVIXgKOZpgBaNSYqiRoF1BfLF3o3kk8W0zih0RYxnxqVVX5j86DD iaeN8Ke+UPY/FTQSyjzXRIix6xctYgfkgPoaWwjix/fqnT4lrPTYoBLf1VMsFLAjUVz4 urHESv2r0+hCuNKvssecKfvDdO9JKigSVRnLWvAp4ImlskfnksFXRqc7rgsEn9IrKWIn LYvcNlHuqv4+huQLJdyByqA3YEpjgvalPro82ifOVNudQLe058zY8/dfCtAjCzmNehrN wcNvSMOMbX+idKHSdi1sn+8/bDjLWgttqluK61e4AxmEdil4ysYan5/wVWd+tzJPt2FD pRng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=/XwIGgOXv4F9+pRS0TzrF1GrdJ9DxxkMfT3QupPCcYY=; b=jZ5G4wX6ywd6ZXvAhbtqJy3jaOuxwlMK3brMREbkL8KspdSelBq32bnGM+91KYSVsG Fkjoc0S52TPHHs7QP2wCo+ijrfDjpmdVkh4J3jnC17Qy0zAeQcDBXan0y9stY2d32Fu0 dpcQisbwLTvViA3zm/fgmgiWDbwe3ims0kDWUw6CzgoEYvqUpK2lV00daLxUND+H3ZXK z9Fgl1NTgcqcZ3Jl3m/SAQs4q+ngfZ8/fQ0uOB6rG6+4whcDB6uWmzuWXK9SQ7+Ea1qs Nj/wZ0ROIgGQH5MBbNYAKzoErkiDe4VKzLHdUHBCRCM4kp6zInbyBncE4SEbRVt1Ap+2 +Ifg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=g6qGhgeg; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id f30si2503879qta.422.2017.10.18.05.42.24 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 18 Oct 2017 05:42:24 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=g6qGhgeg; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44462 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nfy-0003KL-F9 for patch@linaro.org; Wed, 18 Oct 2017 08:42:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nXe-0005IA-UX for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4nXZ-0003zT-42 for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:46 -0400 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]:51460) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4nXY-0003z5-St for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:41 -0400 Received: by mail-lf0-x243.google.com with SMTP id r129so5622356lff.8 for ; Wed, 18 Oct 2017 05:33:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/XwIGgOXv4F9+pRS0TzrF1GrdJ9DxxkMfT3QupPCcYY=; b=g6qGhgegiIRM47mnhXrH1wEGfptGOVXhCsZsj3kK63wlT3GrucnPInJOzhgsILq0DI K53Q+DHTVFZ0rSxV/FAZ/dgRmhzCIrHVzyA99fzc18eE+4CwDPgn99NPSy0945ssHGaG nO7Kw3cx0HQqSI2DJZQxho1TeJPwhmqulkMkY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/XwIGgOXv4F9+pRS0TzrF1GrdJ9DxxkMfT3QupPCcYY=; b=PiTT9eZTpd8f0/Hg9xBWVormMks+RzP3jhnQ2P0gS5eHsvl7eONgssKPFj418723pj 9d/ZwjkFTMLgh1z5WTv81gxDZ9t04dHYj0IQy97sEqYBer2VYoZQlfdJlv5QgFlkAmrl eUZ6wtMWWqSlW6HuXFR1x3rFZLNPUdBNweE7j/Y28TZB9m3XVTPz5zYafJatjJq5mFXp 0mD7QP0EdQEZGtrpG9yvEQKaJS3nCa2H+LkSYj1e1K2XZMDK6Cfb1gv5EBcvI7WgjnEI Tg2/cHsQ52wl/sSK03mlRPGcNoYOaCLjGaDyD3dvvtpZeUxOCqo93PWSj2D+IqXsui65 8VGQ== X-Gm-Message-State: AMCzsaVyW4F9RO1KC0abonYlEg0cJ1KXyrWQ8ffqfXLM9Q0zxC/pmynA O4/uXQSk7CymMBKKD8RJD6Z5gB+iDPE= X-Google-Smtp-Source: ABhQp+QIGWoFZuz7AliFXitswKPyqpAIG5sx+0gU59fSU4DR5qhuUm7XrXcMqTolnPKSjtEOOE6a5w== X-Received: by 10.25.160.201 with SMTP id j192mr5207653lfe.145.1508330019445; Wed, 18 Oct 2017 05:33:39 -0700 (PDT) Received: from berserk.kos.to (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id j71sm2590718lfk.6.2017.10.18.05.33.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Oct 2017 05:33:38 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 18 Oct 2017 15:33:22 +0300 Message-Id: <1847b7ba7015a7448079c2d8fd7187726c33c707.1508329282.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::243 Subject: [Qemu-devel] [PULL 08/10] linux-user: Fix target FS_IOC_GETFLAGS and FS_IOC_SETFLAGS numbers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell We were defining TARGET_FS_IOC_GETFLAGS and TARGET_FS_IOC_SETFLAGS using the host 'long' type in the size field, which meant that they had the wrong values if the host and guest had different sized longs. Switch to abi_long instead. This fixes a bug where these ioctls don't work on 32-bit guests on 64-bit hosts (and makes the LTP test 'setxattr03' pass where it did not previously.) Reported-by: pgndev Signed-off-by: Peter Maydell Reviewed-by: Laurent Vivier Signed-off-by: Riku Voipio --- linux-user/syscall_defs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.14.2 diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 6e2287e918..447915cf80 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -1101,8 +1101,8 @@ struct target_pollfd { /* Note that the ioctl numbers claim type "long" but the actual type * used by the kernel is "int". */ -#define TARGET_FS_IOC_GETFLAGS TARGET_IOR('f', 1, long) -#define TARGET_FS_IOC_SETFLAGS TARGET_IOW('f', 2, long) +#define TARGET_FS_IOC_GETFLAGS TARGET_IOR('f', 1, abi_long) +#define TARGET_FS_IOC_SETFLAGS TARGET_IOW('f', 2, abi_long) #define TARGET_FS_IOC_FIEMAP TARGET_IOWR('f',11,struct fiemap) From patchwork Wed Oct 18 12:33:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 116280 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp6012580qgn; Wed, 18 Oct 2017 05:34:15 -0700 (PDT) X-Received: by 10.55.215.153 with SMTP id t25mr2181370qkt.285.1508330055169; Wed, 18 Oct 2017 05:34:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508330055; cv=none; d=google.com; s=arc-20160816; b=J9ChXNrK34jw9nctjKNEVreCntOvDI4LFTeoMSdUGK3GppFZMGCWbIh3Bl1dOgKozV Kn2dOyQr/PxsFhKzHvPLs1Mz1B5kSk4agaAzVsicIdpv4fPz0EK/c5XBYfkHv3ZhmHSE c5CXX6mXau35KaCXmKJDBj3JgD1UaKWVb3kuaCUx0wIWvucqy6ltCfFIM9txOFxNq+iP 0OBa82aoFJnNoZ6ODU0hFNqeurxzsAgu5TJR4zUfxuQ6C4ZGUfRSkHU4rI14cG5MagT0 eJjpCCQIuKbNKJxStFMOqbUTyuTkiKEZYdtISMvgbfG8qUTd6JtjRyXHiMNH9OrI4gYK HBWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=a6Fx/kvZnuCI53JZEHGshgwcKPKG0/PHcayuflh6CVA=; b=DDXhC7r+VaW25qpJRWEB0DhCCk+GXu50HyPl+4aEwv6yo/pthR+PN9iDd2vC4eSXFE JNrPSMo1wo7KjjqxCxmu0fhDRlxpz1P9tUnhCVkqoxRv9X5Bj+XM7XVKYDTK40GMj+7u HYmn7kGuz29DpXjqlwqiyx8Zc/p57IqQvYJ8wa4u0cYRP7lMmXh3kEVnGw+biejAjRu0 xXBlTxFkWxfKZAASG+sJiQ0NKnJaUGTt0iJbB1WXxX85Oi5W+vuZBJ1nyXf4oc1XwaBZ FDnFAxiH/JLEBHPA2sw9wtIzG7dAP5wULy9uGLN3E0PwefhgEtj5BT5sb/gM6YEs1Gj+ Lg3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=L29KteA1; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id z4si1080550qkf.140.2017.10.18.05.34.14 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 18 Oct 2017 05:34:15 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=L29KteA1; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44430 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nY5-0005LA-3H for patch@linaro.org; Wed, 18 Oct 2017 08:34:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nXe-0005HZ-0U for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4nXa-0003zt-Ij for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:46 -0400 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]:56610) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4nXa-0003zc-Bm for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:42 -0400 Received: by mail-lf0-x242.google.com with SMTP id 90so5615949lfs.13 for ; Wed, 18 Oct 2017 05:33:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=a6Fx/kvZnuCI53JZEHGshgwcKPKG0/PHcayuflh6CVA=; b=L29KteA1E6dWy8PAw/8Qqn9U5UPoj9mgH+ivkmnKOMouGQchxjL0e0Njxk+tz3z4bw W7OGh1flQwi4f8CXRg1N2f9rZGyOPoqeepKK0pfjC3aselZebv16ELX4hR6sRhYctrNG a3UdLufM+erOLdRBIkFN4lB6b3lrBxeFWL/ys= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=a6Fx/kvZnuCI53JZEHGshgwcKPKG0/PHcayuflh6CVA=; b=pRCn8kLNQWAuysx7cJGItX0sTWBc61cU7dQjb8o/Qy2O5yQSmleJk41JpymR15unMk 2TdQs6H5paa3+W7Cy+Rvn4uhhcOdxmIycLPvEly8AoO0duIDtp7Ca7UiXM4+tIG97zWm ycPv/jcYZ+jGhOynQJ6EqL2UFjWi52MMzT5sU8jhJmkHxNeABf6t+wMK0eXTRNsDawaw mSzljL7diuaYnh8VnPgbRrZ/zdYqoQpJKX/DkSyqhqoJps261Nn8fuktCoYJwTbwai8Y HPILyZLbrvLmJmBHR125jtsnCuKt5G4W6hweQ8d77fwesgF58P6AnJLt/FV5A2tZu3eE qHGA== X-Gm-Message-State: AMCzsaU3kkGkHra4dxh8S425bzFYSjt3sqzDnUJTORQt7yMSi/rgttcS jxWu8zYa3yE604leKwUT6iMel8lijS4= X-Google-Smtp-Source: ABhQp+RDNDlZDfiYbmYw27VxHi12zfWPBh1JXTq6CDhXwI60ZnfFuWbiApMj0gE+7+9gAOfjwRXCxw== X-Received: by 10.25.59.90 with SMTP id i87mr5014990lfa.46.1508330020907; Wed, 18 Oct 2017 05:33:40 -0700 (PDT) Received: from berserk.kos.to (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id j71sm2590718lfk.6.2017.10.18.05.33.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Oct 2017 05:33:39 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 18 Oct 2017 15:33:23 +0300 Message-Id: <8423fa9010f2cadd50e8c21a20c62dc5b977704c.1508329282.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::242 Subject: [Qemu-devel] [PULL 09/10] linux-user/main: support dfilter X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Alex Bennée This adds the -dfilter support to linux-user. There is a minor checkpatch complaint about formatting which I've ignored for aesthetic reasons. Signed-off-by: Alex Bennée Reviewed-by: Laurent Vivier Reviewed-by: Richard Henderson Signed-off-by: Riku Voipio --- linux-user/main.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.14.2 diff --git a/linux-user/main.c b/linux-user/main.c index fd54d344bb..dde04c769a 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -3869,6 +3869,11 @@ static void handle_arg_log(const char *arg) qemu_set_log(mask); } +static void handle_arg_dfilter(const char *arg) +{ + qemu_set_dfilter_ranges(arg, NULL); +} + static void handle_arg_log_filename(const char *arg) { qemu_set_log_filename(arg, &error_fatal); @@ -4066,6 +4071,8 @@ static const struct qemu_argument arg_table[] = { {"d", "QEMU_LOG", true, handle_arg_log, "item[,...]", "enable logging of specified items " "(use '-d help' for a list of items)"}, + {"dfilter", "QEMU_DFILTER", true, handle_arg_dfilter, + "range[,...]","filter logging based on address range"}, {"D", "QEMU_LOG_FILENAME", true, handle_arg_log_filename, "logfile", "write logs to 'logfile' (default stderr)"}, {"p", "QEMU_PAGESIZE", true, handle_arg_pagesize, From patchwork Wed Oct 18 12:33:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 116288 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp6019947qgn; Wed, 18 Oct 2017 05:42:03 -0700 (PDT) X-Received: by 10.55.130.5 with SMTP id e5mr1973588qkd.155.1508330523431; Wed, 18 Oct 2017 05:42:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508330523; cv=none; d=google.com; s=arc-20160816; b=ToBVQ5qFE0h7buVQHb8pPICmRnUMO1yJnl3oP5NrF8ClG2AiixI8ceoFeLl5mqFOV6 9CzEEDMvYHTUYszOFdRywnaX2CUFG+UMjbcQsqoCJxtb8UNwIhqvarrVVjMMsoy5hExy JMDDUniSA2AXtNdqUrpfIXWx+Yz6rbUi6445es0covM59GCF/S/90hnjj/mAfzCA4t8R Ss7T9X0+hQS6h7ML3fWBDV+/I5owdJEDz36kAZEJDbBeaH/DalV4yTpZVJdXSAY/MVXo 1xeZ7f3UIFoLuR/p3slQcrCNV3WYFPAYEm69nZ+GA+6S6kT2HtGtGTSR4i5oPDXez6nK angQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=NURbWz0h+eczd8WS3aI0rlmYaJfhP0FKvBpT3e8cyoc=; b=akDn5zv5bcToLvS1kMiiSbL8tBQL781BaTEjdwM0iB9UcLoU3dUwc2phcuWLeisueK 39Ws6gPQVrYYhbwShUBReQIaMtn+t1Ll9zUA4EKKsjM6Xr1lIx3Ywyi0Y0F8P1P0cast OY0iDOexZLOuTNt1+YiTLNnnGl4SdC2AKsPptHv1HMStrQYokzMCBTA/Rqv2N4pkRHla 2oLwPkFZZzx0e3XpnZTDOGyKw35oGmbDhxjsg8HqWUa9xfygh17ar+jDFvXKFTuWuPTB 31TO7pAg43puPi6wN/NLbQg/VkV64hL8/BxqQh0KLRewyG7ckU7EG2rwNkm8gAH9C5hC S+eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=e1qLNGsA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id x57si41000qtk.42.2017.10.18.05.42.03 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 18 Oct 2017 05:42:03 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=e1qLNGsA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44461 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nfd-0002zS-Cf for patch@linaro.org; Wed, 18 Oct 2017 08:42:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58655) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nXe-0005HY-0S for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4nXc-00040W-9B for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:46 -0400 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]:46831) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4nXc-00040D-0M for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:44 -0400 Received: by mail-lf0-x243.google.com with SMTP id g70so5628429lfl.3 for ; Wed, 18 Oct 2017 05:33:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NURbWz0h+eczd8WS3aI0rlmYaJfhP0FKvBpT3e8cyoc=; b=e1qLNGsAOqdWezp8Laz+jozYC1aIMN8BTcr0wklLZKr+0kkX9HlhvUL4Sg7DthPRYs /0JYPyl5GxyCsQhuyBoA367Hou2OdxWU/1Rz8y3LBteU7o7aBJT/8p/gxNqbmfaFmjGx sOMN0H+9i50gjg5hiMkbaI2oJ/9nx8Vas13hI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NURbWz0h+eczd8WS3aI0rlmYaJfhP0FKvBpT3e8cyoc=; b=VapDRDSiB3JbHU3wpIhI0mXCz/TrV/Pu6QBLspCvgijpfw4+d+Hz9ZbOmqdzADMbuz +7i2iPMYr8sXR1O34eDkd7Afp0R/vF6OuLvBO9/elve6+NU9w2DREkwMLhnFlfE4YWQf nrrFb96mcGtz3oDE33Atq4E9zPAOKIEm2qPKxQocyg4OQ0iJXxuEFPK7uc7nPuYyoq9y YEao8FGDG1X14z3/zRNminWu9JQBVGQ7qN9R9QjWhYm2ct3o5mkbLVRrL/A+lBXlO9eE faJzl26a58JtjgIAaz0SYCMY0dBknEOMrKAbpUKwZvX8e3mFpHCrAXgu3wqNH95jE5sc xfTw== X-Gm-Message-State: AMCzsaVuczFOFUs2jfm/vJQgXzmKtlr4eXYdUm5FK/1FqeWTngZn+xys EZ1qd7AivENQy1k4jQmIilQI7iAd7/I= X-Google-Smtp-Source: ABhQp+T8bqy8p78RW0rvMm+k7LIjY5DJAnHGpEcsDmavMU7rFSX9XcNWNh4b1GedHvDWTGl1BYHCYA== X-Received: by 10.25.168.2 with SMTP id r2mr5247612lfe.103.1508330022553; Wed, 18 Oct 2017 05:33:42 -0700 (PDT) Received: from berserk.kos.to (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id j71sm2590718lfk.6.2017.10.18.05.33.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Oct 2017 05:33:41 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 18 Oct 2017 15:33:24 +0300 Message-Id: X-Mailer: git-send-email 2.14.2 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::243 Subject: [Qemu-devel] [PULL 10/10] linux-user: Fix TARGET_MTIOCTOP/MTIOCGET/MTIOCPOS values X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell The TARGET_MTIOCTOP/TARGET_MTIOCGET/TARGET_MTIOCPOS values were being defined in terms of host struct types, but these structures are such that their size might differ on different hosts. Switch to using a target struct definition instead. Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- linux-user/syscall_defs.h | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) -- 2.14.2 diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 447915cf80..e405d1d31d 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -2712,9 +2712,34 @@ struct target_f_owner_ex { #define TARGET_VFAT_IOCTL_READDIR_BOTH TARGET_IORU('r', 1) #define TARGET_VFAT_IOCTL_READDIR_SHORT TARGET_IORU('r', 2) -#define TARGET_MTIOCTOP TARGET_IOW('m', 1, struct mtop) -#define TARGET_MTIOCGET TARGET_IOR('m', 2, struct mtget) -#define TARGET_MTIOCPOS TARGET_IOR('m', 3, struct mtpos) +struct target_mtop { + abi_short mt_op; + abi_int mt_count; +}; + +#if defined(TARGET_SPARC) || defined(TARGET_MIPS) +typedef abi_long target_kernel_daddr_t; +#else +typedef abi_int target_kernel_daddr_t; +#endif + +struct target_mtget { + abi_long mt_type; + abi_long mt_resid; + abi_long mt_dsreg; + abi_long mt_gstat; + abi_long mt_erreg; + target_kernel_daddr_t mt_fileno; + target_kernel_daddr_t mt_blkno; +}; + +struct target_mtpos { + abi_long mt_blkno; +}; + +#define TARGET_MTIOCTOP TARGET_IOW('m', 1, struct target_mtop) +#define TARGET_MTIOCGET TARGET_IOR('m', 2, struct target_mtget) +#define TARGET_MTIOCPOS TARGET_IOR('m', 3, struct target_mtpos) struct target_sysinfo { abi_long uptime; /* Seconds since boot */