From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756290AbbJGV36 (ORCPT ); Wed, 7 Oct 2015 17:29:58 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:30362 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754462AbbJGV35 (ORCPT ); Wed, 7 Oct 2015 17:29:57 -0400 Subject: Re: [RFC PATCH v1 2/2] xen_nopv: Combine a bunch of the PV features that can be disabled To: Konrad Rzeszutek Wilk , joao.m.martins@oracle.com, david.vrabel@citrix.com, jgross@suse.com, dario.faggioli@citrix.com, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org References: <1444249310-23433-1-git-send-email-konrad.wilk@oracle.com> <1444249310-23433-3-git-send-email-konrad.wilk@oracle.com> From: Boris Ostrovsky Message-ID: <56158EC9.6010104@oracle.com> Date: Wed, 7 Oct 2015 17:29:45 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <1444249310-23433-3-git-send-email-konrad.wilk@oracle.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/07/2015 04:21 PM, Konrad Rzeszutek Wilk wrote: > under one parameter. Removes the xen_nopvspin parameter and > makes it part of the xen_nopv. > > Signed-off-by: Konrad Rzeszutek Wilk > --- > Documentation/kernel-parameters.txt | 15 +++++------ > arch/x86/xen/enlighten.c | 50 +++++++++++++++++++++++++++++++++---- > arch/x86/xen/spinlock.c | 18 ++++--------- > arch/x86/xen/xen-ops.h | 4 +++ > 4 files changed, 62 insertions(+), 25 deletions(-) > > diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt > index 22a4b68..73cd745 100644 > --- a/Documentation/kernel-parameters.txt > +++ b/Documentation/kernel-parameters.txt > @@ -4125,13 +4125,14 @@ bytes respectively. Such letter suffixes can also be entirely omitted. > the unplug protocol > never -- do not unplug even if version check succeeds > > - xen_nopvspin [X86,XEN] > - Disables the ticketlock slowpath using Xen PV > - optimizations. > - > - xen_nopv [X86] > - Disables the PV optimizations forcing the HVM guest to > - run as generic HVM guest with no PV drivers. > + xen_nopv= [X86,XEN] > + Disables various (or all) PV optimizations forcing the > + HVM (or PV) guest to run without them. > + Format: [off0,][off] { [spin][,ipi] | all } > + all -- every PV feature on HVM. > + spin -- Disables the ticketlock slowpath using Xen PV > + optimizations (PV and HVM). > + ipi - Disable PV event channel IPI (on HVM). > > xirc2ps_cs= [NET,PCMCIA] > Format: > diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c > index 30d12af..c644d2c 100644 > --- a/arch/x86/xen/enlighten.c > +++ b/arch/x86/xen/enlighten.c > @@ -1829,17 +1829,57 @@ static void __init xen_hvm_guest_init(void) > } > #endif > > -static bool xen_nopv = false; > +static unsigned int xen_nopv_feat; > +#define XEN_NOPV_SPIN 1<<1 > +#define XEN_NOPV_IPI 1<<2 > +#define XEN_NOPV_ALL (XEN_NOPV_SPIN | XEN_NOPV_IPI) > + > +bool xen_no_pvspin(void) > +{ > + return xen_nopv_feat & XEN_NOPV_SPIN; > +} > + > +bool xen_no_pv(void) > +{ > + return xen_nopv_feat & XEN_NOPV_ALL; > +} Should XEN_NOPV_ALL be the 'OR' of the other two? I think it implies them but is broader than that. We may decide to have NOPV_IPI and NOPV_SPIN but still run a Xen-aware guest (i.e. we want to return 'true' from xen_platform()). (Besides, this will return true if only one of the two bits is set.) > + > +bool xen_no_pvipi(void) > +{ > + return xen_nopv_feat & XEN_NOPV_IPI; > +} I don't see anyone using this. Also, I think these should be inlines. -boris