Re: [Xen-devel] [PATCH] x86: remove an ASSERT to avoid crash when destroy a domain.
On 17-08-06 03:34:20, Jan Beulich wrote: > >>> Yi Sun08/05/17 3:42 AM >>> > >In 'psr_free_cos', we should not use 'ASSERT(socket_info)' because > >the 'socket_info' is allocated only if 'psr' boot parameter is set. > >So remove it and use 'psr_alloc_feat_enabled' to check if 'socket_info' > >is valid or not to avoid crash. > > Title and description are no longer in line with the actual change. > Oh, sorry, my fault, too hurried to change these. > Jan ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH] x86: remove an ASSERT to avoid crash when destroy a domain.
>>> Yi Sun08/05/17 3:42 AM >>> >In 'psr_free_cos', we should not use 'ASSERT(socket_info)' because >the 'socket_info' is allocated only if 'psr' boot parameter is set. >So remove it and use 'psr_alloc_feat_enabled' to check if 'socket_info' >is valid or not to avoid crash. Title and description are no longer in line with the actual change. Jan ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] [PATCH] x86: remove an ASSERT to avoid crash when destroy a domain.
In 'psr_free_cos', we should not use 'ASSERT(socket_info)' because the 'socket_info' is allocated only if 'psr' boot parameter is set. So remove it and use 'psr_alloc_feat_enabled' to check if 'socket_info' is valid or not to avoid crash. Signed-off-by: Yi Sun--- xen/arch/x86/psr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c index 7d9fa26..9ce8f17 100644 --- a/xen/arch/x86/psr.c +++ b/xen/arch/x86/psr.c @@ -1294,11 +1294,11 @@ static void psr_free_cos(struct domain *d) { unsigned int socket, cos; -ASSERT(socket_info); - if ( !d->arch.psr_cos_ids ) return; +ASSERT(socket_info); + /* Domain is destroyed so its cos_ref should be decreased. */ for ( socket = 0; socket < nr_sockets; socket++ ) { -- 1.9.1 ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel