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

Re: [PATCH 2/4] x86/svm: cleanup svm.h


  • To: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 20 Feb 2023 23:08:10 +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=ZkrdgVnzit6kWn7S7oMccACtAX2VxqAEUryZpD+YZ6Y=; b=fBcAk/hbAXGVcDoSWKNhDLsj8J2ewIehDAl1O98K2ZmcSgQACKog1Cuaem1Y7d70LIwtyGMbzWVuzlnmb0CiQpBMV0vwtQbjiqaMazmogR5bCgqUjdMYVKr22WPKhWIwqzgau5VACXKsIV/lEyLh6GMHf2MfnRhR0Ueb3EHyeYfLoR9GZcrpPgxjMVbDmvY/DkJi9G8n+T87qiFXBJf5iMJdSf96OXnjcUyVxqo70Nde4EOmtUpKhDziDRI0p5wbTtvc6txBFDewGS9akZTmUHZOwchmDZ7P/ek69Rs6/mFmt0q1biTBEviWxldpeUXN3cJnz7cFeH95tPT36pQ0QQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vdq1PXcu1rTAAa7EUNDFQPaPG8wOrTVyAx9jIVBDU0T2D9Iwsil+J86MRBI6O0MOq6k/x7gT3WRGpTnkjUo91DXy4edgacnXHiDw1mZ6NAMA8h4G719gsHL2lJHU2SS1wk/a2XBd6XE5/R7xoYPXDzHMKFH61W2RRM7WrkVgto8JrkCSRku4eVW/URpcwhQKMNe4y0i/4tb3uQwzzBgReCwkI+e3ZQ06fHkEVW7hs31j21O2kj7ZFxFqR0ccG9oy7OkIswAvSyyS4bFxl9rQFrESMNoE5G/DUoH/+nHw3qit7SQ/C+xIK23szL0sasJkrwalX/c+2tWZ4QVHeRUEnA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Mon, 20 Feb 2023 23:08:36 +0000
  • Ironport-data: A9a23:uygY/aJzsUtIriZEFE+R6pQlxSXFcZb7ZxGr2PjKsXjdYENS3zNRm GscWjrVOfaCNmGgft0gbdnj8U4FuZ6AzoBiGQNlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU7Ss1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws Jb5rta31GWNglaYCUpJrfPcwP9TlK6q4mhA5AZmPaojUGL2zBH5MrpOfcldEFOgKmVkNrbSb /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/ jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c5pHX0e6 /5CNwpdRS6squ6qw6u3Ybhz05FLwMnDZOvzu1lG5BSAVbMMZ8+GRK/Ho9hFwD03m8ZCW+7EY NYUYiZuaxKGZABTPlAQC9Q1m+LAanvXKmUE7g7K4/VvpTGLkWSd05C0WDbRUvWMSd9YgQCzo WXe8n6iKhobKMae2XyO9XfEaurnzH2lBNhLTeTQGvhCvW2+6U8iVw0tcBixmqKAs0KiSfkOA hlBksYphe1onKCxdfH3QgeqqXqDshkDUvJfFuQ77EeGza+8yxaUAC0IQyBMbPQitdQqXno62 1mRhdTrCDdz9rqPRhq19L2ZsDezMig9NnIZaGkPSg5ty8bniJE+iFTIVNkLLUKuptj8GDW1y TbVqiE73u0XlZRSj/j9+k3biTWxoJSPVhQy+gjcQmOi6EV+eZKhYIurr1Pc6J6sMbqkc7VIh 1Bc8+D20QzEJcvlePClKAnVIIyU2g==
  • Ironport-hdrordr: A9a23:vKDiGqBc+RUkihHlHelo55DYdb4zR+YMi2TDt3oddfU1SL38qy nKpp4mPHDP5wr5NEtPpTniAtjjfZq/z/5ICOAqVN/PYOCPggCVxepZnOjfKlPbehEX9oRmpN 1dm6oVMqyMMbCt5/yKnDVRELwbsaa6GLjDv5a785/0JzsaE52J6W1Ce2GmO3wzfiZqL7wjGq GR48JWzgDQAkj+PqyAdx84t/GonayzqK7b
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 17/02/2023 6:48 pm, Xenia Ragiadakou wrote:
> Remove the forward declaration of struct vcpu because it is not used.

Huh, turns out that was my fault in c/s b158e72abe, shortly after I
introduced them in the first place.

Also, looking into that, there's one legitimate use of svm.h from
outside, which is svm_load_segs*() which means we can't make all the
headers be local.

But still, most of svm.h shouldn't be includable in the rest of Xen. 
Perhaps we can make a separate dedicated header for just this.

[edit]  And svm_{doman,vcpu}.  Perhaps we want a brand new
include/asm/hvm/svm.h with only the things needed elsewhere.

> Move the forward declaration of struct cpu_user_regs just above the
> function that needs it (to remind that it will need to be removed
> along with the function).

I'm not sure.  This feels like churn.

> Move the definitions of NPT_PFEC_with_gla and NPT_PFEC_in_gpt in svm.c
> because they are used only in this file.

IMO, these would better live in vmcb.h because that's where all the
other decode information lives, not that there is much.  I previously
started trying to convert all the exit_into fields into a typed union,
but I didn't get as far the NPT info.

> Move the definitions of SVM_PAUSE{FILTER,THRESH}_INIT in vmcb.c because
> they are used only in this file.

Honestly, at this point you might as well just delete the defines, and
opencode at their single usage site.  They're pure obfuscation like
this, given no statement of units / behaviour, etc.

That said, we do need to stea^W borrow adaptive PLE, and make the
settings hvm-common because right now we've got two different ways of
configuring the same thing for VT-x and SVM.  (This is definitely not
cleanup work.  Just an observation for anyone feeling at a loose end.)

~Andrew



 


Rackspace

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