From nobody Sat Apr 27 04:13:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1568133714; cv=none; d=zoho.com; s=zohoarc; b=hJKwaDatXV5jRgWNhCJZr9Pk8p76Wtg77/uS68HkulMQWutobeGgUIYls5PU0VAEfss2+JkJnVVSYplUIPDwNBbSWZ4eZu2YRt02fp+ZG9Hil6bLoX7MNOYR3Swp5tS3SIGTb8VI0D+zMalr8ECjIYh4b6DteNuENyJQhc1Z4H8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568133714; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=AV6Mh1umFYbaDBhT6em+rv3JQUQZHc/z/ZeFSX/VEJk=; b=PCThKIEyqz5JL9lIk4RRqQVwu4A0RFlmXXhX1ay8sgc1yP+RAz9lKTMnbyedjLgGy2V7FATaG1hmAy4qG/ptjPszGu2tKu27SG8WmB0UzGAIVKUH/vuNttrHnmrGVfiMojLAXtAbHOTlOyzwyzbPGJhoJa3tLbtftfRj/zV9yio= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568133714851543.8695634370408; Tue, 10 Sep 2019 09:41:54 -0700 (PDT) Received: from localhost ([::1]:43050 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7jDE-000262-Oo for importer@patchew.org; Tue, 10 Sep 2019 12:41:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53239) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7j7x-0004fS-F1 for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7j7w-00029R-By for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:25 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:50289) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7j7w-00028h-2q for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:24 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mbzhv-1ih4sB2VsF-00dZ1m; Tue, 10 Sep 2019 18:36:08 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 10 Sep 2019 18:35:46 +0200 Message-Id: <20190910163600.19971-2-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190910163600.19971-1-laurent@vivier.eu> References: <20190910163600.19971-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:3R9/nrf6F1+CkOxpfuZXTiwuoLi5+ZCthPICIeKxQmd0X1UvGFI MQmzmbiT/3J+WnCW6EqF81pvOlc3TzWWY37E+FojlVlnQfUN+O7bVrOQkpJsNDh5wANfigX CaHHcknek7lf/z2cNEXB1/bPjYqZSM5pd+K0vwCw4/aW7OKUXjY22SQnNP3yzNIqb0R8UoF RJnInhWrsHAPV3z/SLnxg== X-UI-Out-Filterresults: notjunk:1;V03:K0:UvcckU/Hz6g=:6lal6D9cpfbS/ftM1T8tvo dN3z4J0yjaeCS3Uj76R5rRNSPOFtomsNK0n5Q489+P7P0OrPMSp+qavKVbKaiu7v5CmxY/gW8 kp2juFqUy6Fpiqs1/x0fbhGxFNUy85owI8QMQITeR76BF+AYcFVGivIbUB6O0QonWH/WkFkKZ 75VGcTldsBkmb7QpcNexPgasZMS4p8m3FTdR7cSIei6F7veyLiXfq1uQ56Q2TYaV+3laeBpEH Kr+MvQQOokx2SR6gX3iBbCUFSTQYbzT65Ni21odrW0TRlpHppCHJnR/Pm2pGrEDVmJv5SQ1tz dAIDTvtxBET7PtGCwyjsW6PmxVrlACmDqNL5I2uhSMyjRCcloGgnnKBnwSTLfRW4sid3e4if6 CUxqeWiZ0W+2ZmeaCaHBpiqt04092H65c95422SbeZRmD8ubE1K8lZ7GXwlg2E0lS9Gv1nmd1 ekU0V2GubZan6F3ggM/OG5eH//ZvQU7vKjCh8Hjh0z21+gECJgG5be9ClM22tXpjk4STkWRg+ hQV9XxZq+TlWfxOpt16gqxDmYy3SzPey9gTqX9B0jLqhzyBKunqvKmqLrz6Jz3W2w8V5WMxYp XcOUo90PtOGoBKqs3GuVD7Ntiw2QV/c/i3m+5WY+W0p3tqyJWPAYOIlQfC2rUvhN37dDF80Vq OtWkqF3htZYjC7KI2PAELMiaf6/OgAK47MAdh5MpGZpPbVKGG0QQIPMb4LbQ3snLN018txDpQ 8MxHgeQeEN+gP5nRa8X2sRvcaCtcKKXEXOC02eTgl48fnAszyPdhJ/XEn5ZnHEjbbSgD2/EUT A5EQbUnNVKIQWx5dBFksaqPGQVzXww0LrBu433CH65dICWrAc8= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.131 Subject: [Qemu-devel] [PULL 01/15] linux-user: remove useless variable X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov , Riku Voipio , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" filename is only used to open the file if AT_EXECFD is not provided. But exec_path already contains the path of the file to open. Remove filename as it is only used in main.c whereas exec_path is also used in syscall.c. Fixes: d088d664f201 ("linux-user: identify running binary in /proc/self/exe= ") Signed-off-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefano Garzarella Message-Id: <20190714134028.315-1-laurent@vivier.eu> Signed-off-by: Laurent Vivier --- linux-user/main.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 47917bbb20fc..28f0065b6ddf 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -49,7 +49,6 @@ char *exec_path; =20 int singlestep; -static const char *filename; static const char *argv0; static int gdbstub_port; static envlist_t *envlist; @@ -586,7 +585,6 @@ static int parse_args(int argc, char **argv) exit(EXIT_FAILURE); } =20 - filename =3D argv[optind]; exec_path =3D argv[optind]; =20 return optind; @@ -657,9 +655,9 @@ int main(int argc, char **argv, char **envp) =20 execfd =3D qemu_getauxval(AT_EXECFD); if (execfd =3D=3D 0) { - execfd =3D open(filename, O_RDONLY); + execfd =3D open(exec_path, O_RDONLY); if (execfd < 0) { - printf("Error while loading %s: %s\n", filename, strerror(errn= o)); + printf("Error while loading %s: %s\n", exec_path, strerror(err= no)); _exit(EXIT_FAILURE); } } @@ -784,10 +782,10 @@ int main(int argc, char **argv, char **envp) cpu->opaque =3D ts; task_settid(ts); =20 - ret =3D loader_exec(execfd, filename, target_argv, target_environ, reg= s, + ret =3D loader_exec(execfd, exec_path, target_argv, target_environ, re= gs, info, &bprm); if (ret !=3D 0) { - printf("Error while loading %s: %s\n", filename, strerror(-ret)); + printf("Error while loading %s: %s\n", exec_path, strerror(-ret)); _exit(EXIT_FAILURE); } =20 --=20 2.21.0 From nobody Sat Apr 27 04:13:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1568133929; cv=none; d=zoho.com; s=zohoarc; b=EWzB+2IBydP81Hevj7Kt7Lo3Cqkrhw4edKWXQ5uVnRBmqOOkBuVfp6d+AlxPfzzizY4ZiSAzgF2YBBcecwicQ82tP1gbJAYpy+oJKwU1xJ1fOqCAjXyVd3v4xDsS16GvqiM6OpUCx3N6TycmAOIY60FFQHcSC7qc5gKzKaLjPZg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568133929; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=NFKImPmr08G8SsfslwDCiB7mSjMEwDNYejz9mjUnLgQ=; b=cfe4dmG8Z+Cf8NssHqkgYgWlET1nHyzVdPoCzO8+szHqEh/TF0iF/bwSKeXwnZM7WzJPDAdbT4r4qAGFV9ocJuns3n/fv/sjlkqtXLPksEyuDVZeQePyJo4IUj5NSxBAMz510RT2XNN7CjIhE2dU2lEa5OkY6s8X42gWPJ7kWHc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568133929012234.55047599653437; Tue, 10 Sep 2019 09:45:29 -0700 (PDT) Received: from localhost ([::1]:43238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7jGh-0005qN-FS for importer@patchew.org; Tue, 10 Sep 2019 12:45:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53240) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7j7x-0004fa-Hq for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7j7w-00029X-Ce for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:25 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:48109) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7j7w-00028g-3y for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:24 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MEmMt-1hvvnu1rh5-00GJZm; Tue, 10 Sep 2019 18:36:09 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 10 Sep 2019 18:35:47 +0200 Message-Id: <20190910163600.19971-3-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190910163600.19971-1-laurent@vivier.eu> References: <20190910163600.19971-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:0KXaXHtt6r83pzwF5arVoOGeOG2MJZuwiWfdj6t9LUAuKaYJDOi KsXZfV/1poENgUcxzfe3k6IpKK2jX6ZTcTo3x5gQqnkKdQavG+p5K2aAK6Cxa5EOlnSgERM 5d+l3DtXNeSrmJXmG4RuGsIAyNvOnMobh78rYctUyOVT4JfUVw1dTLgCe7eqzPJKYVuXklH MMYLLmkRVcUX7J48+l7yA== X-UI-Out-Filterresults: notjunk:1;V03:K0:S01fj9U4d/k=:gRbZXPngHBiiycGGbUtTrB g1+PyRCWvXGj9g95EuHEM3B09b2N3CQK5qeNq/Xbp4PikkuzX3e3kaeUjqz7uozjTMK18D27O KCR6AKdzPiEfFF8Mj/jIabT/CAhNvgPgBv3fsAH6xCn9Ve5GXnzujem9UVx0dg62sCLhH+Cjj 4HxlKeR3Shii4y2E41tuw5sLOjqy3xEfJBGSU/sy9FoOerw87wPeQIWx9P3X+lMidNX3S9Q6Q PEbxme2e7v7XnAvbJ35e7mx4dE8XnZQ77PNeFMg8Php6ylHBbRA68KPrgaYb2kwJsip9q9FYZ rTdpxIxWaPFz02+tmu/d1ZNN7sfZoQFhw57dRQ5HCCv7iY3C/xYmpaFzI2vufEBjcrK9bb5vL AkuH9MXnboS0BtCU8zXO8xW0OyRqq7ByuvYLYhv7biR68XBbfOHrjmF7JXvYn2RsnW2ElF7uE t7Mf2b1097DdTfqtAdhe+3HKxzOdXmUwT1IS+J04cX3x2ZZIvdcF+x0n2PlE+965xVOtq36Yc 4CYExUP8PphzAbWl/uL2XvI+rIpqD7lhGV0yeNGZEGzEivSuI6MEJv8B4AwShgyR0rxrWP73E l5va/CQhQi+V8j4NXIljjqkXXe5zZcGcmVtANhBOTgTrJtrQuYWaC5FLgbgc8ID4xBu6EzXqI 3X6gV8g5ELSLx48K4f9IJNVruP3Y2UihlVLQlOon8US8AEW6fxcxqi0tlBtaivwk0U+/tr9fU 1gOMo45DrKFVk38nZpnG658xLXbjloGxaZM2C1BZla5PHE5hTbqF67ls7mKjboaJUnxfsyeoi o/nnITporo6yuO5CFPFsGNUQnV1IfgXNntx7DZRCAKxvk44+Fg= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.135 Subject: [Qemu-devel] [PULL 02/15] linux-user: Add AT_HWCAP2 for aarch64-linux-user X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov , Riku Voipio , Richard Henderson , Laurent Vivier , Peter Maydell Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Richard Henderson Add the HWCAP2_* bits from kernel version v5.3-rc3. Enable the bits corresponding to ARMv8.5-CondM and ARMv8.5-FRINT. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Message-Id: <20190809171156.3476-1-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/elfload.c | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 3365e192eb3f..43c16a846d33 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -607,9 +607,23 @@ enum { ARM_HWCAP_A64_SB =3D 1 << 29, ARM_HWCAP_A64_PACA =3D 1 << 30, ARM_HWCAP_A64_PACG =3D 1UL << 31, + + ARM_HWCAP2_A64_DCPODP =3D 1 << 0, + ARM_HWCAP2_A64_SVE2 =3D 1 << 1, + ARM_HWCAP2_A64_SVEAES =3D 1 << 2, + ARM_HWCAP2_A64_SVEPMULL =3D 1 << 3, + ARM_HWCAP2_A64_SVEBITPERM =3D 1 << 4, + ARM_HWCAP2_A64_SVESHA3 =3D 1 << 5, + ARM_HWCAP2_A64_SVESM4 =3D 1 << 6, + ARM_HWCAP2_A64_FLAGM2 =3D 1 << 7, + ARM_HWCAP2_A64_FRINT =3D 1 << 8, }; =20 -#define ELF_HWCAP get_elf_hwcap() +#define ELF_HWCAP get_elf_hwcap() +#define ELF_HWCAP2 get_elf_hwcap2() + +#define GET_FEATURE_ID(feat, hwcap) \ + do { if (cpu_isar_feature(feat, cpu)) { hwcaps |=3D hwcap; } } while (= 0) =20 static uint32_t get_elf_hwcap(void) { @@ -621,8 +635,6 @@ static uint32_t get_elf_hwcap(void) hwcaps |=3D ARM_HWCAP_A64_CPUID; =20 /* probe for the extra features */ -#define GET_FEATURE_ID(feat, hwcap) \ - do { if (cpu_isar_feature(feat, cpu)) { hwcaps |=3D hwcap; } } while (= 0) =20 GET_FEATURE_ID(aa64_aes, ARM_HWCAP_A64_AES); GET_FEATURE_ID(aa64_pmull, ARM_HWCAP_A64_PMULL); @@ -645,11 +657,22 @@ static uint32_t get_elf_hwcap(void) GET_FEATURE_ID(aa64_sb, ARM_HWCAP_A64_SB); GET_FEATURE_ID(aa64_condm_4, ARM_HWCAP_A64_FLAGM); =20 -#undef GET_FEATURE_ID + return hwcaps; +} + +static uint32_t get_elf_hwcap2(void) +{ + ARMCPU *cpu =3D ARM_CPU(thread_cpu); + uint32_t hwcaps =3D 0; + + GET_FEATURE_ID(aa64_condm_5, ARM_HWCAP2_A64_FLAGM2); + GET_FEATURE_ID(aa64_frint, ARM_HWCAP2_A64_FRINT); =20 return hwcaps; } =20 +#undef GET_FEATURE_ID + #endif /* not TARGET_AARCH64 */ #endif /* TARGET_ARM */ =20 --=20 2.21.0 From nobody Sat Apr 27 04:13:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1568134257; cv=none; d=zoho.com; s=zohoarc; b=GvO9fkoiiMFY9mYeDwN8/RSOBmc5wJUQofEJET2lq9bqxFfXGlesJyNpXJIhJh7xlTEX0CcB/N+jYUa/GwlYt89U+fplyj4v0PkVOnmbmvD2012SPucvwwHcw0gk4AZQasK328nYIdpSgNzBJkLZDlIsvgvqBCRJo3WCz5qQtCs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568134257; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=nMbsdsYri0UBHAcC/KL6LN2m3Qtom5IdfoeFA6igrLQ=; b=AMGxZ79Voo6jOVD9EMh+ISpwysxkHWinflQt0CgQBIJ14G9VdULHpZ+5L8LnU2aHTrPBMxsOg+3FymRadaHk0HBD+dYe1+u2chtDdn5bX/MQAx5Hu+2S9U4pHNHxXrNGqy2TAS3Fs4O5CodsZmTYYU8ELmuTUIx3c5uqf39mr7I= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568134257589133.33785070000897; Tue, 10 Sep 2019 09:50:57 -0700 (PDT) Received: from localhost ([::1]:43385 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7jM0-0003Qg-0w for importer@patchew.org; Tue, 10 Sep 2019 12:50:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53205) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7j7v-0004d0-TD for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7j7u-00027R-SS for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:23 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:57281) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7j7u-00026W-Jp for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:22 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MUGyh-1hgTKD29YJ-00REic; Tue, 10 Sep 2019 18:36:10 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 10 Sep 2019 18:35:48 +0200 Message-Id: <20190910163600.19971-4-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190910163600.19971-1-laurent@vivier.eu> References: <20190910163600.19971-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:TqnRmrny+VBJejcU8FarPvdXfnkbn9J5m5FZ5Ps8QM7oDgWSZ1r EqqE+cm1aOuZgoN5M1avIfIROAjj32cXAbiNWCnY2xV24IlzrLDk1F4tqKzHOzO+s1tdFsM UdN5i2CKJlWGhp49nV967Q8f/otyLIhYete8FWhkE5RrHQqp7eHfyhH4TKouy4ntucqfBZ4 B50YzjbnVeUHnxtWYtz/g== X-UI-Out-Filterresults: notjunk:1;V03:K0:MkD7WgbsN68=:pT8d67nKJEn6QZI/RIPICO V7UFxYPUaB7fEAa+wAX++bGkqC7Vt1H4/hofP3MRvjcKf+D/fCzOkKGa3ugDkA4mWYYSrgmVn CocA6nqMNhJJpXr4XXxAGsQYV6oR7rUyfjEFj29hYLJN5jhjC+PNoz5MNT8XXUbdXV2TL7OJQ ciWE9jltG+IZmgrKl6QxpJzf9EgQH2DfEalWpF2rtHwm5ZIRcWKVNnpZCYnAv6oRIkLMIkqsb 9VbOvpKM0otkmL900Z0FH+mTM1oXDtSM2Tq2+Woy0DuBG1CfbdOABKTVMWs4XIZfEOuAg4jve 1weIcaYnvVYLS80gHRxD4PoBnYJ0IAAe1v3LiBu8hf5oalFvY5MAruBytLj8mKT/CvPackLlr FoxXoJPJ6nL2SgZAu22ery9RoTz3a2T412WV4M8Owf2IMKVp6t3JSAwXMEQoINY9hUmC7huXq gTamPsaSHxt7CBTcMU6LWPLTJ5P2nMTKmoDQmN4CjsiuxCyOtK5Kox/pKh+OD8llY+m+BXrkC loy1z/wUGrM9WV21mN5+clZxWF8O9GJ2N2sxUOag7Z4wDxcC6r8olnMBUhUmfOpIeiZ4xcYh7 8WWimXeFoFUaWjHBysKPCnLIS7QN7MOfYeV6jG9rfaYQolsktJZq/P6fvXG+/eGfej5kGQNaj Knax3RM4mQmp6xIlvIElHqFNklBbvMhspB37urpWtEco2w16XyWZnsgHu6VF0Jxo4MILN4itk mNG3YTWZp9tmYnHR76NWrazWYh+MUY5epNVHeOZKf1Q5il9r11el2RKTGs1/2JnR8/bWLO0UE C2dnpEWFQZ9TqxTz2KZaO4Ps2aDpP6hW11FPi6YifofnHlHfz4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.131 Subject: [Qemu-devel] [PULL 03/15] linux-user: erroneous fd_trans_unregister call X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov , Riku Voipio , Laurent Vivier , Shu-Chun Weng Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Shu-Chun Weng via Qemu-devel timer_getoverrun returns the "overrun count" for the timer, which is not a file descriptor and thus should not call fd_trans_unregister on it. Signed-off-by: Shu-Chun Weng Reviewed-by: Laurent Vivier Message-Id: <20190819185348.221825-1-scw@google.com> Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 1 - 1 file changed, 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 8b41a03901d4..b42f59a32c8d 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -11847,7 +11847,6 @@ static abi_long do_syscall1(void *cpu_env, int num,= abi_long arg1, timer_t htimer =3D g_posix_timers[timerid]; ret =3D get_errno(timer_getoverrun(htimer)); } - fd_trans_unregister(ret); return ret; } #endif --=20 2.21.0 From nobody Sat Apr 27 04:13:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1568133716; cv=none; d=zoho.com; s=zohoarc; b=LpcDJOzEe7mVSOWTgFUO2wyR/XQLhh4qxgZCOXs41hViwbcudS4mBt6L4q3j4SXPdCP5FVzPN15tA2Oi4vLB3wa1l27C5BfAXsuGVb52rXUBjOZVZHdfOLoeawirPpwqqmLSRaD0JADfVvMwg84BYItC0aUwwZcGRzD0zH+13t8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568133716; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=tWWTRqX1cq7pInOa3UIPDwDmPhfOe1V/Y5nF6blMpkU=; b=XRGb0K6yCUTPKlKYiF+EX9L5Z4X3Zci9t8/2SzMJfA1FvBCEuwMCTlYBaedEMgmjEc3nUpJcW7OeVGOSrBS2FfLjE9EwpaBLCTvKfpi5UslcCG8WWdCQYKMdQdjx/MZrt5ub8wMQfe0UxtuNJ3fO2gcz6AIY8Fvin687iZbcl9M= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568133716823312.85863624120145; Tue, 10 Sep 2019 09:41:56 -0700 (PDT) Received: from localhost ([::1]:43052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7jDH-00027f-3l for importer@patchew.org; Tue, 10 Sep 2019 12:41:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53126) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7j7r-0004X1-J1 for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7j7q-00021s-JD for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:19 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:48125) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7j7q-00021B-AU for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:18 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MsqIi-1iRKL50RYW-00tAs1; Tue, 10 Sep 2019 18:36:11 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 10 Sep 2019 18:35:49 +0200 Message-Id: <20190910163600.19971-5-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190910163600.19971-1-laurent@vivier.eu> References: <20190910163600.19971-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:Snl31syHCaRUwPZeR5XWR6Csa5PyqsiRk6pbWTvrU2g9jMoikBf Yh7q/CyPLwmmJXTQ6L0N3tMIVEAktqdNuo9qbvj4tGNXPnj5oDAe4vPsPmiz4rVutI4X1tT 4O+iil0yIhC5B2F+BL5RrpdTp86neml/SZWBueax5nExFhsMSclMV2KfUopxE1eWCapaKpt 9SC+OFyTzHaJO8r4cAYeg== X-UI-Out-Filterresults: notjunk:1;V03:K0:aswRB7F3vmY=:ZIV49uQwCuIrOMSeDbp618 2GpOMkCf2+dHx6H1++YrgDF504Y6iiVnWyMZ7PFEKbQuAHQ0wVELVADa0EXAvLf92kgscsy/m CF5ddfI3378gNfSVI4P1dZ1og3zidRBh5N3Q1aQIT9pBS+/chiC6B7NCx/wk1IT2JpVT6n3xS QT6iGslUP4+YbJXmzQcOUWY/99jkTbHrzdg7sfQFDt0wUvfcYdgjGtifjDql/BAUQPaQbjjRB ktoehj2hwfRq6GXWdOvZqpAp8vDBrfEUKIwd7dTirw3LKppxmThLjCzkGhszsl9lPaScUMIO5 6lPtzgsYSAreSi5ANXs8QhmIItz1oL22eAYesMab6zY/r6sFLNB/dAY+zFybQK9vQtGBkm5eG ik7jiqSWAbPMTKqr/f/5vswQZchK0n7SupjX3uEfkH5OslovbY9jDYKfjYASr0B2Hkx7xzZVb 9tiJQyR1ZutNR/YQxsKz9zHPz2x9anzFrsfoRDuqXVPJOg5FZkS34ESBfNBTdjkFHWOT2YVf8 vcvr5ZHfL8X2bp+MgWQmYECVK8OPkrZgI9XMFNGdUWc47Xvh5ix+Bg1Ls6G14454z2yQcfOwq oCDSDiahYezGzd0LqARYgLfeYyDesoQmDYP4FLIvUZlYZ1pKrxyz+CbP+36X5gudi8lvwvNye AN75ec+dfjNbTAVXJoCTxz5trpMutvC+GJFM5LitWNgXi86oO5EudEQXmKDfJ8hnFp/COZbLj KOFmBBXpiXz/fcskrLWyuKcjqImwtAA5Wg+4OjZR+SThWgDRhoHDlBFGGXFI+lUQ7Ri55Kntp dghiev9OxkKESTHb/9k/lwUuXXtMWA+TT81u+iIN3cvDTb5M4Q= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.133 Subject: [Qemu-devel] [PULL 04/15] linux-user: fail and report on bad dfilter specs X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov , Riku Voipio , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Alex Benn=C3=A9e Just passing NULL means we end up ignoring the bad dfilter spec instead of reporting it and exiting as we should. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Laurent Vivier Message-Id: <20190830143648.2967-1-alex.bennee@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/main.c b/linux-user/main.c index 28f0065b6ddf..c257b063dbc1 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -235,7 +235,7 @@ static void handle_arg_log(const char *arg) =20 static void handle_arg_dfilter(const char *arg) { - qemu_set_dfilter_ranges(arg, NULL); + qemu_set_dfilter_ranges(arg, &error_fatal); } =20 static void handle_arg_log_filename(const char *arg) --=20 2.21.0 From nobody Sat Apr 27 04:13:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1568134369; cv=none; d=zoho.com; s=zohoarc; b=HZJ7xu9/tv0G+YN6kvtDfEOJuHeW62ehixZpzBbROQ/oM/Fr3oyLOOXTfol8fh0JEsaJXwHvw2wY8A75hhhm7cA1rx50SBJdS4CiZ4bTFbXH9bVIpa6zROLHgtHHHdjSjw7cmUTSLJwPdDdNP4BlCa1ge/Ixiqi+sME7Up0Czxs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568134369; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=fwlWUy2XkVbXpkMC1yHRpQLJMPBBSInF8cIMNUSR3DY=; b=i427V6noB0MW5tzORT8bp7BFuneMcyySUE6bLoZWykNzth2ubKmAMlJ15P/FMgwa4wRErTDieHnhl08cIpOQKT1gZrt9G0wzObinJawXIfCHIqxVkgsYCK1A7Xeq+FHlpcADWCuDFhgjgAARa99UcYP7uqeCBV6ciJGzT4CP2H4= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568134369981890.1857992776602; Tue, 10 Sep 2019 09:52:49 -0700 (PDT) Received: from localhost ([::1]:43408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7jNo-00062d-S8 for importer@patchew.org; Tue, 10 Sep 2019 12:52:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53274) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7j7y-0004hq-UF for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7j7x-0002AS-LF for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:26 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:56731) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7j7x-00029l-CL for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:25 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M8QiW-1i3JGt2lYe-004XCH; Tue, 10 Sep 2019 18:36:11 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 10 Sep 2019 18:35:50 +0200 Message-Id: <20190910163600.19971-6-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190910163600.19971-1-laurent@vivier.eu> References: <20190910163600.19971-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:4eKavIKS2mpYouw47awiX+VDUg4EsMju00X+tqbb4u0JwD6/WKZ kIanhMxOPY/qtkWvLq90yrR/Vn2u0Mjn3v024oOp4lwRatPznFIuiRYjgLgN3DgCDProIvv jaMZtPudnmRjmNZTfBxSbigI+btK7RDg044bwCDpsDypxpy/1cRaeFY5pJeEARRF+g3n7Yx zZcMFjRe1ZWWwU/hLXVXg== X-UI-Out-Filterresults: notjunk:1;V03:K0:sQA5gutfdQA=:vhQhw5nNhmKq3ShLhRSrgA 7vWJ5W7m2cJgQAlcTDPstRkdP59Efu5qooK5eY5cEeGumoBdT/R7i5RKmcw2nyoyKgWqKsB1v UgUwK0XI3+ID/3ZdqOnNhG4Jlj3lDyRxlK2DKhCpcShm4gCREZ/AwZWCWNnzF5lZvnFBptsHN iCltmwLWSBufjc9mUQ4FM/lWIEeeDFeB3U/1HKteRpEGcUAsrb3eeHcTVKlZPmiIu3PboRv45 St/3PI3FxI8BmrbV4e1Rp070vDbcFtsXscdKB+I4y3nwmNafFR8Jk/pSi+WD8xSzRtRQCDmLP 0o8SNv5B78bRzFB1vFs+xOb4vFgveYFa0Xpd5dOU5a0o8DK9M78LmqN7LGjBmzX9/RWobsgFj Hr8YFmUlf5QmVrD96tflGgtzEbIjr8BWjMfJ5DSIT4sIBS5DinxVIStnjtddRwoayxZ8vizzN 0kD48lGq8n7ndig25tQhu5SpNPb5592uIkO8lu2h8oAXjzqOMUlc4UuKAEP1hv7P5ADw41lfO 8W90OKFGCpkRedKgnjEhJyn/9mzTFkIOOBA6EE9T+7gpqSoY859mrA5g7pT7M1mkL0Nyvsyup JZwXgGS4SsTPYJnjVa5ISfwy3dAsT4Uz2ekH4UsDJRqEWablo6blWO8YOJ6lCq9k0VUofyyJq JQaV1hVrjNyfShed9HrrQA2ezcpR1PuWP2IkuaXEsHSwTGQZdpzEkqh08b0hTj2OZKxqCj2wF iy59qANbTUZZTVx8mkEdQd2WGoYwYcK5ERc15EX4n3Je5fJZWIhHqNMcYM98z71J+aeO+poVl 8Y6dV9qItEP2QO2okolbaWJpFJjNYqqKffhnbqV5jg9eVp0Ao8= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.135 Subject: [Qemu-devel] [PULL 05/15] linux-user: add memfd_create X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov , Riku Voipio , Laurent Vivier , Shu-Chun Weng Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Shu-Chun Weng via Qemu-devel Add support for the memfd_create syscall. If the host does not have the libc wrapper, translate to a direct syscall with NC-macro. Buglink: https://bugs.launchpad.net/qemu/+bug/1734792 Signed-off-by: Shu-Chun Weng Reviewed-by: Laurent Vivier Message-Id: <20190819180947.180725-1-scw@google.com> Signed-off-by: Laurent Vivier --- include/qemu/memfd.h | 4 ++++ linux-user/syscall.c | 12 ++++++++++++ util/memfd.c | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/include/qemu/memfd.h b/include/qemu/memfd.h index d551c28b6850..975b6bdb7797 100644 --- a/include/qemu/memfd.h +++ b/include/qemu/memfd.h @@ -32,6 +32,10 @@ #define MFD_HUGE_SHIFT 26 #endif =20 +#if defined CONFIG_LINUX && !defined CONFIG_MEMFD +int memfd_create(const char *name, unsigned int flags); +#endif + int qemu_memfd_create(const char *name, size_t size, bool hugetlb, uint64_t hugetlbsize, unsigned int seals, Error **er= rp); bool qemu_memfd_alloc_check(void); diff --git a/linux-user/syscall.c b/linux-user/syscall.c index b42f59a32c8d..6928f654ced3 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include "qemu/cutils.h" #include "qemu/path.h" +#include "qemu/memfd.h" #include "qemu/queue.h" #include #include @@ -11938,6 +11939,17 @@ static abi_long do_syscall1(void *cpu_env, int num= , abi_long arg1, /* PowerPC specific. */ return do_swapcontext(cpu_env, arg1, arg2, arg3); #endif +#ifdef TARGET_NR_memfd_create + case TARGET_NR_memfd_create: + p =3D lock_user_string(arg1); + if (!p) { + return -TARGET_EFAULT; + } + ret =3D get_errno(memfd_create(p, arg2)); + fd_trans_unregister(ret); + unlock_user(p, arg1, 0); + return ret; +#endif =20 default: qemu_log_mask(LOG_UNIMP, "Unsupported syscall: %d\n", num); diff --git a/util/memfd.c b/util/memfd.c index 00334e5b218f..4a3c07e0bee6 100644 --- a/util/memfd.c +++ b/util/memfd.c @@ -35,7 +35,7 @@ #include #include =20 -static int memfd_create(const char *name, unsigned int flags) +int memfd_create(const char *name, unsigned int flags) { #ifdef __NR_memfd_create return syscall(__NR_memfd_create, name, flags); --=20 2.21.0 From nobody Sat Apr 27 04:13:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1568133513; cv=none; d=zoho.com; s=zohoarc; b=mv5dckplzA26uT/K0s7m9aFYw0ClVCon/czvr6Q2JwYuqW2W8aAZ9nAKKJuNWTH6SbrEUl7bi26uGDsm9vPxEummwADge0bhPYe4TJNDkB++sZ5aPx0488+/3oHEUtBwfwo0oJvfFIxh3p3bSx1MWP3J3fkV9zfG75X+8sZLWY0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568133513; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=/Dqr83SHQ3z/XApHSO4Zg34LIjGtHnwefMj5rEzrPDs=; b=AOoi6rBY2ORlwRjAHIv1J0mQjEKjEyrocyxu4umuleVNnOX47P3UkLsfMWVah14mlOYGrwmKk5HK7wx2mZwliHPNKsFq6WsHvNdbiyrjcLJhJdzcnIoxLputYs1BGaTGNIdmW8LYmSvt5oASYf+BDjaGFHknwXuFgUvEWm2ThaI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568133513550305.8706048594647; Tue, 10 Sep 2019 09:38:33 -0700 (PDT) Received: from localhost ([::1]:42930 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7j9x-0006cx-Bj for importer@patchew.org; Tue, 10 Sep 2019 12:38:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53073) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7j7p-0004Uf-Rn for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7j7o-00020T-G4 for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:17 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:59679) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7j7o-0001zK-6b for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:16 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M6lUk-1i3sIc16fW-008Mwl; Tue, 10 Sep 2019 18:36:12 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 10 Sep 2019 18:35:51 +0200 Message-Id: <20190910163600.19971-7-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190910163600.19971-1-laurent@vivier.eu> References: <20190910163600.19971-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:ELE3NguVAMW9oC7+Roai81gb83Tae7RgDGcbFSQPSxhXLlnKWiF WJYSH1vNO7P7AD1L/ej5Jai0Znd3mJrGMUGHcRmI5EC+C6MnmFuf+I4u7Sa7iRkvu3Ql/vW ++AnuhJL9FCbNXpSg2SuxNTqmcVbirTbIGtdAd9493Q/mYTawHfBVxQK2pZhsefvaIPiTAP 9OtOnl6sEZNxnPPmXJ5Ug== X-UI-Out-Filterresults: notjunk:1;V03:K0:I2jXH4wke7Q=:D+Mo61yGKXvn+FjM5shYRv uYp3Z7bmk4LU0+Yc6qDieIL4yEcMFBDdknmnheWENIbsOc+UKHEneZitCTs9w7j14mnGL1ua2 hLIHnsbxdTMtBX8F/ssDbGll49i5jGVhYLmVtGtJqx/FiVdKwYsHsh4PzPT2edLx0LaXjTEFy o8ATeQQdMJRuzGpHrCDM5myCy6nuKkjIMWt9aOOKyWnBctExqGawWOajNSSvFr4IEn938r2gO PR1ghDv7idn0UBtKXggB/JZBkgIP+T9fWEl9UF95fqwbGLVkJ+pcbBCCv9VF3nA2UyppXYthJ 0TjQq4KKm+qt/lujMI25WbXUGPzs6cha39vVkMMFNi1AA1ROHOvg0TNYO5obPvjz9/X9Q/ojx Z+f2srms0TUBAlXcrQB0t8SRwb7hoXquxmlwgzkBYT0u9LE7oc+wMba58bDX+w90dVX672zER IWU+ma+cPAdUHzyy9BNINDd6E7Qvlr6ekGbCGbvwY+SBbv0+SI2W9SQL6mVNIyxdaSzdnTc32 Ytrg2JN+6jEg/Bi/pLgbEXiT6J01Ue1Z5LUFrZlDwdWnNUgsCa9qDzsN9nhHGH6GIhLdn//CO e/Xr5Gm5GDzgY31FI2YCLcTfMMB3Ut2uKHLx+W3uS0ZWKCM9BrRelDS4lgfFmhBP7cKvBs9NM Stuu2Sfts3LNH9PdRbkOhbvnsPvlogYzhUW/8P2LIP1RW4Ljn02ttYACGX6VmSTo5O2ZCJ5gE zp8bctkOJv6JQXna7zZEridIldTFZFQ7KP15KdAbP9p/NFqg0RW57xmIPdWjGhHn+ezo+BuU6 NpQqFaSNFSZnFN+QwU1VMrntCmMs6GKsTHRvkIml8/5rgopJaY= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.131 Subject: [Qemu-devel] [PULL 06/15] linux-user: Pass CPUState to MAX_RESERVED_VA X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov , Riku Voipio , Richard Henderson , Laurent Vivier , Peter Maydell Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Richard Henderson Turn the scalar macro into a functional macro. Move the creation of the cpu up a bit within main() so that we can pass it to the invocation of MAX_RESERVED_VA. Delay the validation of the -R parameter until MAX_RESERVED_VA is computed. So far no changes to any of the MAX_RESERVED_VA macros to actually use the cpu in any way, but ARM will need it. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Message-Id: <20190822185929.16891-2-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/arm/target_cpu.h | 2 +- linux-user/main.c | 43 +++++++++++++++++++++---------------- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/linux-user/arm/target_cpu.h b/linux-user/arm/target_cpu.h index 8a3764919ad9..279ea532d5b7 100644 --- a/linux-user/arm/target_cpu.h +++ b/linux-user/arm/target_cpu.h @@ -21,7 +21,7 @@ =20 /* We need to be able to map the commpage. See validate_guest_space in linux-user/elfload.c. */ -#define MAX_RESERVED_VA 0xffff0000ul +#define MAX_RESERVED_VA(CPU) 0xffff0000ul =20 static inline void cpu_clone_regs(CPUARMState *env, target_ulong newsp) { diff --git a/linux-user/main.c b/linux-user/main.c index c257b063dbc1..24cb24f0bf8f 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -77,12 +77,12 @@ int have_guest_base; (TARGET_LONG_BITS =3D=3D 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) +# define MAX_RESERVED_VA(CPU) (0xfffffffful & TARGET_PAGE_MASK) # else -# define MAX_RESERVED_VA (1ul << TARGET_VIRT_ADDR_SPACE_BITS) +# define MAX_RESERVED_VA(CPU) (1ul << TARGET_VIRT_ADDR_SPACE_BITS) # endif # else -# define MAX_RESERVED_VA 0 +# define MAX_RESERVED_VA(CPU) 0 # endif #endif =20 @@ -356,8 +356,7 @@ static void handle_arg_reserved_va(const char *arg) unsigned long unshifted =3D reserved_va; p++; reserved_va <<=3D shift; - if (reserved_va >> shift !=3D unshifted - || (MAX_RESERVED_VA && reserved_va > MAX_RESERVED_VA)) { + if (reserved_va >> shift !=3D unshifted) { fprintf(stderr, "Reserved virtual address too big\n"); exit(EXIT_FAILURE); } @@ -605,6 +604,7 @@ int main(int argc, char **argv, char **envp) int i; int ret; int execfd; + unsigned long max_reserved_va; =20 error_init(argv[0]); module_call_init(MODULE_INIT_TRACE); @@ -670,24 +670,31 @@ int main(int argc, char **argv, char **envp) /* init tcg before creating CPUs and to get qemu_host_page_size */ tcg_exec_init(0); =20 - /* Reserving *too* much vm space via mmap can run into problems - with rlimits, oom due to page table creation, etc. We will still t= ry it, - if directed by the command-line option, but not by default. */ - if (HOST_LONG_BITS =3D=3D 64 && - TARGET_VIRT_ADDR_SPACE_BITS <=3D 32 && - reserved_va =3D=3D 0) { - /* reserved_va must be aligned with the host page size - * as it is used with mmap() - */ - reserved_va =3D MAX_RESERVED_VA & qemu_host_page_mask; - } - cpu =3D cpu_create(cpu_type); env =3D cpu->env_ptr; cpu_reset(cpu); - thread_cpu =3D cpu; =20 + /* + * 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. + */ + max_reserved_va =3D MAX_RESERVED_VA(cpu); + if (reserved_va !=3D 0) { + if (max_reserved_va && reserved_va > max_reserved_va) { + fprintf(stderr, "Reserved virtual address too big\n"); + exit(EXIT_FAILURE); + } + } else if (HOST_LONG_BITS =3D=3D 64 && TARGET_VIRT_ADDR_SPACE_BITS <= =3D 32) { + /* + * reserved_va must be aligned with the host page size + * as it is used with mmap() + */ + reserved_va =3D max_reserved_va & qemu_host_page_mask; + } + if (getenv("QEMU_STRACE")) { do_strace =3D 1; } --=20 2.21.0 From nobody Sat Apr 27 04:13:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1568133901; cv=none; d=zoho.com; s=zohoarc; b=DTE5Hf6OfIfMwHahJEvJg0oPmYe1BgsvWz0D6WR4oBFfqAztCcXtDCQbdqomh4ynRgILhoQ46KxMmlcK5H/+g/0y3c5h1CtqjxkdoIOXQKzA6S9B5PvmVS6n8sqifinTwSwxKjwD0/9wWJxTUrxt4RFBPxqs5+naWem/9g4adMs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568133901; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=5WUn/6kfhidm5mpu0C/wAtccXkgTaI7FLXy5AetX8q8=; b=cUaXYAcWzJ9wvQLulC6r97tc8qz4w32w3yfiDUJsw6GgGt6pbooPOBuB8mVFZk7bigFt2rqUBH/BScH1A/h4hGWxdu74aw0UFDJnXzHHSBXduxazux8zQpHqO2+TyRUaTp/i4TDliltrGd6x6oIgnhzUF/778HPLNz+sapbcpYA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568133901150780.8508323010645; Tue, 10 Sep 2019 09:45:01 -0700 (PDT) Received: from localhost ([::1]:43222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7jG9-000594-JX for importer@patchew.org; Tue, 10 Sep 2019 12:44:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53089) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7j7q-0004VY-Go for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7j7p-000214-FZ for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:18 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:54549) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7j7p-0001zX-6l for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:17 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MYehP-1hc3TT3cWp-00VeZS; Tue, 10 Sep 2019 18:36:13 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 10 Sep 2019 18:35:52 +0200 Message-Id: <20190910163600.19971-8-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190910163600.19971-1-laurent@vivier.eu> References: <20190910163600.19971-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:NrnoZuyyvRcyXw1YmJnEBT5z5hd9yw8C+ku7f8wk+z9qKrAlHck uCVbZz7r6GrkavrDF4ketOG9NLa70mg8LNA6VvR1+h8inYuG+LSc+5AOimViH1QqOAc1zu6 QvfleKpfOoVL3VIuK/P15SXBUkgd/bBuEVNWkTgH1GJjbC02C/rKSVKN1QVq9CUKNH9rdbl NuUOiF2kSSPo8ZJv01eSw== X-UI-Out-Filterresults: notjunk:1;V03:K0:INcU2wQI8OU=:Ff0ZBHMdaNTC0/POC9Fpdm QntY9sG9OO+S9w0NXg+kBTPA5kZp/Qmt9sBdUysiKhamNP2zoY78Pcez4Nujqt/9qBHtZ1xoS L2t4eC57uH8k/6EBi2+l6L3en6rr9VKJnKOVNiPN5Yu8RTpLdBesaRBuYYnlj2Pdn4VJQG7Xq 3gLZ5s19Rza3BJcHTLbhq+L2A7msjhNezC3C7VooNTxZbCSH/rjawtdUSDeHe7hlynntnQMWx 3F9SVuNzAAb5YGc+Ir79CSMpwXnCC5NVvqATn1WsNuzSZBYI23BkkCIY/vyvLX8YKvFdJu8oc UwmlkstbMt5P8ecUPJJpWl5pqnVV3sERYHj2E5f4Ph1kgk0AwBZS6zYsBE4KRzCRm5qkRFMhy C9FANKi0SpPDEcLP6XbBcL126EzBHXsa6bm8C0PLMjHnph81Eqa9UQIup2f/CAWfi7mpjEyxX fbS3go4CA/NyVpRsmdvcldEnH7uAwoqqekXyRX0yoTDG+YJ5Zf1Iz9GZQdvo3uyxOrycG4nat Z1NZvseb2dfsanDIsMoaq+ZzLfKCRXfyH0fnuw5I0T/1fxiDJb21PV6u1qx2fiDhnz4oF001r rnXW1E+tzKasdhoPPNrbogoT3M0HHo0NHhc4NqtR3FSLDG9GlukaS7giO5NdBdk09jsfs135U 4S6Eiv0ylbkNweq/EFfVXMnUIJAA5hXDnTDj8EQgZNdqdPEkBkEjUyacdCUIL1DwEZEJmUiDA PPHt6nMbveX0MwJIio+T3nzV2/+Bk0h/Y4176HgLcAypWPldwdAD6i39cu0xZdvoYL5GzEAPy IvuBGfFp1iL1RKAUErHEqb8JpLPwSbRwpe7EgDSEB/mPcItlZ8= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.130 Subject: [Qemu-devel] [PULL 07/15] linux-user/arm: Adjust MAX_RESERVED_VA for M-profile X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov , Riku Voipio , Richard Henderson , Laurent Vivier , Peter Maydell Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Richard Henderson Limit the virtual address space for M-profile cpus to 2GB, so that we avoid all of the magic addresses in the top half of the M-profile system map. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Message-Id: <20190822185929.16891-3-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/arm/target_cpu.h | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/linux-user/arm/target_cpu.h b/linux-user/arm/target_cpu.h index 279ea532d5b7..3f79356a07fc 100644 --- a/linux-user/arm/target_cpu.h +++ b/linux-user/arm/target_cpu.h @@ -19,9 +19,27 @@ #ifndef ARM_TARGET_CPU_H #define ARM_TARGET_CPU_H =20 -/* We need to be able to map the commpage. - See validate_guest_space in linux-user/elfload.c. */ -#define MAX_RESERVED_VA(CPU) 0xffff0000ul +static inline unsigned long arm_max_reserved_va(CPUState *cs) +{ + ARMCPU *cpu =3D ARM_CPU(cs); + + if (arm_feature(&cpu->env, ARM_FEATURE_M)) { + /* + * There are magic return addresses above 0xfe000000, + * and in general a lot of M-profile system stuff in + * the high addresses. Restrict linux-user to the + * cached write-back RAM in the system map. + */ + return 0x80000000ul; + } else { + /* + * We need to be able to map the commpage. + * See validate_guest_space in linux-user/elfload.c. + */ + return 0xffff0000ul; + } +} +#define MAX_RESERVED_VA arm_max_reserved_va =20 static inline void cpu_clone_regs(CPUARMState *env, target_ulong newsp) { --=20 2.21.0 From nobody Sat Apr 27 04:13:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1568134007; cv=none; d=zoho.com; s=zohoarc; b=gx6J5oCibtU83XN3zwlTDQDwDNSEPqFJG2oaOPQBFn8f1uheSvyTORMUnJOHhNXvPn1lBs3GlDQHs8fKt2qYJdlWzlgrSy5OFfcBiCJ9ApJQNozprJ/2hMfmanPcQ80+E6w9C5nQP6ZXAclnOKkt7z+E5ovdAmBSLKsav/CKt+s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568134007; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=l9gsdGGYkW3E2kWciFdfm9mZisy14QqMNf1bHvqybRU=; b=XuZxp1M2wo6LdMvGAx1P5Pn9TsLv7MRv4zgXDyYkHnBRW1Mjnudye4mR6Bk43B05mBJy6qJqgASLwr1rFoATfkpI7NjsC5nJaOfkkmHCju6xQfCnI3cAFTa3gzWcLWLD/dB5oZAei2v9zUCA5XOVoufz8+h1XV3rjeIvzINMWlI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568134007181863.0279478855581; Tue, 10 Sep 2019 09:46:47 -0700 (PDT) Received: from localhost ([::1]:43246 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7jHw-00073C-Tp for importer@patchew.org; Tue, 10 Sep 2019 12:46:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53324) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7j80-0004kk-Na for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7j7z-0002DN-AT for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:28 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:48975) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7j7z-0002CC-1q for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:27 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M3D7V-1i8Z8K2Mur-003gFE; Tue, 10 Sep 2019 18:36:13 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 10 Sep 2019 18:35:53 +0200 Message-Id: <20190910163600.19971-9-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190910163600.19971-1-laurent@vivier.eu> References: <20190910163600.19971-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:8PuUuQxpps+wGdANSUaUT5KRfXwI2yvSl82GB/fy8bNwTtWQ/25 Rt2kjnf70qVUBpL76pgVd/F1VpC/GGwwP/a6TWZo7APfgMlZ8EfVEmubDa+3BZJnQHm574x ZyB6WGnz9uCGB4ZG9TPJ2jGdbWVlPqIs0+vzkcOiF8sMH0r3Kbwm6ue3ywmEjtg6jFK/nWZ GEGsu5wxTqtLki0L1cG/w== X-UI-Out-Filterresults: notjunk:1;V03:K0:T9nXBAJdT98=:fSoo2oRLEhiZ4orgYZh4Hy myTMbFW44J8cWZakmnlJPPs4JEh9qYh9E3Ii5qsgDyyae+duGUT5NMnKTBTt94JkZy8kk0bTw OUUlTrLplIF/Ii0Qm+ht+4qs66VpYvqZ/GB2tediG3InHvi54lJZXUiWbc5quRa2zrJN+Nv1Q z+IbYA0LMFiZfzenm+GrBZJU71xglsbE30N2uc+9XGPcg6qfmzw96maXlw4jc5VbiUeuaEm+s IOyaLs6kEAWL4//eozSoq6EfzsKwMsH8nMn43BwCXq5qr91ZAl2YakQT1R0AHXI1YlNS/2vaO vO0hvMwYrNqhfDnsCw9IY2WlTgc3x/yqdBby0Or+xGKqs0NMUasSrSQzC4ryMYmoTEMlPfN53 iIkNHGIW7qCoMQ1T2+7MVZQtYoa/sKdHqf4j2yom7berMIWpcrQccRz1vjPe02s66CdYpvQXU wYQYonVFZq9hhgjiIX9fdgDeP0lbiQuWvTV8GnZA3MGrFOcWaaH1uV+n52lfl0BFVd7ncil3S tOXo6soIq409AV5Tcmoz4BqVgYi7G7LBXLgAIlDeUwzhTftpRZlKp3rBcH9ApcR5SVwnbBiPc EDktiWauoS41U1u6vgytnSF0yw6JsJ3Gs3/ntEAhbAzcrEHr8jdGIRq2Se+2CAXH3HeX6iy46 nFP9JOSOVYFQ6qZnXkFTQknGzCRbnfpDj1S7jqM/DDE3v+9IHRbsNTKVlv1VXkDS3NN9MR/LO y8Ruj+I1XyLL1JicO8mrHQe6AerPBmAlt4hhKHIZaBtClRkb/BEuz1kZiJSDXeiXdLjFbtTZl 1xdFFA0mBR/UZWEpVXdH8okcqLUplCvnxC0H24ETenomai/i7c= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.135 Subject: [Qemu-devel] [PULL 08/15] linux-user: Support gdb 'qOffsets' query for ELF X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov , Riku Voipio , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Josh Kunz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Josh Kunz via Qemu-devel This is needed to support debugging PIE ELF binaries running under QEMU user mode. Currently, `code_offset` and `data_offset` remain unset for all ELF binaries, so GDB is unable to correctly locate the position of the binary's text and data. The fields `code_offset`, and `data_offset` were originally added way back in 2006 to support debugging of bFMT executables (978efd6aac6), and support was just never added for ELF. Since non-PIE binaries are loaded at exactly the address specified in the binary, GDB does not need to relocate any symbols, so the buggy behavior is not normally observed. http://sourceware.org/gdb/onlinedocs/gdb/General-Query-Packets.html#index-q= Offsets-packet Buglink: https://bugs.launchpad.net/qemu/+bug/1528239 Signed-off-by: Josh Kunz Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20190816233422.16715-1-jkz@google.com> [lv: added link to documentation] Signed-off-by: Laurent Vivier --- linux-user/elfload.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 43c16a846d33..f6693e576098 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -2403,6 +2403,8 @@ static void load_elf_image(const char *image_name, in= t image_fd, } =20 info->load_bias =3D load_bias; + info->code_offset =3D load_bias; + info->data_offset =3D load_bias; info->load_addr =3D load_addr; info->entry =3D ehdr->e_entry + load_bias; info->start_code =3D -1; --=20 2.21.0 From nobody Sat Apr 27 04:13:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1568134382; cv=none; d=zoho.com; s=zohoarc; b=fz+AyVvlB0WlDHFga9Et5+RTF89WAmCv61cQhzX1qx9xe8xBEY/mG8cwq47gyzy79VUE4FHQTjHscIODjEGdtn5lNwKh6SFJuJeCAyhQLkByNa+Vrgt/dvii3fDW5p61asJx/L8ISfaKxZkhBbuCaPJ01BdKwNhn5hXgkhNAet4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568134382; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=KU/NuTtIXUpoBwBQrTu+oiaI9j6JTGaV0C6e/qMH838=; b=cE1QJwB/fNPkMXYUxZmT8tHB9rLPMmiixM1YMlovQd17200rXGE7DjwybiuGyxFyhomSERj+cJVXRAYZke5FKUeIi/NikM761AjVgvVyTlblgGPyfEQOtcrAy9/WoHUZAkCiiWb5yTZhgJVhW1RW2B6bfTcrmj32f58YjtVZWfc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568134382244765.8638911514302; Tue, 10 Sep 2019 09:53:02 -0700 (PDT) Received: from localhost ([::1]:43410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7jO0-0006J2-WC for importer@patchew.org; Tue, 10 Sep 2019 12:53:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53370) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7j83-0004pm-66 for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7j81-0002Fn-J1 for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:31 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:60705) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7j81-0002Ey-9k for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:29 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N0Fl9-1iImgj2G6p-00xJsI; Tue, 10 Sep 2019 18:36:14 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 10 Sep 2019 18:35:54 +0200 Message-Id: <20190910163600.19971-10-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190910163600.19971-1-laurent@vivier.eu> References: <20190910163600.19971-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:NtEeMdw9DuKI+X6WX5LXmEzAjadMcGIYgavPfh5I8NJkOzZ8DvY ghSplZ4Xqz8LuNSAV9kPIKczV4HX7C7iMnjcRQXIRFJEzlVFgsJAC/KrTfjZbaScSYwB7r2 bggjIDuxFf+L1C/XAGfm56k/NduJuhkFofV9fQa9wYuXkAlxs4SMbp/CbXylxmeWY27Ci0D h08X4LVGsMHKLYCJgmn1w== X-UI-Out-Filterresults: notjunk:1;V03:K0:jCQJErf8zCs=:2kHPx3A5SREMdlTJDn1RJK kDc6ie/WKfcQ+E1UYDL6QvU6im7305NnYLk0V+/KklxT10fCcffZqbry5zGWIsG8XFIycli24 uKnsr1ksPDCNRrAFfPt6beyeLcp2codxyTbU1KiZbAn8moXDoFIDgdYK9B2HlvmdQtRErV1u9 wi3F+etByMnBDvd6b85p/v1NauMlK9kBqEMCemeU2F3cV80CwLFhHmosylOgVHLmm3hrqJ3It iilhuP0MxvP8W0NyFSvJ1kOUaaB5TzOa0I2Il6q8KPSBUdWuXwMkD6mjmaLV4E4QTQLmlpKYi r1m0aiJcRMsxONFcvJD5xp8lLEDS+wTjUukSaz93WOqApH4Sh2AhBR/ez5wnaYZZSqh0jihoS hSg2H4nvnlLcqeHKSISJcVipgk9XDhYtt7Fs4FWev3uo6QNjyUSFkmJHUfrf1rvHLByn7kbmW 6Iif38y4Vi0obq9Zpt/xvwDx0p8zfJG35ImuDr+aKVIcgWrNe1c/SK66DIq75M237bWIi/OUy bdeOBdMstJ3OYuI95B78TRs7rMrR722E2vbaYX+wx/uqCL74EXmmUbB4tkc3dnsVe2WaaSsWH UOHtXRiEPkF7uNNt6lg2jF5VmvEz1+4OWEBePZY771+as9FoB+ItMZCWStBrfrcEKWJjFH0oY niKUblJbAhHOUYQbHVlEfpgPDL+2lV1Z31PfpOHJkrO0mbFlRB7k6Dpa2lVp3dLrgCPEWwo6G OHJrHaL75WomGrqB4AqAiGh3DGcqVrcI1gNWXSz22U/JvyF8ITwNYxTIsxFZqgtyLDmCtV+3e NgaxLhHO6wT9JGsCh0m/vA1a80vQqu+rOpRga/9SRTWcfzDIWI= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.187 Subject: [Qemu-devel] [PULL 09/15] target/xtensa: linux-user: add call0 ABI support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov , Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Max Filippov Xtensa binaries built for call0 ABI don't rotate register window on function calls and returns. Invocation of signal handlers from the kernel is therefore different in windowed and call0 ABIs. There's currently no way to determine xtensa ELF binary ABI from the binary itself. Add handler for the -xtensa-abi-call0 command line parameter/QEMU_XTENSA_ABI_CALL0 envitonment variable to the qemu-user and record ABI choice. Use it to initialize PS.WOE in xtensa_cpu_reset. Check PS.WOE in setup_rt_frame to determine how a signal should be delivered. Reviewed-by: Laurent Vivier Signed-off-by: Max Filippov Message-Id: <20190906165713.5558-1-jcmvbkbc@gmail.com> Signed-off-by: Laurent Vivier --- linux-user/main.c | 11 +++++++++++ linux-user/xtensa/signal.c | 25 +++++++++++++++++-------- target/xtensa/cpu.c | 24 ++++++++++++++++++++---- target/xtensa/cpu.h | 3 +++ 4 files changed, 51 insertions(+), 12 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 24cb24f0bf8f..27d9a87bc83d 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -391,6 +391,13 @@ static void handle_arg_trace(const char *arg) trace_file =3D trace_opt_parse(arg); } =20 +#if defined(TARGET_XTENSA) +static void handle_arg_abi_call0(const char *arg) +{ + xtensa_set_abi_call0(); +} +#endif + struct qemu_argument { const char *argv; const char *env; @@ -444,6 +451,10 @@ static const struct qemu_argument arg_table[] =3D { "", "[[enable=3D]][,events=3D][,file=3D]"}, {"version", "QEMU_VERSION", false, handle_arg_version, "", "display version information and exit"}, +#if defined(TARGET_XTENSA) + {"xtensa-abi-call0", "QEMU_XTENSA_ABI_CALL0", false, handle_arg_abi_ca= ll0, + "", "assume CALL0 Xtensa ABI"}, +#endif {NULL, NULL, false, NULL, NULL, NULL} }; =20 diff --git a/linux-user/xtensa/signal.c b/linux-user/xtensa/signal.c index 8d54ef3ae34b..590f0313ffe9 100644 --- a/linux-user/xtensa/signal.c +++ b/linux-user/xtensa/signal.c @@ -134,6 +134,8 @@ void setup_rt_frame(int sig, struct target_sigaction *k= a, abi_ulong frame_addr; struct target_rt_sigframe *frame; uint32_t ra; + bool abi_call0; + unsigned base; int i; =20 frame_addr =3D get_sigframe(ka, env, sizeof(*frame)); @@ -182,20 +184,27 @@ void setup_rt_frame(int sig, struct target_sigaction = *ka, __put_user(0x00, &frame->retcode[5]); #endif } - env->sregs[PS] =3D PS_UM | (3 << PS_RING_SHIFT); - if (xtensa_option_enabled(env->config, XTENSA_OPTION_WINDOWED_REGISTER= )) { - env->sregs[PS] |=3D PS_WOE | (1 << PS_CALLINC_SHIFT); - } memset(env->regs, 0, sizeof(env->regs)); env->pc =3D ka->_sa_handler; env->regs[1] =3D frame_addr; env->sregs[WINDOW_BASE] =3D 0; env->sregs[WINDOW_START] =3D 1; =20 - env->regs[4] =3D (ra & 0x3fffffff) | 0x40000000; - env->regs[6] =3D sig; - env->regs[7] =3D frame_addr + offsetof(struct target_rt_sigframe, info= ); - env->regs[8] =3D frame_addr + offsetof(struct target_rt_sigframe, uc); + abi_call0 =3D (env->sregs[PS] & PS_WOE) =3D=3D 0; + env->sregs[PS] =3D PS_UM | (3 << PS_RING_SHIFT); + + if (abi_call0) { + base =3D 0; + env->regs[base] =3D ra; + } else { + env->sregs[PS] |=3D PS_WOE | (1 << PS_CALLINC_SHIFT); + base =3D 4; + env->regs[base] =3D (ra & 0x3fffffff) | 0x40000000; + } + env->regs[base + 2] =3D sig; + env->regs[base + 3] =3D frame_addr + offsetof(struct target_rt_sigfram= e, + info); + env->regs[base + 4] =3D frame_addr + offsetof(struct target_rt_sigfram= e, uc); unlock_user_struct(frame, frame_addr, 1); return; =20 diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index 76db1741a796..c65dcf9dd782 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -53,6 +53,20 @@ static bool xtensa_cpu_has_work(CPUState *cs) #endif } =20 +#ifdef CONFIG_USER_ONLY +static bool abi_call0; + +void xtensa_set_abi_call0(void) +{ + abi_call0 =3D true; +} + +bool xtensa_abi_call0(void) +{ + return abi_call0; +} +#endif + /* CPUClass::reset() */ static void xtensa_cpu_reset(CPUState *s) { @@ -70,10 +84,12 @@ static void xtensa_cpu_reset(CPUState *s) XTENSA_OPTION_INTERRUPT) ? 0x1f : 0x10; env->pending_irq_level =3D 0; #else - env->sregs[PS] =3D - (xtensa_option_enabled(env->config, - XTENSA_OPTION_WINDOWED_REGISTER) ? PS_WOE := 0) | - PS_UM | (3 << PS_RING_SHIFT); + env->sregs[PS] =3D PS_UM | (3 << PS_RING_SHIFT); + if (xtensa_option_enabled(env->config, + XTENSA_OPTION_WINDOWED_REGISTER) && + !xtensa_abi_call0()) { + env->sregs[PS] |=3D PS_WOE; + } #endif env->sregs[VECBASE] =3D env->config->vecbase; env->sregs[IBREAKENABLE] =3D 0; diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index 0459243e6bb1..b363ffcf1066 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -673,6 +673,9 @@ static inline MemoryRegion *xtensa_get_er_region(CPUXte= nsaState *env) { return env->system_er; } +#else +void xtensa_set_abi_call0(void); +bool xtensa_abi_call0(void); #endif =20 static inline uint32_t xtensa_replicate_windowstart(CPUXtensaState *env) --=20 2.21.0 From nobody Sat Apr 27 04:13:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1568133521; cv=none; d=zoho.com; s=zohoarc; b=mCcsWOYqp9D/5DmkyrQTx3uQbypxoF/aNGYQuSq8EyLm8wmIXDsC9toAgKqCc9xXmlkqQSM+JLr4TPmwOvpCa+ZOXMhR/LMhlmoP2gu5UlMVrk6pFVzbs+0D7Lj3mtmdd9JO0CFhkbzEJi8QeKFkB6M7JBWONVKvDeILKRHvGW0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568133521; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=JPALSgRarX8Ru+Zz0boBgzs9owEDBMX4Slzwc78CXZ4=; b=nzjvxJ8Vlq46JTiYAkOcglf/NVUHZmbUAOEDJidrLzOcBT7Y1J8MyLuR1EBGrh780qx9lHjA3iW2QOJuDiFLWHRBhtHoGOYzJmO/vQjdRrSDU/7qsQqS1ymCuAFeztnkwW82f1uEDQQ/8CeenqtWuE8WjoIjcfjMjfYl86EDKRs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568133521412830.56451431506; Tue, 10 Sep 2019 09:38:41 -0700 (PDT) Received: from localhost ([::1]:42932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7jA3-0006iP-Is for importer@patchew.org; Tue, 10 Sep 2019 12:38:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53103) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7j7r-0004WF-1M for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7j7q-00021U-2F for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:18 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:50173) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7j7p-00020p-Pg for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:18 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MC2o9-1hzngw2Qv7-00CRge; Tue, 10 Sep 2019 18:36:15 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 10 Sep 2019 18:35:55 +0200 Message-Id: <20190910163600.19971-11-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190910163600.19971-1-laurent@vivier.eu> References: <20190910163600.19971-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:HUVvV838EzmYfbOXW2KgtkzBNxo/KVs7dc/jLXCYjpGP/YnZO2/ z8GvrK7cpBi1h/Fx8dzBxk4ACbEm3iA+5Y3sPyhpA7lW9fl0p228go0gnSG/tWvwkJB23KF zeimzRvJVlyatjSSC69lvTVjTTX7z3U0UvxMwBnkFqp2jJPhato8nDoz0JElQ1HfJu5FhoW 3YPYuPQVPQG5ZqRm3n6ww== X-UI-Out-Filterresults: notjunk:1;V03:K0:ZR1l7HXMZS8=:4PAsNddvlM1DYCEJ3tti6Y G9uDsvzUpcuzToDR6uJ3WuOlFFY2PR58tRurr3L/1mzeuYPgZxUHSdRa0pPmYEfgaD7HpQ+2C 6HNrkK3YCKnkKAu8bo7WM6nmudNGstBdjpiUSNLhQ80EGW4Vv5C9JPElunt3uoGDe3X56ektB HF5mlPBrWGxJWVawyNLtgFEvwTVfKXKsCP79JmjGfr/V4AohrU/MbIVUYsLps5ulP465hZ7+Z H44H1XhbCnHiE0dZfBiFjP5qjx7nBPnhlIrQf1rdtiy7pWF0g8An8vlID2RWGbjR3sdQ4csKs ExX4s/7t5AD3+cHAnhfAS9q5cVXtOIl/UOLclqMFCCZxu4/RKdHnTtAX7WWAX11Y3bk7C2juG g+8Ys9X/aFZ0zolZ/y4fFjLSpx4/HJpL3DxTCujJla+Rflim1h7dfd9wBywfIeBBMachiGsGT tIiZrQfhnGz0FTN1t8iL901btVE7xIAZ1XnL98GGBejBVKm/UlgrQSZbd+/CKS39TIUUCTBSA vqTRakn6q3/favZ3hZuyiJj1wcBMp6ln59w94IU8ISaS+zKOz1T9gpa/Da3Ifuf0TBYMz5GyH 7MAvxCbItaVr6MCS9RbiGNK+Z2VuCkLuoKVm2yp8nuDEDrOanAn9d2YH9B0/51kd3VhpaUUxj D/XEiRZ3mFjkm/1tT5vvx7NqHGTKxgEFL/Of9Ks4WRQZM0skBtxGsej0vTk2jmiyP0BkxpWPD 5lJ2XR7J0NSLqIpp1C8fBTAzeBWCc69v7rRZkrM+6xCmJ0xCe76N9aDUaHMxGCoYX9j0LeidT 3c7O3i7BWzobQI1l4Bug/eld0R2/Hy+JMCdUutakipy0P/aCrg= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.131 Subject: [Qemu-devel] [PULL 10/15] linux-user: drop redundant handling of environment variables X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov , Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Max Filippov QEMU_STRACE and QEMU_RAND_SEED are handled by the parse_args, no need to do it again in main. Signed-off-by: Max Filippov Reviewed-by: Laurent Vivier Message-Id: <20190906165736.5612-1-jcmvbkbc@gmail.com> Signed-off-by: Laurent Vivier --- linux-user/main.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 27d9a87bc83d..560d053f7249 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -706,13 +706,6 @@ int main(int argc, char **argv, char **envp) reserved_va =3D max_reserved_va & qemu_host_page_mask; } =20 - if (getenv("QEMU_STRACE")) { - do_strace =3D 1; - } - - if (seed_optarg =3D=3D NULL) { - seed_optarg =3D getenv("QEMU_RAND_SEED"); - } { Error *err =3D NULL; if (seed_optarg !=3D NULL) { --=20 2.21.0 From nobody Sat Apr 27 04:13:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1568134127; cv=none; d=zoho.com; s=zohoarc; b=jyEUN56Y0uPrnwWcCNfQl0YrQdWrpgXk3+/y+9Y/0hD0zEF5O3zoSXfUOKssifJ3UlNmaWzq27eUI8zWO8JWXUItZz/hfo4QL2XOYXgXgHGPGTzzgBCjMBf6I7gt4LRWT8ODGPqu40vHRnjztEmsNl6ktfy4pAlX0m9Q42n2v88= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568134127; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=9OrtjAu8uRcw/r2xwWBEC/8rYNbw/uHKgLJ194iB2Y8=; b=b/lIznnGdt7OAKfiCp7sbVG+34zzT7I6bBYxLT961K7is6NBP0LWm+/YMguvfci7NSOUl8FBiaY3OSj6J18PXHQkg5Oc5qUx7b+1JULh3IXl85aF2XOT6ndmL9Bk8lOlZD4eGoJ0+Kwmq1rjFI82SA3+OM9PyOJ7ZpJDRuf7ugQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568134127153586.1901492004362; Tue, 10 Sep 2019 09:48:47 -0700 (PDT) Received: from localhost ([::1]:43292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7jJt-0000nQ-Kb for importer@patchew.org; Tue, 10 Sep 2019 12:48:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53322) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7j80-0004kd-JS for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7j7y-0002CR-Gm for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:28 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:49987) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7j7y-0002A5-6m for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:26 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MF3U0-1hwkmW32wy-00FUUn; Tue, 10 Sep 2019 18:36:17 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 10 Sep 2019 18:35:56 +0200 Message-Id: <20190910163600.19971-12-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190910163600.19971-1-laurent@vivier.eu> References: <20190910163600.19971-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:41RhpoLHz9r9zbIIkATbA9d5daLDxfC5+TdTSDHQbYs+HxMMKo3 UzcJn/SstI7UDyQfDAyimjgR9H8fzpYYYhDV2pHkYgwF1YGsEArLwbCkfJoqhv/OG0y6Ikz FdNTGYs1B9Nv+ZommiPtzu6KSTvPxH4L9dWGeBQCFYeQFqCMTu2jzvvOmzDDTgmPWnvHGap PYpWIZrDtTx4v6ZMYgT2w== X-UI-Out-Filterresults: notjunk:1;V03:K0:RrCpcRTQj/s=:S07j2V9cPurv4HCJh4KUb7 8r9O6p4FjHJBpPmxo3LJtelJ6U3AuHfOsOvG54bAi04pXaif0Y4cW79yfTJmqguSPYxLLj/qz b4isb/sgATjqF5MfI5TYAKEXY2L/5Zv0zsauAdY/RW6INGom3ZCvyLI2BJ+7tZCb21pzWkhRs UbPpYAv8sLrg09FeRbGqi3MOgQIc3tH5fn6Ycrp8kHsIxKh5fzqD1a5IcHLunKEAxvVAMADEQ 6TkWX7ZvjjakgIYL3KtItirMa2EP2FC4JqZUOeKCxDVzYv9G2Xn1N+w0Vyww8vmE3W6bJyi3u 46CpRKZhr1AxjywJoXOlz13o5/0UNEjo+1RIhLZ3qWXvqHUzhA2tnKvx+OXQnO0hiEYpRsTHg oxA8m3gG0GyKRMfsNgWkQxOwmRIIQT61a+Pegqt3w25wLLsIVOhDxsjxFz60nXpW4Kb1ZjO/X KQY1c0K3MXDxevfVyn8E41bUouXA1ZBL808YKTppf8G7neMrvHPQGiqZHddP61e9V+VVYkxuw Mld5FMX5pzHkcIaefl0uWThQXt9TFwUbrskVh+HPiYOxwZSW5BSExVwnR4XHYEghVtm6l9O7X j9HVmfimHK89cNn9MWNoR+8n9ZHfZoERwqc3i5hKYCgNRxbBb7IhcQ1ivtVB3G01dKjYXnVYf v6lYVohIus4TLrrp82gvNUIaMHdjdR0rRrQ+EhAZgpVtFiF7xxcnxpOO74oYqaubxL74O0yt5 pTmnJJUCE4adY3VB09rtmp0UKkuWqxt/UQKPkHXL61Dr+HSAL+9KMpzQeP/l2X6NfaTZnd8YR 4ROW9jUpd99k3sslFhLwRThjcTEJ0xIJp3urVgIrSlU0qyGMsA= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.187 Subject: [Qemu-devel] [PULL 11/15] linux-user: Add support for RNDRESEEDCRNG ioctl X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov , Riku Voipio , Laurent Vivier , Aleksandar Markovic Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Aleksandar Markovic RNDRESEEDCRNG is a newer ioctl (added in kernel 4.17), and an "ifdef" guard is used for that reason in this patch. Signed-off-by: Aleksandar Markovic Reviewed-by: Laurent Vivier Message-Id: <1567601968-26946-3-git-send-email-aleksandar.markovic@rt-rk.co= m> Signed-off-by: Laurent Vivier --- linux-user/ioctls.h | 3 +++ linux-user/syscall_defs.h | 1 + 2 files changed, 4 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 3281c97ca263..cd9b6f9a8d45 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -246,6 +246,9 @@ IOCTL(RNDADDTOENTCNT, IOC_W, MK_PTR(TYPE_INT)) IOCTL(RNDZAPENTCNT, 0, TYPE_NULL) IOCTL(RNDCLEARPOOL, 0, TYPE_NULL) +#ifdef RNDRESEEDCRNG + IOCTL(RNDRESEEDCRNG, 0, TYPE_NULL) +#endif =20 IOCTL(CDROMPAUSE, 0, TYPE_NULL) IOCTL(CDROMSTART, 0, TYPE_NULL) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 06622703008a..19a1d39cbc82 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -850,6 +850,7 @@ struct target_pollfd { #define TARGET_RNDADDTOENTCNT TARGET_IOW('R', 0x01, int) #define TARGET_RNDZAPENTCNT TARGET_IO('R', 0x04) #define TARGET_RNDCLEARPOOL TARGET_IO('R', 0x06) +#define TARGET_RNDRESEEDCRNG TARGET_IO('R', 0x07) =20 /* From */ =20 --=20 2.21.0 From nobody Sat Apr 27 04:13:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1568134277; cv=none; d=zoho.com; s=zohoarc; b=NsO6x5zlQ1H2r1oeJta+NWVKyVTyHYfChQHGcXvDOFqFCvgZT24aW6JqLUOudi/fF9NAQiAbU1LXlk40BMEpwDv78W8BytFfDGgftKgItI+2BrxgrIDnYf2KyfOOPRKcC5eTPLv04pazfa+H0vfdZ5DwaDACn9CQmasMPlI7vn0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568134277; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=3lBNS3N8lj+lYhhqmBIaGIljCTKwtWzjInWdQ8zJSHU=; b=auv06LKwmoZc0E7I6LzPSq6KEVFMoRc9/u3GQcGQMU5Jxt0i+tLwJ6X21Gc1RNZuaeTBmOlbE+DA9jZPd4HBoP2PgWUQ762wyS3bqZQESat4fK5L6tO4fNpcmdaVghXZvGp5eX/3PVWec54Ht1WDqCD3sR7UTtdauJlNBches7o= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568134277797717.5915848651516; Tue, 10 Sep 2019 09:51:17 -0700 (PDT) Received: from localhost ([::1]:43388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7jMK-0003pB-57 for importer@patchew.org; Tue, 10 Sep 2019 12:51:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53355) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7j81-0004n1-TX for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7j80-0002FG-PM for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:29 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:58527) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7j80-0002Da-FC for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:28 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MS43X-1higAc3LD9-00TQZi; Tue, 10 Sep 2019 18:36:18 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 10 Sep 2019 18:35:57 +0200 Message-Id: <20190910163600.19971-13-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190910163600.19971-1-laurent@vivier.eu> References: <20190910163600.19971-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:8P4zXj3D1FoRmVr4ARkgUOLDysmxAr2oo5mxX/cqvbMQ72UFX1E WTpPieRqowiT+XKtRZZwwhWN9BHVc9F4S+WiIOBeluOQ+Mr+DcoFQQu4a6yFb9xuR4+SEv9 kJyXJ6tld/NoVu2ZSD1BM29r8ZxaEG3jairY1CkNQbgIEDixVRPP7ctGBrD3HxeNvdnIWNf jYyLi3/05ymrP/p9Lqx1g== X-UI-Out-Filterresults: notjunk:1;V03:K0:PTOslLJNI5M=:UfFzEj1m6etqI0qeTQa/Q6 DWf9Bpzbkt9WaPRu2BH9CZ7IMrJC1fOtMJ0+XqwwajGG5Msi3Pnxu6WdWn4tZbO3wfi45Xzn4 DCEm8OP+14NoxuMJ4AxeK3yRq2sV9pJEgVuJ2/yVQvGxTaH8p5wBy63ZnI2OTIb23CqD7dOzn 3qNyjMDt80JqH449cRsW//fFA7uwUZva6P/KAtdvGsLpLItbomBqSc8Q7n0XItLJqNhfxcpJA cUFCBsDp3aX/VX4GMCZW2m+w3VjuKVmUNRRvYXNP1mtA7MwcnlRByltSl34hTGhXIPEnOOsHS 1QKcUVWp5QBWbIH3ZmtjTOJqq7exz81yPb0SrqJcnq3Vc2yGsz1p5jeStyAHOXkF0ZfvcNmTN +u9PLmioGTYmz3titc5L6sALjBO9utYUL8gCDdH2Yj84XRFN4XDrBLaeY94fXnizU4iIWeEf8 SUKRrrKfYkBWmzfeLlgJyrV6ClNyX3HqszoRI5+n30sxCJmzCfJOLnDhhhO7LATbeU+VBoUJD xxFnykRixHvT5lT1ke70HjrW+cprsRo4U1HZhQVGQn129taLQl+HtCJtmhZ46aj0XZzc2as+L lKbrpBBrxLhklFv305PMXYW7hqC+QyfdezeIAFspCyX33YvDD8hbgrnW4o6Knjr5+39EU8uBb 02OjILrPC+Q4YKxHumy92o6f6sATnZo8Ofj+sWxJkitrAMMJ/mxetZdjB6C/7+ItjCMpIybzz 6iXIOWAKon4iefS94C82/PwhikLd1/7HRV6yVTfurlnlaLIRCz4EuSxjCeKgeHcvrihWVkZR1 q5R/4vj1rCUKwxGN9+epUa7+WZxtWjQ/abQp62o9GP6rJXf7yw= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.130 Subject: [Qemu-devel] [PULL 12/15] linux-user: Add support for FIOGETOWN and FIOSETOWN ioctls X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov , Riku Voipio , Laurent Vivier , Aleksandar Markovic Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Aleksandar Markovic FIOGETOWN and FIOSETOWN ioctls have platform-specific definitions, hence non-standard definition in QEMU too. Other than that, they both have a single integer argument, and their functionality is emulated in a straightforward way. Signed-off-by: Aleksandar Markovic Reviewed-by: Laurent Vivier Message-Id: <1567601968-26946-4-git-send-email-aleksandar.markovic@rt-rk.co= m> Signed-off-by: Laurent Vivier --- linux-user/ioctls.h | 2 ++ linux-user/syscall_defs.h | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index cd9b6f9a8d45..1830de96e12b 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -177,6 +177,8 @@ #endif #endif /* CONFIG_USBFS */ =20 + IOCTL(FIOGETOWN, IOC_R, MK_PTR(TYPE_INT)) + IOCTL(FIOSETOWN, IOC_W, MK_PTR(TYPE_INT)) IOCTL(SIOCATMARK, IOC_R, MK_PTR(TYPE_INT)) IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(MK_STRUCT(STRUCT_int_ifreq))) IOCTL(SIOCGIFFLAGS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_short_ifreq))) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 19a1d39cbc82..498223b77787 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -758,10 +758,14 @@ struct target_pollfd { =20 #if defined(TARGET_ALPHA) || defined(TARGET_MIPS) || defined(TARGET_SH4) |= | \ defined(TARGET_XTENSA) +#define TARGET_FIOGETOWN TARGET_IOR('f', 123, int) +#define TARGET_FIOSETOWN TARGET_IOW('f', 124, int) #define TARGET_SIOCATMARK TARGET_IOR('s', 7, int) #define TARGET_SIOCSPGRP TARGET_IOW('s', 8, pid_t) #define TARGET_SIOCGPGRP TARGET_IOR('s', 9, pid_t) #else +#define TARGET_FIOGETOWN 0x8903 +#define TARGET_FIOSETOWN 0x8901 #define TARGET_SIOCATMARK 0x8905 #define TARGET_SIOCSPGRP 0x8902 #define TARGET_SIOCGPGRP 0x8904 --=20 2.21.0 From nobody Sat Apr 27 04:13:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1568133930; cv=none; d=zoho.com; s=zohoarc; b=FEkev6pwU2HIXv5Kr7Biz5jG/2B+bRKDDv6jJtXQin7E2NbT88Mzl4mvgPlbtdd+bQ2i0hwQ+42IJCUPgI90H98wB4uMJULb8B3Kym3GEWvFdNPf76aIrs+RwzUvcciCvJlJNeyBkfEI1OX9WR5jGwcuJ068Eehj0+0E5tOWTys= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568133930; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=4KQk3fq57MBygLCVHK1CjEioaWYUq1JYrATHRLH2eQ8=; b=FgYNOF8DPIuOVWW6vgo8Ks3CfNKZ1zB9PFNOxy9BNynKHBm6CZG4swLw5iFkMxZi4zNUajPyJYz2tHdlvQStvIfCSzrma0cNc1Rhcik2nPtOjbpYDWD0p9VB4c52vlUrwHb+Ad6BbnQb94TsnGSdrrfBaAcvysm9IKQluu6xXO0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568133929925873.6349323302175; Tue, 10 Sep 2019 09:45:29 -0700 (PDT) Received: from localhost ([::1]:43236 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7jGf-0005ph-R9 for importer@patchew.org; Tue, 10 Sep 2019 12:45:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53392) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7j85-0004tJ-04 for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7j83-0002Gu-VU for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:32 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:59871) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7j83-0002GU-Mt for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:31 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MuDLZ-1iPxOx41KH-00uXui; Tue, 10 Sep 2019 18:36:19 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 10 Sep 2019 18:35:58 +0200 Message-Id: <20190910163600.19971-14-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190910163600.19971-1-laurent@vivier.eu> References: <20190910163600.19971-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:7qgUg+r2PreMjPeylXr3/hm5lIOx0wzUU6m4vf3hYTDBv5XZR5w l8hPg709p8ShakQ88AxFXbBOgr79r9NWhKflz+gKceELbd1LOkqaTSfrbTiy3NGoJZJ7qLD JvGG2s5yy7kGDfZRQsohxvFfMcQSIL47df3nZ6r/B7cS5lj5Gxo+dfqLvQiJ2K9RNTxcOie Wj1fJzow5X3tLkEvP5NyQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:4EE97/bQTxE=:v7bq8KfBkigv07lY2vMXIx EShrgXZ4kWOglB5rytzhxOeGOOpJQBibKyp/pwUZZHY64T4VgmrX9ljJ6QTlmdV8RJKVSxCVv owvIVASw5VmGcVL00PiqRzdQIs7WOWynQ4dbKrtGYXEoeFx2KX1mch9AcVCPx9fVu9C8hiVmg BT/trd9o8KrRCdsZHNRnyiq4iSK+d47HEKg/Fp3aQTex2p4T9LZ1n0LQEyNDipud2H+wQWPML fGGBTQxqZ6lnMVadCzZTAtlPc9tmBs2f4vihnTzT+Iuic5XJXqcHQTpkDGUxUPO3nKqWExDJC LYA5RaBrK4EfAYJC7ZC69ybkQW9Y5Ru3PPM9JWieRn+/66MFSaKNc1NeXxYt3QqECwUTdqmTs alUqPF3kI1Zwf/eVSe5wfvQT9crOLzvE5MR0D6Ynw3AJ0inT9RWiEOxPPtMX/VV9ETLCdfV32 kb/NL+Uais5bPHSToxFelgjZXYGN8d5tAzVejTc55oNNC52YeHBsuMwx5NWVy1uFyR6BvVKkC wR17qcyRAA5o03Pa8oV2M4Y7kTI7rj8tbemPbMpAE+iP2QR2zlevKyv2JTeotCHTJRLBT2k1A VG5Amq/D58rtETNMrYR64YNhOq08tc672L9CsiH8luJx09fD3Ti9MAad7+1YHb0mhNU3/3C8X UZXLEpGevSgzinVfzrhEQRG17gUMRgAuWEARWqzzKkE01Lo2rg7HRqp299gUqp+2O98MPnoyG AJQRY0F0C46RK3VUt05FZyvZMUG4um3upCdYW/vUT+/5AQd/3LVTBoncqNbQCplipxP4YnPXV G4yLRE96cYwuyw8S3EErsYK+aexWwQSitlvSVjyQ9P2KsKivS8= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.135 Subject: [Qemu-devel] [PULL 13/15] linux-user: Add support for FDFLUSH ioctl X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov , Riku Voipio , Yunqiang Su , Laurent Vivier , Aleksandar Markovic Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Yunqiang Su FDFLUSH is used for flushing buffers of floppy drives. Support in QEMU is needed because some of Debian packages use this ioctl while running post-build tests. One such example is 'tar' package. Signed-off-by: Yunqiang Su Signed-off-by: Aleksandar Markovic Reviewed-by: Laurent Vivier Message-Id: <1567601968-26946-5-git-send-email-aleksandar.markovic@rt-rk.co= m> Signed-off-by: Laurent Vivier --- linux-user/ioctls.h | 2 ++ linux-user/syscall.c | 1 + linux-user/syscall_defs.h | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 1830de96e12b..bc1944804220 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -112,6 +112,8 @@ IOCTL(BLKZEROOUT, IOC_W, MK_PTR(MK_ARRAY(TYPE_ULONGLONG, 2))) #endif =20 + IOCTL(FDFLUSH, 0, TYPE_NULL) + #ifdef FIBMAP IOCTL(FIBMAP, IOC_W | IOC_R, MK_PTR(TYPE_LONG)) #endif diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 6928f654ced3..e2af3c1494fa 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -89,6 +89,7 @@ #include #include #include +#include #if defined(CONFIG_FIEMAP) #include #endif diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 498223b77787..917202a2035d 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -888,6 +888,10 @@ struct target_pollfd { #define TARGET_BLKROTATIONAL TARGET_IO(0x12, 126) #define TARGET_BLKZEROOUT TARGET_IO(0x12, 127) =20 +/* From */ + +#define TARGET_FDFLUSH TARGET_IO(2, 0x4b) + #define TARGET_FIBMAP TARGET_IO(0x00,1) /* bmap access */ #define TARGET_FIGETBSZ TARGET_IO(0x00,2) /* get the block size used fo= r bmap */ =20 --=20 2.21.0 From nobody Sat Apr 27 04:13:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1568134169; cv=none; d=zoho.com; s=zohoarc; b=MGAJaMXqgZGJBbJJaJpth2ld/FTx6SC0y3D4wC+pIRSL1CxjaOmWAtbUcersqEuHiWMUyIaJ0JDfprH3NhHoO88c9cUJvJkkJaafbpVrLhUv26NO49RxMlIlzCPeu5qAnzUm0DmHvPErYklXiAdnTzsY4VYmtD1Bal9zMIkeWAI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568134169; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=ytm4ckK4nz6eGXnCG1Jon+z7HA28ox8NzjOF48QyZzo=; b=igQlmDyul6kfeC5Qvm+e1kSVkcipnqew4ZZL/1GR/riGNLeOMA+be610tw3YNIxxqniyHmYUx4vAHS2ALNGuTCddv1/NlcG/f7C8rXoAGyvybee50SwLCc/dR7EQ4CFhsL7I/G8LDh8dwjunFvsXQYMl8zpyoSRY2QquU7txKKE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568134169346240.09145199466514; Tue, 10 Sep 2019 09:49:29 -0700 (PDT) Received: from localhost ([::1]:43324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7jKa-0001kO-2e for importer@patchew.org; Tue, 10 Sep 2019 12:49:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53425) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7j87-0004wy-3K for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7j86-0002Ip-0q for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:34 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:55029) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7j85-0002IK-O8 for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:33 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N9MYu-1iAqJs0Mq4-015GEj; Tue, 10 Sep 2019 18:36:20 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 10 Sep 2019 18:35:59 +0200 Message-Id: <20190910163600.19971-15-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190910163600.19971-1-laurent@vivier.eu> References: <20190910163600.19971-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:j3hxowZgULFsmcQkhqJXfvJU6P0M974wp99dlXXw63V2K4PMAer q00eNjanqIeN1N/jIrjk8reaBdis5iEHJrpN5HYuwG+GKgxey2TNuegrfSgVDlT7NZPwQkW QZjYHz2uoQAJSUF0xr+tzsyw+aGlH+I9yFz5+qOJL6pfDr5B9t8AIVe80heQtF/VHgplabO +o5eJyrNp5Hvhl/Thy+GA== X-UI-Out-Filterresults: notjunk:1;V03:K0:NOOetTmBtf0=:DHIfczAsisCLrslwKVyrWQ ekUCcbVzbzI+mT36y5o/wswO/FqkTKzTAdlcKcp3tdLcZ0n6Xe7TxGnou2D6LzlWekrB8ejOG 4BapOzpg95Gt24SdCv0GAJhDHRraTb+AjQHNLlYRfi+NjeSzSQqSGz5G+X7OMd2pFulThGFXU enhJeJEmfmtGLJDwPvbAp0lTJhow2PXAe/yt0HkUUV/nPHNNjwRX/XeAB2m1lquQjFhAYPa7F bPKX1rCO8xq+zy6Y9+IQZuZ1Os7GtWV2mRSVSy9dua3Thhpm8qgdf+drXmyHVZfNwEUk/Cy0U YSwmBPxSuhAAeMbG3m4m11AkqkuTaDEK4hrUtW0LHewnTE57nckbeSxuX8aA30TQEEsyrcVIp CEDGpgQ4omqr9ASnRpO07jHMWpo/nF9STjlKIcyPG1Fbl6tDysJh3+C3RI3zOJH0ds2+ip2Wm JrWWu315037VUHwS7emysJZe3gRe9V19j+OofGK9M2DgNmRET1yRUE56lOxHHrVDJcYISsiJF 2ea89cl5Icvx4yfB2cKZY3qcE4s/VuMCyYuXvZHAOsqDjzPYgmcUzK04XHZBB3hF76I/O4Yv8 zJxEhFU1/vBQcdW+PfNJ9aCQOelfCt34XffCVM9Sbj/0oYlW8WFD+30vtHJum1B3JuKC23Sh/ tITJI70WpzcoVzscLsjD+80bTbyNHSiRsF+z8mpJ/7OW0u6Sy4Lr80eYdzD4XkPN/ZgeKHtei da0k+hnf7jdpLXFX3FCyNZi4lB9gBKX5bv//rZUj6DA4UMjE5IoZ3JJjd/D9ZBT9MPBTS4YVl hvMAdPGTn9voe5P4Wxho0/dzQjnQcdLNl5OwIk2Tso9K4GCdFc= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.187 Subject: [Qemu-devel] [PULL 14/15] linux-user: Add support for FDMSGON and FDMSGOFF ioctls X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov , Riku Voipio , Laurent Vivier , Aleksandar Markovic Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Aleksandar Markovic FDMSGON and FDMSGOFF switch informational messages of floppy drives on and off. Signed-off-by: Aleksandar Markovic Reviewed-by: Laurent Vivier Reviewed-by: Laurent Vivier Message-Id: <1567601968-26946-6-git-send-email-aleksandar.markovic@rt-rk.co= m> Signed-off-by: Laurent Vivier --- linux-user/ioctls.h | 2 ++ linux-user/syscall_defs.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index bc1944804220..b253469999ee 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -112,6 +112,8 @@ IOCTL(BLKZEROOUT, IOC_W, MK_PTR(MK_ARRAY(TYPE_ULONGLONG, 2))) #endif =20 + IOCTL(FDMSGON, 0, TYPE_NULL) + IOCTL(FDMSGOFF, 0, TYPE_NULL) IOCTL(FDFLUSH, 0, TYPE_NULL) =20 #ifdef FIBMAP diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 917202a2035d..4e33ef396be4 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -890,6 +890,8 @@ struct target_pollfd { =20 /* From */ =20 +#define TARGET_FDMSGON TARGET_IO(2, 0x45) +#define TARGET_FDMSGOFF TARGET_IO(2, 0x46) #define TARGET_FDFLUSH TARGET_IO(2, 0x4b) =20 #define TARGET_FIBMAP TARGET_IO(0x00,1) /* bmap access */ --=20 2.21.0 From nobody Sat Apr 27 04:13:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1568134455; cv=none; d=zoho.com; s=zohoarc; b=Hgah1GHgnTaxlRRtmE7zbpKxIlcQQ0/j7zlucdHDa7ywFMBXWBmPVfvpC19nMj8u4GqWFQUwK5Lt/BB2/k+/Fwe9jANPSibIA/ofSQm4QkjeQYkOa1PLSaKytJg3NwpWLQPuxuVCEs+qYxtCsvaxQz6VT0q/ONYJIlzjgEJ4oiA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568134455; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=JXmyOG3cKB9B0vuEgVwDfhS4Ueedz8oi9s4k9KaTa8A=; b=T2JHrbYlxcDhMfvDZp+433EGXWxZrvsmYBHTYiPUrQmr87mY8gQZzPQ9g27rt+4/o7rfnq7JGah3htVkAzBfq5OqZgYWpuS2nTLrhRWZs+x0tdB1EXrRk6WIZxt4PjQdiVM/Z1EgQ3RtwKY5sJmTVyZuvy8cONFjRv+yq8FkL4c= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568134455574850.5766880716915; Tue, 10 Sep 2019 09:54:15 -0700 (PDT) Received: from localhost ([::1]:43422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7jP9-0007kE-7K for importer@patchew.org; Tue, 10 Sep 2019 12:54:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53319) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7j80-0004kY-NL for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7j7y-0002CM-Gg for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:28 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:60739) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7j7y-0002A6-6c for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:26 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MCKSA-1hyPjj0ll4-009Qkh; Tue, 10 Sep 2019 18:36:21 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 10 Sep 2019 18:36:00 +0200 Message-Id: <20190910163600.19971-16-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190910163600.19971-1-laurent@vivier.eu> References: <20190910163600.19971-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:ulRcokUfmXdMbuiGnDuBpfBvI+ZopA0SBBBNyQnDkISRpg6SGTm 8Z6PeQZxTTCGX4wcPaG2yH1DtPGItUI04WkkSJl4RxyaDnZKqN9/letktg1GrcsITV+Kacg n8M90wF1ciZsC1BMZ02UWlRD/a5rkLNQAOcrC/pEZeY5/fQYxhIMGlO2rq/5IB/zNyDpeqH DqElenvUr8QknxPVP0sRQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:hK/tHS/D818=:UQaPQow9eglUooyDRVejIr NDzTA7j1S10WZaiLqBIbDppIHFcdhCZC4OVtX4ymSDfKdL5191d0afqtCvEXAXlHYaL6AM8mr C74dKVKq8PogupkoO1LfX4pHIXtIzyoODEdFEA38o4TEgSHFzeKCN6BgQVqJTyD+ncSmahrCl Tnbwwt6mOWSp7+3MClq/8hlqjVePKvCSxvNocNWIzoxC4AbiqgwMKfQFPOr5rBA/JV+76947k byBpBrMUJu7+24KrzsgRbi1MfLihI/IYmScR9+IWDets+CE505eIjK6LztnKGRzWeY8b/+KxH D7rF/udx71QKyRqR7Jo3isL3qovv7X0hQmuZi8FdgWywvN2UAx07tbOdMsVbgZpKOiA/nAAsJ eN39PNAC0viDT+gGOlaqEuoqhUIq0pkCY4Pxk8hksrvyAfP1RzpohpNiuB0D8dGLACZ9isg8B 3NyL8BwO8b+sJb4aFcyDcAGPakLeLkfffU1k9LN65s0t1AbkdqLtD6lphjvNRL8ZpXV7uoVDe +VrdEu9tb1WSAoxJUrSQqfVOtERz9raJXU2lQo8ozxzb+F14nH9y6aFMNRBXXUKtrJjOHTVBl kKXU9JYJrdEYh0cI0j2oO2wNF1RxloXk/NEdkP4HjasjsmfuYu+pAZIre1b+6EkuM2n3ljEf6 U3Qe7XBbKl5BDpRAild7YbUkdti7IW7nR6SyAEQExOPg8owxioMp5uKYehOOczWsJ3HFa42g+ bb4tiOCr+elx6RIswuUFettKBpKG/XKeOzEZUMfztg3uq2N08gnZGp6C6GIO5PaW2nyGW0ccd HfE0HL5Ag3fmpSAFyEGd4Id1QJIEPJoEVt56KIqUv9vWzmv/Ng= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.187 Subject: [Qemu-devel] [PULL 15/15] linux-user: Add support for FDRESET, FDRAWCMD, FDTWADDLE, and FDEJECT ioctls X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov , Riku Voipio , Laurent Vivier , Aleksandar Markovic Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Aleksandar Markovic FDRESET, FDRAWCMD, FDTWADDLE, and FDEJECT ioctls are misc commands for controlling a floppy drive. Signed-off-by: Aleksandar Markovic Reviewed-by: Laurent Vivier Message-Id: <1567601968-26946-7-git-send-email-aleksandar.markovic@rt-rk.co= m> Signed-off-by: Laurent Vivier --- linux-user/ioctls.h | 4 ++++ linux-user/syscall_defs.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index b253469999ee..c6b9d6ad6653 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -115,6 +115,10 @@ IOCTL(FDMSGON, 0, TYPE_NULL) IOCTL(FDMSGOFF, 0, TYPE_NULL) IOCTL(FDFLUSH, 0, TYPE_NULL) + IOCTL(FDRESET, 0, TYPE_NULL) + IOCTL(FDRAWCMD, 0, TYPE_NULL) + IOCTL(FDTWADDLE, 0, TYPE_NULL) + IOCTL(FDEJECT, 0, TYPE_NULL) =20 #ifdef FIBMAP IOCTL(FIBMAP, IOC_W | IOC_R, MK_PTR(TYPE_LONG)) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 4e33ef396be4..fa69c6ab8d01 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -893,6 +893,10 @@ struct target_pollfd { #define TARGET_FDMSGON TARGET_IO(2, 0x45) #define TARGET_FDMSGOFF TARGET_IO(2, 0x46) #define TARGET_FDFLUSH TARGET_IO(2, 0x4b) +#define TARGET_FDRESET TARGET_IO(2, 0x54) +#define TARGET_FDRAWCMD TARGET_IO(2, 0x58) +#define TARGET_FDTWADDLE TARGET_IO(2, 0x59) +#define TARGET_FDEJECT TARGET_IO(2, 0x5a) =20 #define TARGET_FIBMAP TARGET_IO(0x00,1) /* bmap access */ #define TARGET_FIGETBSZ TARGET_IO(0x00,2) /* get the block size used fo= r bmap */ --=20 2.21.0