Re: [PATCH 1/6] x86: Introduce x86_decode_lite()

2024-04-23 Thread Andrew Cooper
On 23/04/2024 10:17 am, Jan Beulich wrote: > On 22.04.2024 20:14, Andrew Cooper wrote: >> --- /dev/null >> +++ b/xen/arch/x86/x86_emulate/decode-lite.c >> @@ -0,0 +1,245 @@ >> +/* SPDX-License-Identifier: GPL-2.0-only */ >> + >> +#include "private.h" >> + >> +#define Imm8 (1 << 0) >> +#define

Re: [XEN PATCH] automation/eclair: add deviations for MISRA C:2012 Rule 16.4

2024-04-23 Thread Jan Beulich
On 23.04.2024 12:02, Federico Serafini wrote: > --- a/docs/misra/deviations.rst > +++ b/docs/misra/deviations.rst > @@ -302,6 +302,19 @@ Deviations related to MISRA C:2012 Rules: > leave such files as is. > - Tagged as `deliberate` for ECLAIR. > > + * - R16.4 > + - Switch

[XEN PATCH] automation/eclair: add deviations for MISRA C:2012 Rule 16.4

2024-04-23 Thread Federico Serafini
Update ECLAIR configuration to take into account the deviations agreed during MISRA meetings for Rule 16.4. Signed-off-by: Federico Serafini --- automation/eclair_analysis/ECLAIR/deviations.ecl | 8 docs/misra/deviations.rst| 13 + 2 files changed,

Re: [XEN PATCH v2 4/5] xen/arm: allow dynamically assigned SGI handlers

2024-04-23 Thread Jens Wiklander
Hi Julien, On Mon, Apr 22, 2024 at 12:57 PM Julien Grall wrote: > > Hi Jens, > > On 22/04/2024 08:37, Jens Wiklander wrote: > > Updates so request_irq() can be used with a dynamically assigned SGI irq > > as input. This prepares for a later patch where an FF-A schedule > > receiver interrupt

Re: [PATCH 1/6] x86: Introduce x86_decode_lite()

2024-04-23 Thread Jan Beulich
On 22.04.2024 20:14, Andrew Cooper wrote: > In order to relocate all IP-relative fields in an alternative replacement > block, we need to decode the instructions enough to obtain their length and > any relative fields. > > Full x86_decode() is far too heavyweight, so introduce a minimal form

[XEN PATCH v1 7/7] x86/MCE: optional build of AMD/Intel MCE code

2024-04-23 Thread Sergiy Kibrik
Separate Intel/AMD-specific MCE code using CONFIG_{INTEL,AMD} config options. Now we can avoid build of mcheck code if support for specific platform is intentionally disabled by configuration. Signed-off-by: Sergiy Kibrik --- xen/arch/x86/cpu/mcheck/Makefile| 6 ++

[XEN PATCH v1 6/7] x86/MCE: guard call to Intel-specific intel_get_extended_msrs()

2024-04-23 Thread Sergiy Kibrik
Add check for CONFIG_INTEL build option to conditional call of this routine, so that if Intel support is disabled the call would be eliminated. No functional change intended. Signed-off-by: Sergiy Kibrik --- xen/arch/x86/cpu/mcheck/mce.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)

[XEN PATCH v1 5/7] x86/MCE: guard {intel/amd}_mcheck_init() calls

2024-04-23 Thread Sergiy Kibrik
Guard calls to CPU-specific mcheck init routines in common MCE code using new INTEL/AMD config options. The purpose is not to build platform-specific mcheck code and calls to it, if this platform is disabled in config. Signed-off-by: Sergiy Kibrik --- xen/arch/x86/cpu/mcheck/mce.c | 6 --

[XEN PATCH v1 4/7] x86/MCE: guard lmce_support/cmci_support

