Re: [RFC PATCH v2 1/2] xen/memory : Add a stats_table resource type

2022-12-13 Thread Jan Beulich
On 14.12.2022 08:29, Jan Beulich wrote: > On 07.10.2022 14:39, Matias Ezequiel Vara Larsen wrote: >> +static int stats_vcpu_alloc_mfn(struct domain *d) >> +{ >> +struct page_info *pg; >> + >> +pg = alloc_domheap_page(d, MEMF_no_refcount); > > The ioreq and vmtrace resources are also alloca

Re: [PATCH 01/12] tools/xenstore: manage per-transaction domain accounting data in an array

2022-12-13 Thread Juergen Gross
On 01.12.22 23:13, Julien Grall wrote: Hi Juergen, On 01/11/2022 16:04, Juergen Gross wrote: In order to prepare keeping accounting data in an array instead of using independent fields, switch the struct changed_domain accounting data to that scheme, for now only using an array with one element

Re: [PATCH 1/2] x86/mm: avoid phys_to_nid() calls for invalid addresses

2022-12-13 Thread Jan Beulich
On 14.12.2022 04:28, Wei Chen wrote: > Hi Jan, > > On 2022/12/13 19:36, Jan Beulich wrote: >> With phys_to_nid() now actively checking that a valid node ID is on >> record, the two uses in paging_init() can actually trigger at least the >> 2nd of the assertions there. They're used to calculate all

Re: [RFC PATCH v2 1/2] xen/memory : Add a stats_table resource type

2022-12-13 Thread Jan Beulich
On 07.10.2022 14:39, Matias Ezequiel Vara Larsen wrote: > --- a/xen/common/memory.c > +++ b/xen/common/memory.c > @@ -1078,6 +1078,12 @@ unsigned int ioreq_server_max_frames(const struct > domain *d) > return nr; > } > > +unsigned int stats_table_max_frames(const struct domain *d) > +{ >

Re: Possible bug? DOM-U network stopped working after fatal error reported in DOM0

2022-12-13 Thread G.R.
On Thu, Nov 3, 2022 at 8:37 PM Roger Pau Monné wrote: > > > > Roger. > > > Hi Roger, any news for the upstream fix? I haven't heard any news since... > > > The reason I came back to this thread is that I totally forgot about > > > this issue and upgraded to FreeNAS 13 only to rediscover this issue

RE: [PATCH v4 1/3] x86/vmx: implement VMExit based guest Bus Lock detection

2022-12-13 Thread Tian, Kevin
> From: Roger Pau Monne > Sent: Wednesday, December 14, 2022 12:31 AM > > Add support for enabling guest Bus Lock Detection on Intel systems. > Such detection works by triggering a vmexit, which ought to be enough > of a pause to prevent a guest from abusing of the Bus Lock. > > Add an extra Xen

RE: [PATCH v4 2/3] x86/vmx: introduce helper to set VMX_INTR_SHADOW_NMI

2022-12-13 Thread Tian, Kevin
> From: Roger Pau Monne > Sent: Wednesday, December 14, 2022 12:31 AM > > Introduce a small helper to OR VMX_INTR_SHADOW_NMI in > GUEST_INTERRUPTIBILITY_INFO in order to help dealing with the NMI > unblocked by IRET case. Replace the existing usage in handling > EXIT_REASON_EXCEPTION_NMI and als

[ovmf test] 175187: all pass - PUSHED

2022-12-13 Thread osstest service owner
flight 175187 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/175187/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf 804e8c656643642894a26a2ce3652ad4567b658f baseline version: ovmf 592bf33a29360e8a447ed

[PATCH V10 3/3] docs: Add documentation for generic virtio devices

2022-12-13 Thread Viresh Kumar
This patch updates xl.cfg man page with details of generic Virtio device related information. Signed-off-by: Viresh Kumar Reviewed-by: Anthony PERARD Reviewed-by: Oleksandr Tyshchenko --- docs/man/xl.cfg.5.pod.in | 33 + 1 file changed, 33 insertions(+) diff --

[PATCH V10 1/3] libxl: Add support for generic virtio device

2022-12-13 Thread Viresh Kumar
This patch adds basic support for configuring and assisting generic Virtio backends, which could run in any domain. An example of domain configuration for mmio based Virtio I2C device is: virtio = ["type=virtio,device22,transport=mmio"] To make this work on Arm, allocate Virtio MMIO params (IRQ a

[PATCH V10 2/3] xl: Add support to parse generic virtio device

2022-12-13 Thread Viresh Kumar
This patch adds basic support for parsing generic Virtio backend. An example of domain configuration for mmio based Virtio I2C device is: virtio = ["type=virtio,device22,transport=mmio"] Signed-off-by: Viresh Kumar Reviewed-by: Anthony PERARD --- tools/xl/xl_parse.c | 81 ++

[PATCH V10 0/3] toolstack support for generic virtio devices on Arm

2022-12-13 Thread Viresh Kumar
Hello, This patchset adds toolstack support for I2C, GPIO and generic virtio devices. This is inspired from the work done by Oleksandr for the Disk device. This is developed as part of Linaro's Project Stratos, where we are working towards Hypervisor agnostic Rust based backends [1]. This is bas

[PATCH] arch: change variable types to match those of what is assigned to them

2022-12-13 Thread Seija K.
There are many places where "int len = strlen(foo);" is written, just for len to be passed as a parameter of size_t. This causes truncation and then expansion back from int to size_t. Not to mention this is poor logic and needless truncations can add extra unneeded instructions. This patch aims to

[PATCH] arch: change variable types to match those of what is assigned to them

2022-12-13 Thread Seija Kijin
There are many places where "int len = strlen(foo);" is written, just for len to be passed as a parameter of size_t. This causes truncation and then expansion back from int to size_t. Not to mention this is poor logic and needless truncations can add extra unneeded instructions. This patch aim

[PATCH] arch: change variable types to match those of what is assigned to them

2022-12-13 Thread Seija K.
There are many places where "int len = strlen(foo);" is written, just for len to be passed as a parameter of size_t. This causes truncation and then expansion back from int to size_t. Not to mention this is poor logic and needless truncations can add extra unneeded instructions. This patch aims to

Re: [PATCH V9 1/3] libxl: Add support for generic virtio device

2022-12-13 Thread Viresh Kumar
On 13-12-22, 13:45, Oleksandr Tyshchenko wrote: > On 13.12.22 12:08, Viresh Kumar wrote: > > +/* Virtio device types */ > > +#define VIRTIO_DEVICE_TYPE_GENERIC "virtio,device" > > +#define VIRTIO_DEVICE_TYPE_GPIO "virtio,device22" > > +#define VIRTIO_DEVICE_TYPE_I2C "virtio,device29" >

Re: [PATCH V9 1/3] libxl: Add support for generic virtio device

2022-12-13 Thread Viresh Kumar
On 13-12-22, 12:14, Jan Beulich wrote: > Please can you arrange tags in time order, which would mean R-b past any > S-o-b? I'll try to remember to swap them while committing, but in the > future please save committers from needing to do so. I was confused if Reviewed-by's should be after of before

Re: [PATCH 1/2] x86/mm: avoid phys_to_nid() calls for invalid addresses

2022-12-13 Thread Wei Chen
Hi Jan, On 2022/12/13 19:36, Jan Beulich wrote: With phys_to_nid() now actively checking that a valid node ID is on record, the two uses in paging_init() can actually trigger at least the 2nd of the assertions there. They're used to calculate allocation flags, but the calculated flags wouldn't b

[PATCH v2] xen/arm: Reduce redundant clear root pages when teardown p2m

2022-12-13 Thread Henry Wang
Currently, p2m for a domain will be teardown from two paths: (1) The normal path when a domain is destroyed. (2) The arch_domain_destroy() in the failure path of domain creation. When tearing down p2m from (1), the part to clear and clean the root is only needed to do once rather than for every ca

[PATCH v2 3/3] xen/arm: Extend the memory overlap check to include EfiACPIReclaimMemory

2022-12-13 Thread Henry Wang
Similarly as the static regions and boot modules, memory regions with EfiACPIReclaimMemory type (defined in bootinfo.acpi if CONFIG_ACPI is enabled) should also not be overlapping with memory regions in bootinfo.reserved_mem and bootinfo.modules. Therefore, this commit reuses the `meminfo_overlap_

[PATCH v2 2/3] xen/arm: Extend the memory overlap check to include bootmodules

2022-12-13 Thread Henry Wang
Similarly as the static regions defined in bootinfo.reserved_mem, the bootmodule regions defined in bootinfo.modules should also not be overlapping with memory regions in either bootinfo.reserved_mem or bootinfo.modules. Therefore, this commit introduces a helper `bootmodules_overlap_check()` and

[PATCH v2 0/3] Memory region overlap check in device tree

2022-12-13 Thread Henry Wang
As we are having more and more types of memory region defined in the device tree, it is necessary to add the overlap check of these memory regions in Xen, because such check will help user to identify the misconfiguration in the device tree at the early stage of boot time. The first patch introduc

[PATCH v2 1/3] xen/arm: Add memory overlap check for bootinfo.reserved_mem

2022-12-13 Thread Henry Wang
As we are having more and more types of static region, and all of these static regions are defined in bootinfo.reserved_mem, it is necessary to add the overlap check of reserved memory regions in Xen, because such check will help user to identify the misconfiguration in the device tree at the early

[xen-unstable test] 175180: regressions - FAIL

2022-12-13 Thread osstest service owner
flight 175180 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/175180/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-i386-livepatch 8 xen-boot fail REGR. vs. 175144 test-xtf-amd64-amd

Re: [PATCH] arch: change variable types to match those of what is assigned to them

2022-12-13 Thread Max Filippov
Hi Seija, On Tue, Dec 13, 2022 at 4:51 PM Seija Kijin wrote: > > There are many places where "int len = strlen(foo);" is written, just for len > to be passed as a parameter of size_t. [...] > diff --git a/arch/xtensa/platforms/iss/console.c > b/arch/xtensa/platforms/iss/console.c > index 10b7

[linux-linus test] 175178: regressions - FAIL

2022-12-13 Thread osstest service owner
flight 175178 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/175178/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 173462 test-amd64

Re: [RFC 3/4] Add xen superpage splitting support to arm

2022-12-13 Thread Demi Marie Obenour
On Tue, Dec 13, 2022 at 11:07:55PM +, Julien Grall wrote: > Hi Demi, > > On 13/12/2022 22:17, Demi Marie Obenour wrote: > > On Tue, Dec 13, 2022 at 09:15:49PM +, Julien Grall wrote: [snip] > > > > + > > > > +/* > > > > + * Generate the entry for this new table we created, > > > >

Re: [RFC 0/4] Adding Virtual Memory Fuses to Xen

2022-12-13 Thread Demi Marie Obenour
On Tue, Dec 13, 2022 at 11:05:49PM +, Julien Grall wrote: > Hi Demi, > > On 13/12/2022 22:22, Demi Marie Obenour wrote: > > On Tue, Dec 13, 2022 at 08:55:28PM +, Julien Grall wrote: > > > On 13/12/2022 19:48, Smith, Jackson wrote: > > > > Hi Xen Developers, > > > > > > Hi Jackson, > > >

[ovmf test] 175182: all pass - PUSHED

2022-12-13 Thread osstest service owner
flight 175182 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/175182/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf 592bf33a29360e8a447ed8b75daefe94c0888642 baseline version: ovmf 1fd8d08970a9ee7d350c7

Re: Porting Xen in raspberry pi4B

2022-12-13 Thread Stefano Stabellini
Hi Vipul, Good progress! The main function we should check is "xenfb_refresh" but from the logs it looks like it is called several times. Which means that everything seems to be working as expected on the Linux side. It is time to investigate the QEMU side: ./hw/display/xenfb.c:xenfb_handle_event

Re: [RFC 3/4] Add xen superpage splitting support to arm

2022-12-13 Thread Julien Grall
Hi Demi, On 13/12/2022 22:17, Demi Marie Obenour wrote: On Tue, Dec 13, 2022 at 09:15:49PM +, Julien Grall wrote: Hi, On 13/12/2022 19:54, Smith, Jackson wrote: Updates xen_pt_update_entry function from xen/arch/arm/mm.c to automatically split superpages as needed. Your signed-off-by is

[PATCH v2] efi: Relocate the ESRT when booting via multiboot2

2022-12-13 Thread Demi Marie Obenour
This was missed in the initial patchset. Signed-off-by: Demi Marie Obenour --- xen/arch/x86/efi/efi-boot.h | 2 + xen/common/efi/boot.c | 136 ++-- 2 files changed, 70 insertions(+), 68 deletions(-) diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/

Re: [RFC 0/4] Adding Virtual Memory Fuses to Xen

2022-12-13 Thread Julien Grall
Hi Demi, On 13/12/2022 22:22, Demi Marie Obenour wrote: On Tue, Dec 13, 2022 at 08:55:28PM +, Julien Grall wrote: On 13/12/2022 19:48, Smith, Jackson wrote: Hi Xen Developers, Hi Jackson, Thanks for sharing the prototype with the community. Some questions/remarks below. [snip] With

Re: [PATCH v3 18/18] xen/arm64: mm: Rework switch_ttbr()

2022-12-13 Thread Julien Grall
Hi Stefano, On 13/12/2022 22:56, Stefano Stabellini wrote: On Tue, 13 Dec 2022, Julien Grall wrote: Hi Stefano, On 13/12/2022 02:00, Stefano Stabellini wrote: On Mon, 12 Dec 2022, Julien Grall wrote: From: Julien Grall At the moment, switch_ttbr() is switching the TTBR whilst the MMU is st

Re: [PATCH v3 18/18] xen/arm64: mm: Rework switch_ttbr()

2022-12-13 Thread Stefano Stabellini
On Tue, 13 Dec 2022, Julien Grall wrote: > Hi Stefano, > > On 13/12/2022 02:00, Stefano Stabellini wrote: > > On Mon, 12 Dec 2022, Julien Grall wrote: > > > From: Julien Grall > > > > > > At the moment, switch_ttbr() is switching the TTBR whilst the MMU is > > > still on. > > > > > > Switching

[PATCH v2 11/14] x86: Derive XEN_MSR_PAT from its individual entries

2022-12-13 Thread Demi Marie Obenour
This avoids it being a magic constant that is difficult for humans to decode. Use BUILD_BUG_ON to check that the old and new values are identical. Signed-off-by: Demi Marie Obenour --- xen/arch/x86/include/asm/processor.h | 10 +- xen/arch/x86/mm.c| 6 ++ 2 file

[PATCH v2 13/14] x86/mm: Reject invalid cacheability in PV guests by default

2022-12-13 Thread Demi Marie Obenour
Setting cacheability flags that are not ones specified by Xen is a bug in the guest. By default, inject #GP into any guest that does this. allow_invalid_cacheability can be used on the Xen command line to disable this check. Signed-off-by: Demi Marie Obenour --- xen/arch/x86/mm.c | 25 +

[PATCH v2 12/14] x86/mm: make code robust to future PAT changes

2022-12-13 Thread Demi Marie Obenour
It may be desirable to change Xen's PAT for various reasons. This requires changes to several _PAGE_* macros as well. Add static assertions to check that XEN_MSR_PAT is consistent with the _PAGE_* macros, and that _PAGE_WB is 0 as required by Linux. Signed-off-by: Demi Marie Obenour --- xen/ar

[PATCH v2 14/14] x86: Use Linux's PAT

2022-12-13 Thread Demi Marie Obenour
This is purely for testing, to see if it works around a bug in i915. It is not intended to be merged. NOT-signed-off-by: DO NOT MERGE --- xen/arch/x86/include/asm/page.h | 4 ++-- xen/arch/x86/include/asm/processor.h | 13 + xen/arch/x86/mm.c| 2 -- 3 files

[PATCH v2 06/14] x86: Add memory type constants

2022-12-13 Thread Demi Marie Obenour
These are not currently used, so there is no functional change. Future patches will use these constants. Suggested-by: Andrew Cooper Signed-off-by: Demi Marie Obenour --- xen/arch/x86/include/asm/x86-defns.h | 13 + 1 file changed, 13 insertions(+) diff --git a/xen/arch/x86/includ

[PATCH v2 10/14] x86: Remove remaining uses of MTRR_* constants

2022-12-13 Thread Demi Marie Obenour
No functional change intended. Suggested-by: Andrew Cooper Signed-off-by: Demi Marie Obenour --- xen/arch/x86/cpu/mtrr/generic.c | 2 +- xen/arch/x86/cpu/mtrr/main.c| 7 +-- xen/arch/x86/hvm/mtrr.c | 22 +++--- xen/arch/x86/include/asm/mtrr.h | 4 xen/arc

[PATCH v2 09/14] x86: Replace EPT_EMT_* constants with X86_MT_*

2022-12-13 Thread Demi Marie Obenour
This allows eliminating the former. No functional change intended. Suggested-by: Andrew Cooper Signed-off-by: Demi Marie Obenour --- xen/arch/x86/include/asm/hvm/vmx/vmx.h | 9 - xen/arch/x86/mm/hap/nested_ept.c | 4 ++-- 2 files changed, 2 insertions(+), 11 deletions(-) diff --

[PATCH v2 08/14] x86: Replace MTRR_* constants with X86_MT_* constants

2022-12-13 Thread Demi Marie Obenour
This allows eliminating most of the former. No functional change intended. Suggested-by: Andrew Cooper Signed-off-by: Demi Marie Obenour --- xen/arch/x86/cpu/mtrr/generic.c | 10 ++--- xen/arch/x86/cpu/mtrr/main.c| 26 ++--- xen/arch/x86/e820.c |

[PATCH v2 07/14] x86: Replace PAT_* with X86_MT_*

2022-12-13 Thread Demi Marie Obenour
This allows eliminating the former. Suggested-by: Andrew Cooper Signed-off-by: Demi Marie Obenour --- xen/arch/x86/hvm/hvm.c | 12 xen/arch/x86/hvm/mtrr.c | 52 - xen/arch/x86/hvm/vmx/vmx.c | 16 +- xen/arch/x86/include/asm/

[PATCH v2 05/14] x86/mm/shadow: do not open-code PAGE_CACHE_ATTRS

2022-12-13 Thread Demi Marie Obenour
This makes the code easier to understand. Acked-by: Jan Beulich Signed-off-by: Demi Marie Obenour --- xen/arch/x86/mm/shadow/multi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c index 4e94fec3d50cde0e5a2

[PATCH v2 03/14] x86/mm/shadow: avoid assuming a specific Xen PAT

2022-12-13 Thread Demi Marie Obenour
This makes the code easier to understand and more robust if Xen's PAT ever changes. Reviewed-by: Andrew Cooper Signed-off-by: Demi Marie Obenour --- xen/arch/x86/mm/shadow/multi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x

[PATCH v2 04/14] efi: Avoid hard-coding the various PAT constants

2022-12-13 Thread Demi Marie Obenour
This makes the code much easier to understand, and avoids problems if Xen's PAT ever changes in the future. Reviewed-by: Jan Beulich Signed-off-by: Demi Marie Obenour --- xen/common/efi/boot.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xen/common/efi/boot.c

[PATCH v2 02/14] p2m-pt: Avoid hard-coding Xen's PAT

2022-12-13 Thread Demi Marie Obenour
This makes the code much easier to understand. No functional change intended. As per Andrew Cooper, the existing logic is incorrect, but this does not make it any worse. Signed-off-by: Demi Marie Obenour --- xen/arch/x86/mm/p2m-pt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)

[PATCH v2 01/14] x86/mm: Avoid hard-coding PAT in get_page_from_l1e()

2022-12-13 Thread Demi Marie Obenour
Also force the unused entries to UC and add a comment. Signed-off-by: Demi Marie Obenour --- xen/arch/x86/mm.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 78b1972e4170ca9c37c6e64e76e66a7da87f..b73cb29327ba4

[PATCH v2 00/14] Make PAT handling less brittle

2022-12-13 Thread Demi Marie Obenour
While working on Qubes OS Marek found out that there were some PAT hacks in the Linux i195 driver. I decided to make Xen use Linux’s PAT to see if it solved the graphics glitches that were observed; it did. This required a substantial amount of preliminary work that is useful even without using L

Re: [RFC 0/4] Adding Virtual Memory Fuses to Xen

2022-12-13 Thread Demi Marie Obenour
On Tue, Dec 13, 2022 at 08:55:28PM +, Julien Grall wrote: > On 13/12/2022 19:48, Smith, Jackson wrote: > > Hi Xen Developers, > > Hi Jackson, > > Thanks for sharing the prototype with the community. Some questions/remarks > below. [snip] > > With this technique, we protect the integrity and

Re: [RFC 3/4] Add xen superpage splitting support to arm

2022-12-13 Thread Demi Marie Obenour
On Tue, Dec 13, 2022 at 09:15:49PM +, Julien Grall wrote: > Hi, > > On 13/12/2022 19:54, Smith, Jackson wrote: > > Updates xen_pt_update_entry function from xen/arch/arm/mm.c to > > automatically split superpages as needed. > Your signed-off-by is missing. > > > --- > > xen/arch/arm/mm.c |

Re: [PATCH RFC 03/10] domain: GADDR based shared guest area registration alternative - teardown

2022-12-13 Thread Julien Grall
Hi Jan, On 19/10/2022 08:40, Jan Beulich wrote: In preparation of the introduction of new vCPU operations allowing to register the respective areas (one of the two is x86-specific) by guest-physical address, add the necessary domain cleanup hooks. Signed-off-by: Jan Beulich --- RFC: Zapping th

Re: [PATCH] xen/arm: Reduce redundant clear root pages when teardown p2m

2022-12-13 Thread Julien Grall
On 12/12/2022 11:27, Henry Wang wrote: Hi Julien, Hi, -Original Message- From: Julien Grall Subject: Re: [PATCH] xen/arm: Reduce redundant clear root pages when teardown p2m Hi Henry, PROGRESS(p2m): +/* + * We are about to free the intermediate page-tables,

Re: [PATCH 2/2] NUMA: replace phys_to_nid()

2022-12-13 Thread Julien Grall
Hi Jan, On 13/12/2022 14:08, Jan Beulich wrote: On 13.12.2022 14:48, Julien Grall wrote: On 13/12/2022 12:46, Jan Beulich wrote: On 13.12.2022 13:06, Julien Grall wrote: On 13/12/2022 11:38, Jan Beulich wrote: All callers convert frame numbers (perhaps in turn derived from struct page_info p

Re: [PATCH linux-next v2] x86/xen/time: prefer tsc as clocksource when it is invariant

2022-12-13 Thread Boris Ostrovsky
On 12/12/22 5:09 PM, Krister Johansen wrote: On Mon, Dec 12, 2022 at 01:48:24PM -0500, Boris Ostrovsky wrote: On 12/12/22 11:05 AM, Krister Johansen wrote: diff --git a/arch/x86/include/asm/xen/cpuid.h b/arch/x86/include/asm/xen/cpuid.h index 6daa9b0c8d11..d9d7432481e9 100644 --- a/arch/x86/i

Re: [XEN v5 11/11] xen/Arm: GICv3: Enable GICv3 for AArch32

2022-12-13 Thread Julien Grall
Hi, On 05/12/2022 13:26, Ayan Kumar Halder wrote: One can now use GICv3 on AArch32 systems. However, ITS is not supported. The reason being currently we are trying to validate GICv3 on an AArch32_v8R system. Refer ARM DDI 0568A.c ID110520, B1.3.1, "A Generic Interrupt Controller (GIC) implemente

Re: [XEN v5 10/11] xen/Arm: GICv3: Define macros to read/write 64 bit

2022-12-13 Thread Julien Grall
Hi, On 05/12/2022 13:26, Ayan Kumar Halder wrote: On AArch32, ldrd/strd instructions are not atomic when used to access MMIO. Furthermore, ldrd/strd instructions are not decoded by Arm when running as a guest to access emulated MMIO region. Thus, we have defined readq_relaxed_non_atomic()/writeq

Re: [XEN v5 09/11] xen/Arm: GICv3: Define remaining GIC registers for AArch32

2022-12-13 Thread Julien Grall
Hi, On 05/12/2022 13:26, Ayan Kumar Halder wrote: Define missing assembly aliases for GIC registers on arm32, taking the ones defined already for arm64 as a base. Aliases are defined according to the GIC Architecture Specification ARM IHI 0069H. Defined the following registers:- 1. Interrupt Co

Re: [XEN v5 08/11] xen/Arm: GICv3: Define ICH_AP0R and ICH_AP1R for AArch32

2022-12-13 Thread Julien Grall
Hi Ayan, On 05/12/2022 13:26, Ayan Kumar Halder wrote: Adapt save_aprn_regs()/restore_aprn_regs() for AArch32. For which we have defined the following registers:- 1. Interrupt Controller Hyp Active Priorities Group0 Registers 0-3 2. Interrupt Controller Hyp Active Priorities Group1 Registers 0-

Re: [XEN v5 07/11] xen/Arm: GICv3: Define ICH_LR_EL2 on AArch32

2022-12-13 Thread Julien Grall
Hi Ayan, On 05/12/2022 13:26, Ayan Kumar Halder wrote: Refer "Arm IHI 0069H ID020922", 12.4.6, Interrupt Controller List Registers AArch64 System register ICH_LR_EL2 bits [31:0] are architecturally mapped to AArch32 System register ICH_LR[31:0]. AArch64 System register ICH_LR_EL2 bits [63:32] a

Re: [RFC 3/4] Add xen superpage splitting support to arm

2022-12-13 Thread Julien Grall
Hi, On 13/12/2022 19:54, Smith, Jackson wrote: Updates xen_pt_update_entry function from xen/arch/arm/mm.c to automatically split superpages as needed. Your signed-off-by is missing. --- xen/arch/arm/mm.c | 91 +++ 1 file changed, 78 inse

Re: [RFC 0/4] Adding Virtual Memory Fuses to Xen

2022-12-13 Thread Julien Grall
On 13/12/2022 19:48, Smith, Jackson wrote: Hi Xen Developers, Hi Jackson, Thanks for sharing the prototype with the community. Some questions/remarks below. My team at Riverside Research is currently spending IRAD funding to prototype next-generation secure hypervisor design ideas on Xe

[RFC 4/4] Implement VMF for arm64

2022-12-13 Thread Smith, Jackson
Implements the functions from xen/vmf.h for arm64. Introduces an xen/arch/arm/mm-walk.c helper file for walking an entire page table structure. --- xen/arch/arm/Makefile | 1 + xen/arch/arm/include/asm/mm-walk.h | 53 ++ xen/arch/arm/include/asm/mm.h | 11 +++ xen/arc

[RFC 3/4] Add xen superpage splitting support to arm

2022-12-13 Thread Smith, Jackson
Updates xen_pt_update_entry function from xen/arch/arm/mm.c to automatically split superpages as needed. --- xen/arch/arm/mm.c | 91 +++ 1 file changed, 78 insertions(+), 13 deletions(-) diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c index 6

[RFC 2/4] Add VMF tool

2022-12-13 Thread Smith, Jackson
VMF tool for calling vmf_op hypercall. Eventually should be merged into xl and related libraries. --- tools/Makefile | 1 + tools/vmf/Makefile | 32 +++ tools/vmf/vmf.c| 65 ++ 3 files changed, 98 insertions(+) c

[RFC 1/4] Add VMF Hypercall

2022-12-13 Thread Smith, Jackson
This commit introduces a new vmf_op hypercall. If desired, could be merged into an exisiting hypercall. Also, introduce a VMF Kconfig option and xen/vmf.h, defining the arch specific functions that must be implmented to support vmf. --- tools/include/xenctrl.h | 2 + tools/libs/

[RFC 0/4] Adding Virtual Memory Fuses to Xen

2022-12-13 Thread Smith, Jackson
Hi Xen Developers, My team at Riverside Research is currently spending IRAD funding to prototype next-generation secure hypervisor design ideas on Xen. In particular, we are prototyping the idea of Virtual Memory Fuses for Software Enclaves, as described in this paper: https://www.nspw.org/papers/

Re: [PATCH v3 18/18] xen/arm64: mm: Rework switch_ttbr()

2022-12-13 Thread Julien Grall
Hi Stefano, On 13/12/2022 02:00, Stefano Stabellini wrote: On Mon, 12 Dec 2022, Julien Grall wrote: From: Julien Grall At the moment, switch_ttbr() is switching the TTBR whilst the MMU is still on. Switching TTBR is like replacing existing mappings with new ones. So we need to follow the bre

Re: [PATCH linux-next v2] x86/xen/time: prefer tsc as clocksource when it is invariant

2022-12-13 Thread Krister Johansen
On Tue, Dec 13, 2022 at 08:23:29AM +0100, Jan Beulich wrote: > On 12.12.2022 23:05, Krister Johansen wrote: > > On Mon, Dec 12, 2022 at 05:46:29PM +0100, Jan Beulich wrote: > >> On 12.12.2022 17:05, Krister Johansen wrote: > >>> Both the Intel SDM[4] and the Xen tsc documentation explain that marki

[ovmf test] 175176: all pass - PUSHED

2022-12-13 Thread osstest service owner
flight 175176 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/175176/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf 1fd8d08970a9ee7d350c7dd42bffb0cb96426041 baseline version: ovmf 11ce7a2de7549306a853c

Re: [PATCH v3 12/18] xen/arm64: Rework the memory layout

2022-12-13 Thread Julien Grall
Hi Stefano, On 13/12/2022 01:22, Stefano Stabellini wrote: On Mon, 12 Dec 2022, Julien Grall wrote: From: Julien Grall Xen is currently not fully compliant with the Arm Arm because it will switch the TTBR with the MMU on. In order to be compliant, we need to disable the MMU before switching

Re: [PATCH v3 09/18] xen/arm32: head: Remove restriction where to load Xen

2022-12-13 Thread Julien Grall
On 12/12/2022 09:55, Julien Grall wrote: /* * Map the UART in the fixmap (when earlyprintk is used) and hook the * fixmap table in the page tables. diff --git a/xen/arch/arm/domain_page.c b/xen/arch/arm/domain_page.c index b7c02c919064..907fb93d4df0 100644 --- a/xen/arch/arm/domain_page.c

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

2022-12-13 Thread osstest service owner
flight 175173 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/175173/ 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

[PATCH v2] xen/arm: smmuv3: mark arm_smmu_disable_pasid __maybe_unused

2022-12-13 Thread Stewart Hildebrand
When building with clang 12 and CONFIG_ARM_SMMU_V3=y, we observe the following build error: drivers/passthrough/arm/smmu-v3.c:1408:20: error: unused function 'arm_smmu_disable_pasid' [-Werror,-Wunused-function] static inline void arm_smmu_disable_pasid(struct arm_smmu_master *master) { }

[xen-unstable test] 175168: regressions - FAIL

2022-12-13 Thread osstest service owner
flight 175168 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/175168/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-i386-livepatch 8 xen-boot fail REGR. vs. 175144 test-xtf-amd64-amd

Re: [PATCH] arch: change variable types to match those of what is assigned to them

2022-12-13 Thread Russell King (Oracle)
On Tue, Dec 13, 2022 at 12:35:35PM -0500, Seija K. wrote: > There are many places where "int len = strlen(foo);" is written, just > for len to be passed as a parameter of size_t. This causes truncation > and then expansion back from int to size_t. Not to mention this is > poor logic and needless tr

Re: [PATCH] arch: change variable types to match those of what is assigned to them

2022-12-13 Thread Randy Dunlap
Hi, Please look at https://lore.kernel.org/lkml/caa42ikx2f2lsaq9c5rxnctphob6n+l35winc5wk1k2eysaj...@mail.gmail.com/T/#u and see if that matches what you thought you sent as a patch. The gmail web interface is notorious for dropping tabs in emails. On 12/13/22 09:35, Seija K. wrote: > There

Re: [PATCH] arch: change variable types to match those of what is assigned to them

2022-12-13 Thread Russell King (Oracle)
On Tue, Dec 13, 2022 at 12:03:51PM -0500, Seija K. wrote: > There are many places where "int len = strlen(foo);" is written, just > for len to be passed as a parameter of size_t. This causes truncation > and then expansion back from int to size_t. Not to mention this is > poor logic and needless tr

[xen-unstable bisection] complete test-xtf-amd64-amd64-4

2022-12-13 Thread osstest service owner
branch xen-unstable xenbranch xen-unstable job test-xtf-amd64-amd64-4 testid xen-boot Tree: linux git://xenbits.xen.org/linux-pvops.git Tree: linuxfirmware git://xenbits.xen.org/osstest/linux-firmware.git Tree: qemu git://xenbits.xen.org/qemu-xen-traditional.git Tree: qemuu git://xenbits.xen.org/q

[linux-linus test] 175166: regressions - FAIL

2022-12-13 Thread osstest service owner
flight 175166 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/175166/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 173462 test-amd64

[ovmf test] 175172: all pass - PUSHED

2022-12-13 Thread osstest service owner
flight 175172 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/175172/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf 11ce7a2de7549306a853cc3fe3abe6ef8f874b40 baseline version: ovmf 5890a18409a0e67a491c6

Re: [RFC PATCH v2 1/2] xen/memory : Add a stats_table resource type

2022-12-13 Thread Jan Beulich
On 07.10.2022 14:39, Matias Ezequiel Vara Larsen wrote: > This commit proposes a new mechanism to query the RUNSTATE_running counter for > a given vcpu from a dom0 userspace application. This commit proposes to expose > that counter by using the acquire_resource interface. The current mechanism > r

[PATCH v4 3/3] x86/vmx: implement Notify VM Exit

2022-12-13 Thread Roger Pau Monne
Under certain conditions guests can get the CPU stuck in an unbounded loop without the possibility of an interrupt window to occur on instruction boundary. This was the case with the scenarios described in XSA-156. Make use of the Notify VM Exit mechanism, that will trigger a VM Exit if no interr

[PATCH v4 1/3] x86/vmx: implement VMExit based guest Bus Lock detection

2022-12-13 Thread Roger Pau Monne
Add support for enabling guest Bus Lock Detection on Intel systems. Such detection works by triggering a vmexit, which ought to be enough of a pause to prevent a guest from abusing of the Bus Lock. Add an extra Xen perf counter to track the number of Bus Locks detected. This is done because Bus Lo

[PATCH v4 2/3] x86/vmx: introduce helper to set VMX_INTR_SHADOW_NMI

2022-12-13 Thread Roger Pau Monne
Introduce a small helper to OR VMX_INTR_SHADOW_NMI in GUEST_INTERRUPTIBILITY_INFO in order to help dealing with the NMI unblocked by IRET case. Replace the existing usage in handling EXIT_REASON_EXCEPTION_NMI and also add such handling to EPT violations and page-modification log-full events. Repo

[PATCH v4 0/3] x86/vmx: implement Bus Lock and VM Notify

2022-12-13 Thread Roger Pau Monne
Hello, Following series implements support for bus lock and notify VM exit. Patches are not really dependent, but I've developed them together by virtue of both features being in Intel Instructions Set Extensions PR Chapter 9. Thanks, Roger. Roger Pau Monne (3): x86/vmx: implement VMExit base

[PATCH v2 19/19] tools/xenstore: make output of "xenstore-control help" more pretty

2022-12-13 Thread Juergen Gross
Using a tab for separating the command from the options in the output of "xenstore-control help" results in a rather ugly list. Use a fixed size for the command instead. Signed-off-by: Juergen Gross --- V2: - new patch --- tools/xenstore/xenstored_control.c | 2 +- 1 file changed, 1 insertion(+

[PATCH v2 18/19] tools/xenstore: let check_store() check the accounting data

2022-12-13 Thread Juergen Gross
Today check_store() is only testing the correctness of the node tree. Add verification of the accounting data (number of nodes) and correct the data if it is wrong. Do the initial check_store() call only after Xenstore entries of a live update have been read. Signed-off-by: Juergen Gross ---

[PATCH v2 07/19] tools/xenstore: introduce dummy nodes for special watch paths

2022-12-13 Thread Juergen Gross
Instead of special casing the permission handling and watch event firing for the special watch paths "@introduceDomain" and "@releaseDomain", use static dummy nodes added to the data base when starting Xenstore. The node accounting needs to reflect that change by adding the special nodes in the do

[PATCH v2 10/19] tools/xenstore: change per-domain node accounting interface

2022-12-13 Thread Juergen Gross
Rework the interface and the internals of the per-domain node accounting: - rename the functions to domain_nbentry_*() in order to better match the related counter name - switch from node pointer to domid as interface, as all nodes have the owner filled in - use a common internal function fo

[PATCH v2 17/19] tools/xenstore: introduce trace classes

2022-12-13 Thread Juergen Gross
Make the xenstored internal trace configurable by adding classes which can be switched on and off independently from each other. Define the following classes: - obj: Creation and deletion of interesting "objects" (watch, transaction, connection) - io: incoming requests and outgoing responses -

[PATCH v2 12/19] tools/xenstore: replace literal domid 0 with dom0_domid

2022-12-13 Thread Juergen Gross
There are some places left where dom0 is associated with domid 0. Use dom0_domid instead. Signed-off-by: Juergen Gross Reviewed-by: Julien Grall --- tools/xenstore/xenstored_core.c | 5 +++-- tools/xenstore/xenstored_domain.c | 8 2 files changed, 7 insertions(+), 6 deletions(-) di

[PATCH v2 14/19] tools/xenstore: let chk_domain_generation() return a bool

2022-12-13 Thread Juergen Gross
Instead of returning 0 or 1 let chk_domain_generation() return a boolean value. Simplify the only caller by removing the ret variable. Signed-off-by: Juergen Gross Reviewed-by: Julien Grall --- tools/xenstore/xenstored_domain.c | 18 -- 1 file changed, 8 insertions(+), 10 delet

[PATCH v2 15/19] tools/xenstore: switch hashtable to use the talloc framework

2022-12-13 Thread Juergen Gross
Instead of using malloc() and friends, let the hashtable implementation use the talloc framework. This is more consistent with the rest of xenstored and it allows to track memory usage via "xenstore-control memreport". Signed-off-by: Juergen Gross --- tools/xenstore/hashtable.c| 86

[PATCH v2 06/19] tools/xenstore: add hashlist for finding struct domain by domid

2022-12-13 Thread Juergen Gross
Today finding a struct domain by its domain id requires to scan the list of domains until finding the correct domid. Add a hashlist for being able to speed this up. This allows to remove the linking of struct domain in a list. Note that the list of changed domains per transaction is kept as a list

[PATCH v2 16/19] tools/xenstore: make log macro globally available

2022-12-13 Thread Juergen Gross
Move the definition of the log() macro to xenstored_core.h in order to make it usable from other source files, too. While at it preserve errno from being modified. Signed-off-by: Juergen Gross Reviewed-by: Julien Grall --- tools/xenstore/xenstored_core.c | 14 -- tools/xenstore/xen

[PATCH v2 08/19] tools/xenstore: replace watch->relative_path with a prefix length

2022-12-13 Thread Juergen Gross
Instead of storing a pointer to the path which is prepended to relative paths in struct watch, just use the length of the prepended path. It should be noted that the now removed special case of the relative path being "" in get_watch_path() can't happen at all. Signed-off-by: Juergen Gross --- V

[PATCH v2 11/19] tools/xenstore: don't allow creating too many nodes in a transaction

2022-12-13 Thread Juergen Gross
The accounting for the number of nodes of a domain in an active transaction is not working correctly, as it allows to create arbitrary number of nodes. The transaction will finally fail due to exceeding the number of nodes quota, but before closing the transaction an unprivileged guest could cause

[PATCH v2 13/19] tools/xenstore: make domain_is_unprivileged() an inline function

2022-12-13 Thread Juergen Gross
clang 14 is complaining about a NULL dereference for constructs like: domain_is_unprivileged(conn) ? conn->in : NULL as it can't know that domain_is_unprivileged(conn) will return false if conn is NULL. Fix that by making domain_is_unprivileged() an inline function (and related to that domid_i

  1   2   >