All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xenia Ragiadakou <burzalodowa@gmail.com>, xen-devel@lists.xenproject.org
Cc: "Jun Nakajima" <jun.nakajima@intel.com>,
	"Kevin Tian" <kevin.tian@intel.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>
Subject: Re: [PATCH v3 10/14] x86/vmx: move declarations used only by vmx code from vmx.h to private headers
Date: Mon, 27 Feb 2023 16:41:40 +0000	[thread overview]
Message-ID: <a76615be-99db-90ba-292f-1d96c6844e1b@citrix.com> (raw)
In-Reply-To: <12849cea-58af-e13f-89ab-a7e9d4200df8@citrix.com>

On 27/02/2023 4:26 pm, Andrew Cooper wrote:
> On 24/02/2023 6:50 pm, Xenia Ragiadakou wrote:
>> Create two new private headers in arch/x86/hvm/vmx called vmx.h and pi.h.
>> Move all the definitions and declarations that are used solely by vmx code
>> into the private vmx.h, apart from the ones related to posted interrupts that
>> are moved into pi.h.
>>
>> EPT related declarations and definitions stay in asm/hvm/vmx/vmx.h because
>> they are used in arch/x86/mm and drivers/passthrough/vtd.
>>
>> Also, __vmread(), used in arch/x86/cpu, and consequently the opcodes stay in
>> asm/hvm/vmx/vmx.h.
> Every time I read the vpmu code, I get increasingly sad.
>
> That is dangerously unsafe, and comes with a chance of exploding completely.
>
> That __vmread() is in NMI context, which means `current` isn't safe to
> deference (we might hit in the middle of a context switch), and more
> generally there's no guarantee that the loaded VMCS is the one
> associated with `current` (we might hit in the middle of a remote VMCS
> access).
>
> vpmu is generally not supported, and BTS needs further custom enablement
> because it is only useable with a custom bus analyser.
>
>
> The __vmread() needs deleting - its absolutely not safe to say.

to stay*

>
> I'm tempted to hardwire the return 0, and punt the problem to whomever
> next uses BTS.
>
> Alternatively, MSR_DBGCTL needs wiring into the hvm_get_reg()
> infrastructure, but I'm not convinced this will actually work in either
> of the two problem cases above, hence preferring the previous option.
>
> Thoughts?
>
> ~Andrew



  reply	other threads:[~2023-02-27 16:42 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-24 18:49 [PATCH v3 00/14] x86/hvm: {svm,vmx} {c,h} cleanup Xenia Ragiadakou
2023-02-24 18:49 ` [PATCH v3 01/14] x86/svm: move declarations used only by svm code from svm.h to private header Xenia Ragiadakou
2023-02-24 18:49 ` [PATCH v3 02/14] x86/svm: make asid.h private Xenia Ragiadakou
2023-02-24 19:42   ` [PATCH v3 02/14 - ALT] x86/svm: Remove the asm/hvm/svm/asid.h header Andrew Cooper
2023-02-24 19:59     ` Xenia Ragiadakou
2023-02-24 18:49 ` [PATCH v3 03/14] x86/svm: delete header asm/hvm/svm/intr.h Xenia Ragiadakou
2023-02-24 18:50 ` [PATCH v3 04/14] x86/svm: make emulate.h private Xenia Ragiadakou
2023-02-24 19:50   ` Andrew Cooper
2023-02-24 19:58   ` [PATCH v3 04/14 - ALT] x86/svm: Remove the asm/hvm/svm/emulate.h header Andrew Cooper
2023-02-24 20:04     ` Xenia Ragiadakou
2023-02-24 18:50 ` [PATCH v3 05/14] x86/svm: move nestedsvm declarations used only by svm code to private header Xenia Ragiadakou
2023-02-24 20:12   ` Andrew Cooper
2023-02-24 20:28     ` Xenia Ragiadakou
2023-02-24 20:34       ` Andrew Cooper
2023-02-24 21:06   ` [PATCH v3 05.5/14] x86/svm: Decouple types in struct nestedsvm Andrew Cooper
2023-02-27  8:52     ` Xenia Ragiadakou
2023-02-27 10:47       ` Andrew Cooper
2023-02-24 18:50 ` [PATCH v3 06/14] x86/svm: move vmcb declarations used only by svm code to private header Xenia Ragiadakou
2023-02-24 18:50 ` [PATCH v3 07/14] x86/svm: move svmdebug.h declarations to private vmcb.h and delete it Xenia Ragiadakou
2023-02-24 18:50 ` [PATCH v3 08/14] x86/vmx: move vmx_update_debug_state() in vmcs.c and declare it static Xenia Ragiadakou
2023-02-27 15:59   ` Andrew Cooper
2023-02-24 18:50 ` [PATCH v3 09/14] x86/vmx: remove unused included headers from vmx.h Xenia Ragiadakou
2023-02-24 18:50 ` [PATCH v3 10/14] x86/vmx: move declarations used only by vmx code from vmx.h to private headers Xenia Ragiadakou
2023-02-27 15:25   ` Jan Beulich
2023-02-28  7:36     ` Xenia Ragiadakou
2023-02-28  8:05       ` Jan Beulich
2023-02-27 16:26   ` Andrew Cooper
2023-02-27 16:41     ` Andrew Cooper [this message]
2023-02-28  7:47     ` Jan Beulich
2023-02-24 18:50 ` [PATCH v3 11/14] x86/vmx: remove unused included headers from vmx.c Xenia Ragiadakou
2023-02-24 18:50 ` [PATCH v3 12/14] x86/vmx: declare nvmx_enqueue_n2_exceptions() static Xenia Ragiadakou
2023-02-24 18:50 ` [PATCH v3 13/14] x86/vmx: move vvmx declarations used only by vmx code to private header Xenia Ragiadakou
2023-02-24 18:50 ` [PATCH v3 14/14] x86/vmx: move vmcs " Xenia Ragiadakou
2023-02-24 19:29 ` [PATCH v3 00/14] x86/hvm: {svm,vmx} {c,h} cleanup Andrew Cooper
2023-02-24 20:08   ` Xenia Ragiadakou
2023-02-24 21:33     ` Andrew Cooper
2023-02-24 23:39       ` Xenia Ragiadakou
2023-02-27 10:46       ` Jan Beulich
2023-02-27 11:15         ` Andrew Cooper
2023-02-27 11:33           ` Jan Beulich
2023-02-27 12:06             ` Andrew Cooper
2023-02-27 12:17               ` Jan Beulich
2023-02-28  7:09                 ` Xenia Ragiadakou
2023-02-28  7:11                   ` Jan Beulich
2023-03-01 13:05                     ` Andrew Cooper

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=a76615be-99db-90ba-292f-1d96c6844e1b@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=burzalodowa@gmail.com \
    --cc=jbeulich@suse.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --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.