Re: [Xen-devel] [PATCH v2] SVM: Add union intstat_t for offset 68h in vmcb struct

2020-03-26 Thread Wen Pu
On 2020/3/26 0:03, Andrew Cooper wrote: > On 25/03/2020 15:23, Pu Wen wrote: >> On 2020/3/25 18:30, Roger Pau Monné wrote: >>> On Tue, Mar 24, 2020 at 06:37:26PM +0800, Pu Wen wrote: diff --git a/xen/include/asm-x86/hvm/svm/vmcb.h b/xen/include/asm-x86/hvm/svm/vmcb.h index

Re: [Xen-devel] [PATCH v2] SVM: Add union intstat_t for offset 68h in vmcb struct

2020-03-26 Thread Wen Pu
On 2020/3/25 23:56, Andrew Cooper wrote: > On 25/03/2020 15:22, Pu Wen wrote: >> On 2020/3/24 20:28, Andrew Cooper wrote: >>> Hmm - this field doesn't appear to be part of AVIC, which makes me >>> wonder what we're doing without it. >>> >>> It appears to be a shadow copy of EFLAGS.IF which is only

Re: [Xen-devel] [PATCH v2] SVM: Add union intstat_t for offset 68h in vmcb struct

2020-03-25 Thread Andrew Cooper
On 25/03/2020 15:23, Pu Wen wrote: > On 2020/3/25 18:30, Roger Pau Monné wrote: >> On Tue, Mar 24, 2020 at 06:37:26PM +0800, Pu Wen wrote: >>> diff --git a/xen/include/asm-x86/hvm/svm/vmcb.h >>> b/xen/include/asm-x86/hvm/svm/vmcb.h >>> index b9e389d481..d8a3285752 100644 >>> ---

Re: [Xen-devel] [PATCH v2] SVM: Add union intstat_t for offset 68h in vmcb struct

2020-03-25 Thread Andrew Cooper
On 25/03/2020 15:22, Pu Wen wrote: > On 2020/3/24 20:28, Andrew Cooper wrote: >> Hmm - this field doesn't appear to be part of AVIC, which makes me >> wonder what we're doing without it. >> >> It appears to be a shadow copy of EFLAGS.IF which is only written on >> vmexit, and never consumed, but

Re: [Xen-devel] [PATCH v2] SVM: Add union intstat_t for offset 68h in vmcb struct

2020-03-25 Thread Pu Wen
On 2020/3/25 18:30, Roger Pau Monné wrote: On Tue, Mar 24, 2020 at 06:37:26PM +0800, Pu Wen wrote: diff --git a/xen/include/asm-x86/hvm/svm/vmcb.h b/xen/include/asm-x86/hvm/svm/vmcb.h index b9e389d481..d8a3285752 100644 --- a/xen/include/asm-x86/hvm/svm/vmcb.h +++

Re: [Xen-devel] [PATCH v2] SVM: Add union intstat_t for offset 68h in vmcb struct

2020-03-25 Thread Pu Wen
On 2020/3/24 19:55, Jan Beulich wrote: --- a/xen/include/asm-x86/hvm/svm/vmcb.h +++ b/xen/include/asm-x86/hvm/svm/vmcb.h @@ -316,6 +316,17 @@ typedef union uint64_t raw; } intinfo_t; +typedef union +{ +struct +{ Nit: The brace should be on the same line as "struct"; can be

Re: [Xen-devel] [PATCH v2] SVM: Add union intstat_t for offset 68h in vmcb struct

2020-03-25 Thread Pu Wen
On 2020/3/24 20:28, Andrew Cooper wrote: > Hmm - this field doesn't appear to be part of AVIC, which makes me > wonder what we're doing without it. > > It appears to be a shadow copy of EFLAGS.IF which is only written on > vmexit, and never consumed, but this is based on Appendix B which is the >

Re: [Xen-devel] [PATCH v2] SVM: Add union intstat_t for offset 68h in vmcb struct

2020-03-25 Thread Roger Pau Monné
On Tue, Mar 24, 2020 at 06:37:26PM +0800, Pu Wen wrote: > diff --git a/xen/include/asm-x86/hvm/svm/vmcb.h > b/xen/include/asm-x86/hvm/svm/vmcb.h > index b9e389d481..d8a3285752 100644 > --- a/xen/include/asm-x86/hvm/svm/vmcb.h > +++ b/xen/include/asm-x86/hvm/svm/vmcb.h > @@ -316,6 +316,17 @@

Re: [Xen-devel] [PATCH v2] SVM: Add union intstat_t for offset 68h in vmcb struct

2020-03-24 Thread Andrew Cooper
On 24/03/2020 10:37, Pu Wen wrote: > According to chapter "Appendix B Layout of VMCB" in the new version > (v3.32) AMD64 APM[1], bit 1 of the VMCB offset 68h is defined as > GUEST_INTERRUPT_MASK. > > In current xen codes, it use whole u64 interrupt_shadow to setup > interrupt shadow, which will

Re: [Xen-devel] [PATCH v2] SVM: Add union intstat_t for offset 68h in vmcb struct

2020-03-24 Thread Jan Beulich
On 24.03.2020 11:37, Pu Wen wrote: > According to chapter "Appendix B Layout of VMCB" in the new version > (v3.32) AMD64 APM[1], bit 1 of the VMCB offset 68h is defined as > GUEST_INTERRUPT_MASK. > > In current xen codes, it use whole u64 interrupt_shadow to setup > interrupt shadow, which will