From nobody Sat Apr 20 06:48:37 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=1568185554; cv=none; d=zoho.com; s=zohoarc; b=O524R6a5c6oLPHYzQQZnj42KKvqxcoI93XPGQo1NVP2LU2j2/pkEY4vgQYGqx4sgUbh40UTa6K8J6TVP61pq46gB+nO0koMN0twAwsLI9tETPr2ZvLzXI+bNcuANuFRsn33xdUq5HiVCHuzbt/48jOJ/HIP6AMflJ8QsesKEjyg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568185554; 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=DJxa2XSie2w+VTTzgWlXxFLYrJ1rvawEIoBy36twU4Q5iyxGhbFVCNSdn7CmeIozkU01l6Zi6ncqDXqUl7VatrIiji5TXIrxYD/lqpFdqDxRoPU/9As+1lUKcTSaqu2oAI2WGtdto+qIXXofpvmG7fm1YVVS129GC2l1Hs/xe74= 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 1568185554388602.7737358480263; Wed, 11 Sep 2019 00:05:54 -0700 (PDT) Received: from localhost ([::1]:47148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7whD-00059v-78 for importer@patchew.org; Wed, 11 Sep 2019 03:05:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40899) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wRk-00068g-Ad for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7wRj-0004Qj-8g for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:44 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:58021) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7wRj-0004Py-0H for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:43 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mzhzd-1iLKWS2rw1-00vbu6; Wed, 11 Sep 2019 08:49:25 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 11 Sep 2019 08:49:06 +0200 Message-Id: <20190911064920.1718-2-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190911064920.1718-1-laurent@vivier.eu> References: <20190911064920.1718-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:XRNaDVW/Z6FFauGWDmfsEwdbmHLOp9czIYg/b7ZfJNy9qHKSfGE H29vtQwz34phoQeBvDFaul7IhkYM7kkgeblbhRyuVReX6iH2xZ0HQbw6cNuQAmyNWe/5v9h OM+/n4WMocQe/9ZzRR1wVkMA2ZYxKhwMYPs//Eu+fxr8fnwqbEpH1nunhTqRVJ+HjaqObim Kiy5vJZZvdnyG+1Fc2NRg== X-UI-Out-Filterresults: notjunk:1;V03:K0:g+4deSDCMqQ=:5LDGnoSHT9zYaHZq4eChyl wkBSEG1Lm965AykirnABv66GwVBtdb3be0NMI80huF3vxDRXl+YgcYjL2zYeuyGmP2buUFjyg E++sGDaBdgxa0HUW0Bp7Ju+iXXJM3sXM3SYJ+1JthrI32ZJ16q9q4vZvvQbtdpRDF8J8iy10V /txQccNthfJWCX0ZkJQAfXCw31es6yCNuVM1BQ3NEQ2KfY3RG9kyWQUG+QD0DwRF8wL6kZqEx vIqr1ZLkcYh8Wx41QoyA7l+wLjOVjxrARUUfEUXjYdO+PA3swHavAeIWOzi7uG+nqP7bqFvgX o1dQqTysDZzEJ45/CgBaYBhORKNYPQFaRfcwXDsqHRK+U8JSkVpMYWVJhoqMmKATPyHiSs6ov IV4+oxiQyJfht6sznBDER3qbhGsZI+g/d8gZekuJNgBB1p5C2aKtQjmjlYlKbwPjH6cmiFfI/ Q1W2gs9nDRybBGek2RTrID+241hYXC3JFFSZOhAbuBybDxfDVek2ZV+iYSv+BjDBeRDETXDzh dqIcJr0x56rz3lgsCg3cCDDIxUiNBcWJu7ZKxIpch00cio61JPjlqk9MnUQ9MdC6GHt4dhGbx 2PWk8c+UNCeX2/2qoamLvKIWWO0lpzTC2I03bujsu6i6C+5x46XJxqFty2tbxFL0X4gQ4NCSF UTkngEnueaR/ipcBBjqpvYcmXlFUgqe0b0eM+EpRF1A0KZhE1Kp9EMsUBHaQXFwRUTrpCq4G/ VxkuZJmn0FoH1gAn7pLBwMPleEr1gFZzeIk0w+zT2KM9PAGydc7KxzbzA+sKIzXbwxLYsx7ls mg9TTswo+e/RjTV3sN2GxCOO9m/JR09NOng4Zpe5Nw7JSW4DHY= 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 v2 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 20 06:48:37 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=1568184940; cv=none; d=zoho.com; s=zohoarc; b=Av6+R6ygbkZVZX5RcsO9wqr3fFKtYF4oYi8LuARasO146MHw46LZbKqopBvMgVS4rWXhu91Z+JMT1ly8xsOfdsSHvIsaoJTNCLkTZ9MNlCArjOJdaN/XUaZNxDTFnU6A54OEiYagVvc3XD2NwUYgJXJpbXvtf9RGhDrKvISQHgs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568184940; 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=do65Q0tUqyv3PynS+ymCqyfHyITrcl75miFE8IgpTxv8qVpUU75ahbSe8B9KPXBBPpvHAEfBRikpChJ4IWT3KlM2kFXkp8czuz4lBgPFXjRgc7Zk4FU47rYPOsX0hI7687b7CspRm20ksQndvI7tqDiZqnK5iZYzO1Cte2X+3oI= 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 1568184940712510.0622440010212; Tue, 10 Sep 2019 23:55:40 -0700 (PDT) Received: from localhost ([::1]:47054 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wXQ-0003vd-Kz for importer@patchew.org; Wed, 11 Sep 2019 02:55:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40764) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wRb-0005wi-5a for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7wRa-0004Kg-1Y for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:34 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:41833) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7wRZ-0004Jr-Py for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:33 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MQNAv-1hmGox1OCH-00MH9W; Wed, 11 Sep 2019 08:49:26 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 11 Sep 2019 08:49:07 +0200 Message-Id: <20190911064920.1718-3-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190911064920.1718-1-laurent@vivier.eu> References: <20190911064920.1718-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:UhOsa0Li3ZyDuFmsDVyrTCLiv2TPTPABsCgKe8F3x9i9OA/gwZ9 vo06RmXRwf7uVchkxm5aXG9q0BsRImvXqf3YYoTBLvXQUQHjTrPM9ne0xswrJMcodq/Uhtf Tv2kfIy2PTN9AYoS663uR0+5Odd4+xw49C26ertwvCc4qbEEYH4h/Vl71cUSZmCBcabhdKO dmaSeX/cjQFTKTNS4PPbA== X-UI-Out-Filterresults: notjunk:1;V03:K0:9pFxjYD9aoQ=:aH3Zo5CmoFyoORO/tWz+bD WWPkPj2z9y/K8DzYONkHBhWnT7jYmAjMRIKg3+FX0+J0qTS37GQgGF6Di2l8FO/j2aboRXXNR md9m3NBzUsTA2PhAfEt4DZcDdf4qHE8MeswkA7bp99MRqvQbWzdg1SsAkedU6/JkEWpUxZSfi YVpNW+2c3cSMfitCTiAKhXc4rZURRlm1XWFNo2sEz2lWkOgjtmCLUuNY3BuiYntaLuDFcgQvk 1sk7XC3timCt0On/Rt+D3YeTn/Vzspg1yScFEgDgLzyaYmjQQCaHlfdhFPixPiQ2fx4YimBD8 70Lh97J+r58w9alfpOBj3F6uoz8p12f2+ADRsTByoKl/Si/1g+KhBIoxk8j17Qf/On33jpLIA SG3wX69wB8b2e5wn0rU9/YNxZsPWYb4dJyVnT2O8OjA0sU3ZqvWGr8PFq79MymZZKVrSM4BSe c2/9ovOZr/xP+or5skr5LJkf/blfaPAldbNIvrkMUMf8ER0q+UUaDkxGF0MrHJfbZQN75gV66 UAVbBYhyyJBfK86x+IXX2HH7LiBNlzBisT/RW/b3BGHDbv1VhdbzKRba0B3uHrppy/1DuBmEt jIDZVTUcpej5KATOB6oTlgSPQtqao1MfTdW2ok5u24hf6oTlwFCQjtQTkwjcay2wDSFIhIQnK M5ruflqlEqOms+X7/o6YzvvPy2RBb7VRgIa8xToc+plBWfONYhDid+5NMuZ4dioDtjUP86mp5 OFFyNt2cg1YHmvbfPAtqCNcAEp6VKTazDzmP+iKfQTX1FyfkIW2hjtSw5EknXoGwbhybUxnoB HVHzqkFd8xFjttmQmx2X4Fj4QsY7EISXMD/blbtAIjUVzkMnJM= 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 v2 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 20 06:48:37 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=1568185245; cv=none; d=zoho.com; s=zohoarc; b=MK5dd7+RtM3FtvkvF56wkdHuWDbSgc9eAfZ3jlPO1PzREuBQTHarLEYrVorIcI6JcYOZttIKmLsF1D9kp++yoHSRpXfK0r29+jjy5+Q9X1UnD6RNUBYZekBAWGDNLksGnDljUq3v2kQ3lnPLEgdNPNPs05VrQqpcsTBYZ8EsdiA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568185245; 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=bk6Iy4cANCssXWU7QVZ/ZIV0bYucKtKMJ1/aXHHV3d0=; b=DejaEimLxMvDz3yqZqIGHNAKtuq38jZj+SNyxnZa3VYt/pCAm8ABnmzeVLPiOqiLklWn6eCd50fh1yrntktHjrpZYbkvI2sa2SnJIU1SPgRAOw+Oa12o4Att3BDOh1U6gJXtw/C0wRCbdvJInoY0vo2+9u8kBiCje1Ow75NQ2+I= 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 1568185245550568.7431742396259; Wed, 11 Sep 2019 00:00:45 -0700 (PDT) Received: from localhost ([::1]:47112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wcF-0001D8-9Q for importer@patchew.org; Wed, 11 Sep 2019 03:00:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40791) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wRd-0005zV-Du for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7wRc-0004Lw-E7 for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:37 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:41639) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7wRc-0004LP-5r for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:36 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MQdtO-1hneOe3lJO-00Neb7; Wed, 11 Sep 2019 08:49:27 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 11 Sep 2019 08:49:08 +0200 Message-Id: <20190911064920.1718-4-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190911064920.1718-1-laurent@vivier.eu> References: <20190911064920.1718-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:BhFz3JGYOqV2oRqgFfYhck60WR/r0kySBhTCOvHWSxF7Kis7fKY vY2LdwEoDwQuO+ZKuMD/I0S53u1Ka1bi2Nibue/ONBiSPUKE56B7bVwyHppeBJFZQS09tz3 XlZh3yw+W1K+78UchimIMpWdaqs6o5FKjC3OFLYKS5DgyxIPE0rw2dDhjmK721uCNYP/M86 b/J0Xh2NVDALJLnxJvDMA== X-UI-Out-Filterresults: notjunk:1;V03:K0:XsCRCjD72+c=:1Uao9+BpcdNnoZK+wH3SOk t7HRE4ZvMFQqQtYDF/gUH0byvVWGl3QEvDj5AFjZYk854GTC+8BR+5rIUmdWVE1N6Xg7Suw9w ChfVnR/kbol6ypoKErMZsKj4en9f9GKb7t3Cknk0XMSHQntB6ey/kG/MzZ/uUo08AwMlt9cPY 45RQtVG+dxyhyhkMbjEoZPFBX4B5b1k9cYbXZ8Ef3eQZamHHqnCamUr4KybdxpSTEQfkV+6Ad TdF13sjcHAP+5r3xereYrThy3RVx393PT+B0PlApyF74FIM2vMpDrhB653yKPS5U0J8axNM7d dZc5lfdg3wwWRBuAfarizyCy4D4UYnhON5Zd8gIO0bQUVtB2/5npJQDgMDt/AN6vcxETCOUjF GElDgkMnULYKe9c+oZC7njDMugagM7cOnmb4kmwFjRVc2Mw7wwsXSR4zffmaHcs1s0oK7Ss1Z PNxUEaUUNbeD5FLjyQfT544qRTLhl5NOdB/6XSjWqhnlT3N6VIixsvaLHGe/9vQu6C7PrEOVI ZvgNdGAzl5J6mH/j0PFyIzk+q8dWs+dYVyUpeSi0/LnmFjtOL98VlO26Z5UKvnnODsyQkcqVV 5VA+su51z+ZcRHHdYDfpjCN0prX4Ci8gds0+edEoNPyw3vnCreADyE5I2IuKtTVNKVJ7/9mX3 mlGBP7yGe9vqH9k2A2uQ2X8ihZ4qq2ii+2/ovSK5t25lqusYnuwkdif9uji7ebs5aQKt8NKK7 340CF1Tz9HrdDNUQfrEJvNTpTxs5pYbzhTVhqKfA5z6kwdIMuNQvS4hE6wFpFvFurGC2ifJ5A HDvPIZZAKhrRvS6OKZB9BF+Dc55Qec84YgMjFoBWP9P2ay1KL0= 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 v2 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 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 20 06:48:37 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=1568185060; cv=none; d=zoho.com; s=zohoarc; b=PbVntYEpdx5N+1k0jhyAyG/8/blwX+tUi6HP9d+pkIcf8YqMuk+Xs7T4YiOOTvPCBN2VTqTel4SBH0b48t8fiCh6rs3gfTDtRinPGaFUeriNZel7VGdMeXgIFYde809Bmy8mW9WBGLCur38PkGH1SxjaQu9tO7y/iH/OOvt43Sc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568185060; 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=a27WAwqbEY9K+D0og9fqKwrXBN21e0fAoWFN3zWpktPf5Dhlp+9ERrAK3PpWJVstcnRG86Cnd4/KVgl3W6kyIrFXrKZ93VDUfYH1D+0XDOAP4yWuO0sfEGkJ4mb4iznHAs5kKGDLfGVxtNVrt5TgkeC0wkHhhpFTlii4DcDMSoI= 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 1568185060855853.7597088353606; Tue, 10 Sep 2019 23:57:40 -0700 (PDT) Received: from localhost ([::1]:47082 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wZP-0006Fh-Fb for importer@patchew.org; Wed, 11 Sep 2019 02:57:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40818) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wRf-00061q-76 for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7wRe-0004Mp-1u for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:39 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:60443) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7wRd-0004MK-QF for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:38 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mo77T-1iSRH21szb-00pfb6; Wed, 11 Sep 2019 08:49:27 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 11 Sep 2019 08:49:09 +0200 Message-Id: <20190911064920.1718-5-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190911064920.1718-1-laurent@vivier.eu> References: <20190911064920.1718-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:tZI6n73vaB5Qv0qy5MoNsYEtjZ5ZaZbRe8BNUoALuIYHSgURjaB 3I8034V3qK3vmu2YNHZRf9tNx/70H2DOEquDRe5C4ecb/PCTNxmGamqHOUD1I6O+WjQlBBS jBHqmWT0p7Drg8ZdSKxx23fQpQcMzHiKZh9nD/78MWayDxb3lDgjTHEDXFYGp/njvVi5+lo j/sH0FciNz0RlCizQMslg== X-UI-Out-Filterresults: notjunk:1;V03:K0:hToNasJc+CI=:l8Huln66Xq1zBK/XPsnOan 0jzkaJHK3hRFQrILRcE4QNRir5CgxXu8xUnyh2ObbPnif/ji5Lh+qevST95SVDWi28Uh3mld1 qo4R87gfu0r5lSntBQDo7qE8uctHwYhHd41uKyDAC3QtfJtmh/4s4EuO+s1KyU7hp+qfEt+H0 pfsqfWz8NUizGFRh3XHc5rgV8hl2ExjDKmTEUF66FImx8/APNLHOV+xi65aRO/2DHdfUvuLCn +f2680fH6DCPiCxJ44C0/ZOPHWBk/6qEkQZ6QAs7ndiLPh5nMgsBl0XnwFDQdZWO2cpm11IZv L3GjNK04zhcyjlup0Mk2OKvZqNMdjz56LbOt8OllyuY2U8FRYE1UTbACt7myankS9Bm1SbPr7 Hz5M2zBJ7qkpi5YVhjna99KMiaADtjtIrbdIRH0znYBsemMDLhLO3DKHjItrFOrPLv7b4gr/w 3h38rOIbjCtbTI5amz/Kk7H0F0INHW5INijfEl8+AmJVHKrUQLgItoWF7dla7estOSxXBbm4G 6xEdh0xNRNKowPb84zszOOpmEYoEe21ruBAjpBhGvXlW0ClkEHm98w8M83n9LtVId+2BXqVA4 63OudArRd3Ba77ZgZ9a3tAsuJCpBL5ixxmm9SSc/Wk/h0n7MH1r4HLl+J00ABYPBTb2PEjZJE yaSpQNjVuXRtG3kxMw4XLEwWi3uYbAc6pldi/pFfJALAoOb9zhX8+2alf+yipQT+KKZkNqih1 tbARWKU8Ur/B9/QgM9es9Y9l7CdrwGd64ylIpuithH3YgQwnfT8Mn/o6v5NlyKnar29pvEnW/ +jXbWEptu/vI3kPQPlha+BRK3a09ctROSB7RLuvniVQQxHsBHM= 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 v2 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 20 06:48:37 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=1568185047; cv=none; d=zoho.com; s=zohoarc; b=mgM1R9UvUoHKySBmEwLOdrEdfhxQnXe0ihAPMii46SnYXmoz5w7eqH0Oi2UR4uD6QvHDFXHqlr4hnrcfYs8iR0NLosGayS1gAs8TQA9uB/vgnUUv3Qtm5Xly8Uyh/YFD2sOANIXvJ5LcOlfreFApcV86cSvfaIk/x0umRg9+TBU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568185047; 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=WC2uppqJUbugrQQ7hFKQ1aQC6iEQVV5LiHH8tKjW+pA=; b=JNz38eP0hB2Ur7X3/VQxLEXVWWupAzk3XPjrb3Q7ferZ8zaOZUCWCBlOBc6iYa96kp1TAOEzhvZF53HPHVO6d/a3t6tGQjKIir6X/6aNUYIH0F/wTt9Rgc+ZroBD445lJGriLTa4YuAdNA0K0dKb8e86vOSeBOWwWai9wpP1wXQ= 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 1568185047242342.54681522146166; Tue, 10 Sep 2019 23:57:27 -0700 (PDT) Received: from localhost ([::1]:47076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wZB-0005xc-LD for importer@patchew.org; Wed, 11 Sep 2019 02:57:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40863) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wRh-00065N-Qv for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7wRg-0004Oi-EN for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:41 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:36063) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7wRg-0004Nl-4x for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:40 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N2Dks-1iG9aT46rW-013eFZ; Wed, 11 Sep 2019 08:49:28 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 11 Sep 2019 08:49:10 +0200 Message-Id: <20190911064920.1718-6-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190911064920.1718-1-laurent@vivier.eu> References: <20190911064920.1718-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:n84p1J/+NgbBL4KSeiMwKyNItfyANhcsb9q3qPhMAKibBDdeeSg FFvSDv7PkbsYxJvRQSSxh9e6wtB/oaNseFyK/udsBEnnxgocSQca4O4stzjmY0in9Cjzahz +bo2iGmgPXbEwqX8WTr6//vuiDBXw0y0ZH5tL3IRAQfJ7iYm2n9er6LizgPFx6rxt+rKXLX sYSomXedZJ/6aRxlJFC9Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:yssrlqachBQ=:ltXFK8C9bj8fp1aKPUSQBa QH2SHBZx90B7ePIis0RITZY9KyjZpSKjGjetRyARigM0ZG2ILJJDw5f1NI0czKzrW5geEA/wT m+YXokh0i/sA31NxKbxljjnCtPsogvuXvLQx3BLcTqV3hQgctOO4PNLcWr/QI2tRR9dsvsDYT YRbh2N9//aNNh7qbOHTRxLNxdwEgI9tjVwGiqbV9xsBgFjdna6+jPmqrEBctLhfo6Y4/2LWdx 1UKGd0qCLBuXJkdoiZa7e76pHuPODKSfl8EbLI7VpEud1OHdXlt0rbfhCLdzDRuCiW4554FGz KHRZY3ZbHjYhN65t2Ju3cG84794AgVZtiHN+M23Zz3ix41WqVwJHZ9KmSKJsUgEB4btcPoX2N aYWB9zKeqlVcWLPmweXL5htdTu4vDBXP2zuRAiCbmE2K9kwvIij/NWPcSG8glsjGbwylKrKVG LYk2Nn4s9rXFfW2iwmzWbRf7FaOdI6BpvmX31lrBQX6ybMnVEoVaiyxesGbwZsLTjiS90E9OR BBSSX/kr8VjDCqG7hvhWjq7iMNX64BmZ0q6NzjvtOUmfyW4WCX7W08DnVT9Tno+RpNAOuKp4i 65euaRFmCNzHw1Qarj1Yzm/swHE50tBu828Xne/njspoJ9MA5YtNalG7lq488Jv81aXymXCbU XnKubxofs4aBnam35sHGriU1SaJMt47QggEFTogRrV7loRK1JN4UnybyFwZajePi0phLoicsC 25/8f3O2uwz9s5Dv2pN/KijH/meLKIwRvIZSJq2HDro8fmSOqYmy3TbVkGDrLWz/ZmmV9Wv/J 2XykyZt8X4azkRAD7qKHShLI/Jm7NwaNGnF9OB0hpgtU49UEoI= 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 v2 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 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 20 06:48:37 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=1568185568; cv=none; d=zoho.com; s=zohoarc; b=XmwFXd4N7KeosanDd2CvJhk2YJOxCzMIWANqThHKvxQMWkGFntn5AS+dbdATsQO1wfru1LNzor7VxAz+N/nYxrsU7BfHWNAkTZUto1llJDxfxXPaIWULbzEeQO8rZlqpWphNk3FEwBQRjOk/+R2f4O6GzoLvhmSb8oUDi6HjW3Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568185568; 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=id+RFPPhAiTNNx+qyXvKQ1g2MDSBeDrjJAvCLbt8E5/2kzzJ/RSsxD4QlmkG8R/fqUiUETkiAJiEda/fR1QlULJa8esMubr8ADYQgLlH2sAi7gJD/bpTA5Zvn2Sldjuckhw8pFCTySpzJycW+OGsHaY+4uESeT32x+teg7YyvQ0= 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 1568185568765408.06443323279086; Wed, 11 Sep 2019 00:06:08 -0700 (PDT) Received: from localhost ([::1]:47152 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7whS-0005bl-UM for importer@patchew.org; Wed, 11 Sep 2019 03:05:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40858) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wRh-00064k-BS for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7wRf-0004OM-V1 for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:41 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:58283) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7wRf-0004NS-LU for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:39 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MWRi7-1hbqgV2OPT-00XrjM; Wed, 11 Sep 2019 08:49:28 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 11 Sep 2019 08:49:11 +0200 Message-Id: <20190911064920.1718-7-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190911064920.1718-1-laurent@vivier.eu> References: <20190911064920.1718-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:lfv5mfUSpaYqspHFKcdASL7d5yzUy8SzbylCwkjxEMMQX0pt1dN WQW6rI2nCkDkFAiWvSAPysNHfX2PU7Qe45U9dcp47ivUYgEMkwinEnwH99BvjT+2FN6x5kJ HaKMksge0wZnCFb+vZSykuR1OZY6z5CuLtFggw1Ke6bMb6qpOTIhyxz5W2PPC3yJIM708ma VYO0f0UNibC2KBd6NNcVA== X-UI-Out-Filterresults: notjunk:1;V03:K0:6e6TxgXutMw=:kbGnVGt81wm7jYxVXxAjbh 7zacYdDUQwMER/eSkAFZ7VNjWIMmi+wGzqcje5pVnhK2rj8gUuZbAhoPttcvXgkEOo+J8sJE1 WdgKjXPq1RKCbLiZVg96TuWPa7eMCOZvjwbuEmKEVF8e+OhgQrfkUbeCLr4G2qaYGRVCEqFel LEh2aNkZ29T5TZN7Hub7v9Fccc7ULVpsTQzJfQ+xyUf7qpQ2ZN7/VVeFbSZrLNt6mrbTP4JkC yoE6BIWIiiGhzV3cBEl0K220Pusr8G4t8YF7/KGrNA8vhwFRfp7YxrXB4yG6Y63yMZtdBmtoU 5wmLHH4z1cctgqc6Y5WzGQwFtuKksqXFQDMTap0vxjejt5jz1bpSpUQfBZqccx7sqRVAhT733 ti/jwr0kBlH8r+Dc6KmVBBHEXly5tnawsq1qCvDPDOsQjx3Mg0eJThzuqfcj5nzzW9dzJjo1X J3ATpSbz077Ar5Ei4O6uPp41DgCd0BLZHSEogvxlJGiVp7+cZu3z/j2hx25zbEOZnLxemXXFs RTVqXDXNmMy/KuJWXxpv7Amlru0+yw8iwLHNvjK2qf6GB3ywkVHs5uYFhzL4sPbEuBgz5WeW1 IyYFbxqoyEBor0G9ifZwrzpNqiyD2qvGFI+lVDXfXBk7o37d/rIm2deRMwWhCJLdCRffkSKwT lc3Ah5xDpopr2uurllzxPgEeyOznIEjuAAebtMg1SGTF8R4I/VcBnIZFVwQ8yLQvK5Ypz3j2l q4p/D2Uw2t4tfyCSc7ICKxdvE7Q9C6EuLPl6i+73HRLph6nnhZsFQp2sIL7HWYRNcRypNHVre i2VCQ2+JH7GTn4ec9/E6R9Bf1CUS9tghIMCopx3IF+Lrf8IxtE= 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 v2 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 20 06:48:37 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=1568185549; cv=none; d=zoho.com; s=zohoarc; b=kYQ82lMOnjAE9bzWelKOdtI7glDk1mLlo9HEubDl/H9phSnFILUBiw99UijnOH7h8TKrDEtRRpNZyI2QKY6CGLeb3hM3nbeaLLZsjtgNrVrr/99jEx5jp/cIOHoc4AueRgKUsn5Vsax2pgV5lVh5mC8nP8jPpMCMmcQAVOLroJ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568185549; 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=T4UCbqx3gJwPG69rXDBwflt6wy4cIC4RwIA7jHtZxjND4G1zS5BmQaU5k1Dj6PmhZuhVs6Y6a5MkYKNUHEftfpN4jJU5OB1qMQPTeWvlaQjQtn+CO8xhnLIN9WR7r4PnvUubXEdrDrjAp6M8o4STv7j9ltDuZ+jvYbk/04z4gRU= 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 156818554946272.69402010696524; Wed, 11 Sep 2019 00:05:49 -0700 (PDT) Received: from localhost ([::1]:47150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7whG-0005H0-Ip for importer@patchew.org; Wed, 11 Sep 2019 03:05:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40819) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wRf-00061x-8n for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7wRe-0004Mz-7K for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:39 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:55867) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7wRd-0004MP-Va for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:38 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M433w-1i7wRV0koi-0005Zb; Wed, 11 Sep 2019 08:49:29 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 11 Sep 2019 08:49:12 +0200 Message-Id: <20190911064920.1718-8-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190911064920.1718-1-laurent@vivier.eu> References: <20190911064920.1718-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:j1F0yFaoMBQbhDzxmPD/ys5XuuMgxXp2xefCRwWzaxgBAq1Qh3Y XnXREZG434/svVgJWbJFkhZWP2mZgf+nj1Wd+MNGLW54VD0DuihYSGH9mjuYsFyBAvdvfb3 DSfavkSh/rrOerPWH9p1PIO7ZFOQE8vWQ/IB1i5Mcdt83cPdFQ6LnUDJ0yHOr0iXYXDtQbo 5sW5mhIBET57KsWKgLUHg== X-UI-Out-Filterresults: notjunk:1;V03:K0:KvlJrzyYUls=:nUrra4ZjROo/bXiDf4TkaG DpJTcZ3KbUbA/oB5W1FAlyOYtcwt373QGxC9h/7fUTdc/amveaIpeuEcx9hiYsbHpcS+PnGNp 1ggUaT3/L7ThyUGweeBC8PhvSGiqL899UFVIQ6kH4RcsbIGMSBOezIAGokE4dQx0pQSdw3Ot9 kUICto5xq+46r2uvKHk6Doje2Vsr8UJTKTWXVUmWrpgxt+A0qFPq0GVb/3MJOrVS6gtCfXt96 JQ5YbvoaXxBzh2iK/+7/tT37ETZWPEB+73M8b0fLzZ61HyCXrVlX9F0MbTRxYWT7/wydno5Gl unvrJIbLnVlageGdJ2BxjOxlAsWwhiD4Lrb5A0RQQG28Y/qw5bYkyKAJMxMcBj2tHwrkt9H6Z SpHA+bSYz53KVsGGCCtiA0hAPi3qBvQMQl65e+WZ/Pg9AtVUNis4T2aoH3t2bfsmefrpYFUqi QyUsG10PqwM3Q7OsI/NDFGNmq4vWJHJ/wmSvRa6pCCXzs1rzBXsSu7gIAr+8RHBpD9k1uOAqg uTSOsSLmS1MaSG7z+gO0XIzG1uVGhkD/k6tCdfy+rEJC/sjzz3KZwPAHvJQjYTDI/8gjs1uQC JZZ5WG/v025B9zj+7FJirH5oY0FqRt5b8jwWNSvw7nEuq+wTSPzFUNwNKcfHAR4kqOe7Ac2I1 qzEtQ9LLjpTMsCNsJ+JqseZG7vkuCz5dHE87Ni4rgnEThrCgxoyN6YRa/ENdsAL3UmgGCdxKm hv8/Icf8qlrWSNQKYJoqmD9/d0j3hiB3+GP25MS/GYZiQqMEsY3ZQBRxncda4FXZ3Bbnda6Lx bCDKTgldaPP/DqpHC1kfcf26DWuq5KoOOKTrNzGoqMdmnVk5ZnyLTmY5HhbHXsNSwIsdWybAR W+dMya93idaAwZAZ8Gmo3SDOR/fAN3XIdQyEdqkx3jtsvEvjv4ZT30NnpDISMzxOcEwJoyhqq Dwj8xb8D619mtdNdgsbWgH3bmEo3UjU5vDrjVHSyeso7XqyVe2cX7vCnU+QDrMlYmer45+Zm5 xWw56EaQ7WW0DhBDxU62KX0bmc7GVgdKFEaBJTK2QV72 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 v2 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 20 06:48:37 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=1568185713; cv=none; d=zoho.com; s=zohoarc; b=FzbqPwIVlWPVRROuOusNlem/zMzZ6t9xd+XcEjgSYDidszv1eKVHEkh3nXXL+M3ARBi2QIz8BmQQaLhZP6JYc29nJlq55WLSjbDtC3AwhXpIqhdvuY4RbXwy+dUfwCxpFPRUOSVqZgromWs3xKX/dsPlW9JPta1b9w1AFOWBEGU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568185713; 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=KB6+NLmYdSnlxKUrg5VFp2rvn4SH8TWtflOuQnjW/pE=; b=b445hscz+aUYRCS9S7x+YsDlTuDinjTqCVdi326m+JUqFFan5+ZKTTkqbAMcXt2lbatsmy2GtsuJJvdZbIKHeuZdqyYV+7zZ9kPxn9ZS9mOC3mJdETGF7nFErgDu80K+eEAuE5fIeF6O/b8CTrdCt3H8KAbVM9M52S77JtXJ1pk= 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 1568185713620284.02609284387586; Wed, 11 Sep 2019 00:08:33 -0700 (PDT) Received: from localhost ([::1]:47192 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wjv-0000kC-Vf for importer@patchew.org; Wed, 11 Sep 2019 03:08:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40905) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wRk-00068w-J5 for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7wRj-0004Qc-13 for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:44 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:53909) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7wRi-0004Pv-P2 for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:42 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MF3Y8-1hsYDp3EXQ-00FVtr; Wed, 11 Sep 2019 08:49:30 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 11 Sep 2019 08:49:13 +0200 Message-Id: <20190911064920.1718-9-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190911064920.1718-1-laurent@vivier.eu> References: <20190911064920.1718-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:XctwPDcSm58FR8JIA/1GR/JKYqhEdsyYJBACwt7866Wxq36LhJo ExXa6FP1Ijad+wIKMsSoixv//jNPBC7RCf4cIQJUopfC49nf2dd89CgDlOIWfSieVZ5v3KT ZY1HadVsoeM7cbeqMsC2yAXBXYsSm0V/+CTRQ9XVEbK5zBx8o/J3USqFKkbWI/mj8BX9WSM ystkQ6HLtL36d3Mt5bGcQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:Nh4AoSULLbY=:fhqEHJHpeFd6iS5Zi5PAAm O3lIEH2Az+zEY1X262R1pymeaOz89mU+NkjHhulGCl2AcpoOFlcc8oKTv5xJrcnmgYCDfrk9W nuiQyLrpGviSvq2tL3JAQoC37c/MgfxFAzjck7try7SIIzxltH4Mg9juY8fkgWvP5mABR/qmg YQ8GFc2kRE4CJfMo10HN8q+o6I//7Olgtjj/NH/bZBX8wVyIxKzOYa8EofRjdVHyDGwWIV/Tz heAxCN3AKHzqDgOHJphvgHmS2UxHcV87cwfDvEBOdZ698W8lY4YoBawfzieZuwX4UjqBB3bA+ kuI8f9fguUwLCvqr09qc+VQrxFVYANDn1H0ozvsxZITzUihYxtgks2HQ1K4ZyoGw25cGfxNvz M3xsk0uphvhgw+4OA6ObVlnNucobcwMItlDf60hX4GWLXfQuYvgVucOna4NdRd8IAfqF1ydPe Jw8s9Md83QsvFKYjYyMbkCds1nJBB0b+2zp9QqxRVPpUxrAZNLaIKX3ksOQBQVWR3VpO2NtNz 8KPxhqdKliYiZhIr1fgIF27Y20nnxRnlNWZab79WzPAfza6hKiy1XV+wg3eAARY+zos1NaNU/ 2+dwmH0wVwF12EAIlWNthay6G4smddkVLvpTWAkeH9ct4v/3FGknPwMgQwjTteJUKglHUZhH2 Ho1p7o7zlAUOvYkp8e4k/hINrf1i2x7qKEYzR9mqPX56x5xIH8Z4tNtpbngHOUjtYW6pgjm3M wOfkws0l54thgqKIEkzIpG7tsydALHWbVhyAkOkA4Z3Gd9NErpJ09uOf4GfoRfEWl162g5WRP uo+hnX4o3wqGOvFXKg+5cfvc/yunovhw+d1HQUu9mGfgBYSNDA= 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 v2 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 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 20 06:48:37 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=1568185112; cv=none; d=zoho.com; s=zohoarc; b=FLaqqmw9P49hFqhGlDhw4I1+oINDyFRN5lX5ub8PlPG4UBpn510jcfHiHCJms//RMSwZnE8VK3otHlJ104RJJVuPCn8KSGOn63KAtc5gavdAnWgDn9pO0mfHb8H6z6fZvxf7i6l4JXwUsk8CWlATvst43qQSuB8I/puZnVHABVQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568185112; 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=hkYd6xrR14wiQVYsZBR1CSUoYuqe0MtgahHUwY+3b0kURACKW92xXuqi47r+HFgWY9nCBcop3ZD8RG4FVTEcKpMFPXd4FwFwe5yIAfRVQTSUN8Kb/Vy9RYuzsZhyxX+QoVSzs6+cx3BcHNKzQ/7k1lXvKgoC7JSinILraH5znck= 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 1568185112323876.2222734076926; Tue, 10 Sep 2019 23:58:32 -0700 (PDT) Received: from localhost ([::1]:47092 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7waE-0007Le-Sc for importer@patchew.org; Wed, 11 Sep 2019 02:58:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40859) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wRh-00064l-Dc for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7wRf-0004O7-R7 for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:41 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:58579) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7wRf-0004NP-Ho for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:39 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mfpf7-1iaeTz1CQb-00gHwg; Wed, 11 Sep 2019 08:49:30 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 11 Sep 2019 08:49:14 +0200 Message-Id: <20190911064920.1718-10-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190911064920.1718-1-laurent@vivier.eu> References: <20190911064920.1718-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:LnM+/PclvjTfbuUkA144zj60DLByuO/n4wuW+SnFLw1/dPskucT lNgS1WFJdJUT1rZIZCzhuHHagE0aeYLhsVisDpxas/J4hPK2M3KhgTBXu3WGNAdgAhPkHs4 Ga1CvLwWVvsN0AkZJD8KUuZOdNrD0fki0XIOGpNEiN8WS4F49vFl0A8GzEjn7m4szQNtVo8 q9eN2XWqhkpZrLr9GKB7w== X-UI-Out-Filterresults: notjunk:1;V03:K0:yGY4M75zvd0=:Nkj/MjvErwfFVrXx9X8Ko5 gLXUxgkwqxJx1O+HYyNxKQT62jGNzMuQ5L7tVKpXnHYSZ0+gtuyX6FDYztBz2OnKE/wTznatY bQr5vjkWnaaef0u6z/yYse9wqGwB/95+p5kWTuxLc7kK8Rzl4Ee4s/7kunO8lytB50DaGUCoa ClAnFzbDkbnXN+RMILMrZvmuDu0HF0sODTb4ja5roajqBmHZNL/L6ZJyiY/hJRiBpFsmCu3xO 1CSc1hzjj/wcTqFO3OxlHyXBxS0FxkJ3FM9VYXIxdoTP9KdLNfWmz0RXzR8nrjvmEXAWbkKC+ CvJbJ/Iw7G+iFlz8mK3O0kKX/+PJd7NwMeWDKKT5Abt0QjhI9ouIUcyhT/oTrvL4FAXQfD5ZB +zleJseX2kYkjni9luUucOqmfd9sLAGijyYNjxT2RmggEPBk5TtGQ3+XtVqvUWaBQJv28X68A 2XAdAp0C6lYw+wIXpKi59JwzTALNlU9oazRpyLR+2ZqENecFOZGuXjo2lGyDAXjOW1dIpgwlE l1Eg2q5oU164l1784TPj4NGyHlaWqgd7vHfUV3kCotwfvVYsqKqH8yvB85Dzl4f7GkYdUGDZx m0P5NVt8SL4sxfomw/QsDBHec9+p1VJQxesFa81fSTftIhHx+8irpyeL/D4vhFs9D4WtA0t8i FPoLY534yDUVnOpgCQshQ5UhOwIgx6j/rC5lyMzDkXMO+nTh5wPxQlAKv79oYdcejNGXXReB/ ni+jhgHlgYyqzAZVM/16iNVoxXWQ8s8meSqHHkGAyYcuW1bwbhJaMnXNZWJc00Msr8920/CdK cvBXhdVFh0Bum/2RtAuzHdQEJ0jXMAD3p1OC7N8ReUMOGOW0Ow= 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 v2 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 20 06:48:37 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=1568185705; cv=none; d=zoho.com; s=zohoarc; b=OBjOxi6evJfJ0CjHRb4UIvkWjsyluhdNR7B9gA/UKH8O4y8hV2BPtxZLpnUJww4r9am6X9hg9ChE8BzcUSmOqP7dwzEbFrIYb8bY/PMDlixIO6WWf80qU8eIZ3OWvJjI01UK5VPzWdyZyMX8M8VD4NATFMcJJ14pEOPojWksdqI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568185705; 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=P32vI4e44icJFUumjqjeGYCtXBAQ8y2vLBNbRN+LLxNGAbS3J0Y7iR2W9DS14CAjuCg81SiO/h34FnPUaeccyyZZrWTRVNPei+G6gPlbRrGeLqIpmXKQFksXpVCYoYs/N2/Hps4i3v1j4j4drK9iEVhN0Y+DXiQFJVVePtdbuUY= 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 1568185705244405.4475651978879; Wed, 11 Sep 2019 00:08:25 -0700 (PDT) Received: from localhost ([::1]:47188 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wjn-0000Tk-Bz for importer@patchew.org; Wed, 11 Sep 2019 03:08:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40930) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wRm-0006Bq-Mm for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7wRl-0004Rz-Ne for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:46 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:55083) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7wRl-0004Rd-Ev for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:45 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M5wc7-1i290j3Jj1-007V9s; Wed, 11 Sep 2019 08:49:30 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 11 Sep 2019 08:49:15 +0200 Message-Id: <20190911064920.1718-11-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190911064920.1718-1-laurent@vivier.eu> References: <20190911064920.1718-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:Su61+BnpKiccqNuEQD+A6HqyxIOzxrWccEsaFWHENjM9CIChd6C a1w0VRCm+u9ubulRdzheD77DvR1dMe86Uu7EF6GTg6Mxzi472iPznSHK+1Pu8dG8WhpOHLI kOpSdvJMKmVqyOT9SlzT15N2gLZsPqW1rh+aVQwI4vm8V7nd2hJs2wXS0NuIM5kyU68/uYy +iH6Tfmo3cd5KtEO0Ywfw== X-UI-Out-Filterresults: notjunk:1;V03:K0:1yOHbFUPko0=:6FR5lkRiUee9DSqImHk4Hw fPv//MW6vE/U2s1MfdLTP/lzhUKUmVChtlDX9Uer+d2My0TIHNosk1xVkKs2mda59BhJNmYSw 6K7Ew0dUhf7xDm+RgatrByO1nEViIlVjwgyAhS0c/BkouSkkWIpUHX7I5DuKkw3jm6rMdCPdp JoTYHHpOjh2p8Yznks0NHAOFeb/DDHr4rzGV79CPg+J96FUBmxZm8V28jM++RR5rFAMVQksrg xuymSp6F7XCIsQhos2PG6gfuNbmqIpbYV744LeRvo4UH9Om8Z68En624LJE/eaz7k3DmXKNZZ GL3+zxmu3uuKFcHgtRytN7u1v6Lk26nEoKW2PTUXz8FFP4Xj2r+8+nJSwsjWriAcuQtOfNWkq O8oBploh7cS7QAGl9ItA9bRYkMlmkvMbBOnPZfuCDy2fX5x+xT9QiUEoMuilQOqnNyKPD5SPS WtSE3hiEvkteofoxzG54XSQwITLeZfZvoDhxQtrx5g+1tOM39/E5O/PwBj85M6g/Kpb71aRlc WBAUASDo5pVmRDi+wn3Tau3tgIr8FvokockxLbNO+SgXYA5bhk6qz+bXR7fzbCnWcKZKlhwyg NGKtEsgTxpEKJYxgbiH/5NcRWDSXEOh9dgpWq+8Zh3eRk0lG+F3CMW/MzIO0M93SbaE1putDC YPIjyLTpBoSezqxqzBmGPts1zTDN7oP3Uj0dLhJsMa6WYITBehfdQ0sL8hG+dTHBw1Y6qRF/j 6JBwPAtKH46QvEDQ2OlOqYyQbcW33CzVFS326+sR5voHnSPlL8q1P5lM09t2UWllapZdpY7Lb BzC3kGRHMA2twDsXyRLYXsaYlAtSw== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.134 Subject: [Qemu-devel] [PULL v2 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 20 06:48:37 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=1568185241; cv=none; d=zoho.com; s=zohoarc; b=mtA3SeF0vaXGk0DBakaOVea7XSFVs9tHTPH2onKLyIQXhG5hMGyRyAS1vYRGEL6tbdUSGldBmXK+vSgapjNF70LNtE6FoYjISGpx+nxiqvmDzcVOs3ByuOilkxkt+v2hhoswW8+dCsYQ09lDrnBntxgwUZLB4rPh169qCVPkUYQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568185241; 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=fibBXtcHO+dyt4k4Jlkfuar8y7kGt925TTThjw3gROWsxpEFSsq/FA4mwOkZDn8jmfIb03z/7RG+jMd1XjbpuS6cIx8GH5DltTcWSIG0aM44nPt6qIdi0SFAbvAz98lEeAeTX+OOWM7pzwNLTJ3tjfcGOrHSg03eFxHOTaprLeI= 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 1568185241867637.961359647568; Wed, 11 Sep 2019 00:00:41 -0700 (PDT) Received: from localhost ([::1]:47114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wcC-0001Dg-Hr for importer@patchew.org; Wed, 11 Sep 2019 03:00:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40886) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wRj-00067t-OT for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7wRi-0004QL-MI for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:43 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:52691) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7wRi-0004Pg-C3 for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:42 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MmUYD-1iYVoo1gbB-00iWzi; Wed, 11 Sep 2019 08:49:31 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 11 Sep 2019 08:49:16 +0200 Message-Id: <20190911064920.1718-12-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190911064920.1718-1-laurent@vivier.eu> References: <20190911064920.1718-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:q0XKCvUSDgDm/LctnBRhQZeq/VpM7ByItFT/6TnzPuaB1V28WGn rsf9MbPl7I9FHSeOVIWp3/8wcFD6l7w0jgNi+SYI0WPnMMH74CNd3nExf3UycwONCaWFgBP d07KB6Ire9iMy13qYZs4WWDjQeQHE+sJvWQ4cOcfBpDJwiWVpPj0iVxxHl+wdXj3iUxvk1f Hq1aup40dGWl9QG7WO11A== X-UI-Out-Filterresults: notjunk:1;V03:K0:xCnjN746qsA=:aVgGPonZMMmktz8h6Q4QvH jc3gUcADAgj6eP1luiT2/p7IaPLLugAQkQdZbAk1XW6IQYko8OTh4fd9bnm2sBk3Y0LqBceiG syt6auURbwTPL4AwBEa3Sc3LcAxzwzc6eigcsc3AnIJ8+5IR1kirmZULfge8hnCAH/AHoZ3y/ HOKOvbl46xQuYSqf2fpEoRFhStSXKW/I1ElMZpzlZ2qK8c9MYvOPzAOfLPBeOrPz/ziWCKUaP TYYcbjmb6TRMVKCos6vEy2kHbUTJXZp4I/DFp+BKlAbmLJqB6MH4YgFFY7DUusmAHVbFSR2uf wFVxRDrTgLU2M68eZELkq4orXuMpYwD0dNRpt++lFLFPhwO/4O7Vjd1VDD1lnpCeFtHmTWuZ/ IeAtymVYL1kpMVFoy5iCZ65oTfkj+xObw9TUlKfO55FX9U92lUwVjFjZmsdDRRLlJuGRym/O9 pj31ecoInnRfd6ml5xoSQS9bsU9Spvb7WL+w5kFISAYuj3AHLJrzKYXwxE4FFZ0g5uMEWTizd O1kK0WWdUWxvsNWpzaUBS14sf3nOCaMSmzaPW6pN2wtIfJiguJbuOGGT5VkKYSax/UrQBvXW0 RfAfzI2TmLrgLLFqojT6hDcgebqwcHkwFxze1oI5zdpjJOe02k7k+zJweYGG4M8F/RN09W0HC doALd3HzcZBnjGGvrlhHf5fSJBPi2wWx+tU2x2JfctGUarMmTTb65IkR+oggDtTjMhGUxNhxv 6Hu+Q79/4Yr7mn4OU+fXDTrDElMY85wMR4KW+/vj2ePWtAXWI1JQj5mvW8twv4rcKw4HK9gJW yyaLLd2IZjlNomuue9Dr4wsAsdvF3YAQ7VgxCQrVjbf/QIfrlQ= 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 v2 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 20 06:48:37 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=1568185413; cv=none; d=zoho.com; s=zohoarc; b=LO8hr1qojtQm5S+F7t1xx6D9+O2nFYsj/YWai1uZKhjDuHJpHhmx+G5mnLT70ncFCaT1U7yGuR7NBA5NhWEIzBp9ztWKyIDbPXupH9r3L7Kl6ql3x3OB+0tt7P6HAtbG/8Mu4XkpwOtz1vrJpmWMajwE9fobNAovsAfOuLqzDUE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568185413; 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=byP5kckrZ1+HV/WPKMBpl481u+vzQ35RMAFDv7obKXTUdX6vqY9VbZ4kLYH9kj7kj/v+xfkDTxYwnouqi35oKa6ty0iI+0AqsD0XkYTb9zKCjyltuxrGljIAPaH5QBhso6kAbeleeiskH10vwplQx2As8t3J9a0dzGym7zsnXVM= 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 1568185413344405.6794407372579; Wed, 11 Sep 2019 00:03:33 -0700 (PDT) Received: from localhost ([::1]:47126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wf5-0003Bc-9f for importer@patchew.org; Wed, 11 Sep 2019 03:03:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40914) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wRl-00069j-3S for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7wRk-0004RB-0j for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:44 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:50691) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7wRj-0004QV-P7 for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:43 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N0nvJ-1iMQzG3xrh-00wiMo; Wed, 11 Sep 2019 08:49:32 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 11 Sep 2019 08:49:17 +0200 Message-Id: <20190911064920.1718-13-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190911064920.1718-1-laurent@vivier.eu> References: <20190911064920.1718-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:rejogtgCx6V7rSfrGTma3x3K2crDjMlarfafrH3wIPBHhMkOCtT 8SYw0Y929haq8seefGuywKLADFmW6kayfKZVT4291+LP9X/igg0MKGjW6eX+HLe8fgRO9M+ MefTjk1ikpTdXbhvDT6x2lUgm4nH7Fsasokg4VXoZYpcVIzJ7jfolgv8kQTRnBEvVl5aVcx smsbI3WZDUOiW+Qfq+usA== X-UI-Out-Filterresults: notjunk:1;V03:K0:D32bDUqB9lw=:0xq7qxp+a7oc7KV54q2nEH z4YLalHDVuhmtfbz/uJsvrpz6sTPIIqVKeyCEVvoFk3o56PadvCnItIuSyW6DzzTWSMAOFfkl u2s9z/LWHjoFPJPp2dW8MVLAQ9KUF58kZj5btT5mW2wost5q5Lbq/0mmTZ1JI/VD6bZPm0igo YEa2EI5AJ+zyguhcfomYPN6vBx0ODSE/+VI8IZLhJrxzYnUl8O+w8Ctx1XXTvZtQVgCA5TcOL koq0JSpmxJrO+SBHeBMm0W9+SNhp5DvDrFK+CRVy7vbZhF6PwN35PtUNnoQleXG1I3fJGOHeW nUYiJL6vwL1WWlN2BVcbiI0E79FRzw19sXLHEdNNmGYXwO4OQHCxaRjS4xSjYdu95/yhwqDZN L/Xq/KNap1mBLlxjDGRCPA7AOv7ELFnIjEQ+YZaxN6RLfKoCIj9YvKOIQAL0WkYhC2jm5DoMb xB8OzVQKFVNH9z0nNjecdMAZ5iuFmp9OFSjPIE8pht7R9jLtidf7bz9T0bIpDlhR1rxhZyuHY ioVhV/yLgCjR/4P+syC3bQ0lTPVABvx61gI8UpbOP+I/PYT6nAC+xLsNUKIvwbTXDiVNliuIk gVM/5V2b/UuJO3IQRDnC+cxfLvu+SlIXxpup83Xlosi32cpGlZVfB+jPOB+Y6vOIJn5TA/yzQ PMe+HrnHaGREXXe4aibUL5MfpJ0KAhniTQkSdS/p7376LqMQbVD0mNDZfFjbacoAthh3WW3Ol RgDpc4dkMoM1wQClitiFbqOl64jY2vdovnbxfO9cfVQBx7fDtni4Pt+pgLrNRK7M3a6WWaNog aBtAOsSHJRUtZJDyb0hEgSJ8+mMDoJ9QLXHZhrlW0qckTnFiv0= 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 v2 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 20 06:48:37 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=1568185269; cv=none; d=zoho.com; s=zohoarc; b=AspD1FVpSlELwI4OLbnNh2DuT3VpxKSsjAmwnLwG9CzKSrB8KXsNnZqFCLcSA3gc4x5xGIu9vxxr53LoKh1jaFdydQqqwTJtfTyUrpAtVAz1bIfhreU65b8j2Yyqe+Id93JFAZRpmrKNY1VgsR1+yJr96h+RDIZuX4LHvb+s5MA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568185269; 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=Y1DpAOylGGhfK32r1bekheTLbLfRCU0jHuMtxEtgX2xFM7G0qz+KEJ0UEafGHC8Ga5LSBfvr2wv+zOLDsBGhYyo1LHmyOdSAuTTc5T+cYZ2z6iiChh6WTrfqr2S2FQsgel6nlSPYOlcpIKQMGx4R8SA2triRlkgbj0j8DNHHtss= 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 1568185269508315.94951828668934; Wed, 11 Sep 2019 00:01:09 -0700 (PDT) Received: from localhost ([::1]:47116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wch-0001Y3-QM for importer@patchew.org; Wed, 11 Sep 2019 03:01:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40831) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wRg-00062y-1e for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7wRe-0004Mi-0d for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:39 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:39589) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7wRd-0004MJ-P2 for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:37 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N2lzA-1iFbM02H2y-0136Hn; Wed, 11 Sep 2019 08:49:32 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 11 Sep 2019 08:49:18 +0200 Message-Id: <20190911064920.1718-14-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190911064920.1718-1-laurent@vivier.eu> References: <20190911064920.1718-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:AIPZmokLRc935u1DfsDlb1DX8Hy2gMKz2nveL2WXzOhKWg2FH8t pFLKRViTCNSOCmazNf7cC7uG9MwOdVf4Ru9RNAFBtp4Bv9STVRPo/Pk9matPPLxkOZcA/Gz Y9KLzl2Z786yk1NiJ4meiCayZE5x7aL7KQTTE/uduPlONSehqOwUc4Oxtw+DUpiWORMzWEq TmQDJJrdmu3r5I/JHvUTA== X-UI-Out-Filterresults: notjunk:1;V03:K0:T2jYVP9ByZk=:gTOne5bqb3aPuPAnqfQbCP n6XFWHeZnEpz4n8jUdxKHC814Hcjge1NVXP1BYt6e0/3NAr08QZxtbsf6Qi5Eo/w88RN9moW0 vj4QFPkPiCpI1IFxqsT3OrBXgHYyUBv6AIY7K6OzYHfS6iRPs1N5wDlG2jdVod2wwOu/k9qYm dexwtanJknBw7W2zHLnbmvxCxqNevOn5v3o82yG9rdcvw9PNwD81bTePNhU7oTjXViaPPz0H5 I95jkDhXNFr760Rmk7QWyEM+i2mh4gbf3dKOynmNIuAXqt7mqnLj529DDN0ZpdGC4qPglUUUR pYuzle30ArfFlr0/V5F1Pp02wm5PFYN4UTxYUQplm1jkzj8uNX3EDAuDkgssXkKowgC6I01XK O0Dsmch3jilFxV6STzKcQOHvhmxE9DXDkDqGkTK8pU7ZTqHsytUF3d0RhbeXgL7D9JBNUQrr1 YTVdvFSFAtBItik+FP7J3DzfSxFDXJm4Oskn8skl9ZurYdPdd8Z+nEVg5FtxwEHat1SHzGqxS 6zd3CO8pywAIPYFAD+sVnKmDll7r3cCMKeAKqiJOEXC5CMbthR2s3urrz2Ylen460jT3Te4zr Is20Z2Rkfnk3W3JJLGIp6gKjShbZ4Yv4vpPlnpqlyufnp5EET5vXq8nW4swutZVTQaR2uaop2 7Bc/pDd27LNNssfI12pGEWM2wpqgd2w6Zq1Td/qtBzvF44XoLDvU7ccSt5c0+xXHDxmrwngFG Ww3VIoVTkCx/ztcab6kdQ6MIcrjhN3utpi4Br+D+ORFjFn1J0oYZc9zOL2eDWiA07BFnyM4Bi sKDIoMCGL2pm8wTzE4ICJZMv+INnOzuCea03BK5lhUbccyy1Ds= 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 v2 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 20 06:48:37 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=1568185869; cv=none; d=zoho.com; s=zohoarc; b=kF4SMnsb/w8XN+jY2OJuaBBDiqJmhKvdQG3tnmkxkycodppuEOSGFwTjKtNROBEXuNiEtsRS85OoZUwIvRp+wv80RzJAA39gtWLFJAjgU2CDmzGR9f9p7eiA2ZoL1oJxkQNDb1J/IX1LTmEbo0S3WszYLXX5QbUMWdKRmp/5CTQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568185869; 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=Xt42rVqq6xuxkVuAxF8lDRCtHVCEiN/SB2JSTlrUjM/PmMWC09HJuzM9gECbdbkY+xrjlhgqRllUPVAgrTBRAUkpJTti5OM42+k+qwLfTfwegRWMnt5GUaS5lCw4zmzCES2fYM5PxvInO64SjAGEAcg+IJpr6N4yllCuwXr6lT8= 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 1568185869140202.07427726379592; Wed, 11 Sep 2019 00:11:09 -0700 (PDT) Received: from localhost ([::1]:47222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wmR-0004Fw-Mf for importer@patchew.org; Wed, 11 Sep 2019 03:11:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40957) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wRs-0006J2-4G for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7wRr-0004UH-2a for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:52 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:33855) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7wRq-0004Tm-Qf for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:51 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MZTa2-1hesxP0TOo-00WUHl; Wed, 11 Sep 2019 08:49:33 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 11 Sep 2019 08:49:19 +0200 Message-Id: <20190911064920.1718-15-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190911064920.1718-1-laurent@vivier.eu> References: <20190911064920.1718-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:mP/1VcsnpW5gwV8ZafAHCczu1tlzJhHJq+oJV2ymr+TY0WR9AoI xeGL5NqoB07iiHqYsUlhVakkqQxy9tbXNPl1aq4oWWolCkrWL8D8cxOmme/EfX6b97gzXrM aU+5aqHkpLJLt3b/A/IqiMwKAYcADvUTvTD2GE2+bPmo7Bm4xA6AjXNU8E6Zvtn8VfsSoLZ 5WlWzovrlhSoQkKjuqWfA== X-UI-Out-Filterresults: notjunk:1;V03:K0:UXTpGyXhbIk=:EfDKONfc16cTnmGZACmXBU QWbbtFCaUuZgV4oE1N7tsrHC62L/6APPlMDIIDAcaHW8f5zHNcjOCPMnejsFSO/iZbpxNg9su UOex/l0UTK3Mzqcd/EMWruy5Up65wtnIh6dJYBidZkJAoGUutHNDW1Uo6n6uiIJOgIWpMyQ+6 Z5uk0/KfEB0vDGYPb5jCLsSKWnVnMN4p49KqwiXvrUlLiFH30z8w4cF1xZkfpB4zYNdEe/lLe Uh+1IkOMOszJxoI1INiFgcIwavS7XCbGNMF/ndbyerU5RFfgYPQZ9CsWQ2k12Hn7ocVKpVIZH 2AS4hqQq1ok4nxb/OXP0sfz3/kR7i18Ae/zOI4oQ7tWs+4+loDOVM9fhJkqLgGV6x5aLJhM9C KOFuCyvp/okRu3Tgr+o1fpGG4KyXgHzoI0lIX+NThuBXUa1lzWKUsHSl5vE3537N9mrvPRPlu oT8G1X/wRzR7UbRdv9+jeubW9aaCkdTlKtbsi7PWJgFXmzo2GG7jwESXgeB4HwlyYNT+36mrz XXNUiJLQh6AUYyqY3006M3fA1uJUb7eiclqAHLXatBppZIfRd3hv0y5boHeuHk4+HGZ8b2EZ/ Nc9RqEgKTZ1HTtq5trv5up91uQUT9gNDb7c1uxSmV6OiHOi+MYZWRhD8goFWwkO4+SdHj1766 I0VjvqqcQ02rrR9zZKXYq0berN9rZpp7cqfy8hRery+flrbN3pA/0pA40UpdXxcnf6Yc4zTFL FkObg+N/BHVjT1xlHVfUE1EZ+7uAVw8SdyUxaf+GKXtFvUCdi0UT4zhxEsHOjWXcsuANcxZxu Gdwbl9jp15B6BdlTeGeeVxUnYn+gQPikChqP84LlQ+60vS0svQ= 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 v2 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 20 06:48:37 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=1568185609; cv=none; d=zoho.com; s=zohoarc; b=nPqInYUjtXdFXXd/GiF6AXTuXDfMDWQz6QB7Jipyo/YbDuZmJSoNKYdzV25a+2/h2Q9nbemn6Jd2ezZL095Lkf/ex+GLDE6Po+pSY2zo++u7oqLe7vgYq3/Wnu8e2/OoAp5GZ3CRD8xlqS8fjMk3pWawQwJXeAoGyP/KFgni6mg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568185609; 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=MgO3oDr6tbFLX5p64dLYFrcB7WDtBZFDMK2HzlIowalW+Du3LWZvifDMHaQsA7SQVOM4UshkMroQgSXGgSzx+RnGPG13N+mLFAqrBqY1ueKatCWo++T/u1zpLmbUrWLU7alWxlvz94w18yOxgEjaiceUmuN4SviM6KFji4Slqgs= 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 1568185609753897.9580942614841; Wed, 11 Sep 2019 00:06:49 -0700 (PDT) Received: from localhost ([::1]:47154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wiG-0006lQ-9e for importer@patchew.org; Wed, 11 Sep 2019 03:06:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40946) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wRq-0006HP-V6 for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7wRp-0004Tg-Ru for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:50 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:53617) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7wRp-0004TN-Ik for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:49 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MlfL0-1iYmw32kjK-00inyb; Wed, 11 Sep 2019 08:49:33 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 11 Sep 2019 08:49:20 +0200 Message-Id: <20190911064920.1718-16-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190911064920.1718-1-laurent@vivier.eu> References: <20190911064920.1718-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:BbpMENamDwMG3Ang8EA2towk7A2z2LCjA7Hz3tIlbb6OUm6OjY0 0xDnvGVt5ByAEtnMYXVMR2lyFDPv/8QWOZ+dwh0wsZBE+ABNfcCRhs0KkG6m3Lvg6CkE6qP wfKY4X+xQ9S311/jWGJzLC1b34VOhnIwxOOSIVqsJ8HBVxcABmRL79Pasf5PwcU6HGnTeuS ettWEOqexFvw3qbMUxNBg== X-UI-Out-Filterresults: notjunk:1;V03:K0:drFmzaq5Q/0=:r+QBFBFVf5HBIze3nd5buA k5ckR2wMxt7C8VF7Fpe+9xgtYFBOsOqjQuNxyNakAGy/EZJiC9GfcmIJ+SSdzMvI7HVsb5m/K emaAJUeQVlYtt4KgwfUTTCQQAbxfVdr142CXquoexDfmOyUH8yxfY61AVo9XaqTGIkSGG3Koz JCb4xXwvQYJQTEWM8ElKNzzDyWYB9N2kxfkP1UWwOAiGWtrGI6mOFyyeXAuJyFmrEndRkLq8F fRJWqsmxaYjEj3I0hJUWxXXNOc+VWZbLDzwhZXcma0LPNiGUE7dMW+fiR6zkvBM+LdAzLx9+S yYBumIlGW9Jme9rRMT75N09AqQWba4Y38RiTpf7LkAZQEDnAGtKDAPCJouHIhusJ6Jz+NsotY /+NXO6rSYcJwn8ed4J9hzEA3/2Tu3f+AFdQx7hA+EMNNng6yxKmkuG0KFY/8BO8zC9BMwoM6Q wSSfU9/b21Couj9zVk5Irqb2jqxTof/EOeYcoeU3ngDuVbyuGORE+jdaP2NxnSLChhaAxAj0N WAYuAzNaOd2u6uNmhXjUrMQPtGRnHcml/Ac265IAwovAsAcqLwsp74EMoDL17RPh7paLgFMxM AxUBJWNNZQiydOD0U3dSBC19oikKC+R+Ks7dWXs6Ccllw5QGQ/ns3FQ0uoUmWpbVggXHi1d0W iBw4+rYrWeBrYX8cPo1Hb/T7qGSfZbPbj5TplGV+EwchrEGSbwPfc94Mf/6rHXeMFKyIrGbfV Ldl0CE+mvzUyQMSgQa+CPSui0q59mvl+gZ8WSuVPQowRBuH9cKdjgbr7d+jahCdA3j67g69Ci jmyi8SlAiKUYM9DDfM2doq7yoWeeQ== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.134 Subject: [Qemu-devel] [PULL v2 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