From patchwork Mon Apr 26 03:47:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= X-Patchwork-Id: 12223801 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFEE8C433B4 for ; Mon, 26 Apr 2021 03:48:46 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 82C9F61163 for ; Mon, 26 Apr 2021 03:48:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 82C9F61163 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=invisiblethingslab.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.117436.223341 (Exim 4.92) (envelope-from ) id 1lasEH-0000ON-FF; Mon, 26 Apr 2021 03:48:13 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 117436.223341; Mon, 26 Apr 2021 03:48:13 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lasEH-0000OE-7L; Mon, 26 Apr 2021 03:48:13 +0000 Received: by outflank-mailman (input) for mailman id 117436; Mon, 26 Apr 2021 03:48:12 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lasEF-0000O6-P4 for xen-devel@lists.xenproject.org; Mon, 26 Apr 2021 03:48:11 +0000 Received: from out2-smtp.messagingengine.com (unknown [66.111.4.26]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 9095dbae-5d5d-4f96-b99b-98b77f4501ce; Mon, 26 Apr 2021 03:48:08 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 9A8B65C0078; Sun, 25 Apr 2021 23:48:08 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sun, 25 Apr 2021 23:48:08 -0400 Received: from localhost.localdomain (ip5b434f04.dynamic.kabel-deutschland.de [91.67.79.4]) by mail.messagingengine.com (Postfix) with ESMTPA id A6E71240057; Sun, 25 Apr 2021 23:48:07 -0400 (EDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 9095dbae-5d5d-4f96-b99b-98b77f4501ce DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=g3BlWP aDuhYbF02cJ6YoeePymT94Qfj0PRakYSq2bxw=; b=PNBptw/QQT8lCwmC0Mn/o0 xXYNhh9jv65KPbHvD6qTPe+3198OwdipKkpiJhJaFghdoxKL2rXg82/2nARlMIQD 61z92iBLJlkKE5OC4JPod/cSwFCMLVUPJ2tltu+7VK03Dk95ofXGiJBCK1DPOCHa mk+PTlUqfi+Ioyc9432cWeQe/8eHOYVTfclhk1LuJlQtvvxRL7BtQ94tZ1/Cw9dI wIuArOMXXsN0MHlbV0fSRLfgACsFL6HI5EV5eKxxilAoWihwKAn+qhLhqyEM8wC2 3C8Dw2MugKJR+y0F4jhQx68HuqYh/KNe+T1yJ+q5QLmbTi8v33nqQ5YSsprVVK3A == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddujedgjeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofggtghogfesthekre dtredtjeenucfhrhhomhepofgrrhgvkhcuofgrrhgtiiihkhhofihskhhiqdfikphrvggt khhiuceomhgrrhhmrghrvghksehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomh eqnecuggftrfgrthhtvghrnhephefhfeetueelvddvtedttdevieeluedtvedtfeejieel hedutdeuheduieejgfegnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucfkpheple durdeijedrjeelrdegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtg homh X-ME-Proxy: From: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= , xen-devel@lists.xenproject.org Subject: [PATCH] i386: load kernel on xen using DMA Date: Mon, 26 Apr 2021 05:47:10 +0200 Message-Id: <20210426034709.595432-1-marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 Organization: Invisible Things Lab Kernel on Xen is loaded via fw_cfg. Previously it used non-DMA version, which loaded the kernel (and initramfs) byte by byte. Change this to DMA, to load in bigger chunks. This change alone reduces load time of a (big) kernel+initramfs from ~10s down to below 1s. This change was suggested initially here: https://lore.kernel.org/xen-devel/20180216204031.000052e9@gmail.com/ Apparently this alone is already enough to get massive speedup. Signed-off-by: Marek Marczykowski-Górecki Reviewed-by: Alex Bennée Reviewed-by: Anthony PERARD --- hw/i386/pc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 8a84b25a03..14e43d4da4 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -839,7 +839,8 @@ void xen_load_linux(PCMachineState *pcms) assert(MACHINE(pcms)->kernel_filename != NULL); - fw_cfg = fw_cfg_init_io(FW_CFG_IO_BASE); + fw_cfg = fw_cfg_init_io_dma(FW_CFG_IO_BASE, FW_CFG_IO_BASE + 4, + &address_space_memory); fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, x86ms->boot_cpus); rom_set_fw(fw_cfg);