[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 00/14] x86/hvm: {svm,vmx} {c,h} cleanup


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Wed, 1 Mar 2023 13:05:32 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KyDq4tgG8c/dGgCmChWu9MmDNCIb7NVa3KtQ/Z9+Uws=; b=cYsZdzh87WhigYpN54cITHC7FkFMWbqvPrI/513D0aA1uPS95Tm03DXB0S79WuHPetl2VD8y+Ee2bNEwEi+SWZhrM6KCbKILabWhV8pGsw4Ach4zYQS/+LerhtuEgkgQR/IYAUVZJFZJBGtI6/rQBYxP+2FfC96o9+Ls5v0zlimRsVuMA1IbaZf7f2Pv958y3tkd6rQzzkuFsb5yl0zeI0XjJgDSK0sxlYwETL529y0265kzfdJYqU2YjXJy1yPE/auU8+rzFhnpl60aXjazF4cR7Ism1GQSFwQrXoSzUn8jLm0V/QBbYZsH21Z807w0BcSUL4BrTIrIx0fZN076Vw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oJ99BwJIkBBwYI9FOQsA4QS0mVd8QPUqfaMQEl/8jHAk1QjWlp6aj9TDOqmhvlQ15JvtZ0Tu/Dh2fUmB+TqgzMpz9JvehaiJzGPDM7NgDuz5wrKF7Xz0Slg4vkdCSZrmhqva30bdeHGpSO4ic08EJM85RmswvP8xWfiy5EAMVQ4kDPu4ONRi5lCTDdyoXgyP5VkJrzxaz5YKbT4TpaJyNPph21Hmog2OxBP3Wmun0ypoxZrpIvbR4NxUB2qogTRlb/QOQ3YG3m/fVXP0I57s7ZkgqJJE+NYmTnW5WzlklMDaovbS17kPUzmSxnhJCzFZUCjVQc0oM+7dI5VKV8DKpw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 01 Mar 2023 13:06:13 +0000
  • Ironport-data: A9a23:0jj896twU6exU3LqnNnjcgujsefnVL5fMUV32f8akzHdYApBsoF/q tZmKW+GOPyNM2ekc9x/a9/i/U1Q6pHVxtZrTVA+pXs3EXgW+JbJXdiXEBz9bniYRiHhoOCLz O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVKiffHg3HVQ+IMsYoUoLs/YjhYJ1isSODQqIu Nfjy+XSI1bg0DNvWo4uw/vrRChH4bKj6Fv0gnRkPaoQ5ASGziFPZH4iDfrZw0XQE9E88tGSH 44v/JnhlkvF8hEkDM+Sk7qTWiXmlZaLYGBiIlIPM0STqkAqSh4ai87XB9JFAatjsB2bnsgZ9 Tl4ncfYpTHFnEH7sL91vxFwS0mSNEDdkVPNCSDXXce7lyUqf5ZwqhnH4Y5f0YAwo45K7W9yG fMwMiwrczKx2rKP452EdvJIitoCM+PoBdZK0p1g5Wmx4fcOZ7nmGv2Pz/kHmTA6i4ZJAOrUY NcfZXx3dhPcbhZTO1ARTpUjgOOvgXq5eDpdwL6XjfNvvy6Pk0ouiP60aIe9lt+iHK25mm6xo G7c8nu/KRYdLNGFkhKO8262h/+JliT+MG4XPOTgr6Ix3gLCmwT/DjUGdAufgOKwsHW5ZPxee 0IOxHYCiIItoRnDot7VGkfQTGS/lhwWVsdUEuY6wBqQ0aeS6AGcbkAOUyRTYdghuMgpTBQl0 1aIm5XiAjkHmKKRYWKQ8PGTtzzaESoIKykEbCwNTwoA6vHipp0+ilTESdMLOK24kNzzXy3xy jairS4iirFVhskOv42r8FaCjz+yq5zhSg8u+h6RTm+j9hl+ZoOue8qv81ez0BpbBIOQT13Et n5bncGbtbgKFcvUzHHLR/gRFra04frDKCfbnVNkA5gm8XKq5mKneodTpjp5IS+FL/o5RNMgW 2eL0Ss52XOZFCDCgXNfC25pN/kX8A==
  • Ironport-hdrordr: A9a23:DmWYw6i2h5e/HDUbr4CdDqAdWXBQXvgji2hC6mlwRA09TyX4rb HKoB1/73WYtN9/Yh0dcLy7V5VoOEmskqKdgrNhX4tKPjOHhILAFugL0WKF+VPd8kbFh41gPM lbEpSWP+eAaWSS3fyQ3OBhKadb/DBcytHRuQ4C9QYKcei3UdAa0+6mMHfnLqUYLDM2fKYEKA ==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 28/02/2023 7:11 am, Jan Beulich wrote:
