Received: by 10.223.185.116 with SMTP id b49csp6683980wrg; Wed, 28 Feb 2018 13:40:38 -0800 (PST) X-Google-Smtp-Source: AH8x224jf22YDyke3SJUNEu7yl3IAtHPYZnmiL20FVbmu3fX0qcxRpA1PByyWEmJtczr92+8LBDq X-Received: by 10.101.89.74 with SMTP id g10mr15343471pgu.415.1519854038095; Wed, 28 Feb 2018 13:40:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519854038; cv=none; d=google.com; s=arc-20160816; b=Ql43DmfA1MGJ/ux7bD93rR6Vo4/eycvg5c46WcCToA8LaFp+jbU1SqkqnplBhcZAyE leEfhtqaFAy2yHa4HcMi903NnhGusCBWSTOr8Ljxkr9ownaRPknUFIRxP7mcOGL00DHU rp/knMOY3d3iozRosjSX7jFPbSP3Rl8KmWrDQ2UntCE26mHI9Pp7qhm4HWfEnaoPixy1 Ppd49iZY4zSBaxmKlA8iL01cRdqaOF5Gyc7A7DEqv/BhYb2Hslug987QcQQ15utBLjYy H/2Q/0dA470P4gotprVhSYy7arI+1o2WWZVzkac6EoYKG6vvtyRMCJyhori4FZav+QPz O3uA== 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:from:references:cc:to:subject:arc-authentication-results; bh=je3QANJz2m6Qj1/TNuSpUo1NxU6s7UfmRaKA7uxaIY0=; b=k1xhlyWSZSjy68bKtCuhRBcNfvqx2UYCYD6bb5SKAMV8jkHw0UBPbzx1mZli6I1xg4 +ook4cx6nme+vuh8/Uu2vt1DuD61YOwloMGRvKR3BBzxqUSSRQefqj0WMPl8LJUoPyFd JJJCg+tT1hvLLVKA4Ag2wMEs9MNZVd78/WVeoH+u2GCtGOXmzUf1CJcx7d1DV86W7Dn6 cXLoB830aUlKnGIB82P7Qb00HAwVjF2UQ3BvIXqgL9zdNmSw5okbSVjhB/MdKai0UNDR NxjRD15b/CIaSIC63LuIGOmayA+Sc9QIZmTkgL+tK00mjZiXEF5VbuQTPwXDL1c4xbqo RR6Q== ARC-Authentication-Results: i=1; mx.google.com; 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 p1si1455439pgc.593.2018.02.28.13.40.22; Wed, 28 Feb 2018 13:40:38 -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; 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 S935076AbeB1Vjm (ORCPT + 99 others); Wed, 28 Feb 2018 16:39:42 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38644 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932597AbeB1Vjl (ORCPT ); Wed, 28 Feb 2018 16:39:41 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8577580AD238; Wed, 28 Feb 2018 21:39:40 +0000 (UTC) Received: from [10.36.118.24] (unknown [10.36.118.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E8ACB213AEF5; Wed, 28 Feb 2018 21:39:35 +0000 (UTC) Subject: Re: [RFC PATCH v4 0/7] KVM: x86: Allow Qemu/KVM to use PVH entry point To: Maran Wilson , jgross@suse.com, boris.ostrovsky@oracle.com, roger.pau@citrix.com, andrew.cooper3@citrix.com, hch@infradead.org, JBeulich@suse.com, x86@kernel.org, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, rkrcmar@redhat.com, jpoimboe@redhat.com, bp@suse.de, kirill.shutemov@linux.intel.com, thomas.lendacky@amd.com, luto@kernel.org, dave.hansen@linux.intel.com, davem@davemloft.net, gregkh@linuxfoundation.org, mchehab@kernel.org, linus.walleij@linaro.org, rdunlap@infradead.org References: <1519842483-8887-1-git-send-email-maran.wilson@oracle.com> From: Paolo Bonzini Message-ID: <239b5f48-00ad-5ff3-aa4f-ba126596c808@redhat.com> Date: Wed, 28 Feb 2018 22:39:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1519842483-8887-1-git-send-email-maran.wilson@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 28 Feb 2018 21:39:40 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 28 Feb 2018 21:39:40 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'pbonzini@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/02/2018 19:27, Maran Wilson wrote: > Sorry for the delay between this version and the last -- it was mostly > due to holidays and everyone being focused on security bug mitigation > issues. Here are the links to the previous email threads in case it is > helpful: > > V3: https://lkml.org/lkml/2017/12/12/1230 > V2: https://lkml.org/lkml/2017/12/7/1624 > V1: https://lkml.org/lkml/2017/11/28/1280 > > 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. As you say there are many ways to achieve this and I think your choice is fully reasonable (the other alternative that comes to mind is a "Xen detect" function that returns a struct of function pointers). Apart from the placement of the files, it looks great. Thanks! Paolo