Re: [Xen-devel] [PATCH v3 1/3] x86/hvm: Add check when register io handler
On 5/23/2016 6:46 AM, Jan Beulich wrote: On 22.05.16 at 01:42,wrote: --- a/xen/arch/x86/hvm/intercept.c +++ b/xen/arch/x86/hvm/intercept.c @@ -258,6 +258,8 @@ struct hvm_io_handler *hvm_next_io_handler(struct domain *d) { unsigned int i = d->arch.hvm_domain.io_handler_count++; +ASSERT( d->arch.hvm_domain.io_handler ); Am I wrong in understanding that without patch 2 this ASSERT() will actually trigger? In which case the patch order would be wrong (but that could be taken care of during commit). Jan Right, I can fix this in V4 if we decide to change the iommu_domain_initialise() ordering. Suravee ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH v3 1/3] x86/hvm: Add check when register io handler
>>> On 22.05.16 at 01:42,wrote: > --- a/xen/arch/x86/hvm/intercept.c > +++ b/xen/arch/x86/hvm/intercept.c > @@ -258,6 +258,8 @@ struct hvm_io_handler *hvm_next_io_handler(struct domain > *d) > { > unsigned int i = d->arch.hvm_domain.io_handler_count++; > > +ASSERT( d->arch.hvm_domain.io_handler ); Am I wrong in understanding that without patch 2 this ASSERT() will actually trigger? In which case the patch order would be wrong (but that could be taken care of during commit). Jan ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH v3 1/3] x86/hvm: Add check when register io handler
> -Original Message- > From: suravee.suthikulpa...@amd.com > [mailto:suravee.suthikulpa...@amd.com] > Sent: 22 May 2016 00:42 > To: xen-devel@lists.xen.org; Paul Durrant; jbeul...@suse.com; George > Dunlap > Cc: Keir (Xen.org); Suravee Suthikulpanit; Suravee Suthikulpanit > Subject: [PATCH v3 1/3] x86/hvm: Add check when register io handler > > From: Suravee Suthikulpanit> > At the time of registering HVM I/O handler, the HVM domain might > not have been initialized, which means the hvm_domain.io_handler > would be NULL. In the hvm_next_io_handler(), this should be asserted. > > Signed-off-by: Suravee Suthikulpanit > --- > xen/arch/x86/hvm/intercept.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/xen/arch/x86/hvm/intercept.c b/xen/arch/x86/hvm/intercept.c > index fc757d0..2f8d57f 100644 > --- a/xen/arch/x86/hvm/intercept.c > +++ b/xen/arch/x86/hvm/intercept.c > @@ -258,6 +258,8 @@ struct hvm_io_handler *hvm_next_io_handler(struct > domain *d) > { > unsigned int i = d->arch.hvm_domain.io_handler_count++; > > +ASSERT( d->arch.hvm_domain.io_handler ); Needs fixing for style, but with that... Reviewed-by: Paul Durrant > + > if ( i == NR_IO_HANDLERS ) > { > domain_crash(d); > -- > 1.9.1 ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
[Xen-devel] [PATCH v3 1/3] x86/hvm: Add check when register io handler
From: Suravee SuthikulpanitAt the time of registering HVM I/O handler, the HVM domain might not have been initialized, which means the hvm_domain.io_handler would be NULL. In the hvm_next_io_handler(), this should be asserted. Signed-off-by: Suravee Suthikulpanit --- xen/arch/x86/hvm/intercept.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/arch/x86/hvm/intercept.c b/xen/arch/x86/hvm/intercept.c index fc757d0..2f8d57f 100644 --- a/xen/arch/x86/hvm/intercept.c +++ b/xen/arch/x86/hvm/intercept.c @@ -258,6 +258,8 @@ struct hvm_io_handler *hvm_next_io_handler(struct domain *d) { unsigned int i = d->arch.hvm_domain.io_handler_count++; +ASSERT( d->arch.hvm_domain.io_handler ); + if ( i == NR_IO_HANDLERS ) { domain_crash(d); -- 1.9.1 ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
[Xen-devel] [PATCH v3 1/3] x86/hvm: Add check when register io handler
From: Suravee SuthikulpanitAt the time of registering HVM I/O handler, the HVM domain might not have been initialized, which means the hvm_domain.io_handler would be NULL. In the hvm_next_io_handler(), this should be asserted. Signed-off-by: Suravee Suthikulpanit --- xen/arch/x86/hvm/intercept.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/arch/x86/hvm/intercept.c b/xen/arch/x86/hvm/intercept.c index fc757d0..2f8d57f 100644 --- a/xen/arch/x86/hvm/intercept.c +++ b/xen/arch/x86/hvm/intercept.c @@ -258,6 +258,8 @@ struct hvm_io_handler *hvm_next_io_handler(struct domain *d) { unsigned int i = d->arch.hvm_domain.io_handler_count++; +ASSERT( d->arch.hvm_domain.io_handler ); + if ( i == NR_IO_HANDLERS ) { domain_crash(d); -- 1.9.1 ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel