From patchwork Wed Dec 5 22:31:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liam Merwick X-Patchwork-Id: 10714991 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2585115A6 for ; Wed, 5 Dec 2018 22:33:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 143C52E659 for ; Wed, 5 Dec 2018 22:33:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 05F452E65C; Wed, 5 Dec 2018 22:33:23 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,UNPARSEABLE_RELAY 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 822432E659 for ; Wed, 5 Dec 2018 22:33:22 +0000 (UTC) Received: from localhost ([::1]:37276 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUfjN-0002PS-55 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 05 Dec 2018 17:33:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUfi8-000133-PP for qemu-devel@nongnu.org; Wed, 05 Dec 2018 17:32:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gUfi3-0003mA-Tx for qemu-devel@nongnu.org; Wed, 05 Dec 2018 17:32:04 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:57278) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gUfi3-0003l0-IK for qemu-devel@nongnu.org; Wed, 05 Dec 2018 17:31:59 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wB5MSsXQ088145; Wed, 5 Dec 2018 22:31:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=Y8h9l2TPBjlLFhgyifu6t1QIe0PSW4sRGqXDmnVMaMs=; b=KYM93tgRdZtxVPs46hz2L8QnKTc+Wu8gvintk65ssCy7iV7O75XZ64NT9SDvdqvVUTtZ yHENg8ynUxBzxL9TGP3LbUQz7WeDzv32B/4ezPzcU/qo1zuxjSwvIdpKyM6hfu3UMynb kE2n/NML8VT3HZlPox80567f8wfW6fhT1DVTXpjSLSby+02Pf+3Xw35Dg9tc3fozB3Hp e8AfNtSkDTXd20oT2umntmC3hiV8epdLGFvj4hCUJ7q3H7f12z2n6BnLqW+IqSNrs0dm BuFY0AmgMR58RY7Nwdfrx3uLlEreiJ37PlcS6yId8yPDNLXM2EvJRympZ+l/oy6C1lk8 8A== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2130.oracle.com with ESMTP id 2p3ftf95cq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 05 Dec 2018 22:31:56 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wB5MVtNY018817 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 Dec 2018 22:31:55 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wB5MVs2a008462; Wed, 5 Dec 2018 22:31:54 GMT Received: from ol7.uk.oracle.com (/10.175.200.102) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 05 Dec 2018 14:31:54 -0800 From: Liam Merwick To: pbonzini@redhat.com Date: Wed, 5 Dec 2018 22:31:20 +0000 Message-Id: <1544049083-16087-1-git-send-email-liam.merwick@oracle.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9098 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=728 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812050197 X-MIME-Autoconverted: from 8bit to quoted-printable by aserp2130.oracle.com id wB5MSsXQ088145 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 141.146.126.79 Subject: [Qemu-devel] [RFC 0/3] qboot changes for PVH boot 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: maran.wilson@oracle.com, qemu-devel@nongnu.org, sgarzare@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP For certain applications it is desirable to rapidly boot a KVM virtual machine. In cases where legacy hardware and software support within the guest is not needed, QEMU should be able to boot directly into the uncompressed Linux kernel binary with minimal firmware involvement. There already exists an ABI to allow this for Xen PVH guests and the ABI is supported by Linux and FreeBSD: https://xenbits.xen.org/docs/unstable/misc/pvh.html Details on the Linux changes: https://lkml.org/lkml/2018/4/16/1002 This patch series provides qboot support to populate the start_info struct needed by the direct boot ABI and to configure the guest e820 tables to enable QEMU to use that same entry point for booting KVM guests. Usіng the methods/scripts documented by the NEMU team at https://github.com/intel/nemu/wiki/Measuring-Boot-Latency https://lists.gnu.org/archive/html/qemu-devel/2018-12/msg00200.html below are some timings measured (vmlinux and bzImage from the same build). Time to get to kernel start is almost halved (95ṁs -> 48ms) QEMU + qboot + vmlinux (PVH + 4.20-rc4) qemu_init_end: 41.550521 fw_start: 41.667139 (+0.116618) fw_do_boot: 47.448495 (+5.781356) linux_startup_64: 47.720785 (+0.27229) linux_start_kernel: 48.399541 (+0.678756) linux_start_user: 296.952056 (+248.552515) QEMU + qboot + bzImage: qemu_init_end: 29.209276 fw_start: 29.317342 (+0.108066) linux_start_boot: 36.679362 (+7.36202) linux_startup_64: 94.531349 (+57.851987) linux_start_kernel: 94.900913 (+0.369564) linux_start_user: 401.060971 (+306.160058) QEMU + bzImage: qemu_init_end: 30.424430 linux_startup_64: 893.770334 (+863.345904) linux_start_kernel: 894.17049 (+0.400156) linux_start_user: 1208.679768 (+314.509278) Liam Merwick (3): pvh: Add x86/HVM direct boot ABI header file pvh: use x86/HVM direct boot ABI pvh: add benchmark exit point benchmark.h | 3 +- fw_cfg.c | 79 +++++++++++++++++++++++++++- include/start_info.h | 146 +++++++++++++++++++++++++++++++++++++++++++++++++++ linuxboot.c | 2 +- main.c | 3 ++ tables.c | 9 ++++ 6 files changed, 239 insertions(+), 3 deletions(-) create mode 100644 include/start_info.h