[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>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 27 Feb 2023 12:06:56 +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=S/P61n0rVmytk8bPQrEsRCkW6IAaRnRdSI2H7puELhI=; b=D324dFMBubcEDVU2p4P0lcElXa0LJpvaHYQJVrNzIJx1IrXhg9Trrwx+lgi5ntx84Jk5TWcI6r9gphyGbC/P2KEsN4u+/ciRV16F6MF2tABuPaxPKu7xl9Ba6mne7MjNVraviim4nEiDYgsjeqTxuFaeNUw29McUGUw3xMtOGBb37d/3g0bYbnv7qGzSXFpygR3dyXjLTMR5PzmpK6O+32+4GKKg3C6MAP8mYWxQ4u09lmnLE5vtgk4Nzw01VAAcgbDZ1eAP899+cVbDBCRwXf52GuX4JNcgXr5DKfygaTcQxgOUttIoRDwf7LemIMZY02S1kaeYNvm9HKJ87NMbxA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j8U43ObtPwQWrVA+SadAFJh/AoXoPE3vebIeHCA/euoVbPQgSbv+SQwIniATuLoXHwJdfnlO0VOBFT0aUODVLrGlMb721vbR1NWci1a5ryDztqks7BxdORg8FjpUErrfi35yXig4B0Yu+aWBPYRubB/9/APK8n7NJ9ox10u1SbaufauAyzO/huB7TkKniKrl2WIVG0kGiq6oqpFXzFU3SVKAEawS22M/F8hgU/xgbMryKGlU3jVxQtdgsp4VpVLCDSFWWf4Ju0U1R5qxXyvUmdI8PMEC6wI75V9MJ8PZWlTzwexr4bTCniD+0M5O32yndZmT9ZK5PgSRXf8n6XGx3Q==
  • 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>, Xenia Ragiadakou <burzalodowa@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 27 Feb 2023 12:07:36 +0000
  • Ironport-data: A9a23:i/eQDq+fspG6LMs4dXy1DrUDaX+TJUtcMsCJ2f8bNWPcYEJGY0x3m mpJCG+AMvaMa2qgfd4iaN+y9UkGvpDcmIRrHVM9rX08E34SpcT7XtnIdU2Y0wF+jCHgZBk+s 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKicYXoZqTZMEE8JkQhkl/MynrlmiN24BxLlk d7pqojUNUTNNwRcawr40Ire7kIw1BjOkGlA5AdmP6oU5Aa2e0Q9V/rzG4ngdxMUfaEMdgKKb 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDklSr ac9IR0IVimKiri0+recUtNmlv0aeZyD0IM34hmMzBn/JNN/GdXvZvuP4tVVmjAtmspJAPDSI dIDbiZiZwjBZBsJPUoLDJU5n6GjgXyXnz9w8QrJ4/ZopTWDilUpj9ABM/KMEjCObexTklyVu STt+GPhDwtBHNee1SCE4jSngeqncSbTCdJKSeHhr6ICbFu7mlU0JRgYFkOAqNqdhVySAfQYN k0q9X97xUQ13AnxJjXnZDW6qnOZuh8XW/JLDvY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qZkvjlKgAWJTy7qwW0swAJ4dMug8ahRCw4dyKMyRLtugscE 53MNrc49eGTKmNjBP1BklSS2hg5xxukcXdultx1Hw3GlKxdrofodeYYGwX3HycPxN0Us/aeT Qv/2hKxQ==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

> 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.


Everything you've posed here is way out of scope for Xenia's series. 
You are welcome to try and make the changes in the future if you want,
but you're going to have a uphill battle trying to justify it as a
sensible move.

~Andrew



 


Rackspace

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