Received: by 10.223.185.116 with SMTP id b49csp7716875wrg; Thu, 1 Mar 2018 09:53:36 -0800 (PST) X-Google-Smtp-Source: AG47ELvRtCh5f8cel3njcy9lbIubfFPhxQYjQkXgE6Z1DeakzLdILnXVIGWflDVyvxCQqSwhL2rI X-Received: by 10.99.103.69 with SMTP id b66mr2169749pgc.233.1519926815966; Thu, 01 Mar 2018 09:53:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519926815; cv=none; d=google.com; s=arc-20160816; b=C2b0tPmnmdpHUWqNGXGePiulWg38r58xLx1Rz/N7uY4lmIbILgRpgKRYYuNZ6LS8BW aeUsxi6UIzPXUbqKlvhIg9wEtPAsReAyoi1z5k2QLETbECQL1oIPVWy0KumtXESDMY/s pmBf3svUhUGypXOeJIRi2xY+Z27gljXmg+VpHTr5Hbl+XmXQD+WxjcWfGT8jMsFJBi1l HY+d9q9tRFC8rkal+MzqFx259vp+Zcjwk4jvBAhxO1XRU3akpiGWuFCqg6CZaKS3Ljwo lJriJdrE0wH54yx8Rj2PljwcRBQCPX5fRfaDjdjWBEKDwUW6oi3nxZHdLeiYwzjGWw8C XlvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature:arc-authentication-results; bh=PHMzSZopzMAbVOU35APrt5G6pNzEhK+OhifOF+quqiE=; b=Tus+Id+ouXkl9y2CU/bRZ5tQP83yIl+fOAdrv6jwVzwi0SzDuExlBBisQ9hnj4LeFN YWEVGzAEWGr3PWkrPQZ+bLAXKoE++o6JEwRVqP60rVfn6KkBxXtVqLMdxQSCJYxblqrD 1F0sgCGuxwSBclV4xbJn32OlBl4x/ShtFIJMVIZgFalfNGJxGmEl6y1XcIJrsFpX0wmS g1BmK7Kpj2bcx7sr8ukz5J7LuTTW4LAbzpsutoPk305tGtNh0wj8ygQ36NI27s9TAyqg WlsJAxa7xVgKteoyH6EheQBnhL8Uph+1m23MUXdwyLBmgp6lt6ZjoVcNVNlEEncJ3lv+ HiSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=U1p6Ynd+; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e87si3274747pfd.352.2018.03.01.09.53.20; Thu, 01 Mar 2018 09:53:35 -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=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=U1p6Ynd+; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033749AbeCARuw (ORCPT + 99 others); Thu, 1 Mar 2018 12:50:52 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:39812 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1033529AbeCARug (ORCPT ); Thu, 1 Mar 2018 12:50:36 -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 w21Hl09L078827; Thu, 1 Mar 2018 17:48:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=PHMzSZopzMAbVOU35APrt5G6pNzEhK+OhifOF+quqiE=; b=U1p6Ynd+Pm1NV2iXaeLog9XsHB8M6edIkw0aSDVWqDX+P3zEhBN3oEFCQ3hMDf4rEoqg OP0PnLHWkN0qGJr2+CyNY/7dwGL67i2+DCPG62eYi8zJnmOAcX8ETaidhpeMi5pB2Ox+ RfA632+vo3bEl5mxZjlshMeWIVAekD9ZAfMAIBPB9NEU/Eb8JLv8pM47mOIBT7EScSlC MvHcG07bJVbCM1hR09aYJ3wAt++iemXfW2xZx/DMLec9I4M2FE6ImeeVwSK/+4K8ui5n LlYgpCrMK5btSFLflmxDdr8s+7Zl/I+Ae7cxZDVfo/buKRHy/XePFW8TVbHddEuD2kL/ 9w== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2130.oracle.com with ESMTP id 2gep4ng1jn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Mar 2018 17:48:55 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w21HhqLB005880 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 1 Mar 2018 17:43:53 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w21HhpdS010469; Thu, 1 Mar 2018 17:43:51 GMT Received: from [10.141.197.71] (/10.141.197.71) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 01 Mar 2018 09:43:51 -0800 Subject: Re: [RFC PATCH v4 4/7] xen/pvh: Move Xen specific PVH VM initialization out of common code To: Boris Ostrovsky , pbonzini@redhat.com, jgross@suse.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> <1519842483-8887-5-git-send-email-maran.wilson@oracle.com> From: Maran Wilson Organization: Oracle Corporation Message-ID: <2876cbf2-e26a-d6dd-064a-32cf93a9e7ab@oracle.com> Date: Thu, 1 Mar 2018 09:43:49 -0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8819 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803010220 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/1/2018 8:05 AM, Boris Ostrovsky wrote: > On 02/28/2018 01:28 PM, Maran Wilson wrote: >> We need to refactor PVH entry code so that support for other hypervisors >> like Qemu/KVM can be added more easily. >> >> This patch moves the small block of code used for initializing Xen PVH >> virtual machines into the Xen specific file. This initialization is not >> going to be needed for Qemu/KVM guests. Moving it out of the common file >> is going to allow us to compile kernels in the future without CONFIG_XEN >> that are still capable of being booted as a Qemu/KVM guest via the PVH >> entry point. >> >> Signed-off-by: Maran Wilson >> --- >> arch/x86/pvh.c | 28 ++++++++++++++++++++-------- >> arch/x86/xen/enlighten_pvh.c | 18 +++++++++++++++++- >> 2 files changed, 37 insertions(+), 9 deletions(-) >> >> diff --git a/arch/x86/pvh.c b/arch/x86/pvh.c >> index b56cb5e7d6ac..2d7a7f4958cb 100644 >> --- a/arch/x86/pvh.c >> +++ b/arch/x86/pvh.c >> @@ -72,26 +72,38 @@ static void __init init_pvh_bootparams(void) >> pvh_bootparams.hdr.type_of_loader = (9 << 4) | 0; /* Xen loader */ >> } >> >> +/* >> + * If we are trying to boot a Xen PVH guest, it is expected that the kernel >> + * will have been configured to provide the required override for this routine. >> + */ >> +void __init __weak xen_pvh_init(void) >> +{ >> + xen_raw_printk("Error: Missing xen PVH initialization\n"); > I think this should be printk (or, more precisely, this should not be > xen_raw_printk()): we are here because we are *not* a Xen guest and so > Xen-specific printk will not work. (and the same is true for the next > patch where weak mem_map_via_hcall() is added). Actually I left that xen_raw_printk() statement in on purpose. It's also possible that some future developer accidentally drops or hides the strong version of the routine even when CONFIG_XEN (and CONFIG_HVC_XEN) is enabled. In that situation, this error message might prove helpful in quickly identifying the problem when he or she attempts to boot a Xen guest. And in situations where CONFIG_XEN is disabled or someone is booting a non xen guest, the statement simply becomes a nop, so no harm is done. And also, I believe this code is far too early for normal printk() statements to work so switching to that won't buy us anything. Thanks, -Maran > -boris > > >> + BUG(); >> +} >>