All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Kai Huang <kai.huang@linux.intel.com>,
	jbeulich@suse.com, tim@xen.org, kevin.tian@intel.com,
	yang.z.zhang@intel.com, xen-devel@lists.xen.org
Subject: Re: [PATCH 02/10] VMX: New parameter to control PML enabling
Date: Thu, 2 Apr 2015 10:58:43 +0100	[thread overview]
Message-ID: <551D12D3.10401@citrix.com> (raw)
In-Reply-To: <551CD7A2.9020409@linux.intel.com>

On 02/04/15 06:46, Kai Huang wrote:
>
>
> On 03/28/2015 04:42 AM, Andrew Cooper wrote:
>> On 27/03/15 02:35, Kai Huang wrote:
>>> A top level EPT parameter "ept=<options>" and a sub boolean
>>> "pml_enable" are
>>> added to control PML. Other booleans can be further added for any
>>> other EPT
>>> related features.
>>>
>>> Signed-off-by: Kai Huang <kai.huang@linux.intel.com>
>> Please patch docs/misc/xen-command-line.markdown as well.  See the
>> existing "psr" option as a similar example.
>>
>> Also, as indicated in patch 1, I think patches 1 and 2 need swapping in
>> the series.
>>
>>> ---
>>>   xen/arch/x86/hvm/vmx/vmcs.c | 32 ++++++++++++++++++++++++++++++++
>>>   1 file changed, 32 insertions(+)
>>>
>>> diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
>>> index 2f645fe..9b20a4b 100644
>>> --- a/xen/arch/x86/hvm/vmx/vmcs.c
>>> +++ b/xen/arch/x86/hvm/vmx/vmcs.c
>>> @@ -50,6 +50,16 @@ boolean_param("unrestricted_guest",
>>> opt_unrestricted_guest_enabled);
>>>   static bool_t __read_mostly opt_apicv_enabled = 1;
>>>   boolean_param("apicv", opt_apicv_enabled);
>>>   +static void parse_ept_param(char *s);
>>> +/*
>>> + * The 'ept' parameter controls functionalities that depend on, or
>>> impact the
>>> + * EPT mechanism. Optional comma separated value may contain:
>>> + *
>>> + *  pml                 Enable PML
>>> + */
>>> +custom_param("ept", parse_ept_param);
>> It is common to put the custom_param() call below parse_ept_param() so
>> you don't need to forward-declare the function.  The comment can happily
>> live at the top of parse_ept_param().
> Hi Andrew,
>
> Looks it's better to keep parse_ept_param() below custom_param(), as
> simply moving parse_ept_param() above custom_param() results in below
> error (I also changed pml_enable to opt_pml_enabled), as it references
> opt_pml_enabled variable, which is defined below custom_param().
> Actually for "iommu=<options>" parameter, parse_iommu_param() was also
> placed below custom_param().
>
> What do you think?
>
> vmcs.c: In function ‘parse_ept_param’:
> vmcs.c:74:13: error: ‘opt_pml_enabled’ undeclared (first use in this
> function)
>              opt_pml_enabled = val;
>              ^
> vmcs.c:74:13: note: each undeclared identifier is reported only once
> for each function it appears in
> vmcs.c: At top level:
> vmcs.c:81:29: error: ‘opt_pml_enabled’ defined but not used
> [-Werror=unused-variable]
>  static bool_t __read_mostly opt_pml_enabled = 0;

The most concise way of doing this is:

static bool_t __read_mostly opt_pml_enabled = 0;

static void parse_ept_param(char *s)
{
  ...
}
custom_param("ept", parse_ept_param);

