Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp533583rdb; Tue, 31 Oct 2023 14:42:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHXQOPPV10ZyEPwVPErip+eYw51Qwz00PcpZcHbj++KWcsOAmTN7/f4fq9M3tNMtjQe1I9Z X-Received: by 2002:a05:6870:312:b0:1e9:b025:cf88 with SMTP id m18-20020a056870031200b001e9b025cf88mr19746532oaf.36.1698788528770; Tue, 31 Oct 2023 14:42:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698788528; cv=none; d=google.com; s=arc-20160816; b=QJvOi1qIGZzL2NYEqQhXEGDQ7xyOEpnIKI+iLcO8A0uRCN7vqkxacIL70wTDjNDPu4 xmU+vHiynADt0LrOk5EL1cEDIjOGfKOtI/kJpdVMGQWwGQuzTyPwt3WMD/VWIo4we2sQ c0foNh0Z8mls1yQmqWuKzXj39B85OTRKSWMYeYUqc23u8JjhS0pNuBFN53Ofbd29uiZN IAa8/oeVYACx2SKRUoGIJtQnbHBapkOXCHTdD/y4BOqng2pdmDRJU+SmPgSfMR/qLKql R49urSly7+muvhxYEjSIdjGNZkBdfXPKM9EQWb5HmCR5myPzNc0Qu2SuTP+hBGrvU8et 7ZSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:message-id:mime-version :user-agent:feedback-id:dkim-signature:dkim-signature; bh=hjsyai0jUrFlQIqxjLWsiIcKEWgzJEVZ7XvkZayojBc=; fh=UGwA0KYHemBsgrrytif4Av4PhEvI9xy7ts91UC4BWRI=; b=jqVnGye5zbEL0we8pD6zwCnaMCyeYPOSY/ikUuQCMhnSYdQaknGdnOVXiEEPQBGgV7 2FF6mI6I2S6T6gY+M3yf887boreaOTczboOGjxmsM8qnXdbGexh4l5oHihlyqQ9Q/uu7 pw4jF9YComszecePEMgd1DL8cmJzYH2HnzbdBgB6GTzEWlOBRnYG7i0m5z7xav3bLaP8 E137lGkpbSBr3zZBQhm97dyySzlisouKP6JBqBb+Uwuub7M7Pd7LFef1lRCmvzFV3B44 K9IOf5N8Pm8fyCCwPRQ/SR5OzptXC1t9vaMVtYq4XcDiZaMmGVwjJJ4RzCaHg2c3rANg G3xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b=wn5F6uE6; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=LLaKH0Ve; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id r38-20020a634426000000b005af21fd2c6fsi1588059pga.898.2023.10.31.14.42.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 14:42:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b=wn5F6uE6; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=LLaKH0Ve; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id C755481067B4; Tue, 31 Oct 2023 14:41:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344806AbjJaVlv (ORCPT + 99 others); Tue, 31 Oct 2023 17:41:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229649AbjJaVlu (ORCPT ); Tue, 31 Oct 2023 17:41:50 -0400 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD338E4; Tue, 31 Oct 2023 14:41:47 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id CAF743200AC1; Tue, 31 Oct 2023 17:41:46 -0400 (EDT) Received: from imap44 ([10.202.2.94]) by compute3.internal (MEProxy); Tue, 31 Oct 2023 17:41:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm1; t=1698788506; x=1698874906; bh=hjsyai0jUrFlQIqxjLWsiIcKE WgzJEVZ7XvkZayojBc=; b=wn5F6uE6qga83jtPZKrDEktHeBpkXXGDCOYh+H2iS FC/3MeUh/GTPYI8IAcpwxxAoppTdWIwmvRGp03V13uNd2xdxMxplwPy13dhb4AzU xJkI0OvRaNBpRPGP6vn9NsdcPwiH8ZmHLHeRs3B/YCArrt6RM+JN3vb+v7rnkU4B RdnF837IhyADp5IMp9gJYK9PZyceYI2CfhtWTxHf8Ytew7pZM1r2OmdsCED55kpT tYkTcVFFIN/prCTgRKUWouAt3gYJh6ad0TbRw3Y6Gr/Ysm1jAmx7TldaXZ+cii11 T2c1XxnrWr71mhfY0BiaiRPbYYEJodkETy3Xoh6V9RxBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1698788506; x=1698874906; bh=hjsyai0jUrFlQIqxjLWsiIcKEWgzJEVZ7Xv kZayojBc=; b=LLaKH0VevwYs1AlR8qViG9amOgqXci46pCbV+zjsbxe4X74pQ3a 5KpbHQ5+1uesZ4xea/s3DAl4N5dWN9tY6V/H4JeZ7UFnfxXmepiJuNehVBT4JJ5K YBPCVWUCGTqJiHTfAmWYrXI2Ww0Rgmd/Kc7x37S1NRAI01SO6j80jyrk/mUkqOrM pCtVDGKy55Xh4nIjo9k3j47kCgkVUoNkoXTabzTp93aGOENuFPKEaG1a+OzwFflF Pjv9g7n1HzYGKrA0g6O/R7mVc1zTd2ZCLnNSKB6niZtGOvuzquowF8aWAmM5zg3A 4Wsr2+FREQgXt2Zxe1xR/CcBHVzV09HLiGA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedruddtvddgudeglecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkfffhvfevufgtsehttd ertderredtnecuhfhrohhmpedflfhirgiguhhnucgjrghnghdfuceojhhirgiguhhnrdih rghnghesfhhlhihgohgrthdrtghomheqnecuggftrfgrthhtvghrnhepuefhvdehheegud euteefveejtdevledvlefhuefhffffgfehveegffegleeuhffgnecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhirgiguhhnrdihrghnghesfh hlhihgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 1315036A0075; Tue, 31 Oct 2023 17:41:45 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1048-g9229b632c5-fm-20231019.001-g9229b632 MIME-Version: 1.0 Message-Id: <82076999-9346-473d-8841-1480cd70b527@app.fastmail.com> Date: Tue, 31 Oct 2023 21:41:26 +0000 From: "Jiaxun Yang" To: linux-arch@vger.kernel.org Cc: x86@kernel.org, linux-kernel@vger.kernel.org, arnd@arndb.de, bhe@redhat.com Subject: Overhead of io{read,write}{8,16,32,64} on x86 Content-Type: text/plain X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, 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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 31 Oct 2023 14:41:54 -0700 (PDT) Hi all, I'm trying to improve Kernel's support of devices that have ioports mapped into MMIO, that involves converting existing driver which is using {in,out}{l,w,b} to use io{read,write}{8,16,32,64}, so they can benefit from ioport_map and pci_iomap. However, the problem is io{read,write}{8,16,32,64} will incur penalty on x86 by introducing extra function calls (they are not inlined) and having extra condition judgment on MMIO vs PIO. x86 folks, do you think this kind of overhead is acceptable? I do think most of PCI/ISA drivers will need to be converted. linux-arch folks, do you think it will be better if we introduce a variant of io{read,write}{8,16,32,64} that direct to PIO on x86 but remains the same functionality on other architectures? Thanks - Jiaxun