All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xenia Ragiadakou <burzalodowa@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: "Jun Nakajima" <jun.nakajima@intel.com>,
	"Kevin Tian" <kevin.tian@intel.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>
Subject: [PATCH v2 9/9] x86/vmx: move vmx_update_debug_state() in vmcs.c and declare it static
Date: Wed, 22 Feb 2023 14:00:23 +0200	[thread overview]
Message-ID: <20230222120023.3004624-10-burzalodowa@gmail.com> (raw)
In-Reply-To: <20230222120023.3004624-1-burzalodowa@gmail.com>

Move vmx_update_debug_state() in vmcs.c because it is used only in this
file and limit its scope to this file by declaring it static and removing
its declaration from private vmx.h

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
---

Changes in v2:
  - remove it from the private vmx.h header instead of the global one

 xen/arch/x86/hvm/vmx/vmcs.c | 12 ++++++++++++
 xen/arch/x86/hvm/vmx/vmx.c  | 12 ------------
 xen/arch/x86/hvm/vmx/vmx.h  |  1 -
 3 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index bc2acd3063..1492f85213 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1868,6 +1868,18 @@ void vmx_vmentry_failure(void)
 
 void noreturn vmx_asm_do_vmentry(void);
 
+static void vmx_update_debug_state(struct vcpu *v)
+{
+    if ( v->arch.hvm.debug_state_latch )
+        v->arch.hvm.vmx.exception_bitmap |= 1U << TRAP_int3;
+    else
+        v->arch.hvm.vmx.exception_bitmap &= ~(1U << TRAP_int3);
+
+    vmx_vmcs_enter(v);
+    vmx_update_exception_bitmap(v);
+    vmx_vmcs_exit(v);
+}
+
 void cf_check vmx_do_resume(void)
 {
     struct vcpu *v = current;
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 5b210e0db4..ada36d6923 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1610,18 +1610,6 @@ static void cf_check vmx_update_host_cr3(struct vcpu *v)
     vmx_vmcs_exit(v);
 }
 
-void vmx_update_debug_state(struct vcpu *v)
-{
-    if ( v->arch.hvm.debug_state_latch )
-        v->arch.hvm.vmx.exception_bitmap |= 1U << TRAP_int3;
-    else
-        v->arch.hvm.vmx.exception_bitmap &= ~(1U << TRAP_int3);
-
-    vmx_vmcs_enter(v);
-    vmx_update_exception_bitmap(v);
-    vmx_vmcs_exit(v);
-}
-
 static void cf_check vmx_update_guest_cr(
     struct vcpu *v, unsigned int cr, unsigned int flags)
 {
diff --git a/xen/arch/x86/hvm/vmx/vmx.h b/xen/arch/x86/hvm/vmx/vmx.h
index ffc19539bc..7d4ecf6d59 100644
--- a/xen/arch/x86/hvm/vmx/vmx.h
+++ b/xen/arch/x86/hvm/vmx/vmx.h
@@ -14,7 +14,6 @@ void vmx_intr_assist(void);
 void noreturn cf_check vmx_do_resume(void);
 void cf_check vmx_vlapic_msr_changed(struct vcpu *v);
 void vmx_realmode(struct cpu_user_regs *regs);
-void vmx_update_debug_state(struct vcpu *v);
 void vmx_update_exception_bitmap(struct vcpu *v);
 void vmx_update_cpu_exec_control(struct vcpu *v);
 void vmx_update_secondary_exec_control(struct vcpu *v);
-- 
2.37.2



  parent reply	other threads:[~2023-02-22 12:00 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-22 12:00 [PATCH v2 0/9] x86/hvm: {svm,vmx}.{c,h} cleanup Xenia Ragiadakou
2023-02-22 12:00 ` [PATCH v2 1/9] x86/svm: remove unused forward declaration of struct vcpu from svm.h Xenia Ragiadakou
2023-02-22 12:59   ` Jan Beulich
2023-02-23 10:50     ` Andrew Cooper
2023-02-23 11:00       ` Xenia Ragiadakou
2023-02-22 12:00 ` [PATCH v2 2/9] x86/svm: opencode SVM_PAUSE{FILTER,THRESH}_INIT Xenia Ragiadakou
2023-02-23 10:19   ` Jan Beulich
2023-02-22 12:00 ` [PATCH v2 3/9] x86/svm: move declarations used only by svm code from svm.h to private header Xenia Ragiadakou
2023-02-23 10:24   ` Jan Beulich
2023-02-23 11:16   ` Andrew Cooper
2023-02-23 14:40     ` Xenia Ragiadakou
2023-02-22 12:00 ` [PATCH v2 4/9] x86/vmx: remove unused included headers from vmx.h Xenia Ragiadakou
2023-02-23 10:29   ` Jan Beulich
2023-02-23 10:42     ` Xenia Ragiadakou
2023-02-22 12:00 ` [PATCH v2 5/9] x86/vmx: reduce scope of GAS_VMX_OP definition Xenia Ragiadakou
2023-02-23 10:31   ` Jan Beulich
2023-02-23 10:45     ` Xenia Ragiadakou
2023-02-22 12:00 ` [PATCH v2 6/9] x86/vmx: move declations used only by vmx code from vmx.h to private header Xenia Ragiadakou
2023-02-23 10:47   ` Jan Beulich
2023-02-23 11:56     ` Andrew Cooper
2023-02-24  7:49     ` Xenia Ragiadakou
2023-02-24  8:26       ` Jan Beulich
2023-02-22 12:00 ` [PATCH v2 7/9] x86/vmx: remove unused included headers from vmx.c Xenia Ragiadakou
2023-02-23 11:16   ` Jan Beulich
2023-02-22 12:00 ` [PATCH v2 8/9] x86/vmx: declare nvmx_enqueue_n2_exceptions() static Xenia Ragiadakou
2023-02-23 11:19   ` Jan Beulich
2023-02-22 12:00 ` Xenia Ragiadakou [this message]
2023-02-23 11:21   ` [PATCH v2 9/9] x86/vmx: move vmx_update_debug_state() in vmcs.c and declare it static Jan Beulich

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=20230222120023.3004624-10-burzalodowa@gmail.com \
    --to=burzalodowa@gmail.com \
    --cc=andrew.cooper3@citrix.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.