Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp301247imu; Fri, 16 Nov 2018 02:47:57 -0800 (PST) X-Google-Smtp-Source: AJdET5ePaIvA7t61oHLsSxGUOR1UM65l2ChjJZGXm1gKcAbYkP12SN2//eQesYIWxBD/WOVNCKNf X-Received: by 2002:a17:902:bcc4:: with SMTP id o4-v6mr10384821pls.13.1542365277659; Fri, 16 Nov 2018 02:47:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542365277; cv=none; d=google.com; s=arc-20160816; b=Ly9CyT+y0iX7Wb8QJu6xJlU7FKdDuyQeOVYVprG5k0kHHhRShAUVt2JMu23oZDAwL6 FExJQc+AQ4JUKbD1BWmhSXxkPz/xatDElylBrJ8GhfCF5dxRp9wQVyMlKGYhaUvfdk43 2qKkbwj39FETcRmIRLiI5OEtFQgRpJs7PNa4ILjt83hg9FpTZFxVExVnlC/MZ+0hJpsS oL1N394fKmBc0UWkyzXGajbKKPX8HkQrhhEMHMieXECek06+25sR5o78AhO3AJnJd7ys 2QrGSHPzWVLicK/9VsTvUF5SHIzb7YjVMrexFF4hz8SZMJAGw8abo4VcFh7RdYy9KgEJ bHwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature; bh=i+L3xCtiXB8nII9Oiueu+4abIrusChErc/QA97p75xo=; b=Qbv3yBoM7zoDmhCzZS9AUGWLduCshze6fpcWR3by48zV1ug7LAQ4HpXlLBP0wwVNG1 7FZwQSUArK8XwKcRTU80mSaH+kb/fAp7Vrb12eiQt+IB1zK3PV/HEMJ09t1QNyfHniaG EB8cJbJbTit8rUoO2bucPuiJwEoIDoqA+7TK1FJmCA72GZy5xeBu3yCsIVMME53Cw89Q hz8zq1UbpnMlLVUCE6gIX9Y/arijbbx/tFhW0ljjp8o7QP9L1DnUUy6SqvQq2sLjbJkx jOQ3wGTGFs9i0C6eu+RtNPs20F0BMmzUYvLu8kdXdbxSXD2iOC6IkE6/rpHKYbyby3TT ZQNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=UteIwLR4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r1-v6si32663962plb.153.2018.11.16.02.47.43; Fri, 16 Nov 2018 02:47:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=UteIwLR4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389571AbeKPU6W (ORCPT + 99 others); Fri, 16 Nov 2018 15:58:22 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:41820 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727539AbeKPU6V (ORCPT ); Fri, 16 Nov 2018 15:58:21 -0500 Received: by mail-wr1-f65.google.com with SMTP id v18-v6so24370216wrt.8; Fri, 16 Nov 2018 02:46:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:openpgp:autocrypt:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=i+L3xCtiXB8nII9Oiueu+4abIrusChErc/QA97p75xo=; b=UteIwLR4JOGKMusslZlTPHGfcRb8SMx72rmaUU9yLjnIsST5G6cAVlLI/NOqcTHVSh H4t/DAzxhWCjvNg9GH9EF5XN36nHPNjYNl/vvaSKGyQGyQY2q++slP8lZD6WJvzdo6ZZ 0/0IaQBPEEqWrYEuFmAsoJQPAIb1APnQ93tRBzPf822qGhNPjVkQ1kC9oL+hmrYut9jT pe/eYqc2OfPqSzbHLVMyWztwbRC12jz/mlZbPtZGJmAXsqanwT+KqxbH6hUOw3m9s+ZR G1a4BjQ5+WLPhf5X6kjpTJLPjmVuBVRz5CKEFrQCDo4pFO61kQkoVx4+BWIUxqHJXH35 vRSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=i+L3xCtiXB8nII9Oiueu+4abIrusChErc/QA97p75xo=; b=c7twpaXzswnSp2+RcpOwHb5clMcAyMmuEkXim6aTyezGVBr4uyryZjb69YNm/kR3ff 0hLgXMdgoRY8Tii7E+XFchU3Uk+YS277nlm1XlMIEwdfkJXYl7oH/1jIHCIWUNKvXLNj baKJ4Qd3jXiZVtEgtz9MkxP2m4nZBl5219a7VlTkDb6FfU2CDTRZnx6qqSXqPkfFTb4N FKKhGC6lHb0Xl3JlR+lja8k//TLJ++D9HPmqh2iCGfmM/V4YeqlXMCg+di9rirSAc4Rh c7WXrMFhHHQ1D4kJXM46Hn8Ipfq7kJkHaoeEa7WyKaYKgZ8bI/IpauHd0kOC2zNVz9Ei aVEQ== X-Gm-Message-State: AGRZ1gJhReQi+p+Lro82UKQL5TcVa2zyzBPH8pZCrnSIkR3tSXwW/5Qa /4b9hTtEMOH00l12aVzhKHI= X-Received: by 2002:a05:6000:1251:: with SMTP id j17mr7687683wrx.315.1542365191401; Fri, 16 Nov 2018 02:46:31 -0800 (PST) Received: from [192.168.10.150] ([93.56.166.5]) by smtp.googlemail.com with ESMTPSA id 78-v6sm10155096wma.30.2018.11.16.02.46.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 02:46:29 -0800 (PST) Subject: Re: [PATCH v7 0/7] KVM: x86: Allow Qemu/KVM to use PVH entry point To: Maran Wilson , x86@kernel.org, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, jgross@suse.com Cc: boris.ostrovsky@oracle.com, bp@suse.de, dave.hansen@linux.intel.com, davem@davemloft.net, gregkh@linuxfoundation.org, hpa@zytor.com, jpoimboe@redhat.com, kirill.shutemov@linux.intel.com, linus.walleij@linaro.org, luto@kernel.org, mchehab@kernel.org, mingo@redhat.com, rdunlap@infradead.org, tglx@linutronix.de, thomas.lendacky@amd.com, hch@infradead.org, roger.pau@citrix.com, rkrcmar@redhat.com, Stefan Hajnoczi , Stefano Garzarella References: <1523920175-27287-1-git-send-email-maran.wilson@oracle.com> From: Paolo Bonzini Openpgp: preference=signencrypt Autocrypt: addr=pbonzini@redhat.com; keydata= xsEhBFRCcBIBDqDGsz4K0zZun3jh+U6Z9wNGLKQ0kSFyjN38gMqU1SfP+TUNQepFHb/Gc0E2 CxXPkIBTvYY+ZPkoTh5xF9oS1jqI8iRLzouzF8yXs3QjQIZ2SfuCxSVwlV65jotcjD2FTN04 hVopm9llFijNZpVIOGUTqzM4U55sdsCcZUluWM6x4HSOdw5F5Utxfp1wOjD/v92Lrax0hjiX DResHSt48q+8FrZzY+AUbkUS+Jm34qjswdrgsC5uxeVcLkBgWLmov2kMaMROT0YmFY6A3m1S P/kXmHDXxhe23gKb3dgwxUTpENDBGcfEzrzilWueOeUWiOcWuFOed/C3SyijBx3Av/lbCsHU Vx6pMycNTdzU1BuAroB+Y3mNEuW56Yd44jlInzG2UOwt9XjjdKkJZ1g0P9dwptwLEgTEd3Fo UdhAQyRXGYO8oROiuh+RZ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iQ2tSLjKh/cHeyFH68xjeLcinR7jXMrHQK+UCEw6jqi1oeZzGvfmxarUmS0uRuf fAb589AJW50kkQK9VD/9QC2FJISSUDnRC0PawGSZDXhmvITJMdD4TjYrePYhSY4uuIV02v02 8TVAaYbIhxvDY0hUQE4r8ZbGRLn52bEzaIPgl1p/adKfeOUeMReg/CkyzQpmyB1TSk8lDMxQ zCYHXAzwnGi8WU9iuE1P0wARAQABwsEzBBgBAgAJBQJUQnHuAhsMAAoJEH4VEAzNNmmxp1EO oJy0uZggJm7gZKeJ7iUpeX4eqUtqelUw6gU2daz2hE/jsxsTbC/w5piHmk1H1VWDKEM4bQBT uiJ0bfo55SWsUNN+c9hhIX+Y8LEe22izK3w7mRpvGcg+/ZRG4DEMHLP6JVsv5GMpoYwYOmHn plOzCXHvmdlW0i6SrMsBDl9rw4AtIa6bRwWLim1lQ6EM3PWifPrWSUPrPcw4OLSwFk0CPqC4 HYv/7ZnASVkR5EERFF3+6iaaVi5OgBd81F1TCvCX2BEyIDRZLJNvX3TOd5FEN+lIrl26xecz 876SvcOb5SL5SKg9/rCBufdPSjojkGFWGziHiFaYhbuI2E+NfWLJtd+ZvWAAV+O0d8vFFSvr iy9enJ8kxJwhC0ECbSKFY+W1eTIhMD3aeAKY90drozWEyHhENf4l/V+Ja5vOnW+gCDQkGt2Y 1lJAPPSIqZKvHzGShdh8DduC0U3xYkfbGAUvbxeepjgzp0uEnBXfPTy09JGpgWbg0w91GyfT /ujKaGd4vxG2Ei+MMNDmS1SMx7wu0evvQ5kT9NPzyq8R2GIhVSiAd2jioGuTjX6AZCFv3ToO 53DliFMkVTecLptsXaesuUHgL9dKIfvpm+rNXRn9wAwGjk0X/A== Message-ID: <9aeeaf85-6ecf-c1e2-640a-657f5bb0f8ef@redhat.com> Date: Fri, 16 Nov 2018 11:46:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <1523920175-27287-1-git-send-email-maran.wilson@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17/04/18 01:09, Maran Wilson wrote: > 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 without the need to run firmware. > > 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 > > This patch series would enable Qemu to use that same entry point for > booting KVM guests. Hi Maran, what happened to this series (and to the QEMU work)? Paolo > Changes from v6: > > * Addressed issues caught by the kbuild test robot: > - Restored an #include line that had been dropped by mistake (patch 4) > - Removed a pair of #include lines that were no longer needed in a > common code file and causing problems for certain 32-bit configs > (patchs 4 and 7) > > Changes from v5: > > * The interface changes to the x86/HVM start info layout have > now been accepted into the Xen tree. > * Rebase and merge upstream PVH file changes. > * (Patch 6) Synced up to the final version of the header file that was > acked and pulled into the Xen tree. > * (Patch 1) Fixed typo and removed redundant "def_bool n" line. > > Changes from v4: > > Note: I've withheld Juergen's earlier "Reviewed-by" tags from patches > 1 and 7 since there were minor changes (mostly just addition of > CONFIG_KVM_GUEST_PVH as requested) that came afterwards. > > * Changed subject prefix from RFC to PATCH > * Added CONFIG_KVM_GUEST_PVH as suggested > * Relocated the PVH common files to > arch/x86/platform/pvh/{enlighten.c,head.S} > * Realized I also needed to move the objtool override for those files > * Updated a few code comments per reviewer feedback > * Sent out a patch of the hvm_start_info struct changes against the Xen > tree since that is the canonical copy of the header. Discussions on > that thread have resulted in some (non-functional) updates to > start_info.h (patch 6/7) and those changes are reflected here as well > in order to keep the files in sync. The header file has since been > ack'ed for the Xen tree by Jan Beulich. > > Changes from v3: > > * Implemented Juergen's suggestion for refactoring and moving the PVH > code so that CONFIG_XEN is no longer required for booting KVM guests > via the PVH entry point. > Functionally, nothing has changed from V3 really, but the patches > look completely different now because of all the code movement and > refactoring. Some of these patches can be combined, but I've left > them very small in some cases to make the refactoring and code > movement easier to review. > My approach for refactoring has been to create a PVH entry layer that > still has understanding and knowledge about Xen vs non-Xen guest types > so that it can make run time decisions to handle either case, as > opposed to going all the way and re-writing it to be a completely > hypervisor agnostic and architecturally pure layer that is separate > from guest type details. The latter seemed a bit overkill in this > situation. And I've handled the complexity of having to support > Qemu/KVM boot of kernels compiled with or without CONFIG_XEN via a > pair of xen specific __weak routines that can be overridden in kernels > that support Xen guests. Importantly, the __weak routines are for > xen specific code only (not generic "guest type" specific code) so > there is no clashing between xen version of the strong routine and, > say, a KVM version of the same routine. But I'm sure there are many > ways to skin this cat, so I'm open to alternate suggestions if there > is a compelling reason for not using __weak in this situation. > > Changes from v2: > > * All structures (including memory map table entries) are padded and > aligned to an 8 byte boundary. > > * Removed the "packed" attributes and made changes to comments as > suggested by Jan. > > Changes from v1: > > * Adopted Paolo's suggestion for defining a v2 PVH ABI that includes the > e820 map instead of using the second module entry to pass the table. > > * Cleaned things up a bit to reduce the number of xen vs non-xen special > cases. > > > Maran Wilson (7): > xen/pvh: Split CONFIG_XEN_PVH into CONFIG_PVH and CONFIG_XEN_PVH > xen/pvh: Move PVH entry code out of Xen specific tree > xen/pvh: Create a new file for Xen specific PVH code > xen/pvh: Move Xen specific PVH VM initialization out of common file > xen/pvh: Move Xen code for getting mem map via hcall out of common > file > xen/pvh: Add memory map pointer to hvm_start_info struct > KVM: x86: Allow Qemu/KVM to use PVH entry point > > MAINTAINERS | 1 + > arch/x86/Kbuild | 2 + > arch/x86/Kconfig | 14 +++ > arch/x86/kernel/head_64.S | 2 +- > arch/x86/platform/pvh/Makefile | 5 + > arch/x86/platform/pvh/enlighten.c | 136 ++++++++++++++++++++++++ > arch/x86/{xen/xen-pvh.S => platform/pvh/head.S} | 0 > arch/x86/xen/Kconfig | 3 +- > arch/x86/xen/Makefile | 2 - > arch/x86/xen/enlighten_pvh.c | 93 +++------------- > include/xen/interface/hvm/start_info.h | 63 ++++++++++- > 11 files changed, 240 insertions(+), 81 deletions(-) > create mode 100644 arch/x86/platform/pvh/Makefile > create mode 100644 arch/x86/platform/pvh/enlighten.c > rename arch/x86/{xen/xen-pvh.S => platform/pvh/head.S} (100%) >