Re: [XEN PATCH] common/sched: address a violation of MISRA C Rule 8.8

2024-06-20 Thread Jan Beulich
On 21.06.2024 02:20, victorm.l...@amd.com wrote: > --- a/xen/common/sched/credit2.c > +++ b/xen/common/sched/credit2.c > @@ -1476,7 +1476,7 @@ static inline void runq_remove(struct csched2_unit *svc) > list_del_init(&svc->runq_elem); > } > > -void burn_credits(struct csched2_runqueue_data *

Re: [XEN PATCH] xen: add explicit comment to identify notifier patterns

2024-06-20 Thread Jan Beulich
On 21.06.2024 03:09, Stefano Stabellini wrote: > On Mon, 17 Jun 2024, Jan Beulich wrote: >> On 17.06.2024 11:49, Federico Serafini wrote: >>> MISRA C Rule 16.4 states that every `switch' statement shall have a >>> `default' label" and a statement or a comment prior to the >>> terminating break stat

Re: [PATCH 1/2] automation/eclair_analysis: deviate MISRA C Rule 21.2

2024-06-20 Thread Jan Beulich
On 21.06.2024 03:02, Stefano Stabellini wrote: > On Thu, 20 Jun 2024, Jan Beulich wrote: >> On 19.06.2024 19:09, Alessandro Zucchelli wrote: >>> Rule 21.2 reports identifiers reserved for the C and POSIX standard >>> libraries: all xen's translation units are compiled with option >>> -nostdinc, thi

[ovmf test] 186440: all pass - PUSHED

2024-06-20 Thread osstest service owner
flight 186440 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/186440/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf d512bd31293c7f2aeef9b60fb6f112d0e90adff3 baseline version: ovmf 57a890fd03356350a1b7a

[linux-linus test] 186437: tolerable FAIL - PUSHED

2024-06-20 Thread osstest service owner
flight 186437 linux-linus real [real] flight 186439 linux-linus real-retest [real] http://logs.test-lab.xenproject.org/osstest/logs/186437/ http://logs.test-lab.xenproject.org/osstest/logs/186439/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): test-armhf-

Re: [XEN PATCH v2 6/6][RESEND] automation/eclair_analysis: clean ECLAIR configuration scripts

2024-06-20 Thread Stefano Stabellini
On Mon, 17 Jun 2024, Nicola Vetrini wrote: > Remove from the ECLAIR integration scripts an unused option, which > was already ignored, and make the help texts consistent > with the rest of the scripts. > > No functional change. > > Signed-off-by: Nicola Vetrini Acked-by: Stefano Stabellini >

Re: [XEN PATCH v2] xen: add explicit comment to identify notifier patterns

2024-06-20 Thread Stefano Stabellini
On Thu, 20 Jun 2024, Federico Serafini wrote: > On 19/06/24 13:17, Julien Grall wrote: > > Hi Federico, > > > > On 19/06/2024 10:29, Federico Serafini wrote: > > > MISRA C Rule 16.4 states that every `switch' statement shall have a > > > `default' label" and a statement or a comment prior to the >

Re: [XEN PATCH] xen: add explicit comment to identify notifier patterns

2024-06-20 Thread Stefano Stabellini
On Mon, 17 Jun 2024, Jan Beulich wrote: > On 17.06.2024 11:49, Federico Serafini wrote: > > MISRA C Rule 16.4 states that every `switch' statement shall have a > > `default' label" and a statement or a comment prior to the > > terminating break statement. > > > > This patch addresses some violatio

Re: [PATCH] automation/eclair_analysis: deviate common/unlzo.c for MISRA Rule 7.3

2024-06-20 Thread Stefano Stabellini
On Thu, 20 Jun 2024, Jan Beulich wrote: > On 20.06.2024 15:19, Alessandro Zucchelli wrote: > > On 2024-06-20 03:17, Stefano Stabellini wrote: > >> On Tue, 18 Jun 2024, Jan Beulich wrote: > >>> On 18.06.2024 11:54, Alessandro Zucchelli wrote: > The file contains violations of Rule 7.3 which sta

Re: [PATCH 1/2] automation/eclair_analysis: deviate MISRA C Rule 21.2

2024-06-20 Thread Stefano Stabellini
On Thu, 20 Jun 2024, Jan Beulich wrote: > On 19.06.2024 19:09, Alessandro Zucchelli wrote: > > Rule 21.2 reports identifiers reserved for the C and POSIX standard > > libraries: all xen's translation units are compiled with option > > -nostdinc, this guarantees that these libraries are not used, th

Re: [PATCH] automation/eclair_analysis: deviate and|or|xor for MISRA C Rule 21.2

2024-06-20 Thread Stefano Stabellini
On Thu, 20 Jun 2024, Jan Beulich wrote: > On 20.06.2024 11:07, Alessandro Zucchelli wrote: > > Rule 21.2 reports identifiers reserved for the C and POSIX standard > > libraries: or, and and xor are reserved identifiers because they constitute > > alternate spellings for the corresponding operators;

Re: [XEN PATCH] common/sched: address a violation of MISRA C Rule 8.8

2024-06-20 Thread Andrew Cooper
On 21/06/2024 1:20 am, victorm.l...@amd.com wrote: > diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c > index 685929c290..10a32bd160 100644 > --- a/xen/common/sched/credit2.c > +++ b/xen/common/sched/credit2.c > @@ -1476,7 +1476,7 @@ static inline void runq_remove(struct csched2

Re: [XEN PATCH] automation/eclair: add deviations of MISRA C Rule 5.5

2024-06-20 Thread Stefano Stabellini
On Thu, 20 Jun 2024, Federico Serafini wrote: > MISRA C Rule 5.5 states that "Identifiers shall be distinct from macro > names". > > Update ECLAIR configuration to deviate: > - macros expanding to their own name; > - clashes between macros and non-callable entities; > - clashes related to the sele

[XEN PATCH] common/sched: address a violation of MISRA C Rule 8.8

2024-06-20 Thread victorm.lira
From: Victor Lira Rule 8.8: "The static storage class specifier shall be used in all declarations of objects and functions that have internal linkage" This patch fixes this by adding the static specifier. No functional changes. Reported-by: Stewart Hildebrand Signed-off-by: Victor Lira --- Cc

Re: [XEN PATCH v2 4/6][RESEND] automation/eclair_analysis: address violations of MISRA C Rule 20.7

2024-06-20 Thread Stefano Stabellini
On Mon, 17 Jun 2024, Nicola Vetrini wrote: > MISRA C Rule 20.7 states: "Expressions resulting from the expansion > of macro parameters shall be enclosed in parentheses". > > The local helpers GRP2 and XADD in the x86 emulator use their first > argument as the constant expression for a case label.

Re: [XEN PATCH v2 1/6][RESEND] automation/eclair: address violations of MISRA C Rule 20.7

2024-06-20 Thread Stefano Stabellini
On Mon, 16 Jun 2024, Nicola Vetrini wrote: > MISRA C Rule 20.7 states: "Expressions resulting from the expansion > of macro parameters shall be enclosed in parentheses". > > The helper macro bitmap_switch has parameters that cannot be parenthesized > in order to comply with the rule, as that would

[xen-unstable test] 186430: tolerable FAIL

2024-06-20 Thread osstest service owner
flight 186430 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/186430/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-armhf-armhf-libvirt 16 saverestore-support-checkfail like 186417 test-amd64-amd64-xl-qemut-win7-amd64

Re: [PATCH for-4.19] xen/arch: Centralise __read_mostly and __ro_after_init

2024-06-20 Thread Andrew Cooper
On 20/06/2024 6:22 pm, Shawn Anastasio wrote: > On 6/14/24 7:49 AM, Andrew Cooper wrote: >> These being in cache.h is inherited from Linux, but is an inappropriate >> location to live. >> >> __read_mostly is an optimisation related to data placement in order to avoid >> having shared data in cachel

Re: [PATCH for-4.19] xen/arch: Centralise __read_mostly and __ro_after_init

2024-06-20 Thread Shawn Anastasio
On 6/14/24 7:49 AM, Andrew Cooper wrote: > These being in cache.h is inherited from Linux, but is an inappropriate > location to live. > > __read_mostly is an optimisation related to data placement in order to avoid > having shared data in cachelines that are likely to be written to, but it > real

[xen-unstable-smoke test] 186435: tolerable all pass - PUSHED

2024-06-20 Thread osstest service owner
flight 186435 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/186435/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-libvirt 15 migrate-support-checkfail never pass test-arm64-arm64-xl-xsm 1

Re: MISRA C Rule 5.3 violation - shadowing in mctelem.c

2024-06-20 Thread Nicola Vetrini
On 2024-06-19 15:42, Jan Beulich wrote: On 19.06.2024 15:23, Nicola Vetrini wrote: I was looking at the shadowing due to the struct identifier and the local variables "mctctl" in x86/cpu/mcheck/mctelem.c (see [1], the second report). This kind of shadowing seems very intentional, and the initial

Re: [XEN PATCH for-4.19? v2] x86/apic: Fix signed shift in io_apic.c

2024-06-20 Thread Andrew Cooper
On 20/06/2024 4:40 pm, Jan Beulich wrote: > On 20.06.2024 17:36, Matthew Barnes wrote: >> There exists bitshifts in the IOAPIC code where signed integers are >> shifted to the left by up to 31 bits, which is undefined behaviour. >> >> This patch fixes this by changing the integers from signed to un

Re: [PATCH for-4.19?] libelf: avoid UB in elf_xen_feature_{get,set}()

2024-06-20 Thread Andrew Cooper
On 20/06/2024 4:34 pm, Jan Beulich wrote: > When the left shift amount is up to 31, the shifted quantity wants to be > of unsigned int (or wider) type. > > While there also adjust types: get doesn't alter the array and returns a > boolean, while both don't really accept negative "nr". Drop a stray

Re: [XEN PATCH for-4.19? v2] x86/apic: Fix signed shift in io_apic.c

2024-06-20 Thread Jan Beulich
On 20.06.2024 17:36, Matthew Barnes wrote: > There exists bitshifts in the IOAPIC code where signed integers are > shifted to the left by up to 31 bits, which is undefined behaviour. > > This patch fixes this by changing the integers from signed to unsigned. > > Signed-off-by: Matthew Barnes > R

[XEN PATCH v2] x86/apic: Fix signed shift in io_apic.c

2024-06-20 Thread Matthew Barnes
There exists bitshifts in the IOAPIC code where signed integers are shifted to the left by up to 31 bits, which is undefined behaviour. This patch fixes this by changing the integers from signed to unsigned. Signed-off-by: Matthew Barnes Reviewed-by: Jan Beulich --- Changes in v2: - Correct sig

[PATCH for-4.19?] libelf: avoid UB in elf_xen_feature_{get,set}()

2024-06-20 Thread Jan Beulich
When the left shift amount is up to 31, the shifted quantity wants to be of unsigned int (or wider) type. While there also adjust types: get doesn't alter the array and returns a boolean, while both don't really accept negative "nr". Drop a stray blank each as well. Signed-off-by: Jan Beulich --

Re: [XEN for-4.19 PATCH] x86/apic: Fix signing in left bitshift

2024-06-20 Thread Andrew Cooper
On 20/06/2024 3:31 pm, Matthew Barnes wrote: > There exists a bitshift in the IOAPIC code where a signed integer is > shifted to the left by at most 31 bits. This is undefined behaviour, > and can cause faults in xtf tests such as pv64-pv-iopl~hypercall. > > This patch fixes this by changing the in

Re: [XEN PATCH] x86/apic: Fix signing in left bitshift

2024-06-20 Thread Jan Beulich
On 20.06.2024 16:31, Matthew Barnes wrote: > There exists a bitshift in the IOAPIC code where a signed integer is > shifted to the left by at most 31 bits. This is undefined behaviour, s/at most/up to/ maybe? > and can cause faults in xtf tests such as pv64-pv-iopl~hypercall. > > This patch fixe

[libvirt test] 186427: tolerable all pass - PUSHED

2024-06-20 Thread osstest service owner
flight 186427 libvirt real [real] http://logs.test-lab.xenproject.org/osstest/logs/186427/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-armhf-armhf-libvirt 16 saverestore-support-checkfail like 186407 test-amd64-amd64-libvirt-xsm 15 migrate-s

Re: [XEN PATCH 01/13] automation/eclair: consider also hypened fall-through

2024-06-20 Thread Federico Serafini
On 20/06/24 16:39, Julien Grall wrote: Hi, On 20/06/2024 15:02, Federico Serafini wrote: Update ECLAIR configuration to deviate MISRA C Rule 16.3 using different version of hypened fall-through and search for the comment for 2 lines after the last statement. Signed-off-by: Federico Serafini -

Re: [XEN PATCH 01/13] automation/eclair: consider also hypened fall-through

2024-06-20 Thread Julien Grall
Hi, On 20/06/2024 15:02, Federico Serafini wrote: Update ECLAIR configuration to deviate MISRA C Rule 16.3 using different version of hypened fall-through and search for the comment for 2 lines after the last statement. Signed-off-by: Federico Serafini --- automation/eclair_analysis/ECLAIR/d

Re: [XEN PATCH v10 4/5] tools: Add new function to get gsi from dev

2024-06-20 Thread Anthony PERARD
On Mon, Jun 17, 2024 at 05:00:34PM +0800, Jiqian Chen wrote: > diff --git a/tools/include/xencall.h b/tools/include/xencall.h > index fc95ed0fe58e..750aab070323 100644 > --- a/tools/include/xencall.h > +++ b/tools/include/xencall.h > @@ -113,6 +113,8 @@ int xencall5(xencall_handle *xcall, unsigned

[XEN PATCH] x86/apic: Fix signing in left bitshift

2024-06-20 Thread Matthew Barnes
There exists a bitshift in the IOAPIC code where a signed integer is shifted to the left by at most 31 bits. This is undefined behaviour, and can cause faults in xtf tests such as pv64-pv-iopl~hypercall. This patch fixes this by changing the integer from signed to unsigned. Signed-off-by: Matthew

Re: [XEN PATCH 01/13] automation/eclair: consider also hypened fall-through

2024-06-20 Thread Federico Serafini
On 20/06/24 16:15, Jan Beulich wrote: On 20.06.2024 16:02, Federico Serafini wrote: --- a/automation/eclair_analysis/ECLAIR/deviations.ecl +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl @@ -400,7 +400,7 @@ safe." -doc_end -doc_begin="Switch clauses ending with an explicit comment

Re: [XEN PATCH 01/13] automation/eclair: consider also hypened fall-through

2024-06-20 Thread Jan Beulich
On 20.06.2024 16:02, Federico Serafini wrote: > --- a/automation/eclair_analysis/ECLAIR/deviations.ecl > +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl > @@ -400,7 +400,7 @@ safe." > -doc_end > > -doc_begin="Switch clauses ending with an explicit comment indicating the > fallthrough in

Re: [PATCH] automation/eclair_analysis: deviate common/unlzo.c for MISRA Rule 7.3

2024-06-20 Thread Jan Beulich
On 20.06.2024 15:19, Alessandro Zucchelli wrote: > On 2024-06-20 03:17, Stefano Stabellini wrote: >> On Tue, 18 Jun 2024, Jan Beulich wrote: >>> On 18.06.2024 11:54, Alessandro Zucchelli wrote: The file contains violations of Rule 7.3 which states as following: The lowercase character `l'

[XEN PATCH 13/13] x86/vlapic: address a violation of MISRA C Rule 16.3

2024-06-20 Thread Federico Serafini
Add missing break statement to address a violation of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/hvm/vlapic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x8

[XEN PATCH 02/13] x86/cpuid: use fallthrough pseudo keyword

2024-06-20 Thread Federico Serafini
The current comment making explicit the fallthrough intention does not follow the agreed syntax: replace it with the pseduo keyword. No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/cpuid.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xen/arch/x86

[XEN PATCH 10/13] x86/mpparse: add break statement

2024-06-20 Thread Federico Serafini
Add a missing break statement to address a violation of MISRA C Rule 16.3. No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/mpparse.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86/mpparse.c b/xen/arch/x86/mpparse.c index d8ccab2449..306d8ed97a 100644 --

[XEN PATCH 11/13] x86/pmtimer: address a violation of MISRA C Rule 16.3

2024-06-20 Thread Federico Serafini
Add missing break statement to address a violation of MISRA C Rule 16.3 ("An unconditional `break' statement shall terminate every switch-clause"). No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/hvm/pmtimer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/

[XEN PATCH 08/13] x86/vpt: address a violation of MISRA C Rule 16.3

2024-06-20 Thread Federico Serafini
Add pseudo keyword fallthrough to meet the requirements to deviate a violation of MISRA C Rule 16.3 ("An unconditional `break' statement shall terminate every switch-clause"). No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/hvm/vpt.c | 2 ++ 1 file changed, 2 insertions(

[XEN PATCH 04/13] x86/vpmu: address violations of MISRA C Rule 16.3

2024-06-20 Thread Federico Serafini
Add missing break statements to address violations of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/cpu/vpmu.c | 3 +++ xen/arch/x86/cpu/vpmu_intel.c | 1 + 2 files chang

[XEN PATCH 06/13] x86/mce: add missing break statements

2024-06-20 Thread Federico Serafini
Add missing break statements to address violations of MISRA C Rule 16.3. No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/cpu/mcheck/mce_amd.c | 1 + xen/arch/x86/cpu/mcheck/mce_intel.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/xen/arch/x86/cpu/mcheck/mce_a

[XEN PATCH 12/13] x86/vPIC: address a violation of MISRA C Rule 16.3

2024-06-20 Thread Federico Serafini
Add pseudokeyword fallthrough to meet the requirements to deviate a violation of MISRA C Rul 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/hvm/vpic.c | 1 + 1 file changed, 1 insertion(+)

[XEN PATCH 05/13] x86/traps: use fallthrough pseudo keyword

2024-06-20 Thread Federico Serafini
Add break or pseudo keyword fallthrough to address violations of MISRA C Rule 16.3. No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/traps.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 9906e874d5..cbcec3fafb 100

[XEN PATCH 07/13] x86/hvm: address violations of MISRA C Rule 16.3

2024-06-20 Thread Federico Serafini
MISRA C Rule 16.3 states that "An unconditional `break' statement shall terminate every switch-clause". Add pseudo keyword fallthrough and missing break statement to address violations of the rule. As a defensive measure, return -EOPNOTSUPP in case an unreachable return statement is reached. Sig

[XEN PATCH 00/13] x86: address violations of MISRA C Rule 16.3

2024-06-20 Thread Federico Serafini
This patch series addresses violations of MISRA C Rule 16.3 and updates the ECLAIR configuration to consider also hypened fall-through comment as a deviation to the rule. Federico Serafini (13): automation/eclair: consider also hypened fall-through x86/cpuid: use fallthrough pseudo keyword x

[XEN PATCH 09/13] x86/mm: add defensive return

2024-06-20 Thread Federico Serafini
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. Signed-off-by: Federico Serafini --- xen/arch/x86/mm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86/mm

[XEN PATCH 01/13] automation/eclair: consider also hypened fall-through

2024-06-20 Thread Federico Serafini
Update ECLAIR configuration to deviate MISRA C Rule 16.3 using different version of hypened fall-through and search for the comment for 2 lines after the last statement. Signed-off-by: Federico Serafini --- automation/eclair_analysis/ECLAIR/deviations.ecl | 2 +- docs/misra/deviations.rst

[XEN PATCH 03/13] x86/domctl: add missing break statement

2024-06-20 Thread Federico Serafini
Add missing break statement to address a violation of MISRA C Rule 16.3. No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/domctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index 9190e11faa..68b5b46d1a 100644 --- a/x

[XEN PATCH 11/13] x86/pmtimer: address a violation of MISRA C Rule 16.3

2024-06-20 Thread Federico Serafini
Add missing break statement to address a violation of MISRA C Rule 16.3 ("An unconditional `break' statement shall terminate every switch-clause"). No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/hvm/pmtimer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/

[XEN PATCH 07/13] x86/hvm: address violations of MISRA C Rule 16.3

2024-06-20 Thread Federico Serafini
MISRA C Rule 16.3 states that "An unconditional `break' statement shall terminate every switch-clause". Add pseudo keyword fallthrough and missing break statement to address violations of the rule. As a defensive measure, return -EOPNOTSUPP in case an unreachable return statement is reached. Sig

[XEN PATCH 10/13] x86/mpparse: address a violation of MISRA C Rule

2024-06-20 Thread Federico Serafini
Add a missing break statement to address a violation of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/mpparse.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86

[XEN PATCH 04/13] x86/vpmu: address violations of MISRA C Rule 16.3

2024-06-20 Thread Federico Serafini
Add missing break statements to address violations of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/cpu/vpmu.c | 3 +++ xen/arch/x86/cpu/vpmu_intel.c | 1 + 2 files chang

[XEN PATCH 02/13] x86/cpuid: use fallthrough pseudo keyword

2024-06-20 Thread Federico Serafini
The current comment making explicit the fallthrough intention does not follow the agreed syntax: replace it with the pseduo keyword. No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/cpuid.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xen/arch/x86

[XEN PATCH 09/13] x86/mm: add defensive return

2024-06-20 Thread Federico Serafini
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. Signed-off-by: Federico Serafini --- xen/arch/x86/mm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86/mm

[XEN PATCH 03/13] x86/domctl: address a violation of MISRA C Rule 16.3

2024-06-20 Thread Federico Serafini
Add missing break statement to address a violation of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/domctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86/do

[XEN PATCH 12/13] x86/vPIC: address a violation of MISRA C Rule 16.3

2024-06-20 Thread Federico Serafini
Add pseudokeyword fallthrough to meet the requirements to deviate a violation of MISRA C Rul 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/hvm/vpic.c | 1 + 1 file changed, 1 insertion(+)

[XEN PATCH 05/13] x86/traps: address violations of MISRA C Rule 16.3

2024-06-20 Thread Federico Serafini
Add break or pseudo keyword fallthrough to address violations of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/traps.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xe

[XEN PATCH 08/13] x86/vpt: address a violation of MISRA C Rule 16.3

2024-06-20 Thread Federico Serafini
Add pseudo keyword fallthrough to meet the requirements to deviate a violation of MISRA C Rule 16.3 ("An unconditional `break' statement shall terminate every switch-clause"). No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/hvm/vpt.c | 2 ++ 1 file changed, 2 insertions(

[XEN PATCH 13/13] x86/vlapic: address a violation of MISRA C Rule 16.3

2024-06-20 Thread Federico Serafini
Add missing break statement to address a violation of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/hvm/vlapic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x8

[XEN PATCH 01/13] automation/eclair: consider also hypened fall-through

2024-06-20 Thread Federico Serafini
Update ECLAIR configuration: - allow to deviate MISRA C Rule 16.3 using different version of hypened fall-through; - search for the comment for 2 lines after the last statement. Signed-off-by: Federico Serafini --- automation/eclair_analysis/ECLAIR/deviations.ecl | 2 +- docs/misra/deviations.

[XEN PATCH 06/13] x86/mce: address violations of MISRA C Rule 16.3

2024-06-20 Thread Federico Serafini
Add missing break statements to address violations of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/cpu/mcheck/mce_amd.c | 1 + xen/arch/x86/cpu/mcheck/mce_intel.c | 2 ++ 2

[xen-unstable-smoke test] 186432: regressions - FAIL

2024-06-20 Thread osstest service owner
flight 186432 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/186432/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-armhf 6 xen-buildfail REGR. vs. 186411 Tests which

Re: [PATCH] automation/eclair_analysis: deviate common/unlzo.c for MISRA Rule 7.3

2024-06-20 Thread Alessandro Zucchelli
On 2024-06-20 03:17, Stefano Stabellini wrote: On Tue, 18 Jun 2024, Jan Beulich wrote: On 18.06.2024 11:54, Alessandro Zucchelli wrote: > The file contains violations of Rule 7.3 which states as following: The > lowercase character `l' shall not be used in a literal suffix. > > This file defines

[linux-linus test] 186426: tolerable FAIL - PUSHED

2024-06-20 Thread osstest service owner
flight 186426 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/186426/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): test-armhf-armhf-xl-raw 8 xen-boot fail in 186413 pass in 186426 test-armhf-armhf-xl-credit2 8 x

[XEN PATCH] automation/eclair: add deviations of MISRA C Rule 5.5

2024-06-20 Thread Federico Serafini
MISRA C Rule 5.5 states that "Identifiers shall be distinct from macro names". Update ECLAIR configuration to deviate: - macros expanding to their own name; - clashes between macros and non-callable entities; - clashes related to the selection of specific implementations of string handling funct

Re: [PATCH for-4.18] x86/cpuid: Fix handling of XSAVE dynamic leaves

2024-06-20 Thread Andrew Cooper
On 20/06/2024 1:10 pm, Jan Beulich wrote: > On 20.06.2024 13:14, Andrew Cooper wrote: >> [ This is a minimal backport of commit 71cacfb035f4 ("x86/cpuid: Fix handling >> of XSAVE dynamic leaves") to fix the bugs without depending on large >> rework of >> XSTATE handling in Xen 4.19 ] >> >> Fir

Re: [PATCH for-4.18] x86/cpuid: Fix handling of XSAVE dynamic leaves

2024-06-20 Thread Jan Beulich
On 20.06.2024 13:14, Andrew Cooper wrote: > [ This is a minimal backport of commit 71cacfb035f4 ("x86/cpuid: Fix handling > of XSAVE dynamic leaves") to fix the bugs without depending on large rework > of > XSTATE handling in Xen 4.19 ] > > First, if XSAVE is available in hardware but not vis

[PATCH for-4.18] x86/cpuid: Fix handling of XSAVE dynamic leaves

2024-06-20 Thread Andrew Cooper
[ This is a minimal backport of commit 71cacfb035f4 ("x86/cpuid: Fix handling of XSAVE dynamic leaves") to fix the bugs without depending on large rework of XSTATE handling in Xen 4.19 ] First, if XSAVE is available in hardware but not visible to the guest, the dynamic leaves shouldn't be fill

Re: [XEN PATCH v10 5/5] domctl: Add XEN_DOMCTL_gsi_permission to grant gsi

2024-06-20 Thread Jan Beulich
On 20.06.2024 11:40, Chen, Jiqian wrote: > On 2024/6/18 17:23, Jan Beulich wrote: >> On 18.06.2024 10:23, Chen, Jiqian wrote: >>> On 2024/6/17 23:32, Jan Beulich wrote: On 17.06.2024 11:00, Jiqian Chen wrote: > @@ -1516,14 +1519,39 @@ static void pci_add_dm_done(libxl__egc *egc, >

Re: [XEN PATCH v10 4/5] tools: Add new function to get gsi from dev

2024-06-20 Thread Jan Beulich
On 20.06.2024 12:23, Chen, Jiqian wrote: > On 2024/6/20 15:43, Jan Beulich wrote: >> On 20.06.2024 09:03, Chen, Jiqian wrote: >>> On 2024/6/18 17:13, Jan Beulich wrote: On 18.06.2024 10:10, Chen, Jiqian wrote: > On 2024/6/17 23:10, Jan Beulich wrote: >> On 17.06.2024 11:00, Jiqian Chen

Re: [XEN PATCH v10 4/5] tools: Add new function to get gsi from dev

2024-06-20 Thread Chen, Jiqian
On 2024/6/20 15:43, Jan Beulich wrote: > On 20.06.2024 09:03, Chen, Jiqian wrote: >> On 2024/6/18 17:13, Jan Beulich wrote: >>> On 18.06.2024 10:10, Chen, Jiqian wrote: On 2024/6/17 23:10, Jan Beulich wrote: > On 17.06.2024 11:00, Jiqian Chen wrote: >> --- a/tools/libs/light/libxl_pci.

Re: [PATCH] tools/libs/light: Fix nic->vlan memory allocation

2024-06-20 Thread Jan Beulich
On 19.06.2024 14:57, Anthony PERARD wrote: > On Mon, May 20, 2024 at 01:08:03PM -0400, Jason Andryuk wrote: >> On 2024-05-20 12:44, Leigh Brown wrote: >>> After the following commit: >>> 3bc14e4fa4b9 ("tools/libs/light: Add vlan field to libxl_device_nic") >>> xl list -l aborts with a double free e

Re: [PATCH for-4.19?] tools/libs/light: Fix nic->vlan memory allocation

2024-06-20 Thread Oleksii K.
On Wed, 2024-06-19 at 13:57 +0200, Jan Beulich wrote: > On 20.05.2024 19:08, Jason Andryuk wrote: > > On 2024-05-20 12:44, Leigh Brown wrote: > > > After the following commit: > > > 3bc14e4fa4b9 ("tools/libs/light: Add vlan field to > > > libxl_device_nic") > > > xl list -l aborts with a double fre

Re: [PATCH for-4.19] hotplug: Restore block-tap phy compatibility

2024-06-20 Thread Oleksii K.
On Wed, 2024-06-19 at 14:33 +, Anthony PERARD wrote: > On Wed, Jun 19, 2024 at 02:07:04PM +0200, Jan Beulich wrote: > > On 16.05.2024 15:52, Jason Andryuk wrote: > > > On 2024-05-16 03:41, Jan Beulich wrote: > > > > On 16.05.2024 04:22, Jason Andryuk wrote: > > > > > From: Jason Andryuk > > >

Re: [PATCH for-4.19] livepatch: use appropriate type for buffer offset variables

2024-06-20 Thread Oleksii K.
On Thu, 2024-06-20 at 09:04 +0100, Ross Lagerwall wrote: > On Thu, Jun 20, 2024 at 8:16 AM Jan Beulich > wrote: > > > > As was made noticeable by the last of the commits referenced below, > > using a fixed-size type for such purposes is not only against > > ./CODING_STYLE, but can lead to actual

Re: [PATCH for-4.19 v4] x86/irq: forward pending interrupts to new destination in fixup_irqs()

2024-06-20 Thread Oleksii K.
On Wed, 2024-06-19 at 13:53 +0200, Jan Beulich wrote: > On 19.06.2024 11:58, Roger Pau Monne wrote: > > fixup_irqs() is used to evacuate interrupts from to be offlined > > CPUs.  Given > > the CPU is to become offline, the normal migration logic used by > > Xen where the > > vector in the previous

Re: [XEN PATCH v10 5/5] domctl: Add XEN_DOMCTL_gsi_permission to grant gsi

2024-06-20 Thread Chen, Jiqian
On 2024/6/18 17:23, Jan Beulich wrote: > On 18.06.2024 10:23, Chen, Jiqian wrote: >> On 2024/6/17 23:32, Jan Beulich wrote: >>> On 17.06.2024 11:00, Jiqian Chen wrote: @@ -1516,14 +1519,39 @@ static void pci_add_dm_done(libxl__egc *egc, rc = ERROR_FAIL; goto

Re: [PATCH] automation/eclair_analysis: deviate and|or|xor for MISRA C Rule 21.2

2024-06-20 Thread Jan Beulich
On 20.06.2024 11:07, Alessandro Zucchelli wrote: > Rule 21.2 reports identifiers reserved for the C and POSIX standard > libraries: or, and and xor are reserved identifiers because they constitute > alternate spellings for the corresponding operators; however Xen doesn't > use standard library head

Re: [PATCH 2/2] x86/APIC: address violation of MISRA C Rule 21.2

2024-06-20 Thread Jan Beulich
On 19.06.2024 19:09, Alessandro Zucchelli wrote: > From: Nicola Vetrini > > The rule disallows the usage of an identifier reserved by the C standard. > All identfiers starting with '__' are reserved for any use, so the label > can be renamed in order to avoid the violation. > > No functional cha

Re: [PATCH 1/2] automation/eclair_analysis: deviate MISRA C Rule 21.2

2024-06-20 Thread Jan Beulich
On 19.06.2024 19:09, Alessandro Zucchelli wrote: > Rule 21.2 reports identifiers reserved for the C and POSIX standard > libraries: all xen's translation units are compiled with option > -nostdinc, this guarantees that these libraries are not used, therefore > a justification is provided for allowi

[PATCH] automation/eclair_analysis: deviate and|or|xor for MISRA C Rule 21.2

2024-06-20 Thread Alessandro Zucchelli
Rule 21.2 reports identifiers reserved for the C and POSIX standard libraries: or, and and xor are reserved identifiers because they constitute alternate spellings for the corresponding operators; however Xen doesn't use standard library headers, so there is no risk of overlap. This addresses viol

Re: [PATCH for-4.19 v2] x86/spec-ctrl: Support for SRSO_US_NO and SRSO_MSR_FIX

2024-06-20 Thread Jan Beulich
On 19.06.2024 21:10, Andrew Cooper wrote: > --- a/docs/misc/xen-command-line.pandoc > +++ b/docs/misc/xen-command-line.pandoc > @@ -2390,7 +2390,7 @@ By default SSBD will be mitigated at runtime (i.e > `ssbd=runtime`). > > {ibrs,ibpb,ssbd,psfd, > > eager-fpu,l1d-flush,b

[xen-unstable-smoke test] 186429: regressions - FAIL

2024-06-20 Thread osstest service owner
flight 186429 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/186429/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-armhf 6 xen-buildfail REGR. vs. 186411 Tests which

Re: [PATCH for-4.19] livepatch: use appropriate type for buffer offset variables

2024-06-20 Thread Ross Lagerwall
On Thu, Jun 20, 2024 at 8:16 AM Jan Beulich wrote: > > As was made noticeable by the last of the commits referenced below, > using a fixed-size type for such purposes is not only against > ./CODING_STYLE, but can lead to actual issues. Switch to using size_t > instead, thus also allowing calculati

Re: [XEN PATCH v10 4/5] tools: Add new function to get gsi from dev

2024-06-20 Thread Jan Beulich
On 20.06.2024 09:03, Chen, Jiqian wrote: > On 2024/6/18 17:13, Jan Beulich wrote: >> On 18.06.2024 10:10, Chen, Jiqian wrote: >>> On 2024/6/17 23:10, Jan Beulich wrote: On 17.06.2024 11:00, Jiqian Chen wrote: > --- a/tools/libs/light/libxl_pci.c > +++ b/tools/libs/light/libxl_pci.c >>>

Re: [XEN PATCH v2] xen: add explicit comment to identify notifier patterns

2024-06-20 Thread Federico Serafini
On 19/06/24 13:17, Julien Grall wrote: Hi Federico, On 19/06/2024 10:29, Federico Serafini wrote: MISRA C Rule 16.4 states that every `switch' statement shall have a `default' label" and a statement or a comment prior to the terminating break statement. This patch addresses some violations of

Re: [PATCH for-4.19] xen/arm: static-shmem: fix "gbase/pbase used uninitialized" build failure

2024-06-20 Thread Michal Orzel
On 19/06/2024 14:34, Julien Grall wrote: > > > On 19/06/2024 13:06, Michal Orzel wrote: >> Hi Julien, >> >> On 19/06/2024 13:55, Julien Grall wrote: >>> >>> >>> Hi Michal, >>> >>> On 19/06/2024 07:46, Michal Orzel wrote: Building Xen with CONFIG_STATIC_SHM=y results in a build failure: >>

Re: [PATCH for-4.19? v6 6/9] xen: Make the maximum number of altp2m views configurable for x86

2024-06-20 Thread Jan Beulich
On 19.06.2024 17:46, Petr Beneš wrote: > On Thu, Jun 13, 2024 at 2:03 PM Jan Beulich wrote: >>> @@ -510,13 +526,13 @@ int p2m_change_altp2m_gfn(struct domain *d, unsigned >>> int idx, >>> mfn_t mfn; >>> int rc = -EINVAL; >>> >>> -if ( idx >= min(ARRAY_SIZE(d->arch.altp2m_p2m), MAX_

Re: [PATCH] AMD/IOMMU: Improve register_iommu_exclusion_range()

2024-06-20 Thread Jan Beulich
On 19.06.2024 18:22, Andrew Cooper wrote: > On 19/06/2024 8:45 am, Jan Beulich wrote: >> On 18.06.2024 20:31, Andrew Cooper wrote: >>> * Use 64bit accesses instead of 32bit accesses >>> * Simplify the constant names >>> * Pull base into a local variable to avoid it being reloaded because of the

[PATCH for-4.19] livepatch: use appropriate type for buffer offset variables

2024-06-20 Thread Jan Beulich
As was made noticeable by the last of the commits referenced below, using a fixed-size type for such purposes is not only against ./CODING_STYLE, but can lead to actual issues. Switch to using size_t instead, thus also allowing calculations to be lighter-weight in 32-bit builds. No functional chan

[xen-unstable test] 186417: tolerable FAIL - PUSHED

2024-06-20 Thread osstest service owner
flight 186417 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/186417/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-armhf-armhf-libvirt 16 saverestore-support-checkfail like 186409 test-amd64-amd64-xl-qemut-win7-amd64

Re: [XEN PATCH v10 4/5] tools: Add new function to get gsi from dev

2024-06-20 Thread Chen, Jiqian
On 2024/6/18 17:13, Jan Beulich wrote: > On 18.06.2024 10:10, Chen, Jiqian wrote: >> On 2024/6/17 23:10, Jan Beulich wrote: >>> On 17.06.2024 11:00, Jiqian Chen wrote: --- a/tools/include/xen-sys/Linux/privcmd.h +++ b/tools/include/xen-sys/Linux/privcmd.h @@ -95,6 +95,11 @@ typedef s

Re: [PATCH] xen/guest_access: Fix accessors for 32bit builds of Xen

2024-06-20 Thread Jan Beulich
On 19.06.2024 18:31, Andrew Cooper wrote: > Gitlab CI reports an ARM32 randconfig failure as follows: > > In file included from common/livepatch.c:9: > common/livepatch.c: In function ‘livepatch_list’: > ./include/xen/guest_access.h:130:25: error: cast to pointer from integer of > different