From patchwork Mon Apr 2 17:13:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 10320091 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BFD0D60247 for ; Mon, 2 Apr 2018 17:19:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF36928A75 for ; Mon, 2 Apr 2018 17:19:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9EC1828A41; Mon, 2 Apr 2018 17:19:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, FROM_LOCAL_NOVOWEL, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D3E9A28A41 for ; Mon, 2 Apr 2018 17:19:22 +0000 (UTC) Received: from localhost ([::1]:49909 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3374-00088I-26 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 02 Apr 2018 13:19:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f332O-0004PN-IE for qemu-devel@nongnu.org; Mon, 02 Apr 2018 13:14:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f332N-0004fB-H3 for qemu-devel@nongnu.org; Mon, 02 Apr 2018 13:14:32 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:54717) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f332N-0004eb-Ay for qemu-devel@nongnu.org; Mon, 02 Apr 2018 13:14:31 -0400 Received: by mail-wm0-x243.google.com with SMTP id h76so27081540wme.4 for ; Mon, 02 Apr 2018 10:14:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ktI3Jwvv6apbrNdAUeO2FBMTb6Lw6CPUGov2Aoa3rxI=; b=UizINfJuZKiyrf5wgzce02ZXczc7BbXq6tvEa6SQeV/cpHv8IAmNMEXvQfBrMnxWVI 6xlfKpqJsjk42OgcMIK4C2t6d31Vh42n4RDSyqG1vbl6l6RCTxym8UTiFBBDeJUDGena nkf59ck++29WibjAKkHZNS9gsMVHNK5N7CNI73V9yeyEgIZkGkzuBH+ZueDxAByJiGQa gbAV/+QXPwE5Sf4ECoxezSOb0FzkH3bP5Tsu7z797fNvYrat5c0pkr34qarv2AnYJ9YT 6VQrj7Q752SYiqOHOLgc0mpmpHKpEeHL8uDBGuf80YfruugRYegssjA8IZ3o3X+f8BUZ rnZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ktI3Jwvv6apbrNdAUeO2FBMTb6Lw6CPUGov2Aoa3rxI=; b=R7Nl8+SGMGFWZICc4GKtz2O1IQs5qr/y+XYXIKgav4QoC+yLHXihan7JyRMAGzRCem UR/luQ08j9+k6Ms3OBQB1XopXZqZcW0DqEP2XnhFiNqwRRGYvyqjJFvj00N/cGcpLIZ+ MmRg8zw0rZQngnZNHm57GtBt8KvLiELuG/cZDxMgQkCqaRvx27r5JtaD0ZMRmiqh4gBB IpcdT/m+nieBFi4t1oHpQgQ2oNMtho0Tn5m6Bluv4z0g1jbaqchI5KSwnaj6JMPVldkV Y/5BSG1ydXv5tlZN6gWQ5nEAezf+iSIw9gemrqMkRIdjnpQWxt0m62KrDdRtbmnX1J+z n/LA== X-Gm-Message-State: ALQs6tDcc3Ad0uE5PAyh2nefvlDaWSKyhhmjrkJuXBloZ8Sw0XJcv/tx BBvU0A2v6iknZeZiuXp2HzMu7Q== X-Google-Smtp-Source: AIpwx4/SX7HJawW0mZRAEEKke8BfCuAqCYSBAIsDSqIqf3I4QyfO0kW+QoPRSSdEga+ttawVgO5Abw== X-Received: by 10.46.158.199 with SMTP id h7mr6519313ljk.103.1522689270106; Mon, 02 Apr 2018 10:14:30 -0700 (PDT) Received: from octofox.cadence.com (jcmvbkbc-1-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:1fa::2]) by smtp.gmail.com with ESMTPSA id s87-v6sm142360lfk.69.2018.04.02.10.14.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Apr 2018 10:14:29 -0700 (PDT) From: Max Filippov To: qemu-devel@nongnu.org Date: Mon, 2 Apr 2018 10:13:51 -0700 Message-Id: <20180402171354.27706-6-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180402171354.27706-1-jcmvbkbc@gmail.com> References: <20180402171354.27706-1-jcmvbkbc@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PULL 5/8] target/xtensa: linux-user: fix sysv IPC structures X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Riku Voipio , Laurent Vivier , Max Filippov Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP - make target_ipc_perm fields match kernel definitions for xtensa; - add target_semid64_ds with proper order of times and reserved fields for little/big endian specific for xtensa; - add missing reserved fields after time fields to the target_shmid_ds; - fix types of shm_cpid, shm_lpid and shm_nattch fields of target_shmid_ds to match kernel definitions for xtensa. These changes fix guest ipcs output and fix glibc testsuite tests sysvipc/test-sysvsem and sysvipc/test-sysvshm. Reviewed-by: Laurent Vivier Signed-off-by: Max Filippov --- linux-user/xtensa/target_structs.h | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/linux-user/xtensa/target_structs.h b/linux-user/xtensa/target_structs.h index 020e20e242fc..1b3d9ca314ff 100644 --- a/linux-user/xtensa/target_structs.h +++ b/linux-user/xtensa/target_structs.h @@ -8,21 +8,44 @@ struct target_ipc_perm { abi_uint cuid; /* Creator's user ID. */ abi_uint cgid; /* Creator's group ID. */ abi_uint mode; /* Read/write permission. */ - abi_ushort __seq; /* Sequence number. */ + abi_ulong __seq; /* Sequence number. */ + abi_ulong __unused1; + abi_ulong __unused2; +}; + +struct target_semid64_ds { + struct target_ipc_perm sem_perm; +#ifdef TARGET_WORDS_BIGENDIAN + abi_ulong __unused1; + abi_ulong sem_otime; + abi_ulong __unused2; + abi_ulong sem_ctime; +#else + abi_ulong sem_otime; + abi_ulong __unused1; + abi_ulong sem_ctime; + abi_ulong __unused2; +#endif + abi_ulong sem_nsems; + abi_ulong __unused3; + abi_ulong __unused4; }; +#define TARGET_SEMID64_DS struct target_shmid_ds { struct target_ipc_perm shm_perm; /* operation permission struct */ - abi_int shm_segsz; /* size of segment in bytes */ + abi_long shm_segsz; /* size of segment in bytes */ abi_long shm_atime; /* time of last shmat() */ + abi_ulong __unused1; abi_long shm_dtime; /* time of last shmdt() */ - abi_long shm_ctime; /* time of last change by shmctl() */ - abi_ushort shm_cpid; /* pid of creator */ - abi_ushort shm_lpid; /* pid of last shmop */ - abi_ushort shm_nattch; /* number of current attaches */ - abi_ushort shm_unused; /* compatibility */ abi_ulong __unused2; + abi_long shm_ctime; /* time of last change by shmctl() */ abi_ulong __unused3; + abi_uint shm_cpid; /* pid of creator */ + abi_uint shm_lpid; /* pid of last shmop */ + abi_ulong shm_nattch; /* number of current attaches */ + abi_ulong __unused4; + abi_ulong __unused5; }; #endif