From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>, Kevin Tian <kevin.tian@intel.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
Jun Nakajima <jun.nakajima@intel.com>
Subject: Re: [PATCH 2/3] VMX: allocate VMCS pages from domain heap
Date: Tue, 24 Nov 2015 10:59:38 +0000 [thread overview]
Message-ID: <5654431A.9060607@citrix.com> (raw)
In-Reply-To: <5654422A.9090004@citrix.com>
On 24/11/15 10:55, Andrew Cooper wrote:
> On 24/11/15 07:50, Jan Beulich wrote:
>>>>> On 24.11.15 at 06:04, <kevin.tian@intel.com> wrote:
>>>> From: Jan Beulich [mailto:JBeulich@suse.com]
>>>> Sent: Monday, November 23, 2015 10:28 PM
>>>>
>>>>>>> On 21.10.15 at 05:16, <kevin.tian@intel.com> wrote:
>>>>>> From: Jan Beulich [mailto:JBeulich@suse.com]
>>>>>> Sent: Tuesday, October 20, 2015 6:36 PM
>>>>>>>>> On 20.10.15 at 12:12, <andrew.cooper3@citrix.com> wrote:
>>>>>>> On 19/10/15 16:22, Jan Beulich wrote:
>>>>>>>> @@ -580,7 +583,7 @@ int vmx_cpu_up_prepare(unsigned int cpu)
>>>>>>>> void vmx_cpu_dead(unsigned int cpu)
>>>>>>>> {
>>>>>>>> vmx_free_vmcs(per_cpu(vmxon_region, cpu));
>>>>>>>> - per_cpu(vmxon_region, cpu) = NULL;
>>>>>>>> + per_cpu(vmxon_region, cpu) = 0;
>>>>>>> While this is currently safe (as pa 0 is not part of the available heap
>>>>>>> allocation range), might it be worth introducing a named sentential? I
>>>>>>> can forsee a DMLite nested Xen scenario where we definitely don't need
>>>>>>> to treat the low 1MB magically.
>>>>>> I guess there are more things to adjust if we ever cared to recover
>>>>>> the few hundred kb below 1Mb. And then I don't see why nested
>>>>>> Xen would matter here: One major main reason for reserving that
>>>>>> space is that we want to put the trampoline there. Do you think
>>>>>> DMlite would allow us to get away without? But even if so, this
>>>>>> would again fall under what I've said in the first sentence.
>>>>> Could you at least introduce a macro first? Regardless of how much
>>>>> things to adjust, this way makes future change simple.
>>>> So I've made an attempt, but this is really getting unwieldy: Setting
>>>> per-CPU data to non-zero initial values is not possible; making sure
>>>> cleanup code avoids assuming such variables got initialized is quite
>>>> error prone. Same goes at least to a certain extent for struct vcpu
>>>> members (see e.g. nvmx_vcpu_destroy(), which currently is
>>>> correct no matter whether nvmx_vcpu_initialise() ran at all, or to
>>>> completion).
>>>>
>>>> I also don't see what a macro would help here, or how/where it
>>>> should be used. paddr_valid()? Yes, I could do this, but it wouldn't
>>>> simplify much when later wanting to convert to a non-zero value
>>>> for above reasons (it would instead give the wrong impression that
>>>> changing the value is all it takes).
>>>>
>>> Thanks for looking into this attempt. Based on your explanation
>>> I think your original code is reasonable to go. Here is my ack:
>>>
>>> Acked-by: Kevin Tian <kevin.tian@intel.com>
>> Thanks Kevin. Andrew - please indicate whether your previous
>> comment is to be considered a NAK, or "just a comment".
> I would prefer a sentinel value being introduced, but can live without
> it being changed. It is definitely not the only area which uses 0 as a
> sentinel and cleanup will have to happen, one way or another.
Actually it turns out that we already have an appropriate sentinel.
include/asm-x86/types.h:34:#define INVALID_PADDR (~0UL)
~Andrew
next prev parent reply other threads:[~2015-11-24 10:59 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-19 15:10 [PATCH 0/3] VMX: misc adjustments Jan Beulich
2015-10-19 15:21 ` [PATCH 1/3] VMX: re-order definitions Jan Beulich
2015-10-21 3:04 ` Tian, Kevin
2015-10-19 15:22 ` [PATCH 2/3] VMX: allocate VMCS pages from domain heap Jan Beulich
2015-10-20 10:12 ` Andrew Cooper
2015-10-20 10:35 ` Jan Beulich
2015-10-21 3:16 ` Tian, Kevin
2015-10-21 5:54 ` Jan Beulich
2015-11-23 14:28 ` Jan Beulich
2015-11-24 5:04 ` Tian, Kevin
2015-11-24 7:50 ` Jan Beulich
2015-11-24 10:55 ` Andrew Cooper
2015-11-24 10:59 ` Andrew Cooper [this message]
2015-11-24 11:04 ` Jan Beulich
2015-11-24 11:09 ` Andrew Cooper
2015-10-19 15:23 ` [PATCH 3/3] vVMX: use latched VMCS machine address Jan Beulich
2015-10-21 5:44 ` Tian, Kevin
2016-02-23 8:34 ` Li, Liang Z
2016-02-23 10:31 ` Jan Beulich
2016-02-23 10:48 ` Li, Liang Z
2016-02-24 7:04 ` Li, Liang Z
2016-02-24 10:32 ` Jan Beulich
2016-02-24 15:08 ` Li, Liang Z
2016-02-25 6:50 ` Li, Liang Z
2016-02-25 9:01 ` Jan Beulich
2016-02-25 9:42 ` Li, Liang Z
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=5654431A.9060607@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=jun.nakajima@intel.com \
--cc=kevin.tian@intel.com \
--cc=xen-devel@lists.xenproject.org \
/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.