From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Federico Serafini <federico.serafini@bugseng.com>,
xen-devel@lists.xenproject.org, consulting@bugseng.com
Subject: Re: [XEN PATCH v5 7/8] x86/mm: add defensive return
Date: Mon, 2 Sep 2024 09:43:26 +0200 [thread overview]
Message-ID: <ZtVsnqdU_URZu76d@macbook.local> (raw)
In-Reply-To: <9ac39818-2259-4aa2-8bc6-17809fe62368@citrix.com>
On Fri, Aug 30, 2024 at 08:17:40PM +0100, Andrew Cooper wrote:
> On 30/08/2024 10:18 am, Roger Pau Monné wrote:
> > On Thu, Aug 29, 2024 at 09:04:37AM +0200, Jan Beulich wrote:
> >> On 29.08.2024 02:35, Stefano Stabellini wrote:
> >>> On Mon, 29 Jul 2024, Stefano Stabellini wrote:
> >>>> On Mon, 29 Jul 2024, Federico Serafini wrote:
> >>>>> Add defensive return statement at the end of an unreachable
> >>>>> default case. Other than improve safety, this meets the requirements
> >>>>> to deviate a violation of MISRA C Rule 16.3: "An unconditional `break'
> >>>>> statement shall terminate every switch-clause".
> >>>>>
> >>>>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> >>>> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
> >>>>
> >>>>> ---
> >>>>> No changes from v3 and v4, further feedback on this thread would be appreciated:
> >>>>> https://lists.xenproject.org/archives/html/xen-devel/2024-07/msg00474.html
> >>> Looking at the older threads, I looks like Jan suggested EACCES, I also
> >>> think it is marginally better. My R-b stands also for EACCES. Jan, I
> >>> think you should go ahead and fix on commit
> >> No, I very definitely want a 2nd x86 maintainer opinion here. Or a better
> >> suggestion for the error code to use by anyone. After all, as you confirm,
> >> EACCES is only marginally better.
> > Hm, the only alternative I could suggest is using ERANGE, to signal
> > the value of opt_mmio_relax is out of the expected range, however that
> > could be confusing for the callers?
> >
> > One benefit of using ERANGE is that there's currently no return path
> > in get_page_from_l1e() with that error code, so it would be very easy
> > to spot when an unexpected value of opt_mmio_relax is found. However
> > there are no guarantees that further error paths might use that error
> > code.
>
> EPERM and EACCES are both very wrong here. They imply something that is
> simply not appropriate in this context.
>
> We use EILSEQ elsewhere for believed-impossible conditions where we need
> an errno of some kind. I suggest we use it here too.
Fine with me. With that:
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Thanks.
next prev parent reply other threads:[~2024-09-02 7:44 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-29 9:00 [XEN PATCH v5 0/8] x86: address some violations of MISRA C Rule 16.3 Federico Serafini
2024-07-29 9:00 ` [XEN PATCH v5 1/8] automation/eclair: fix deviation " Federico Serafini
2024-07-29 9:00 ` [XEN PATCH v5 2/8] x86/vpmu: address violations " Federico Serafini
2024-07-29 9:00 ` [XEN PATCH v5 3/8] x86/traps: " Federico Serafini
2024-07-29 9:00 ` [XEN PATCH v5 4/8] x86/mce: " Federico Serafini
2024-07-29 9:00 ` [XEN PATCH v5 5/8] x86/hvm: " Federico Serafini
2024-07-29 9:18 ` Jan Beulich
2024-07-29 9:00 ` [XEN PATCH v5 6/8] x86/hvm: add defensive statements in unreachable program points Federico Serafini
2024-07-29 11:06 ` Jan Beulich
2024-07-29 9:00 ` [XEN PATCH v5 7/8] x86/mm: add defensive return Federico Serafini
2024-07-29 22:12 ` Stefano Stabellini
2024-08-29 0:35 ` Stefano Stabellini
2024-08-29 7:04 ` Jan Beulich
2024-08-30 9:18 ` Roger Pau Monné
2024-08-30 19:17 ` Andrew Cooper
2024-09-02 7:43 ` Roger Pau Monné [this message]
2024-07-29 9:00 ` [XEN PATCH v5 8/8] x86/mpparse: address a violation of MISRA C Rule 16.3 Federico Serafini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZtVsnqdU_URZu76d@macbook.local \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=consulting@bugseng.com \
--cc=federico.serafini@bugseng.com \
--cc=jbeulich@suse.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.