[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] domain: try to address Coverity pointing out a missing "break" in domain_teardown()


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 1 Sep 2021 08:49:46 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=KRa8tMlNf0zznQ/c905c3juUaUd51nNqBn86dcAqfd8=; b=LT+wNyMLWe5lqo1LDTP3O3LWLhmj0zbDh4HVUyxhNTrYWDIEapZ6GHW3CB9TGjbVPdPU5n9fglpUCb+XnQWFG3D0/5CgHj9mgxjA7TRwCTCfyTX+TkLXF6OfA4qx5R+hnXQ/Nf4lKBVseMGRWfAq81AZbeD9K29BURTOor/RKTvMaANRj+4bCoUdrde+kMXt0giOC2zSBptYWnfAFq+9/atdWLr138wy0K40eIq+iGu/7lwLP7sSN+oqJ9i8inTRinwhHiUsvS2kfFBJufMdV4ZAwCIsEFp+bHy42Fk/lJYbeh2RvjNbvDREu+S/NRrvOFaTZ3xfLLLiaBL+h6x0ZA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UI71hRW21G8Kqg8yAMeV8uXNMAAjl1KN3uP68UVFSsFuvbuHHvDvvYlHFxRmkdMckTa0KD7DdLLoSErd+psF/HAulUtcEwkuPtChbWwS5rTrCUDidwQPXRf8qxdmAf4jL3IW1opwedCHRpnq5021KW7rRhkuYi0rkCcZzyBnGmJ0ma46AcOCQb+JFbZG0caP0Ipnu49NmWQByGjsuWswnRyvbvQjaaknAD9QqepEwXOi1K2TS1PSiMBvIIPQVUefjuXdc+tzc+yQRokccyrYbE/d8QAl0o2HpzCe4GNVLxpQGJtZd6eOJg8tfSZqyYVyvjuDS5cdAac0K+XQsGkz7g==
  • Authentication-results-original: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Wed, 01 Sep 2021 08:50:15 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHXnw3T6W43IPECMEKENcWB9l+Su6uO3oGA
  • Thread-topic: [PATCH] domain: try to address Coverity pointing out a missing "break" in domain_teardown()

Hi Jan,

> On 1 Sep 2021, at 09:45, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> Commit 806448806264 ("xen/domain: Fix label position in
> domain_teardown()" has caused Coverity to report a _new_ supposedly
> un-annotated fall-through in a switch(). I find this (once again)
> puzzling; I'm having an increasingly hard time figuring what patterns
> the tool is actually after. I would have expected that the tool would
> either have spotted an issue also before this change, or not at all. Yet
> if it had spotted one before, the statistics report should have included
> an eliminated instance alongside the new one (because then the issue
> would simply have moved by a few lines).
> 
> Hence the only thing I could guess is that the treatment of comments in
> macro expansions might be subtly different. Therefore try whether
> switching the comments to the still relatively new "fallthrough" pseudo
> keyword actually helps.
> 
> Coverity-ID: 1490865
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

A grep inside Xen code show that we have occurence of:
/* fallthrough */
/* Fallthrough */
falltrough

Should we actually fix all of them ?

Anyway this can be in an other patch.

Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

Cheers
Bertrand

> ---
> If this doesn't help, I'm afraid I'm lost as to what Coverity means us
> to do to silence the reporting.
> 
> --- a/xen/common/domain.c
> +++ b/xen/common/domain.c
> @@ -401,13 +401,13 @@ static int domain_teardown(struct domain
>          */
> #define PROGRESS(x)                             \
>         d->teardown.val = PROG_ ## x;           \
> -        /* Fallthrough */                       \
> +        fallthrough;                            \
>     case PROG_ ## x
> 
> #define PROGRESS_VCPU(x)                        \
>         d->teardown.val = PROG_vcpu_ ## x;      \
>         d->teardown.vcpu = v;                   \
> -        /* Fallthrough */                       \
> +        fallthrough;                            \
>     case PROG_vcpu_ ## x:                       \
>         v = d->teardown.vcpu
> 
> 
> 




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.