From patchwork Sun Dec 3 01:12:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 1870983 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SjTLt5Tv0z1ySY for ; Sun, 3 Dec 2023 12:13:10 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CA6DB384F9A9 for ; Sun, 3 Dec 2023 01:13:08 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (domu-toccata.ens-lyon.fr [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id B8B8C385C6F8 for ; Sun, 3 Dec 2023 01:12:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B8B8C385C6F8 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bounce.ens-lyon.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B8B8C385C6F8 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.77.166.138 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701565971; cv=none; b=fq85ImNPu88mu93y79VvxRgKsi2UWshZMfs2yz5GbyIxyhQD22KORutSMN1TXvQju9tOud7+Q8eoH6OO1Uaps3k88pC6y/kURZvuew6RZMSWJAXlmWaETz8aUwL8XB2S164Kdyldd7+2VFmkqi7Odb57HGSVg/JjPwvlWNTstyM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701565971; c=relaxed/simple; bh=lrCiawjekifBfLEecTNtfrg+gPpKU1y6kCvETP3zBo8=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=aso8sEOHAA8Z3SUrjn8k+0FgcRcFbdGZI2XRVbgBywbrsLha93MD23pIEe6ojkLGBeHCnEgutm1BOjxOXnyCxnzh0uhy/W3gGu7VwsEI0vxrnUSCQrqZtZj6ybW8/TYHkoUTcaY2tWHlJnVKirr+l3txzZDW/9poj+LKqeIXNFU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 8B5EB20101; Sun, 3 Dec 2023 02:12:48 +0100 (CET) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TCMcqMFG93Ja; Sun, 3 Dec 2023 02:12:48 +0100 (CET) Received: from begin.home (aamiens-653-1-111-57.w83-192.abo.wanadoo.fr [83.192.234.57]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id 777DF200FD; Sun, 3 Dec 2023 02:12:48 +0100 (CET) Received: from samy by begin.home with local (Exim 4.97) (envelope-from ) id 1r9b2O-00000006KQM-0f81; Sun, 03 Dec 2023 02:12:48 +0100 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault , commit-hurd@gnu.org Subject: [hurd, commited] Revert "Update code to handle the new ABI for sending inlined port rights." Date: Sun, 3 Dec 2023 02:12:47 +0100 Message-ID: <20231203011247.1508471-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org This reverts commit 7e23b3c2c008e0b9b5da055e675d40cc27bb10ef. --- hurd/intr-msg.c | 26 ++------------------------ mach/msg-destroy.c | 12 +++--------- 2 files changed, 5 insertions(+), 33 deletions(-) diff --git a/hurd/intr-msg.c b/hurd/intr-msg.c index d52e90449e..24184f827f 100644 --- a/hurd/intr-msg.c +++ b/hurd/intr-msg.c @@ -199,28 +199,6 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg, __vm_deallocate (__mach_task_self (), (vm_address_t) data, length); } - inline void clean_inlined_ports (mach_port_name_inlined_t *ports) - { - mach_msg_type_number_t i; - switch (name) - { - case MACH_MSG_TYPE_MOVE_SEND: - for (i = 0; i < number; i++) - __mach_port_deallocate (__mach_task_self (), ports[i].name); - if (ty->msgtl_header.msgt_longform) - ty->msgtl_name = MACH_MSG_TYPE_COPY_SEND; - else - ty->msgtl_header.msgt_name = MACH_MSG_TYPE_COPY_SEND; - break; - case MACH_MSG_TYPE_COPY_SEND: - case MACH_MSG_TYPE_MOVE_RECEIVE: - break; - default: - if (MACH_MSG_TYPE_PORT_ANY (name)) - assert (! "unexpected port type in interruptible RPC"); - } - } - char *data; if (ty->msgtl_header.msgt_longform) { @@ -237,11 +215,11 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg, data = (char *) ty + sizeof (mach_msg_type_t); } - /* Calculate length of data in bytes. */ const vm_size_t length = ((number * size) + 7) >> 3; if (ty->msgtl_header.msgt_inline) { - clean_inlined_ports (data); + /* Calculate length of data in bytes. */ + clean_ports_and_memory (data, length, 0); /* Move to the next argument. */ ty = (void *) PTR_ALIGN_UP (data + length, __alignof__ (uintptr_t)); } diff --git a/mach/msg-destroy.c b/mach/msg-destroy.c index 8640c965bd..19137baa62 100644 --- a/mach/msg-destroy.c +++ b/mach/msg-destroy.c @@ -108,17 +108,11 @@ __mach_msg_destroy (mach_msg_header_t *msg) addr = is_inline ? saddr : * (vm_offset_t *) saddr; if (MACH_MSG_TYPE_PORT_ANY(name)) { + mach_port_t *ports = (mach_port_t *) addr; mach_msg_type_number_t i; - if (is_inline) { - mach_port_name_inlined_t *inlined_ports = (mach_port_name_inlined_t *)addr; - for (i = 0; i < number; i++) - mach_msg_destroy_port(inlined_ports[i].name, name); - } else { - mach_port_t *ports = (mach_port_t *) addr; - for (i = 0; i < number; i++) - mach_msg_destroy_port(ports[i], name); - } + for (i = 0; i < number; i++) + mach_msg_destroy_port(*ports++, name); } if (is_inline) {