~Andrew

  reply	other threads:[~2015-04-02  9:58 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-27  2:35 [PATCH 00/10] PML (Paging Modification Logging) support Kai Huang
2015-03-27  2:35 ` [PATCH 01/10] VMX: Enable EPT A/D bit support Kai Huang
2015-03-27 20:38   ` Andrew Cooper
2015-03-30  6:11     ` Kai Huang
2015-03-30  9:36       ` Andrew Cooper
2015-03-30 13:35         ` Kai Huang
2015-03-30 13:39           ` Andrew Cooper
2015-04-02  6:32     ` Kai Huang
2015-04-02  9:55       ` Andrew Cooper
2015-04-09 11:21   ` Tim Deegan
2015-04-10  6:40     ` Kai Huang
2015-04-10  8:54       ` Tim Deegan
2015-04-10  9:26         ` Kai Huang
2015-04-10  9:51           ` Tim Deegan
2015-04-10 13:14             ` Kai Huang
2015-03-27  2:35 ` [PATCH 02/10] VMX: New parameter to control PML enabling Kai Huang
2015-03-27 20:42   ` Andrew Cooper
2015-03-30  6:16     ` Kai Huang
2015-04-02  5:46     ` Kai Huang
2015-04-02  9:58       ` Andrew Cooper [this message]
2015-04-02 13:34         ` Kai Huang
2015-03-27  2:35 ` [PATCH 03/10] VMX: Add PML definition and feature detection Kai Huang
2015-03-27 20:46   ` Andrew Cooper
2015-03-30  6:18     ` Kai Huang
2015-03-27  2:35 ` [PATCH 04/10] VMX: New data structure member to support PML Kai Huang
2015-03-27 20:48   ` Andrew Cooper
2015-03-30  6:19     ` Kai Huang
2015-03-27  2:35 ` [PATCH 05/10] VMX: add help functions " Kai Huang
2015-03-27 21:09   ` Andrew Cooper
2015-03-30  6:43     ` Kai Huang
2015-03-30  9:54       ` Andrew Cooper
2015-03-30 13:40         ` Kai Huang
2015-04-09 12:00   ` Tim Deegan
2015-04-10  7:05     ` Kai Huang
2015-04-10  9:03       ` Tim Deegan
2015-04-10  9:28         ` Kai Huang
2015-04-09 12:31   ` Tim Deegan
2015-04-10  7:07     ` Kai Huang
2015-03-27  2:35 ` [PATCH 06/10] VMX: handle PML buffer full VMEXIT Kai Huang
2015-03-27  2:35 ` [PATCH 07/10] VMX: handle PML enabling in vmx_vcpu_initialise Kai Huang
2015-03-27 21:12   ` Andrew Cooper
2015-03-30  7:03     ` Kai Huang
2015-03-30 10:00       ` Andrew Cooper
2015-03-27  2:35 ` [PATCH 08/10] VMX: disable PML in vmx_vcpu_destroy Kai Huang
2015-04-09 12:04   ` Tim Deegan
2015-04-10  7:25     ` Kai Huang
2015-04-10  9:30       ` Tim Deegan
2015-03-27  2:35 ` [PATCH 09/10] log-dirty: Refine common code to support PML Kai Huang
2015-04-09 12:27   ` Tim Deegan
2015-04-10  7:38     ` Kai Huang
2015-04-10  9:31       ` Tim Deegan
2015-04-10  9:33         ` Kai Huang
2015-03-27  2:35 ` [PATCH 10/10] p2m/ept: Enable PML in p2m-ept for log-dirty Kai Huang
2015-04-09 12:20   ` Tim Deegan
2015-04-10  8:44     ` Kai Huang
2015-04-10  9:46       ` Tim Deegan
2015-04-10 13:18         ` Kai Huang
2015-04-10 14:35           ` Tim Deegan
2015-03-27 21:26 ` [PATCH 00/10] PML (Paging Modification Logging) support Andrew Cooper
2015-03-30  5:50   ` Kai Huang
2015-04-07  8:30     ` Kai Huang
2015-04-07  9:24       ` Tim Deegan
2015-04-08  2:23         ` Kai Huang
2015-04-09 12:32         ` Tim Deegan
2015-04-10  6:40           ` Kai Huang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=551D12D3.10401@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=kai.huang@linux.intel.com \
    --cc=kevin.tian@intel.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    --cc=yang.z.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.