From patchwork Thu Jan 16 22:49:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandar Markovic X-Patchwork-Id: 11337909 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 42214109A for ; Thu, 16 Jan 2020 22:55:44 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2035320728 for ; Thu, 16 Jan 2020 22:55:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2035320728 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rt-rk.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:49432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isE3D-00067y-4A for patchwork-qemu-devel@patchwork.kernel.org; Thu, 16 Jan 2020 17:55:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49038) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isDyz-0008MO-9m for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1isDyx-0002fD-QL for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:20 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:52003 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1isDyv-00024B-V1 for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:18 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 466C61A21EB; Thu, 16 Jan 2020 23:50:13 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.14.106]) by mail.rt-rk.com (Postfix) with ESMTPSA id EC2511A2149; Thu, 16 Jan 2020 23:50:11 +0100 (CET) From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PATCH 01/12] linux-user: Add support for FS_IOC_VERSION ioctls Date: Thu, 16 Jan 2020 23:49:40 +0100 Message-Id: <1579214991-19602-2-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579214991-19602-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1579214991-19602-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 89.216.37.149 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: laurent@vivier.eu, amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Aleksandar Markovic A very specific thing for these two ioctls is that their code implies that their third argument is of type 'long', but the kernel uses that argument as if it is of type 'int'. This anomaly is recognized also in commit 6080723 (linux-user: Implement FS_IOC_GETFLAGS and FS_IOC_SETFLAGS ioctls). Reviewed-by: Laurent Vivier Signed-off-by: Aleksandar Markovic --- linux-user/ioctls.h | 2 ++ linux-user/syscall_defs.h | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index c6b9d6a..c44f42e 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -138,6 +138,8 @@ IOCTL(FS_IOC_GETFLAGS, IOC_R, MK_PTR(TYPE_INT)) IOCTL(FS_IOC_SETFLAGS, IOC_W, MK_PTR(TYPE_INT)) + IOCTL(FS_IOC_GETVERSION, IOC_R, MK_PTR(TYPE_INT)) + IOCTL(FS_IOC_SETVERSION, IOC_W, MK_PTR(TYPE_INT)) #ifdef CONFIG_USBFS /* USB ioctls */ diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 98c2119..f68a8b6 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -911,12 +911,14 @@ struct target_pollfd { #define TARGET_FICLONE TARGET_IOW(0x94, 9, int) #define TARGET_FICLONERANGE TARGET_IOW(0x94, 13, struct file_clone_range) -/* Note that the ioctl numbers claim type "long" but the actual type - * used by the kernel is "int". +/* + * Note that the ioctl numbers for FS_IOC_ + * claim type "long" but the actual type used by the kernel is "int". */ #define TARGET_FS_IOC_GETFLAGS TARGET_IOR('f', 1, abi_long) #define TARGET_FS_IOC_SETFLAGS TARGET_IOW('f', 2, abi_long) - +#define TARGET_FS_IOC_GETVERSION TARGET_IOR('v', 1, abi_long) +#define TARGET_FS_IOC_SETVERSION TARGET_IOW('v', 2, abi_long) #define TARGET_FS_IOC_FIEMAP TARGET_IOWR('f',11,struct fiemap) /* usb ioctls */ From patchwork Thu Jan 16 22:49:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandar Markovic X-Patchwork-Id: 11337897 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4702413A0 for ; Thu, 16 Jan 2020 22:52:29 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0331D20728 for ; Thu, 16 Jan 2020 22:52:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0331D20728 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rt-rk.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:49390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isE03-0001cs-C5 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 16 Jan 2020 17:52:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49034) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isDyz-0008ML-9g for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1isDyx-0002fP-Ql for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:20 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:52004 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1isDyv-00024S-VE for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:18 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id C4EC71A21A0; Thu, 16 Jan 2020 23:50:13 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.14.106]) by mail.rt-rk.com (Postfix) with ESMTPSA id 2592D1A21BC; Thu, 16 Jan 2020 23:50:12 +0100 (CET) From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PATCH 02/12] linux-user: Add support for FS_IOC32_FLAGS ioctls Date: Thu, 16 Jan 2020 23:49:41 +0100 Message-Id: <1579214991-19602-3-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579214991-19602-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1579214991-19602-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 89.216.37.149 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: laurent@vivier.eu, amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Aleksandar Markovic These FS_IOC32_FLAGS ioctls are identical to FS_IOC_FLAGS ioctls, but without the anomaly of their number defined as if their third argument is of type long, while it is treated internally in kernel as is of type int. Reviewed-by: Laurent Vivier Signed-off-by: Aleksandar Markovic --- 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 c44f42e..4fd6939 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -140,6 +140,8 @@ IOCTL(FS_IOC_SETFLAGS, IOC_W, MK_PTR(TYPE_INT)) IOCTL(FS_IOC_GETVERSION, IOC_R, MK_PTR(TYPE_INT)) IOCTL(FS_IOC_SETVERSION, IOC_W, MK_PTR(TYPE_INT)) + IOCTL(FS_IOC32_GETFLAGS, IOC_R, MK_PTR(TYPE_INT)) + IOCTL(FS_IOC32_SETFLAGS, IOC_W, MK_PTR(TYPE_INT)) #ifdef CONFIG_USBFS /* USB ioctls */ diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index f68a8b6..964b2b4 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -920,6 +920,8 @@ struct target_pollfd { #define TARGET_FS_IOC_GETVERSION TARGET_IOR('v', 1, abi_long) #define TARGET_FS_IOC_SETVERSION TARGET_IOW('v', 2, abi_long) #define TARGET_FS_IOC_FIEMAP TARGET_IOWR('f',11,struct fiemap) +#define TARGET_FS_IOC32_GETFLAGS TARGET_IOR('f', 1, int) +#define TARGET_FS_IOC32_SETFLAGS TARGET_IOW('f', 2, int) /* usb ioctls */ #define TARGET_USBDEVFS_CONTROL TARGET_IOWRU('U', 0) From patchwork Thu Jan 16 22:49:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandar Markovic X-Patchwork-Id: 11337899 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 93592184C for ; Thu, 16 Jan 2020 22:52:29 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7375720728 for ; Thu, 16 Jan 2020 22:52:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7375720728 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rt-rk.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:49392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isE03-0001e2-V2 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 16 Jan 2020 17:52:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49035) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isDyz-0008MM-9S for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1isDyx-0002fF-QV for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:20 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:52008 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1isDyv-00024f-VH for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:18 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id D91A51A21FF; Thu, 16 Jan 2020 23:50:13 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.14.106]) by mail.rt-rk.com (Postfix) with ESMTPSA id 5197A1A2160; Thu, 16 Jan 2020 23:50:12 +0100 (CET) From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PATCH 03/12] linux-user: Add support for FS_IOC32_VERSION ioctls Date: Thu, 16 Jan 2020 23:49:42 +0100 Message-Id: <1579214991-19602-4-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579214991-19602-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1579214991-19602-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 89.216.37.149 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: laurent@vivier.eu, amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Aleksandar Markovic These FS_IOC32_VERSION ioctls are identical to FS_IOC_VERSION ioctls, but without the anomaly of their number defined as if their third argument is of type long, while it is treated internally in kernel as is of type int. Reviewed-by: Laurent Vivier Signed-off-by: Aleksandar Markovic --- 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 4fd6939..3affd88 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -142,6 +142,8 @@ IOCTL(FS_IOC_SETVERSION, IOC_W, MK_PTR(TYPE_INT)) IOCTL(FS_IOC32_GETFLAGS, IOC_R, MK_PTR(TYPE_INT)) IOCTL(FS_IOC32_SETFLAGS, IOC_W, MK_PTR(TYPE_INT)) + IOCTL(FS_IOC32_GETVERSION, IOC_R, MK_PTR(TYPE_INT)) + IOCTL(FS_IOC32_SETVERSION, IOC_W, MK_PTR(TYPE_INT)) #ifdef CONFIG_USBFS /* USB ioctls */ diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 964b2b4..a73cc3d 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -922,6 +922,8 @@ struct target_pollfd { #define TARGET_FS_IOC_FIEMAP TARGET_IOWR('f',11,struct fiemap) #define TARGET_FS_IOC32_GETFLAGS TARGET_IOR('f', 1, int) #define TARGET_FS_IOC32_SETFLAGS TARGET_IOW('f', 2, int) +#define TARGET_FS_IOC32_GETVERSION TARGET_IOR('v', 1, int) +#define TARGET_FS_IOC32_SETVERSION TARGET_IOW('v', 2, int) /* usb ioctls */ #define TARGET_USBDEVFS_CONTROL TARGET_IOWRU('U', 0) From patchwork Thu Jan 16 22:49:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandar Markovic X-Patchwork-Id: 11337929 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B5C8B6C1 for ; Thu, 16 Jan 2020 23:00:05 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 956992072B for ; Thu, 16 Jan 2020 23:00:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 956992072B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rt-rk.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:49495 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isE7Q-0003mQ-Q1 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 16 Jan 2020 18:00:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49126) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isDz1-0008O9-Lh for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1isDyz-0002hP-9Z for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:23 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:53722 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1isDyy-0002fZ-Vg for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:21 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id BDA721A20CB; Thu, 16 Jan 2020 23:50:14 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.14.106]) by mail.rt-rk.com (Postfix) with ESMTPSA id A19BE1A21C1; Thu, 16 Jan 2020 23:50:12 +0100 (CET) From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PATCH 04/12] linux-user: Add support for FS_IOC_FSXATTR ioctls Date: Thu, 16 Jan 2020 23:49:43 +0100 Message-Id: <1579214991-19602-5-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579214991-19602-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1579214991-19602-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 89.216.37.149 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: laurent@vivier.eu, amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Aleksandar Markovic Both FS_IOC_FSGETXATTR and FS_IOC_FSSETXATTR accept a pointer to the structure struct fsxattr { __u32 fsx_xflags; /* xflags field value (get/set) */ __u32 fsx_extsize; /* extsize field value (get/set)*/ __u32 fsx_nextents; /* nextents field value (get) */ __u32 fsx_projid; /* project identifier (get/set) */ __u32 fsx_cowextsize; /* CoW extsize field value (get/set)*/ unsigned char fsx_pad[8]; }; as their third argument. These ioctls were relatively recently introduced, so the "#ifdef" guards are used in this implementation. Signed-off-by: Aleksandar Markovic --- linux-user/ioctls.h | 7 +++++++ linux-user/syscall_defs.h | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 3affd88..e1b89a7 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -144,6 +144,13 @@ IOCTL(FS_IOC32_SETFLAGS, IOC_W, MK_PTR(TYPE_INT)) IOCTL(FS_IOC32_GETVERSION, IOC_R, MK_PTR(TYPE_INT)) IOCTL(FS_IOC32_SETVERSION, IOC_W, MK_PTR(TYPE_INT)) +#ifdef FS_IOC_FSGETXATTR + IOCTL(FS_IOC_FSGETXATTR, IOC_W, MK_PTR(MK_STRUCT(STRUCT_fsxattr))) +#endif +#ifdef FS_IOC_FSSETXATTR + IOCTL(FS_IOC_FSSETXATTR, IOC_W, MK_PTR(MK_STRUCT(STRUCT_fsxattr))) +#endif + #ifdef CONFIG_USBFS /* USB ioctls */ diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index a73cc3d..e1663b6 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -924,6 +924,12 @@ struct target_pollfd { #define TARGET_FS_IOC32_SETFLAGS TARGET_IOW('f', 2, int) #define TARGET_FS_IOC32_GETVERSION TARGET_IOR('v', 1, int) #define TARGET_FS_IOC32_SETVERSION TARGET_IOW('v', 2, int) +#ifdef FS_IOC_FSGETXATTR +#define TARGET_FS_IOC_FSGETXATTR TARGET_IOR('X', 31, struct fsxattr) +#endif +#ifdef FS_IOC_FSSETXATTR +#define TARGET_FS_IOC_FSSETXATTR TARGET_IOR('X', 32, struct fsxattr) +#endif /* usb ioctls */ #define TARGET_USBDEVFS_CONTROL TARGET_IOWRU('U', 0) From patchwork Thu Jan 16 22:49:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandar Markovic X-Patchwork-Id: 11337905 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E3A7C109A for ; Thu, 16 Jan 2020 22:54:41 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C3A0E20728 for ; Thu, 16 Jan 2020 22:54:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C3A0E20728 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rt-rk.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:49416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isE2C-0004zP-Tl for patchwork-qemu-devel@patchwork.kernel.org; Thu, 16 Jan 2020 17:54:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49050) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isDyz-0008Mi-BL for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1isDyx-0002fU-Qv for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:21 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:52012 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1isDyw-00024u-EG for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:19 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id B14F01A222F; Thu, 16 Jan 2020 23:50:14 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.14.106]) by mail.rt-rk.com (Postfix) with ESMTPSA id 2702E1A21D6; Thu, 16 Jan 2020 23:50:13 +0100 (CET) From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PATCH 05/12] linux-user: Add support for FITRIM ioctl Date: Thu, 16 Jan 2020 23:49:44 +0100 Message-Id: <1579214991-19602-6-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579214991-19602-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1579214991-19602-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 89.216.37.149 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: laurent@vivier.eu, amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Aleksandar Markovic FITRIM ioctl accepts a pointer to the structure struct fstrim_range { __u64 start; __u64 len; __u64 minlen; }; as its third argument. All ioctls in this group (FI* ioctl) are guarded with "#ifdef", so the guards are used in this implementation too for consistency (however, many of ioctls in FI* group became old enough that their #ifdef guards could be removed, bit this is out of the scope of this patch). Signed-off-by: Aleksandar Markovic --- linux-user/ioctls.h | 3 +++ linux-user/syscall_defs.h | 1 + linux-user/syscall_types.h | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index e1b89a7..e4f0a04 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -123,6 +123,9 @@ #ifdef FIBMAP IOCTL(FIBMAP, IOC_W | IOC_R, MK_PTR(TYPE_LONG)) #endif +#ifdef FITRIM + IOCTL(FITRIM, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_fstrim_range))) +#endif #ifdef FICLONE IOCTL(FICLONE, IOC_W, TYPE_INT) IOCTL(FICLONERANGE, IOC_W, MK_PTR(MK_STRUCT(STRUCT_file_clone_range))) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index e1663b6..97ab3e1 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -908,6 +908,7 @@ struct target_pollfd { #define TARGET_FIBMAP TARGET_IO(0x00,1) /* bmap access */ #define TARGET_FIGETBSZ TARGET_IO(0x00,2) /* get the block size used for bmap */ +#define TARGET_FITRIM TARGET_IOWR('X', 121, struct fstrim_range) #define TARGET_FICLONE TARGET_IOW(0x94, 9, int) #define TARGET_FICLONERANGE TARGET_IOW(0x94, 13, struct file_clone_range) diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h index 4e36983..ca9429e 100644 --- a/linux-user/syscall_types.h +++ b/linux-user/syscall_types.h @@ -226,6 +226,11 @@ STRUCT(dm_target_versions, STRUCT(dm_target_msg, TYPE_ULONGLONG) /* sector */ +STRUCT(fstrim_range, + TYPE_LONGLONG, /* start */ + TYPE_LONGLONG, /* len */ + TYPE_LONGLONG) /* minlen */ + STRUCT(file_clone_range, TYPE_LONGLONG, /* src_fd */ TYPE_ULONGLONG, /* src_offset */ From patchwork Thu Jan 16 22:49:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandar Markovic X-Patchwork-Id: 11337907 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7E3D1109A for ; Thu, 16 Jan 2020 22:54:50 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5E65220728 for ; Thu, 16 Jan 2020 22:54:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5E65220728 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rt-rk.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:49418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isE2L-00053W-7f for patchwork-qemu-devel@patchwork.kernel.org; Thu, 16 Jan 2020 17:54:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49122) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isDz1-0008O5-KT for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1isDyz-0002hV-8q for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:22 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:53728 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1isDyy-0002fs-VY for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:21 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 867081A217B; Thu, 16 Jan 2020 23:50:15 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.14.106]) by mail.rt-rk.com (Postfix) with ESMTPSA id 3740C1A21DB; Thu, 16 Jan 2020 23:50:13 +0100 (CET) From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PATCH 06/12] linux-user: Add support for FIFREEZE and FITHAW ioctls Date: Thu, 16 Jan 2020 23:49:45 +0100 Message-Id: <1579214991-19602-7-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579214991-19602-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1579214991-19602-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 89.216.37.149 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: laurent@vivier.eu, amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Aleksandar Markovic Both FIFREEZE and FITHAW ioctls accept an integer as their third argument. All ioctls in this group (FI* ioctl) are guarded with "#ifdef", so the guards are used in this implementation too for consistency (however, many of ioctls in FI* group became old enough that their #ifdef guards could be removed, bit this is out of the scope of this patch). Reviewed-by: Laurent Vivier Signed-off-by: Aleksandar Markovic --- linux-user/ioctls.h | 6 ++++++ linux-user/syscall_defs.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index e4f0a04..66f8c4e 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -123,6 +123,12 @@ #ifdef FIBMAP IOCTL(FIBMAP, IOC_W | IOC_R, MK_PTR(TYPE_LONG)) #endif +#ifdef FIFREEZE + IOCTL(FIFREEZE, IOC_W | IOC_R, TYPE_INT) +#endif +#ifdef FITHAW + IOCTL(FITHAW, IOC_W | IOC_R, TYPE_INT) +#endif #ifdef FITRIM IOCTL(FITRIM, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_fstrim_range))) #endif diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 97ab3e1..d4d39de 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -908,6 +908,8 @@ struct target_pollfd { #define TARGET_FIBMAP TARGET_IO(0x00,1) /* bmap access */ #define TARGET_FIGETBSZ TARGET_IO(0x00,2) /* get the block size used for bmap */ +#define TARGET_FIFREEZE TARGET_IOWR('X', 119, int) /* Freeze */ +#define TARGET_FITHAW TARGET_IOWR('X', 120, int) /* Thaw */ #define TARGET_FITRIM TARGET_IOWR('X', 121, struct fstrim_range) #define TARGET_FICLONE TARGET_IOW(0x94, 9, int) #define TARGET_FICLONERANGE TARGET_IOW(0x94, 13, struct file_clone_range) From patchwork Thu Jan 16 22:49:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandar Markovic X-Patchwork-Id: 11337919 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8B36A138D for ; Thu, 16 Jan 2020 22:57:03 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6C8982075B for ; Thu, 16 Jan 2020 22:57:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C8982075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rt-rk.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:49448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isE4U-0007uK-7k for patchwork-qemu-devel@patchwork.kernel.org; Thu, 16 Jan 2020 17:57:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49124) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isDz1-0008O7-Kd for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1isDyz-0002hj-AS for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:23 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:53724 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1isDyy-0002ff-Ub for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:21 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id F11871A21AB; Thu, 16 Jan 2020 23:50:15 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.14.106]) by mail.rt-rk.com (Postfix) with ESMTPSA id 407771A21E2; Thu, 16 Jan 2020 23:50:13 +0100 (CET) From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PATCH 07/12] linux-user: Add support for FD ioctls Date: Thu, 16 Jan 2020 23:49:46 +0100 Message-Id: <1579214991-19602-8-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579214991-19602-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1579214991-19602-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 89.216.37.149 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: laurent@vivier.eu, amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Aleksandar Markovic FDSETEMSGTRESH, FDSETMAXERRS, and FDGETMAXERRS ioctls are commands for controlling error reporting of a floppy drive. FDSETEMSGTRESH's third agrument is a pointer to the structure: struct floppy_max_errors { unsigned int abort, /* number of errors to be reached before aborting */ read_track, /* maximal number of errors permitted to read an * entire track at once */ reset, /* maximal number of errors before a reset is tried */ recal, /* maximal number of errors before a recalibrate is * tried */ /* * Threshold for reporting FDC errors to the console. * Setting this to zero may flood your screen when using * ultra cheap floppies ;-) */ reporting; }; defined in Linux kernel header . Since all fields of the structure are of type 'unsigned int', there is no need to define "target_floppy_max_errors". FDSETMAXERRS and FDGETMAXERRS ioctls do not use the third argument. Reviewed-by: Laurent Vivier Signed-off-by: Aleksandar Markovic --- linux-user/ioctls.h | 3 +++ linux-user/syscall_defs.h | 3 +++ linux-user/syscall_types.h | 7 +++++++ 3 files changed, 13 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 66f8c4e..9e3ca90 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -114,7 +114,10 @@ IOCTL(FDMSGON, 0, TYPE_NULL) IOCTL(FDMSGOFF, 0, TYPE_NULL) + IOCTL(FDSETEMSGTRESH, 0, TYPE_NULL) IOCTL(FDFLUSH, 0, TYPE_NULL) + IOCTL(FDSETMAXERRS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_floppy_max_errors))) + IOCTL(FDGETMAXERRS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_floppy_max_errors))) IOCTL(FDRESET, 0, TYPE_NULL) IOCTL(FDRAWCMD, 0, TYPE_NULL) IOCTL(FDTWADDLE, 0, TYPE_NULL) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index d4d39de..e317115 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -899,7 +899,10 @@ struct target_pollfd { #define TARGET_FDMSGON TARGET_IO(2, 0x45) #define TARGET_FDMSGOFF TARGET_IO(2, 0x46) +#define TARGET_FDSETEMSGTRESH TARGET_IO(2, 0x4a) #define TARGET_FDFLUSH TARGET_IO(2, 0x4b) +#define TARGET_FDSETMAXERRS TARGET_IOW(2, 0x4c, struct floppy_max_errors) +#define TARGET_FDGETMAXERRS TARGET_IOR(2, 0x0e, struct floppy_max_errors) #define TARGET_FDRESET TARGET_IO(2, 0x54) #define TARGET_FDRAWCMD TARGET_IO(2, 0x58) #define TARGET_FDTWADDLE TARGET_IO(2, 0x59) diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h index ca9429e..434ce1c 100644 --- a/linux-user/syscall_types.h +++ b/linux-user/syscall_types.h @@ -266,6 +266,13 @@ STRUCT(blkpg_ioctl_arg, TYPE_INT, /* datalen */ TYPE_PTRVOID) /* data */ +STRUCT(floppy_max_errors, + TYPE_INT, /* abort */ + TYPE_INT, /* read_track */ + TYPE_INT, /* reset */ + TYPE_INT, /* recal */ + TYPE_INT) /* reporting */ + #if defined(CONFIG_USBFS) /* usb device ioctls */ STRUCT(usbdevfs_ctrltransfer, From patchwork Thu Jan 16 22:49:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandar Markovic X-Patchwork-Id: 11337927 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 91883921 for ; Thu, 16 Jan 2020 22:59:24 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 722262075B for ; Thu, 16 Jan 2020 22:59:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 722262075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rt-rk.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:49478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isE6l-0002mj-IG for patchwork-qemu-devel@patchwork.kernel.org; Thu, 16 Jan 2020 17:59:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49127) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isDz1-0008OA-LG for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1isDyz-0002hJ-8O for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:23 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:53723 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1isDyy-0002fe-Vu for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:21 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id A4AB01A2196; Thu, 16 Jan 2020 23:50:15 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.14.106]) by mail.rt-rk.com (Postfix) with ESMTPSA id 4827D1A21F9; Thu, 16 Jan 2020 23:50:13 +0100 (CET) From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PATCH 08/12] linux-user: Add support for FDFMT ioctls Date: Thu, 16 Jan 2020 23:49:47 +0100 Message-Id: <1579214991-19602-9-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579214991-19602-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1579214991-19602-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 89.216.37.149 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: laurent@vivier.eu, amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Aleksandar Markovic FDFMTBEG, FDFMTTRK, and FDFMTEND ioctls provide means for controlling formatting of a floppy drive. FDFMTTRK's third agrument is a pointer to the structure: struct format_descr { unsigned int device,head,track; }; defined in Linux kernel header . Since all fields of the structure are of type 'unsigned int', there is no need to define "target_format_descr". FDFMTBEG and FDFMTEND ioctls do not use the third argument. Reviewed-by: Laurent Vivier Signed-off-by: Aleksandar Markovic --- linux-user/ioctls.h | 3 +++ linux-user/syscall_defs.h | 3 +++ linux-user/syscall_types.h | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 9e3ca90..e754a6b 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -115,6 +115,9 @@ IOCTL(FDMSGON, 0, TYPE_NULL) IOCTL(FDMSGOFF, 0, TYPE_NULL) IOCTL(FDSETEMSGTRESH, 0, TYPE_NULL) + IOCTL(FDFMTBEG, 0, TYPE_NULL) + IOCTL(FDFMTTRK, IOC_W, MK_PTR(MK_STRUCT(STRUCT_format_descr))) + IOCTL(FDFMTEND, 0, TYPE_NULL) IOCTL(FDFLUSH, 0, TYPE_NULL) IOCTL(FDSETMAXERRS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_floppy_max_errors))) IOCTL(FDGETMAXERRS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_floppy_max_errors))) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index e317115..9fbf04a 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -899,6 +899,9 @@ struct target_pollfd { #define TARGET_FDMSGON TARGET_IO(2, 0x45) #define TARGET_FDMSGOFF TARGET_IO(2, 0x46) +#define TARGET_FDFMTBEG TARGET_IO(2, 0x47) +#define TARGET_FDFMTTRK TARGET_IOW(2, 0x48, struct format_descr) +#define TARGET_FDFMTEND TARGET_IO(2, 0x49) #define TARGET_FDSETEMSGTRESH TARGET_IO(2, 0x4a) #define TARGET_FDFLUSH TARGET_IO(2, 0x4b) #define TARGET_FDSETMAXERRS TARGET_IOW(2, 0x4c, struct floppy_max_errors) diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h index 434ce1c..ff60240 100644 --- a/linux-user/syscall_types.h +++ b/linux-user/syscall_types.h @@ -266,6 +266,11 @@ STRUCT(blkpg_ioctl_arg, TYPE_INT, /* datalen */ TYPE_PTRVOID) /* data */ +STRUCT(format_descr, + TYPE_INT, /* device */ + TYPE_INT, /* head */ + TYPE_INT) /* track */ + STRUCT(floppy_max_errors, TYPE_INT, /* abort */ TYPE_INT, /* read_track */ From patchwork Thu Jan 16 22:49:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandar Markovic X-Patchwork-Id: 11337925 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D896C921 for ; Thu, 16 Jan 2020 22:58:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B84022077B for ; Thu, 16 Jan 2020 22:58:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B84022077B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rt-rk.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:49476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isE6K-00028T-SK for patchwork-qemu-devel@patchwork.kernel.org; Thu, 16 Jan 2020 17:58:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49123) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isDz1-0008O6-Kb for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1isDyz-0002i0-Bu for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:23 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:53725 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1isDyy-0002fi-V5 for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:21 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 221CD1A21CE; Thu, 16 Jan 2020 23:50:16 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.14.106]) by mail.rt-rk.com (Postfix) with ESMTPSA id 5B4651A2132; Thu, 16 Jan 2020 23:50:13 +0100 (CET) From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PATCH 09/12] linux-user: Add support for FDGETFDCSTAT ioctl Date: Thu, 16 Jan 2020 23:49:48 +0100 Message-Id: <1579214991-19602-10-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579214991-19602-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1579214991-19602-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 89.216.37.149 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: laurent@vivier.eu, amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Aleksandar Markovic FDGETFDCSTAT's third agrument is a pointer to the structure: struct floppy_fdc_state { int spec1; int spec2; int dtr; unsigned char version; unsigned char dor; unsigned long address; unsigned int rawcmd:2; unsigned int reset:1; unsigned int need_configure:1; unsigned int perp_mode:2; unsigned int has_fifo:1; unsigned int driver_version; unsigned char track[4]; }; defined in Linux kernel header . Since there is a fields of the structure of type 'unsigned long', there is a need to define "target_format_descr". Also, five fields rawcmd, reset, need_configure, perp_mode, and has_fifo are all just bitfields and are part od a single 'unsigned int' field. Signed-off-by: Aleksandar Markovic --- linux-user/ioctls.h | 2 ++ linux-user/syscall_defs.h | 18 ++++++++++++++++++ linux-user/syscall_types.h | 12 ++++++++++++ 3 files changed, 32 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index e754a6b..d72cd76 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -122,6 +122,8 @@ IOCTL(FDSETMAXERRS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_floppy_max_errors))) IOCTL(FDGETMAXERRS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_floppy_max_errors))) IOCTL(FDRESET, 0, TYPE_NULL) + IOCTL(FDGETFDCSTAT, IOC_R, + MK_PTR(MK_STRUCT(STRUCT_target_floppy_fdc_state))) IOCTL(FDRAWCMD, 0, TYPE_NULL) IOCTL(FDTWADDLE, 0, TYPE_NULL) IOCTL(FDEJECT, 0, TYPE_NULL) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 9fbf04a..46dc565 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -897,6 +897,23 @@ struct target_pollfd { /* From */ +struct target_floppy_fdc_state { + int spec1; /* spec1 value last used */ + int spec2; /* spec2 value last used */ + int dtr; + unsigned char version; /* FDC version code */ + unsigned char dor; + abi_ulong address; /* io address */ + unsigned int rawcmd:2; + unsigned int reset:1; + unsigned int need_configure:1; + unsigned int perp_mode:2; + unsigned int has_fifo:1; + unsigned int driver_version; /* version code for floppy driver */ + unsigned char track[4]; +}; + + #define TARGET_FDMSGON TARGET_IO(2, 0x45) #define TARGET_FDMSGOFF TARGET_IO(2, 0x46) #define TARGET_FDFMTBEG TARGET_IO(2, 0x47) @@ -907,6 +924,7 @@ struct target_pollfd { #define TARGET_FDSETMAXERRS TARGET_IOW(2, 0x4c, struct floppy_max_errors) #define TARGET_FDGETMAXERRS TARGET_IOR(2, 0x0e, struct floppy_max_errors) #define TARGET_FDRESET TARGET_IO(2, 0x54) +#define TARGET_FDGETFDCSTAT TARGET_IOR(2, 0x15, struct target_floppy_fdc_state) #define TARGET_FDRAWCMD TARGET_IO(2, 0x58) #define TARGET_FDTWADDLE TARGET_IO(2, 0x59) #define TARGET_FDEJECT TARGET_IO(2, 0x5a) diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h index ff60240..2b480d0 100644 --- a/linux-user/syscall_types.h +++ b/linux-user/syscall_types.h @@ -278,6 +278,18 @@ STRUCT(floppy_max_errors, TYPE_INT, /* recal */ TYPE_INT) /* reporting */ +STRUCT(target_floppy_fdc_state, + TYPE_INT, /* spec1 */ + TYPE_INT, /* spec2 */ + TYPE_INT, /* dtr */ + TYPE_CHAR, /* version */ + TYPE_CHAR, /* dor */ + TYPE_ULONG, /* address */ + TYPE_INT, /* bit field for rawcmd:2, reset:1, need_configure:1, */ + /* perp_mode:2, and has_fifo:1 */ + TYPE_INT, /* driver_version */ + MK_ARRAY(TYPE_CHAR, 4)) /* track */ + #if defined(CONFIG_USBFS) /* usb device ioctls */ STRUCT(usbdevfs_ctrltransfer, From patchwork Thu Jan 16 22:49:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandar Markovic X-Patchwork-Id: 11337923 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 454AD921 for ; Thu, 16 Jan 2020 22:57:37 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2587D2072B for ; Thu, 16 Jan 2020 22:57:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2587D2072B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rt-rk.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:49450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isE52-0000NV-4M for patchwork-qemu-devel@patchwork.kernel.org; Thu, 16 Jan 2020 17:57:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49125) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isDz1-0008O8-Kx for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1isDyz-0002hT-9d for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:23 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:53727 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1isDyy-0002fj-VO for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:21 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 2371B1A21D0; Thu, 16 Jan 2020 23:50:16 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.14.106]) by mail.rt-rk.com (Postfix) with ESMTPSA id 7EC301A21C4; Thu, 16 Jan 2020 23:50:13 +0100 (CET) From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PATCH 10/12] configure: Detect kcov support and introduce CONFIG_KCOV Date: Thu, 16 Jan 2020 23:49:49 +0100 Message-Id: <1579214991-19602-11-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579214991-19602-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1579214991-19602-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 89.216.37.149 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: laurent@vivier.eu, amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Aleksandar Markovic kcov is kernel code coverage tracing tool. It requires kernel 4.4+ compiled with certain kernel options. This patch checks if kcov header "sys/kcov.h" is present on build machine, and stores the result in variable CONFIG_KCOV, meant to be used in linux-user code related to the support for three ioctls that were introduced at the same time as the mentioned header (their definition was a part of the first version of that header). Signed-off-by: Aleksandar Markovic Reviewed-by: Laurent Vivier --- configure | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/configure b/configure index 940bf9e..57e6eba 100755 --- a/configure +++ b/configure @@ -4752,6 +4752,12 @@ if compile_prog "" "" ; then syncfs=yes fi +# check for kcov support (kernel must be 4.4+, compiled with certain options) +kcov=no +if check_include sys/kcov.h ; then + kcov=yes +fi + # Check we have a new enough version of sphinx-build has_sphinx_build() { # This is a bit awkward but works: create a trivial document and @@ -6874,6 +6880,9 @@ fi if test "$syncfs" = "yes" ; then echo "CONFIG_SYNCFS=y" >> $config_host_mak fi +if test "$kcov" = "yes" ; then + echo "CONFIG_KCOV=y" >> $config_host_mak +fi if test "$inotify" = "yes" ; then echo "CONFIG_INOTIFY=y" >> $config_host_mak fi From patchwork Thu Jan 16 22:49:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandar Markovic X-Patchwork-Id: 11337913 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9D681138D for ; Thu, 16 Jan 2020 22:56:59 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7AB9B2072B for ; Thu, 16 Jan 2020 22:56:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7AB9B2072B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rt-rk.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:49446 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isE4Q-0007oy-3w for patchwork-qemu-devel@patchwork.kernel.org; Thu, 16 Jan 2020 17:56:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49121) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isDz1-0008O3-L2 for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1isDyz-0002h2-6y for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:22 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:53721 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1isDyy-0002fb-UO for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:21 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 6EF291A21B3; Thu, 16 Jan 2020 23:50:16 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.14.106]) by mail.rt-rk.com (Postfix) with ESMTPSA id CB9C11A228C; Thu, 16 Jan 2020 23:50:13 +0100 (CET) From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PATCH 11/12] linux-user: Add support for KCOV_ ioctls Date: Thu, 16 Jan 2020 23:49:50 +0100 Message-Id: <1579214991-19602-12-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579214991-19602-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1579214991-19602-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 89.216.37.149 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: laurent@vivier.eu, amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Aleksandar Markovic KCOV_ENABLE and KCOV_DISABLE play the role in kernel coverage tracing. These ioctls do not use the third argument of ioctl() system call and are straightforward to implement in QEMU. Reviewed-by: Laurent Vivier Signed-off-by: Aleksandar Markovic --- linux-user/ioctls.h | 5 +++++ linux-user/syscall.c | 3 +++ linux-user/syscall_defs.h | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index d72cd76..39b3825 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -552,3 +552,8 @@ IOCTL_IGNORE(TIOCSTART) IOCTL_IGNORE(TIOCSTOP) #endif + +#ifdef CONFIG_KCOV + IOCTL(KCOV_ENABLE, 0, TYPE_NULL) + IOCTL(KCOV_DISABLE, 0, TYPE_NULL) +#endif diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 171c0ca..6edcb0d 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -73,6 +73,9 @@ #ifdef CONFIG_SENDFILE #include #endif +#ifdef CONFIG_KCOV +#include +#endif #define termios host_termios #define winsize host_winsize diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 46dc565..c8999ef 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -2461,6 +2461,10 @@ struct target_mtpos { #define TARGET_MTIOCGET TARGET_IOR('m', 2, struct target_mtget) #define TARGET_MTIOCPOS TARGET_IOR('m', 3, struct target_mtpos) +/* kcov ioctls */ +#define TARGET_KCOV_ENABLE TARGET_IO('c', 100) +#define TARGET_KCOV_DISABLE TARGET_IO('c', 101) + struct target_sysinfo { abi_long uptime; /* Seconds since boot */ abi_ulong loads[3]; /* 1, 5, and 15 minute load averages */ From patchwork Thu Jan 16 22:49:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandar Markovic X-Patchwork-Id: 11337901 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C026D13A0 for ; Thu, 16 Jan 2020 22:52:32 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A09782073A for ; Thu, 16 Jan 2020 22:52:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A09782073A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rt-rk.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:49394 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isE07-0001iS-8A for patchwork-qemu-devel@patchwork.kernel.org; Thu, 16 Jan 2020 17:52:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49092) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isDz0-0008NO-8e for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1isDyz-0002hC-7Q for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:22 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:53726 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1isDyy-0002fk-Un for qemu-devel@nongnu.org; Thu, 16 Jan 2020 17:51:21 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 7D5761A21C4; Thu, 16 Jan 2020 23:50:16 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.14.106]) by mail.rt-rk.com (Postfix) with ESMTPSA id 174641A21DD; Thu, 16 Jan 2020 23:50:14 +0100 (CET) From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PATCH 12/12] linux-user: Add support for KCOV_INIT_TRACE ioctl Date: Thu, 16 Jan 2020 23:49:51 +0100 Message-Id: <1579214991-19602-13-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579214991-19602-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1579214991-19602-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 89.216.37.149 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: laurent@vivier.eu, amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Aleksandar Markovic KCOV_INIT_TRACE ioctl plays the role in kernel coverage tracing. This ioctl's third argument is of type 'unsigned long', and the implementation in QEMU is straightforward. Reviewed-by: Laurent Vivier Signed-off-by: Aleksandar Markovic --- linux-user/ioctls.h | 1 + linux-user/syscall_defs.h | 1 + 2 files changed, 2 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 39b3825..1da71dd 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -556,4 +556,5 @@ #ifdef CONFIG_KCOV IOCTL(KCOV_ENABLE, 0, TYPE_NULL) IOCTL(KCOV_DISABLE, 0, TYPE_NULL) + IOCTL(KCOV_INIT_TRACE, IOC_R, TYPE_ULONG) #endif diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index c8999ef..bf71b3a 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -2464,6 +2464,7 @@ struct target_mtpos { /* kcov ioctls */ #define TARGET_KCOV_ENABLE TARGET_IO('c', 100) #define TARGET_KCOV_DISABLE TARGET_IO('c', 101) +#define TARGET_KCOV_INIT_TRACE TARGET_IOR('c', 1, abi_ulong) struct target_sysinfo { abi_long uptime; /* Seconds since boot */