From: "Jan Beulich" Subject: [PATCH 3/3] x86/HVM: command line option adjustments Date: Wed, 30 Jul 2014 17:09:41 +0100 Message-ID: <53D934E50200007800027BC2@mail.emea.novell.com> References: <53D933A60200007800027BAE@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part2F1DA8D5.3__=" Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XCWRk-0003iG-8F for xen-devel@lists.xenproject.org; Wed, 30 Jul 2014 16:09:44 +0000 In-Reply-To: <53D933A60200007800027BAE@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Kevin Tian , Keir Fraser , Jun Nakajima , Eddie Dong , Ian Jackson , Tim Deegan , Ian Campbell , Aravind Gopalakrishnan , suravee.suthikulpanit@amd.com, Boris Ostrovsky List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part2F1DA8D5.3__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Adding actual descriptions for them, hiding the hvm_debug=3D one from non-debug builds (the option was recognized but didn't take any effect so far), and adjusting some debug level specifiers to their purpose. Signed-off-by: Jan Beulich --- a/docs/misc/xen-command-line.markdown +++ b/docs/misc/xen-command-line.markdown @@ -661,9 +661,33 @@ supported only when compiled with XSM\_E ### hvm\_debug > `=3D ` =20 +The specified value is a bit mask with the individual bits having the +following meaning: + +Bit 0 - debug level 0 (unused at present) +Bit 1 - debug level 1 (Control Register logging) +Bit 2 - debug level 2 (VMX logging of MSR restores when context = switching) +Bit 3 - debug level 3 (unused at present) +Bit 4 - I/O operation logging +Bit 5 - vMMU logging +Bit 6 - vLAPIC general logging +Bit 7 - vLAPIC timer logging +Bit 8 - vLAPIC interrupt logging +Bit 9 - vIOAPIC logging +Bit 10 - hypercall logging +Bit 11 - MSR operation logging + +Recognized in debug builds of the hypervisor only. + ### hvm\_port80 > `=3D ` =20 +> Default: `true` + +Specify whether guests are to be given access to physical port 80 +(often used for debugging purposes), to override the DMI based +detection of systems known to misbehave upon accesses to that port. + ### highmem-start > `=3D ` =20 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -70,8 +70,10 @@ =20 bool_t __read_mostly hvm_enabled; =20 +#ifdef DBG_LEVEL_0 unsigned int opt_hvm_debug_level __read_mostly; integer_param("hvm_debug", opt_hvm_debug_level); +#endif =20 struct hvm_function_table hvm_funcs __read_mostly; =20 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -1692,7 +1692,7 @@ static int svm_msr_read_intercept(unsign goto gpf; } =20 - HVM_DBG_LOG(DBG_LEVEL_1, "returns: ecx=3D%x, msr_value=3D%"PRIx64, + HVM_DBG_LOG(DBG_LEVEL_MSR, "returns: ecx=3D%x, msr_value=3D%"PRIx64, msr, *msr_content); return X86EMUL_OKAY; =20 --- a/xen/arch/x86/hvm/vmx/vmcs.c +++ b/xen/arch/x86/hvm/vmx/vmcs.c @@ -721,7 +721,7 @@ void vmx_disable_intercept_for_msr(struc clear_bit(msr, msr_bitmap + 0xc00/BYTES_PER_LONG); /* = write-high */ } else - HVM_DBG_LOG(DBG_LEVEL_0, + HVM_DBG_LOG(DBG_LEVEL_MSR, "msr %x is out of the control range" "0x00000000-0x00001fff and 0xc0000000-0xc0001fff" "RDMSR or WRMSR will cause a VM exit", msr);=20 @@ -757,7 +757,7 @@ void vmx_enable_intercept_for_msr(struct set_bit(msr, msr_bitmap + 0xc00/BYTES_PER_LONG); /* write-high= */ } else - HVM_DBG_LOG(DBG_LEVEL_0, + HVM_DBG_LOG(DBG_LEVEL_MSR, "msr %x is out of the control range" "0x00000000-0x00001fff and 0xc0000000-0xc0001fff" "RDMSR or WRMSR will cause a VM exit", msr);=20 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -199,7 +199,7 @@ long_mode_do_msr_read(unsigned int msr,=20 return HNDL_unhandled; } =20 - HVM_DBG_LOG(DBG_LEVEL_0, "msr %#x content %#"PRIx64, msr, *msr_content= ); + HVM_DBG_LOG(DBG_LEVEL_MSR, "msr %#x content %#"PRIx64, msr, *msr_conte= nt); =20 return HNDL_done; } @@ -211,7 +211,7 @@ long_mode_do_msr_write(unsigned int msr, struct vmx_msr_state *guest_msr_state =3D &v->arch.hvm_vmx.msr_state; struct vmx_msr_state *host_msr_state =3D &this_cpu(host_msr_state); =20 - HVM_DBG_LOG(DBG_LEVEL_0, "msr %#x content %#"PRIx64, msr, msr_content)= ; + HVM_DBG_LOG(DBG_LEVEL_MSR, "msr %#x content %#"PRIx64, msr, msr_conten= t); =20 switch ( msr ) { @@ -254,7 +254,7 @@ long_mode_do_msr_write(unsigned int msr, return HNDL_done; =20 uncanonical_address: - HVM_DBG_LOG(DBG_LEVEL_0, "Not cano address of msr write %x", msr); + HVM_DBG_LOG(DBG_LEVEL_MSR, "Not cano address of msr write %x", msr); hvm_inject_hw_exception(TRAP_gp_fault, 0); return HNDL_exception_raised; } @@ -2046,7 +2046,7 @@ static int is_last_branch_msr(u32 ecx) =20 static int vmx_msr_read_intercept(unsigned int msr, uint64_t *msr_content)= { - HVM_DBG_LOG(DBG_LEVEL_1, "ecx=3D%#x", msr); + HVM_DBG_LOG(DBG_LEVEL_MSR, "ecx=3D%#x", msr); =20 switch ( msr ) { @@ -2111,7 +2111,7 @@ static int vmx_msr_read_intercept(unsign } =20 done: - HVM_DBG_LOG(DBG_LEVEL_1, "returns: ecx=3D%#x, msr_value=3D%#"PRIx64, + HVM_DBG_LOG(DBG_LEVEL_MSR, "returns: ecx=3D%#x, msr_value=3D%#"PRIx64,= msr, *msr_content); return X86EMUL_OKAY; =20 @@ -2229,7 +2229,7 @@ static int vmx_msr_write_intercept(unsig { struct vcpu *v =3D current; =20 - HVM_DBG_LOG(DBG_LEVEL_1, "ecx=3D%#x, msr_value=3D%#"PRIx64, msr, = msr_content); + HVM_DBG_LOG(DBG_LEVEL_MSR, "ecx=3D%#x, msr_value=3D%#"PRIx64, msr, = msr_content); =20 switch ( msr ) { --=__Part2F1DA8D5.3__= Content-Type: text/plain; name="docs-cmdline-HVM.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="docs-cmdline-HVM.patch" x86/HVM: command line option adjustments=0A=0AAdding actual descriptions = for them, hiding the hvm_debug=3D one from=0Anon-debug builds (the option = was recognized but didn't take any effect=0Aso far), and adjusting some = debug level specifiers to their purpose.=0A=0ASigned-off-by: Jan Beulich = =0A=0A--- a/docs/misc/xen-command-line.markdown=0A+++ = b/docs/misc/xen-command-line.markdown=0A@@ -661,9 +661,33 @@ supported = only when compiled with XSM\_E=0A ### hvm\_debug=0A > `=3D `=0A = =0A+The specified value is a bit mask with the individual bits having = the=0A+following meaning:=0A+=0A+Bit 0 - debug level 0 (unused at = present)=0A+Bit 1 - debug level 1 (Control Register logging)=0A+Bit 2 - = debug level 2 (VMX logging of MSR restores when context switching)=0A+Bit = 3 - debug level 3 (unused at present)=0A+Bit 4 - I/O operation logging=0A+= Bit 5 - vMMU logging=0A+Bit 6 - vLAPIC general logging=0A+Bit 7 - = vLAPIC timer logging=0A+Bit 8 - vLAPIC interrupt logging=0A+Bit 9 - = vIOAPIC logging=0A+Bit 10 - hypercall logging=0A+Bit 11 - MSR operation = logging=0A+=0A+Recognized in debug builds of the hypervisor only.=0A+=0A = ### hvm\_port80=0A > `=3D `=0A =0A+> Default: `true`=0A+=0A+Specif= y whether guests are to be given access to physical port 80=0A+(often used = for debugging purposes), to override the DMI based=0A+detection of systems = known to misbehave upon accesses to that port.=0A+=0A ### highmem-start=0A = > `=3D `=0A =0A--- a/xen/arch/x86/hvm/hvm.c=0A+++ b/xen/arch/x86/hvm/= hvm.c=0A@@ -70,8 +70,10 @@=0A =0A bool_t __read_mostly hvm_enabled;=0A = =0A+#ifdef DBG_LEVEL_0=0A unsigned int opt_hvm_debug_level __read_mostly;= =0A integer_param("hvm_debug", opt_hvm_debug_level);=0A+#endif=0A =0A = struct hvm_function_table hvm_funcs __read_mostly;=0A =0A--- a/xen/arch/x86= /hvm/svm/svm.c=0A+++ b/xen/arch/x86/hvm/svm/svm.c=0A@@ -1692,7 +1692,7 @@ = static int svm_msr_read_intercept(unsign=0A goto gpf;=0A }=0A = =0A- HVM_DBG_LOG(DBG_LEVEL_1, "returns: ecx=3D%x, msr_value=3D%"PRIx64,= =0A+ HVM_DBG_LOG(DBG_LEVEL_MSR, "returns: ecx=3D%x, msr_value=3D%"PRIx64= ,=0A msr, *msr_content);=0A return X86EMUL_OKAY;=0A = =0A--- a/xen/arch/x86/hvm/vmx/vmcs.c=0A+++ b/xen/arch/x86/hvm/vmx/vmcs.c=0A= @@ -721,7 +721,7 @@ void vmx_disable_intercept_for_msr(struc=0A = clear_bit(msr, msr_bitmap + 0xc00/BYTES_PER_LONG); /* write-high */=0A = }=0A else=0A- HVM_DBG_LOG(DBG_LEVEL_0,=0A+ HVM_DBG_LOG(D= BG_LEVEL_MSR,=0A "msr %x is out of the control = range"=0A "0x00000000-0x00001fff and 0xc0000000-0xc0001f= ff"=0A "RDMSR or WRMSR will cause a VM exit", msr); = =0A@@ -757,7 +757,7 @@ void vmx_enable_intercept_for_msr(struct=0A = set_bit(msr, msr_bitmap + 0xc00/BYTES_PER_LONG); /* write-high */=0A = }=0A else=0A- HVM_DBG_LOG(DBG_LEVEL_0,=0A+ HVM_DBG_LOG(= DBG_LEVEL_MSR,=0A "msr %x is out of the control = range"=0A "0x00000000-0x00001fff and 0xc0000000-0xc0001f= ff"=0A "RDMSR or WRMSR will cause a VM exit", msr); = =0A--- a/xen/arch/x86/hvm/vmx/vmx.c=0A+++ b/xen/arch/x86/hvm/vmx/vmx.c=0A@@= -199,7 +199,7 @@ long_mode_do_msr_read(unsigned int msr, =0A = return HNDL_unhandled;=0A }=0A =0A- HVM_DBG_LOG(DBG_LEVEL_0, "msr = %#x content %#"PRIx64, msr, *msr_content);=0A+ HVM_DBG_LOG(DBG_LEVEL_MSR= , "msr %#x content %#"PRIx64, msr, *msr_content);=0A =0A return = HNDL_done;=0A }=0A@@ -211,7 +211,7 @@ long_mode_do_msr_write(unsigned int = msr,=0A struct vmx_msr_state *guest_msr_state =3D &v->arch.hvm_vmx.msr_= state;=0A struct vmx_msr_state *host_msr_state =3D &this_cpu(host_msr_s= tate);=0A =0A- HVM_DBG_LOG(DBG_LEVEL_0, "msr %#x content %#"PRIx64, = msr, msr_content);=0A+ HVM_DBG_LOG(DBG_LEVEL_MSR, "msr %#x content = %#"PRIx64, msr, msr_content);=0A =0A switch ( msr )=0A {=0A@@ = -254,7 +254,7 @@ long_mode_do_msr_write(unsigned int msr,=0A return = HNDL_done;=0A =0A uncanonical_address:=0A- HVM_DBG_LOG(DBG_LEVEL_0, = "Not cano address of msr write %x", msr);=0A+ HVM_DBG_LOG(DBG_LEVEL_MSR,= "Not cano address of msr write %x", msr);=0A hvm_inject_hw_exception(T= RAP_gp_fault, 0);=0A return HNDL_exception_raised;=0A }=0A@@ -2046,7 = +2046,7 @@ static int is_last_branch_msr(u32 ecx)=0A =0A static int = vmx_msr_read_intercept(unsigned int msr, uint64_t *msr_content)=0A {=0A- = HVM_DBG_LOG(DBG_LEVEL_1, "ecx=3D%#x", msr);=0A+ HVM_DBG_LOG(DBG_LEVEL_M= SR, "ecx=3D%#x", msr);=0A =0A switch ( msr )=0A {=0A@@ -2111,7 = +2111,7 @@ static int vmx_msr_read_intercept(unsign=0A }=0A =0A = done:=0A- HVM_DBG_LOG(DBG_LEVEL_1, "returns: ecx=3D%#x, msr_value=3D%#"P= RIx64,=0A+ HVM_DBG_LOG(DBG_LEVEL_MSR, "returns: ecx=3D%#x, msr_value=3D%= #"PRIx64,=0A msr, *msr_content);=0A return X86EMUL_OKAY= ;=0A =0A@@ -2229,7 +2229,7 @@ static int vmx_msr_write_intercept(unsig=0A = {=0A struct vcpu *v =3D current;=0A =0A- HVM_DBG_LOG(DBG_LEVEL_1, = "ecx=3D%#x, msr_value=3D%#"PRIx64, msr, msr_content);=0A+ HVM_DBG_LOG(DB= G_LEVEL_MSR, "ecx=3D%#x, msr_value=3D%#"PRIx64, msr, msr_content);=0A =0A = switch ( msr )=0A {=0A --=__Part2F1DA8D5.3__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__Part2F1DA8D5.3__=--