2024-04-23 Thread Sergiy Kibrik
Guard access to Intel-specific lmce_support & cmci_support variables in common MCE/VMCE code. These are set in Intel-specific parts of mcheck code and can potentially be skipped if building for non-intel platform by disabling CONFIG_INTEL option. Signed-off-by: Sergiy Kibrik ---

[XEN PATCH v1 3/7] x86/MCE: guard access to Intel/AMD-specific MCA MSRs

2024-04-23 Thread Sergiy Kibrik
Add build-time checks for newly introduced INTEL/AMD config options when calling vmce_{intel/amd}_{rdmsr/wrmsr}() routines. This way a platform-specific code can be omitted in vmce code, if this platform is disabled in config. Signed-off-by: Sergiy Kibrik --- xen/arch/x86/cpu/mcheck/vmce.c | 12

[XEN PATCH v1 2/7] x86/intel: guard vmce_has_lmce() with INTEL option

2024-04-23 Thread Sergiy Kibrik
Since MCG_LMCE_P bit is specific to Intel CPUs the code to check it can possibly be excluded from build if !CONFIG_INTEL. With these guards calls to vmce_has_lmce() are eliminated and mce_intel.c can end up not being built. Also replace boilerplate code that checks for MCG_LMCE_P flag with

[XEN PATCH v1 1/7] x86/vpmu: separate amd/intel vPMU code

2024-04-23 Thread Sergiy Kibrik
Build AMD vPMU when CONFIG_AMD is on, and Intel vPMU when CONFIG_INTEL is on respectively, allowing for a plaftorm-specific build. Also separate arch_vpmu_ops initializers using these options and static inline stubs. No functional change intended. Signed-off-by: Sergiy Kibrik CC: Andrew Cooper

[XEN PATCH v1 0/7] x86: make Intel/AMD vPMU & MCE support configurable

2024-04-23 Thread Sergiy Kibrik
Here's an attempt to further separate support of Intel & AMD CPUs in Xen build. The code to drive both platforms used to be built unconditionally, until recent introduction of CONFIG_{AMD,INTEL} Kconfig options. This series extends coverage of these options on vpmu and mcheck subsystems, that is

[PATCH 5/7] xen/arm: Rework heap page allocation outside allocate_bank_memory

2024-04-23 Thread Luca Fancellu
The function allocate_bank_memory allocates pages from the heap and map them to the guest using guest_physmap_add_page. As a preparation work to support static shared memory bank when the host physical address is not provided, Xen needs to allocate memory from the heap, so rework

[PATCH 2/7] xen/arm: Wrap shared memory mapping code in one function

2024-04-23 Thread Luca Fancellu
Wrap the code and logic that is calling assign_shared_memory and map_regions_p2mt into a new function 'handle_shared_mem_bank', it will become useful later when the code will allow the user to don't pass the host physical address. Signed-off-by: Luca Fancellu --- xen/arch/arm/static-shmem.c |

[PATCH 3/7] xen/p2m: put reference for superpage

2024-04-23 Thread Luca Fancellu
From: Penny Zheng We are doing foreign memory mapping for static shared memory, and there is a great possibility that it could be super mapped. But today, p2m_put_l3_page could not handle superpages. This commits implements a new function p2m_put_superpage to handle superpages, specifically for

[PATCH 7/7] xen/docs: Describe static shared memory when host address is not provided

2024-04-23 Thread Luca Fancellu
From: Penny Zheng This commit describe the new scenario where host address is not provided in "xen,shared-mem" property and a new example is added to the page to explain in details. Take the occasion to fix some typos in the page. Signed-off-by: Penny Zheng Signed-off-by: Luca Fancellu ---

[PATCH 4/7] xen/arm: Parse xen,shared-mem when host phys address is not provided

2024-04-23 Thread Luca Fancellu
Handle the parsing of the 'xen,shared-mem' property when the host physical address is not provided, this commit is introducing the logic to parse it, but the functionality is still not implemented and will be part of future commits. Rework the logic inside process_shm_node to check the shm_id