> On 28.02.2023 08:09, Xenia Ragiadakou wrote:
>> On 2/27/23 14:17, Jan Beulich wrote:
>>> On 27.02.2023 13:06, Andrew Cooper wrote:
>>>> On 27/02/2023 11:33 am, Jan Beulich wrote:
>>>>> On 27.02.2023 12:15, Andrew Cooper wrote:
>>>>>> On 27/02/2023 10:46 am, Jan Beulich wrote:
>>>>>>> On 24.02.2023 22:33, Andrew Cooper wrote:
>>>>>>>> But I think we want to change tact slightly at this point, so I'm not
>>>>>>>> going to do any further tweaking on commit.
>>>>>>>>
>>>>>>>> Next, I think we want to rename asm/hvm/svm/svm.h to asm/hvm/svm.h,
>>>>>>>> updating the non-SVM include paths as we go.  Probably best to
>>>>>>>> chain-include the other svm/hvm/svm/*.h headers temporarily, so we've
>>>>>>>> only got one tree-wide cleanup of the external include paths.
>>>>>>>>
>>>>>>>> Quick tangent - I will be making all of that cpu_has_svm_*
>>>>>>>> infrastructure disappear by moving it into the normal CPUID handling,
>>>>>>>> but I've not had sufficient time to finish that yet.
>>>>>>>>
>>>>>>>> Next, hvm/svm/nestedsvm.h can merge straight into hvm/svm.h, and
>>>>>>>> disappear (after my decoupling patch has gone in).
>>>>>>> Why would you want to fold hvm/svm/nestedsvm.h into hvm/svm/svm.h?
>>>>>>> The latter doesn't use anything from the former, does it?
>>>>>> It's about what else uses them.
>>>>>>
>>>>>> hvm_vcpu needs both svm_vcpu and nestedsvm, so both headers are always
>>>>>> included in tandem.
>>>>> Well, yes, that's how things are today. But can you explain to me why
>>>>> hvm_vcpu has to know nestedsvm's layout?
>>>> Because it's part of the same single memory allocation.
>>> Which keeps growing, and sooner or later we'll need to find something
>>> again to split off, so we won't exceed a page in size. The nested
>>> structures would, to me, look to be prime candidates for such.
>>>
>>>>> If the field was a pointer,
>>>>> a forward decl of that struct would suffice, and any entity in the
>>>>> rest of Xen not caring about struct nestedsvm would no longer see it
>>>>> (and hence also no longer be re-built if a change is made there).
>>>> Yes, you could hide it as a pointer.  The cost of doing so is an
>>>> unnecessary extra memory allocation, and extra pointer handling on
>>>> create/destroy, not to mention extra pointer chasing in memory during use.
>>>>
>>>>>> nestedsvm is literally just one struct now, and no subsystem ought to
>>>>>> have multiple headers when one will do.
>>>>> When one will do, yes. Removing build dependencies is a good reason
>>>>> to have separate headers, though.
>>>> Its not the only only option, and an #ifdef CONFIG_NESTED_VIRT inside
>>>> the struct would be an equally acceptable way of doing this which
>>>> wouldn't involve making an extra memory allocation.
>>> That would make it a build-time decision, but then on NESTED_VIRT=y
>>> hypervisors there might still be guests not meaning to use that
>>> functionality, and for quite some time that may actually be a majority.
>>>
>>>> Everything you've posed here is way out of scope for Xenia's series.
>>> There was never an intention to extend the scope of the work she's doing.
>>> Instead I was trying to limit the scope by suggesting to avoid a piece
>>> of rework which later may want undoing.
>> Can I suggest to leave hvm/svm/svm.h and hvm/svm/nestedsvm.h separate 
>> for now?
> As per before - that's my preference. It'll be Andrew who you would need
> to convince, as he did suggest the folding.

Please fold them.

I have strong doubts that they would actually be unfolded, even if we
did want to make nested virt a build time choice.

(I'm not actually convinced that the existing nestedvcpu structure will
survive first-pass design of a working nested virt solution.)

~Andrew



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.