[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 7/7] gnttab: unreachable code when GNTTAB_MAX_VERSION < 2
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
- Date: Tue, 28 Jul 2026 17:53:52 +0200
- Arc-authentication-results: i=1; bugseng.com; arc=none smtp.remote-ip=162.55.131.47
- Arc-message-signature: i=1; d=bugseng.com; s=openarc; a=rsa-sha256; c=relaxed/relaxed; t=1785254032; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:X-Sender:Organization:Content-Type: Content-Transfer-Encoding; bh=5GX4ZyGRxb/Yyi6f5PXVS1SZmQcWwVXTaOpxtRPeAl0=; b=IdCXSUDJV7tV09sbTcaXHdYNInMh099QMUCtlg55aGMwnofWSkMvZYk/pZDOA/1oAW8s 8TixIo+CxQGSwicMwJhVFbxH1eWsmxohXveSXtVuD1/sl03VNv/kN5kTr1vkmPE6fI/9g l7IRLVBR+ADeUrDmS64puW1ziPvrzqYvHqLWMOMXCwRoVOO5+UQ5vH1mW488aX/LfnlcL 6fk8qAga+rE0fl4zy6OmPRThc21l6ZaKK8pB55uthAG11mtam39K988SKBzxKAwBFjVyX 3BCy8y35EeKREkFShypU3GmTIEFcA5qr14TFpwVA4rLE2VxVlsTFNf3MAPJ0FkLleRXNp +0w/zhqw7WwfU+R/gtbHr23Dye5R1GQVJCeQFmChQSKbRAHV/Jl8NaN8vLndGvKlC4SKW MeiPNjXy3JxL73Xo/pLg4cgAfow73P/d7SRbDRWJNqE6XcbWdYuhvz1iCgKj4K9UDqowp xKPDHTp/UnHcP25/IZiyzuoElNXyxjbIDKa22O0NjFLoGZJlxgmdQuPuJeTO1diZQyGtb ndl1k+HES4j/hHRgi3MVQ4aRJGYmdhp5HHbUZmxjbR52SkzOUZEK0wANKJsEQxFflSc47 U3PU53M6zwBgabzdnz76KaQs4jHd3nD3P+myWrPeA17eZ5Mus9VBPr1scyLnrBA=
- Arc-seal: i=1; d=bugseng.com; s=openarc; a=rsa-sha256; cv=none; t=1785254032; b=lWNQ8cczZlSXCybwKisiGioyiCI+u+CTWU/h6ienTzL6M7Nqp/cN5b6IJwFunifH+CTH 4cRQ98cWsCtG+50eMG/6IKWaREvKofTRzJ8FQbUslXbQqTg+HlAeJUb7/g430XAWtwLFN R6bM/YwkNTY3bTkUXCv8y4m+5GazNyw88Ajx3NO4p0FcHPhaKRFFGi099UxzpiA7X/YY9 928vIhSr4syQ4Z9fBAMa8wR9og7QFCML92pqzdpsZ1fIqHOwuS73MdLf6WndyE1L3JQF9 DAmiewLPYbzRVCc5Dio6hCem+2rdjY40bicloUyJnz5FH7nfOpU5hYTeEdl1tdp2LJvEi XsS/tJdSsdsYIGqSyGbfxu6XLRa8q3R1Bqpq1Cew58f6qpK5ImEUnVGNr+t/FwQCmt2+J nMXMhaA2JYNEllGIXhheH1Hhi7pJaXpmSwjx/Tbpkx5JWkpuJ5fVmCtaJXFDOg+4gp4g2 9hbYgSv63NwTdew+F8LVsoMsKHNrifXyECTLeE/FvO1TnnwYWjfzK+fFCvCdp1Ctst7Yx wQxRpw5XyhCzipFQulPaJjHUiXXciEgJAXd4N+ZINg4YNAonu4T4psJWAdsRNdwwPapV8 q4cxP1cLGYhARvd0DRvqQdh5t5livMLoj+eVC0nXAjzfmpZIpEaz+JOfKvyiKS8=
- Authentication-results: eu.smtp.expurgate.cloud; none
- Authentication-results: bugseng.com; arc=none smtp.remote-ip=162.55.131.47
- Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
- Delivery-date: Tue, 28 Jul 2026 15:53:55 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 2026-07-28 17:42, Jan Beulich wrote:
On 28.07.2026 17:40, Nicola Vetrini wrote:
On 2026-07-28 15:53, Jan Beulich wrote:
I'm surprised Eclair doesn't spot the large chunks of unreachable
code
on
Arm, i.e. violations of Misra C:2012 rule 2.1.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
This pretty certainly isn't dealing with everything. For example,
with
another helper the gt_version field could likely also become
conditional.
With some more effort the nr_status_frames field similarly could
become
conditional.
[...]
Hard to judge only looking at the diff. Is this code unreachable in
the
arm64-allcode analysis configuration as well?
Arm uniformly has
#define GNTTAB_MAX_VERSION 1
so all gnttab-v2 code is unreachable there, no matter what
configuration.
Jan
I see. Existing deviations may play a role here in excluding caution
reports that would otherwise be generated, particularly
-config=MC3A2.R2.1,+reports={safe,"first_area(^.*has an
invariantly.*$)"}
I see only one condition "GNTTAB_MAX_VERSION" is used directly, while
the others are via "opt_gnttab_max_version" which is why I reasoned
there might be cautions involved, instead of violations.
--
Nicola Vetrini, B.Sc.
Software Engineer
BUGSENG (https://bugseng.com)
LinkedIn: https://www.linkedin.com/in/nicola-vetrini-a42471253
|