[PATCH 6/7] xen/arm: Implement the logic for static shared memory from Xen heap

2024-04-23 Thread Luca Fancellu
This commit implements the logic to have the static shared memory banks from the Xen heap instead of having the host physical address passed from the user. When the host physical address is not supplied, the physical memory is taken from the Xen heap using allocate_domheap_memory, the allocation

[PATCH 0/7] Static shared memory followup v2 - pt2

2024-04-23 Thread Luca Fancellu
This serie is a partial rework of this other serie: https://patchwork.kernel.org/project/xen-devel/cover/20231206090623.1932275-1-penny.zh...@arm.com/ The original serie is addressing an issue of the static shared memory feature that impacts the memory footprint of other component when the

[PATCH 1/7] xen/arm: Lookup bootinfo shm bank during the mapping

2024-04-23 Thread Luca Fancellu
The current static shared memory code is using bootinfo banks when it needs to find the number of borrower, so every time assign_shared_memory is called, the bank is searched in the bootinfo.shmem structure. There is nothing wrong with it, however the bank can be used also to retrieve the start

Re: [PATCH] x86/MTRR: correct inadvertently inverted WC check

2024-04-23 Thread Roger Pau Monné
On Tue, Apr 23, 2024 at 09:51:46AM +0200, Jan Beulich wrote: > The ! clearly got lost by mistake. > > Fixes: e9e0eb30d4d6 ("x86/MTRR: avoid several indirect calls") > Reported-by: Marek Marczykowski-Górecki > Signed-off-by: Jan Beulich Acked-by: Roger Pau Monné Thanks, Roger.

Re: [PATCH] x86/rtc: Avoid UIP flag being set for longer than expected

2024-04-23 Thread Jan Beulich
On 22.04.2024 18:38, Ross Lagerwall wrote: > On Thu, Apr 18, 2024 at 2:24 PM Jan Beulich wrote: >> On 08.04.2024 18:26, Ross Lagerwall wrote: >>> --- a/xen/arch/x86/hvm/rtc.c >>> +++ b/xen/arch/x86/hvm/rtc.c >>> @@ -202,6 +202,7 @@ static void check_update_timer(RTCState *s) >>> } >>>

Re: [PATCH] x86/MTRR: avoid several indirect calls

2024-04-23 Thread Jan Beulich
On 23.04.2024 03:17, Marek Marczykowski-Górecki wrote: > On Wed, Jan 17, 2024 at 10:32:53AM +0100, Jan Beulich wrote: >> --- a/xen/arch/x86/cpu/mtrr/main.c >> +++ b/xen/arch/x86/cpu/mtrr/main.c >> @@ -328,7 +316,7 @@ int mtrr_add_page(unsigned long base, un >> } >> >> /* If the type

[PATCH] x86/MTRR: correct inadvertently inverted WC check

2024-04-23 Thread Jan Beulich
The ! clearly got lost by mistake. Fixes: e9e0eb30d4d6 ("x86/MTRR: avoid several indirect calls") Reported-by: Marek Marczykowski-Górecki Signed-off-by: Jan Beulich --- a/xen/arch/x86/cpu/mtrr/main.c +++ b/xen/arch/x86/cpu/mtrr/main.c @@ -316,7 +316,7 @@ int mtrr_add_page(unsigned long base,

[linux-linus test] 185763: regressions - FAIL

2024-04-23 Thread osstest service owner
flight 185763 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/185763/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-armhf 6 xen-buildfail REGR. vs. 185750 Tests which did

Re: [RFC PATCH v3 2/3] x86/mm: Do not validate/devalidate PGT_none type

2024-04-23 Thread Jan Beulich
On 31.10.2023 17:22, Matias Ezequiel Vara Larsen wrote: > This commit prevents PGT_none type pages to be validated/devalidated. This isn't quite true. It is rather the case that (de)validation of this type is trivial, and hence can be short-circuited just like is done for certain other types. >

<    1   2