Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2483927ybd; Mon, 24 Jun 2019 07:13:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxkc/3rfuXpUs5w+EHmASkl20fHWE0AkvzmAPr2ViKLvcTWa0fqHO3e9UFKaBWcWX/dSryY X-Received: by 2002:a17:90a:bf02:: with SMTP id c2mr25229286pjs.73.1561385624419; Mon, 24 Jun 2019 07:13:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561385624; cv=none; d=google.com; s=arc-20160816; b=uuJ7czl+LPoW4UNGUO5TyUI1QdFe+6i68rbr5adipcoih1AqVc9wdBwg4HfoO+mBIv rqC0DOzSKVZ0ZZLgHv4S0lwDMuJOsm7nX3uRxwMjVjQ3p3/9mtcmxbUM/7BAlKspMawR 2XvvAikfXCIdDJdrGUsdHejccf2BWrTf3EshpRNUq0HLupPTdLTek7H5ydZwT3sSP1hH 8/UnpcRBCzSwOjqGiglJ7vFlcnamHOOJGzqoX2qCcU3xo9REvL6y6AzjThlYHzxofxCk cfxHPoNqbNyTnwrK9JgEqu6Ov4MtsDb/ByyX0u19G7eXZkhmeznNwZn3OMJIVHVqjB+Z qmxw== 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; bh=ZKU6ytbpAbCn+K9vJljBZO+csGCFawHTY7JJSq9vSFw=; b=CpnZLJ6Cz6Mrt8XheOgcLbzw/vyE0q+wdCTGUcvsLf8aVG453F/IFOrwGCuKeZMYHv omNzvjAd1xFOhy0ypmDtMthWG5t9bcF8q3ZeVXSltFksKJmBeMeBdQgm+5EgGdtqSATt VuHQVZNKxKdE73JuFBC4X3Qf+6s+4RjqBnNZD0eqwOfBonbYz/xfwHUJeETv2QtxXjBy ANJilhHnUvkGJH5Es1x3efTJUPwpYVUwfHSOOPrhJFwp30/OWl6H5aYNd+ZAfHBBUbYe 0Yhriai/zUtaWYa62nS7m9mdJk893zf+LJZt9csxonT81JiL/R0ERpxTU9af9/khoTLY bMIA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k22si11429615pfi.289.2019.06.24.07.13.28; Mon, 24 Jun 2019 07:13:44 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729250AbfFXNSD (ORCPT + 99 others); Mon, 24 Jun 2019 09:18:03 -0400 Received: from mx2.suse.de ([195.135.220.15]:51410 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728666AbfFXNSC (ORCPT ); Mon, 24 Jun 2019 09:18:02 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 8D1B7AFB7; Mon, 24 Jun 2019 13:18:01 +0000 (UTC) Subject: Re: [PATCH 3/6] x86: Add nopv parameter to disable PV extensions To: Zhenzhong Duan , linux-kernel@vger.kernel.org Cc: tglx@linutronix.de, mingo@kernel.org, bp@alien8.de, hpa@zytor.com, boris.ostrovsky@oracle.com, sstabellini@kernel.org, xen-devel@lists.xenproject.org References: <1561294903-6166-1-git-send-email-zhenzhong.duan@oracle.com> <1561294903-6166-3-git-send-email-zhenzhong.duan@oracle.com> From: Juergen Gross Message-ID: <9e60cea2-a15f-b816-9049-f22be14c04b2@suse.com> Date: Mon, 24 Jun 2019 15:18:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <1561294903-6166-3-git-send-email-zhenzhong.duan@oracle.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23.06.19 15:01, Zhenzhong Duan wrote: > In virtualization environment, PV extensions (drivers, interrupts, > timers, etc) are enabled in the majority of use cases which is the > best option. > > However, in some cases (kexec not fully working, benchmarking) > we want to disable PV extensions. As such introduce the > 'nopv' parameter that will do it. > > There is already 'xen_nopv' parameter for XEN platform but not for > others. 'xen_nopv' can then be removed with this change. > > Signed-off-by: Zhenzhong Duan > Cc: xen-devel@lists.xenproject.org > --- > Documentation/admin-guide/kernel-parameters.txt | 4 ++++ > arch/x86/kernel/cpu/hypervisor.c | 11 +++++++++++ > 2 files changed, 15 insertions(+) > > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt > index 138f666..b352f36 100644 > --- a/Documentation/admin-guide/kernel-parameters.txt > +++ b/Documentation/admin-guide/kernel-parameters.txt > @@ -5268,6 +5268,10 @@ > improve timer resolution at the expense of processing > more timer interrupts. > > + nopv= [X86] > + Disables the PV optimizations forcing the guest to run > + as generic guest with no PV drivers. > + > xirc2ps_cs= [NET,PCMCIA] > Format: > ,,,,,[,[,[,]]] > diff --git a/arch/x86/kernel/cpu/hypervisor.c b/arch/x86/kernel/cpu/hypervisor.c > index 479ca47..4f2c875 100644 > --- a/arch/x86/kernel/cpu/hypervisor.c > +++ b/arch/x86/kernel/cpu/hypervisor.c > @@ -85,10 +85,21 @@ static void __init copy_array(const void *src, void *target, unsigned int size) > to[i] = from[i]; > } > > +static bool nopv; > +static __init int xen_parse_nopv(char *arg) > +{ > + nopv = true; > + return 0; > +} > +early_param("nopv", xen_parse_nopv); > + > void __init init_hypervisor_platform(void) > { > const struct hypervisor_x86 *h; > > + if (nopv) > + return; > + Oh, this is no good idea. There are guest types which just won't work without pv interfaces, like Xen PV and Xen PVH. Letting them fail due to just a wrong command line parameter is not nice, especially as the failure might be very hard to track down to the issue for the user. I guess you could add a "ignore_nopv" member to struct hypervisor_x86 set to true for the mentioned guest types and call the detect functions only if nopv is false or ignore_nopv is true. Juergen