From patchwork Wed Apr 1 15:25:19 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shin-ichiro KAWASAKI X-Patchwork-Id: 15708 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n31FPQlp020718 for ; Wed, 1 Apr 2009 15:25:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932857AbZDAPZ0 (ORCPT ); Wed, 1 Apr 2009 11:25:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932539AbZDAPZ0 (ORCPT ); Wed, 1 Apr 2009 11:25:26 -0400 Received: from vsmtp01.dti.ne.jp ([202.216.231.136]:41461 "EHLO vsmtp01.dti.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932799AbZDAPZZ (ORCPT ); Wed, 1 Apr 2009 11:25:25 -0400 Received: from [192.168.1.22] (PPPa1996.e11.eacc.dti.ne.jp [124.255.93.226]) by vsmtp01.dti.ne.jp (3.11v) with ESMTP AUTH id n31FPK4a012558; Thu, 2 Apr 2009 00:25:20 +0900 (JST) Message-ID: <49D3875F.5020103@juno.dti.ne.jp> Date: Thu, 02 Apr 2009 00:25:19 +0900 From: Shin-ichiro KAWASAKI User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: Magnus Damm CC: "linux-sh@vger.kernel.org" Subject: Re: qemu-sh CF access perormance References: <49D2185C.4050909@juno.dti.ne.jp> In-Reply-To: Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Hi, Magnus! Thank you for your explanation. Magnus Damm wrote: > 2009/3/31 Shin-ichiro KAWASAKI : >> I'd like to ask following questions to linux-sh experts, >> >> - Why such io-traps are used to access CF? >> - Will this io-traps are used for SH7785LCR's SD card access? >> >> I guess these io-traps can be the reason why gcc takes so much time on qemu-sh. > > The r2d hardware implements 16-bit only CF interface while driver > software requires 8-bit access. To work around this issue io_trapped > is used to convert 8-bit accesses to 16-bit accesses. This is quite > slow. > > For more information, please see the comment in arch/sh/boards/mach-r2d/setup.c > > To improve performance, consider adding a command line flag to the > kernel that disables io_trapped. This flag can then be set on the > kernel command line by the person running qemu. > > Hope this helps! It really helps! The attached patch is a rough implementation to add a command line flag 'avoid_trap', which Magnus suggested. It is just a reference, but it reduces the gcc compile time from 40 seconds to around 4 seconds. 10 times faster! Is it OK to add such qemu specific options to linux kernel mainline? Regards, Shin-ichiro KAWASAKI --- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/linux-2.6.28/arch/sh/boards/mach-r2d/setup.c 2008-12-25 08:26:37.000000000 +0900 +++ b/linux-2.6.28/arch/sh/boards/mach-r2d/setup.c 2009-04-01 23:38:44.000000000 +0900 @@ -198,9 +198,11 @@ .minimum_bus_width = 16, }; +static int avoid_trap; + static int __init rts7751r2d_devices_setup(void) { - if (register_trapped_io(&cf_trapped_io) == 0) + if (avoid_trap || register_trapped_io(&cf_trapped_io) == 0) platform_device_register(&cf_ide_device); spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus)); @@ -245,6 +247,9 @@ sm501_reg = (void __iomem *)0xb3e00000 + SM501_DRAM_CONTROL; writel(readl(sm501_reg) | 0x00f107c0, sm501_reg); + + if (strstr(*cmdline_p, "avoid_trap")) + avoid_trap = 1; } /*