[PATCH v4 6/9] xen/arm/gic: Allow removing interrupt to running VMs

2024-05-23 Thread Henry Wang
in gic_remove_irq_from_guest() to after the successful execution of vgic_connect_hw_irq(). Signed-off-by: Vikram Garhwal Signed-off-by: Stefano Stabellini Signed-off-by: Henry Wang --- v4: - Split the original patch, only do the removing IRQ stuff in this patch. - Move the clear of _IRQ_INPROGRESS flag

[PATCH v4 8/9] tools: Introduce the "xl dt-overlay {attach,detach}" commands

2024-05-23 Thread Henry Wang
k the command option parsing logic. Signed-off-by: Henry Wang Reviewed-by: Jason Andryuk --- v4: - Add Jason's Reviewed-by tag. v3: - Introduce new API libxl_dt_overlay_domain() and co., instead of reusing existing API libxl_dt_overlay(). - Add in-code comments for the LIBXL_DT_OVERLAY_* macro

[PATCH v4 5/9] xen/arm: Add XEN_DOMCTL_dt_overlay and device attachment to domains

2024-05-23 Thread Henry Wang
from the overlay tracker based on the DT overlay. The attach of the device is implemented by mapping the IRQ and IOMMU resources. Signed-off-by: Henry Wang Signed-off-by: Vikram Garhwal --- v4: - Split the original patch, only do the device attachment. v3: - Style fixes for arch-selection

[PATCH v4 9/9] docs: Add device tree overlay documentation

2024-05-23 Thread Henry Wang
From: Vikram Garhwal Signed-off-by: Vikram Garhwal Signed-off-by: Stefano Stabellini Signed-off-by: Henry Wang --- v4: - No change. v3: - No change. v2: - Update the content based on the changes in this version. --- docs/misc/arm/overlay.txt | 99 +++ 1

[PATCH v4 1/9] tools/xl: Correct the help information and exit code of the dt-overlay command

2024-05-23 Thread Henry Wang
("tools/xl: Add new xl command overlay for device tree overlay support") Suggested-by: Anthony PERARD Signed-off-by: Henry Wang Reviewed-by: Jason Andryuk --- v4: - No change. v3: - Add Jason's Reviewed-by tag. v2: - New patch --- tools/xl/xl_cmdtable.c | 2 +- tools/xl/xl_vmcontrol.c |

[PATCH v4 3/9] tools/arm: Introduce the "nr_spis" xl config entry

2024-05-23 Thread Henry Wang
for user to decide the number of SPIs. This would help to avoid bumping the `config->arch.nr_spis` in libxl everytime there is a new platform with increased SPI numbers. Update the doc and the golang bindings accordingly. Signed-off-by: Henry Wang Reviewed-by: Jason Andryuk --- v4: - Add Jaso

[PATCH v4 7/9] xen/arm: Support device detachment from domains

2024-05-23 Thread Henry Wang
resources. Note that with these changes, the device de-registration from the IOMMU driver should only happen at the time when the DT overlay is removed from the Xen device tree. Signed-off-by: Henry Wang Signed-off-by: Vikram Garhwal --- v4: - Split the original patch, only do device detachment from

[PATCH v4 4/9] xen/arm/gic: Allow adding interrupt to running VMs

2024-05-23 Thread Henry Wang
state unsync issues for cases when the interrupt is active or pending in the guest, therefore for these cases we simply reject the operation. Do it for both new and old vGIC implementations. Signed-off-by: Henry Wang --- v4: - Split the original patch, only do the adding IRQ stuff in this patch. v3

[PATCH v4 2/9] xen/arm, doc: Add a DT property to specify IOMMU for Dom0less domUs

2024-05-23 Thread Henry Wang
domain construction time based on the property. Signed-off-by: Henry Wang --- v4: - No change. v3: - Use a separate variable to cache the condition from the "passthrough" flag separately to improve readability. - Update the doc to explain the default condition more clearly. v2: - New p

[PATCH v4 0/9] Remaining patches for dynamic node programming using overlay dtbo

2024-05-23 Thread Henry Wang
nryw/xen/-/pipelines/1301720278 [3] https://lore.kernel.org/xen-devel/e743d3d2-5884-4e55-8627-85985ba33...@amd.com/ Henry Wang (7): tools/xl: Correct the help information and exit code of the dt-overlay command xen/arm, doc: Add a DT property to specify IOMMU for Dom0less domUs

Re: [PATCH v3 5/8] xen/arm/gic: Allow routing/removing interrupt to running VMs

2024-05-22 Thread Henry Wang
Hi Julien, Stefano, On 5/22/2024 9:03 PM, Julien Grall wrote: Hi Henry, On 22/05/2024 02:22, Henry Wang wrote: Also, while looking at the locking, I noticed that we are not doing anything with GIC_IRQ_GUEST_MIGRATING. In gic_update_one_lr(), we seem to assume that if the flag is set, then p

Re: [PATCH v3 5/8] xen/arm/gic: Allow routing/removing interrupt to running VMs

2024-05-21 Thread Henry Wang
Hi Stefano, On 5/22/2024 9:16 AM, Stefano Stabellini wrote: On Wed, 22 May 2024, Henry Wang wrote: Hi Julien, On 5/21/2024 8:30 PM, Julien Grall wrote: Hi, On 21/05/2024 05:35, Henry Wang wrote: diff --git a/xen/arch/arm/gic-vgic.c b/xen/arch/arm/gic-vgic.c index 56490dbc43..956c11ba13

Re: [PATCH v3 5/8] xen/arm/gic: Allow routing/removing interrupt to running VMs

2024-05-21 Thread Henry Wang
Hi Julien, On 5/21/2024 8:30 PM, Julien Grall wrote: Hi, On 21/05/2024 05:35, Henry Wang wrote: diff --git a/xen/arch/arm/gic-vgic.c b/xen/arch/arm/gic-vgic.c index 56490dbc43..956c11ba13 100644 --- a/xen/arch/arm/gic-vgic.c +++ b/xen/arch/arm/gic-vgic.c @@ -439,24 +439,33 @@ int

Re: [PATCH v3] xen/arm: Set correct per-cpu cpu_core_mask

2024-05-21 Thread Henry Wang
Hi Michal, On 5/21/2024 3:47 PM, Michal Orzel wrote: Hi Henry. On 3/21/2024 11:57 AM, Henry Wang wrote: In the common sysctl command XEN_SYSCTL_physinfo, the value of cores_per_socket is calculated based on the cpu_core_mask of CPU0. Currently on Arm this is a fixed value 1 (can be checked

[PATCH v3 8/8] docs: Add device tree overlay documentation

2024-05-20 Thread Henry Wang
From: Vikram Garhwal Signed-off-by: Vikram Garhwal Signed-off-by: Stefano Stabellini Signed-off-by: Henry Wang --- v3: - No change. v2: - Update the content based on the changes in this version. --- docs/misc/arm/overlay.txt | 99 +++ 1 file changed, 99

[PATCH v3 0/8] Remaining patches for dynamic node programming using overlay dtbo

2024-05-20 Thread Henry Wang
nryw/xen/-/pipelines/1298425517 Henry Wang (6): xen/common/dt-overlay: Fix lock issue when add/remove the device tools/xl: Correct the help information and exit code of the dt-overlay command xen/arm, doc: Add a DT property to specify IOMMU for Dom0less domUs tools/arm: Introduce the "

[PATCH v3 3/8] xen/arm, doc: Add a DT property to specify IOMMU for Dom0less domUs

2024-05-20 Thread Henry Wang
domain construction time based on the property. Signed-off-by: Henry Wang --- v3: - Use a separate variable to cache the condition from the "passthrough" flag separately to improve readability. - Update the doc to explain the default condition more clearly. v2: - New patch to replace the or

[PATCH v3 1/8] xen/common/dt-overlay: Fix lock issue when add/remove the device

2024-05-20 Thread Henry Wang
ter handle_device(). Fixes: 7e5c4a8b86f1 ("xen/arm: Implement device tree node removal functionalities") Signed-off-by: Henry Wang Reviewed-by: Julien Grall --- v3: - Add Julien's Reviewed-by tag. v2: - Take the lock as soon as getting hold of overlay_node. Also release the lock aft

[PATCH v3 7/8] tools: Introduce the "xl dt-overlay {attach,detach}" commands

2024-05-20 Thread Henry Wang
k the command option parsing logic. Signed-off-by: Henry Wang --- v3: - Introduce new API libxl_dt_overlay_domain() and co., instead of reusing existing API libxl_dt_overlay(). - Add in-code comments for the LIBXL_DT_OVERLAY_* macros. - Use find_domain() to avoid getting domain_id from strto

[PATCH v3 6/8] xen/arm: Add XEN_DOMCTL_dt_overlay DOMCTL and related operations

2024-05-20 Thread Henry Wang
the Xen device tree. Signed-off-by: Henry Wang Signed-off-by: Vikram Garhwal --- v3: - Style fixes for arch-selection #ifdefs. - Do not include public/domctl.h, only add a forward declaration of struct xen_domctl_dt_overlay. - Extract the overlay track entry finding logic to a function, drop

[PATCH v3 5/8] xen/arm/gic: Allow routing/removing interrupt to running VMs

2024-05-20 Thread Henry Wang
-by: Stefano Stabellini Signed-off-by: Henry Wang --- v3: - Update in-code comments. - Correct the if conditions. - Add taking/releasing the vgic lock of the vcpu. v2: - Reject the case where the IRQ is active or pending in guest. --- xen/arch/arm/gic-vgic.c | 15 --- xen/arch/arm/gic.c

[PATCH v3 4/8] tools/arm: Introduce the "nr_spis" xl config entry

2024-05-20 Thread Henry Wang
for user to decide the number of SPIs. This would help to avoid bumping the `config->arch.nr_spis` in libxl everytime there is a new platform with increased SPI numbers. Update the doc and the golang bindings accordingly. Signed-off-by: Henry Wang --- v3: - Reword documentation to avoid ambiguity.

[PATCH v3 2/8] tools/xl: Correct the help information and exit code of the dt-overlay command

2024-05-20 Thread Henry Wang
("tools/xl: Add new xl command overlay for device tree overlay support") Suggested-by: Anthony PERARD Signed-off-by: Henry Wang Reviewed-by: Jason Andryuk --- v3: - Add Jason's Reviewed-by tag. v2: - New patch --- tools/xl/xl_cmdtable.c | 2 +- tools/xl/xl_vmcontrol.c | 6 +++--- 2 fil

Re: [PATCH v2 7/8] tools: Introduce the "xl dt-overlay {attach,detach}" commands

2024-05-20 Thread Henry Wang
Hi Jason, On 5/21/2024 3:41 AM, Jason Andryuk wrote: On 2024-05-16 06:03, Henry Wang wrote: +    domain_id = strtol(argv[optind+2], NULL, 10); domain_id = find_domain(argv[optind+2]); Good point, thanks. I will use the find_domain() in the next version. Kind regards, Henry

Re: [PATCH v2 4/8] tools/arm: Introduce the "nr_spis" xl config entry

2024-05-20 Thread Henry Wang
Hi Jason, On 5/21/2024 3:13 AM, Jason Andryuk wrote: + +=item B + +A 32-bit optional integer parameter specifying the number of SPIs (Shared I'd phrase it "An optional 32-but integer" +Peripheral Interrupts) to allocate for the domain. If the `nr_spis` parameter +is missing, the max number

Re: [PATCH v3 1/4] xen/arm/static-shmem: Static-shmem should be direct-mapped for direct-mapped domains

2024-05-20 Thread Henry Wang
Hi Michal, On 5/21/2024 12:09 AM, Michal Orzel wrote: Thanks. I will take the tag if you are ok with above diff (for the case if this series goes in later than Luca's). I would move this check to process_shm() right after "gbase = dt_read_paddr" setting. This would be the most natural

Re: [PATCH v3 1/4] xen/arm/static-shmem: Static-shmem should be direct-mapped for direct-mapped domains

2024-05-20 Thread Henry Wang
Hi Michal, On 5/20/2024 11:46 PM, Michal Orzel wrote: Hi Henry, On 20/05/2024 16:52, Henry Wang wrote: Hi Michal, Luca, On 5/20/2024 7:24 PM, Michal Orzel wrote: Hi Henry, +CC: Luca On 17/05/2024 05:21, Henry Wang wrote: To make things easier, add restriction that static shared memory

Re: [PATCH v3 1/4] xen/arm/static-shmem: Static-shmem should be direct-mapped for direct-mapped domains

2024-05-20 Thread Henry Wang
Hi Michal, Luca, On 5/20/2024 7:24 PM, Michal Orzel wrote: Hi Henry, +CC: Luca On 17/05/2024 05:21, Henry Wang wrote: To make things easier, add restriction that static shared memory should also be direct-mapped for direct-mapped domains. Check the host physical address to be matched

[PATCH] tools/golang: Add missing golang bindings for vlan

2024-05-20 Thread Henry Wang
libxl_device_nic") Signed-off-by: Henry Wang --- The code is automatically generated by: ``` ./configure make tools ``` --- tools/golang/xenlight/helpers.gen.go | 3 +++ tools/golang/xenlight/types.gen.go | 1 + 2 files changed, 4 insertions(+) diff --git a/tools/golang/xenlight/helpers.g

Re: [PATCH v3] xen/arm: Set correct per-cpu cpu_core_mask

2024-05-19 Thread Henry Wang
Hi All, Gentle ping since it has been a couple of months, any comments on this updated patch? Thanks! Kind regards, Henry On 3/21/2024 11:57 AM, Henry Wang wrote: In the common sysctl command XEN_SYSCTL_physinfo, the value of cores_per_socket is calculated based on the cpu_core_mask of CPU0

Re: [PATCH v2 3/8] xen/arm, doc: Add a DT property to specify IOMMU for Dom0less domUs

2024-05-19 Thread Henry Wang
Hi Julien, On 5/20/2024 8:41 AM, Henry Wang wrote: Hi Julien, Thanks for spending time on the review! On 5/19/2024 6:17 PM, Julien Grall wrote: Hi Henry, On 16/05/2024 11:03, Henry Wang wrote: diff --git a/docs/misc/arm/device-tree/booting.txt b/docs/misc/arm/device-tree/booting.txt index

Re: [PATCH v2 3/8] xen/arm, doc: Add a DT property to specify IOMMU for Dom0less domUs

2024-05-19 Thread Henry Wang
Hi Julien, On 5/20/2024 8:41 AM, Henry Wang wrote: Hi Julien, Thanks for spending time on the review! On 5/19/2024 6:17 PM, Julien Grall wrote: Hi Henry, On 16/05/2024 11:03, Henry Wang wrote: diff --git a/docs/misc/arm/device-tree/booting.txt b/docs/misc/arm/device-tree/booting.txt index

Re: [PATCH v2 5/8] xen/arm/gic: Allow routing/removing interrupt to running VMs

2024-05-19 Thread Henry Wang
Hi Julien, On 5/19/2024 7:08 PM, Julien Grall wrote: Hi, On 17/05/2024 07:03, Henry Wang wrote: @@ -444,14 +444,18 @@ int vgic_connect_hw_irq(struct domain *d, struct vcpu *v, unsigned int virq,   {   /* The VIRQ should not be already enabled by the guest */ This comment needs

Re: [PATCH v2 3/8] xen/arm, doc: Add a DT property to specify IOMMU for Dom0less domUs

2024-05-19 Thread Henry Wang
Hi Julien, Thanks for spending time on the review! On 5/19/2024 6:17 PM, Julien Grall wrote: Hi Henry, On 16/05/2024 11:03, Henry Wang wrote: diff --git a/docs/misc/arm/device-tree/booting.txt b/docs/misc/arm/device-tree/booting.txt index bbd955e9c2..61f9082553 100644 --- a/docs/misc/arm

Re: [PATCH v2 5/8] xen/arm/gic: Allow routing/removing interrupt to running VMs

2024-05-17 Thread Henry Wang
On 5/16/2024 6:03 PM, Henry Wang wrote: From: Vikram Garhwal Currently, routing/removing physical interrupts are only allowed at the domain creation/destroy time. For use cases such as dynamic device tree overlay adding/removing, the routing/removing of physical IRQ to running domains

[PATCH v3 3/4] tools/init-dom0less: Avoid hardcoding GUEST_MAGIC_BASE

2024-05-16 Thread Henry Wang
coding style improvements when possible. Reported-by: Alec Kwapis Signed-off-by: Henry Wang --- v3: - Only get the XenStore page. - Drop the unneeded code. v2: - Update HVMOP keys name. --- tools/helpers/init-dom0less.c | 58 +-- 1 file changed, 14 insertions

[PATCH v3 4/4] docs/features/dom0less: Update the late XenStore init protocol

2024-05-16 Thread Henry Wang
With the new allocation strategy of Dom0less DomUs XenStore page, update the doc of the late XenStore init protocol accordingly. Signed-off-by: Henry Wang --- v3: - Wording change. v2: - New patch. --- docs/features/dom0less.pandoc | 12 +++- 1 file changed, 7 insertions(+), 5 deletions

[PATCH v3 2/4] xen/arm: Alloc XenStore page for Dom0less DomUs from hypervisor

2024-05-16 Thread Henry Wang
-by: Daniel P. Smith Signed-off-by: Henry Wang --- v3: - Only allocate XenStore page. (Julien) - Set HVM_PARAM_STORE_PFN and the XenStore connection status directly from hypervisor. (Stefano) v2: - Reword the commit msg to explain what is "magic page" and use generic terminology "h

[PATCH v3 1/4] xen/arm/static-shmem: Static-shmem should be direct-mapped for direct-mapped domains

2024-05-16 Thread Henry Wang
for direct-mapped domains. Check the host physical address to be matched with guest physical address when parsing the device tree. Document this restriction in the doc. Signed-off-by: Henry Wang --- v3: - New patch. --- docs/misc/arm/device-tree/booting.txt | 3 +++ xen/arch/arm/static-shmem.c

[PATCH v3 0/4] Guest XenStore page allocation for 11 Dom0less domUs

2024-05-16 Thread Henry Wang
-desktop/ [4] https://lore.kernel.org/xen-devel/d33ea00d-890d-45cc-9583-64c953abd...@xen.org/ [5] https://lore.kernel.org/xen-devel/686ba256-f8bf-47e7-872f-d277bf7df...@xen.org/ [6] https://lore.kernel.org/xen-devel/20240517011516.1451087-1-xin.wa...@amd.com/ Henry Wang (4): xen/arm/static

Re: [PATCH v2 6/8] xen/arm: Add XEN_DOMCTL_dt_overlay DOMCTL and related operations

2024-05-16 Thread Henry Wang
Hi Jan, As usual, thanks for the review! On 5/16/2024 8:31 PM, Jan Beulich wrote: On 16.05.2024 12:03, Henry Wang wrote: +/* + * First check if dtbo is correct i.e. it should one of the dtbo which was + * used when dynamically adding the node. + * Limitation: Cases with same

Re: [PATCH] drivers/xen: Improve the late XenStore init protocol

2024-05-16 Thread Henry Wang
Hi Stefano, On 5/17/2024 8:52 AM, Stefano Stabellini wrote: On Thu, 16 May 2024, Henry Wang wrote: enum xenstore_init xen_store_domain_type; EXPORT_SYMBOL_GPL(xen_store_domain_type); @@ -751,9 +755,10 @@ static void xenbus_probe(void) { xenstored_ready = 1

[PATCH v2] drivers/xen: Improve the late XenStore init protocol

2024-05-16 Thread Henry Wang
(). Take the opportunity to enhance the check of the allocated XenStore interface can be properly mapped, and return error early if the memremap() fails. Fixes: 5b3353949e89 ("xen: add support for initializing xenstore later as HVM domain") Signed-off-by: Henry Wang Signed-off-by: Mi

[PATCH v2 3/8] xen/arm, doc: Add a DT property to specify IOMMU for Dom0less domUs

2024-05-16 Thread Henry Wang
domain construction time based on the property. Signed-off-by: Henry Wang --- v2: - New patch to replace the original patch in v1: "[PATCH 03/15] xen/arm: Always enable IOMMU" --- docs/misc/arm/device-tree/booting.txt | 13 + xen/arch/arm/dom0less-build.c | 7 +

[PATCH v2 5/8] xen/arm/gic: Allow routing/removing interrupt to running VMs

2024-05-16 Thread Henry Wang
-by: Stefano Stabellini Signed-off-by: Henry Wang --- v2: - Reject the case where the IRQ is active or pending in guest. --- xen/arch/arm/gic-vgic.c | 8 ++-- xen/arch/arm/gic.c | 15 --- xen/arch/arm/vgic/vgic.c | 5 +++-- 3 files changed, 9 insertions(+), 19 deletions

[PATCH v2 7/8] tools: Introduce the "xl dt-overlay {attach,detach}" commands

2024-05-16 Thread Henry Wang
k the command option parsing logic. Since the addition of these two commands modifies the existing libxl API libxl_dt_overlay(), also provide the backward compatible for it. Signed-off-by: Henry Wang --- v2: - New patch. --- tools/include/libxl.h | 15 - too

[PATCH v2 2/8] tools/xl: Correct the help information and exit code of the dt-overlay command

2024-05-16 Thread Henry Wang
("tools/xl: Add new xl command overlay for device tree overlay support") Suggested-by: Anthony PERARD Signed-off-by: Henry Wang --- v2: - New patch --- tools/xl/xl_cmdtable.c | 2 +- tools/xl/xl_vmcontrol.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/x

[PATCH v2 6/8] xen/arm: Add XEN_DOMCTL_dt_overlay DOMCTL and related operations

2024-05-16 Thread Henry Wang
the Xen device tree. Signed-off-by: Henry Wang Signed-off-by: Vikram Garhwal --- v2: - New patch. --- xen/arch/arm/domctl.c| 3 + xen/common/dt-overlay.c | 415 --- xen/include/public/domctl.h | 15 ++ xen/include/public/sysctl.h | 7 +- xen

[PATCH v2 8/8] docs: Add device tree overlay documentation

2024-05-16 Thread Henry Wang
From: Vikram Garhwal Signed-off-by: Vikram Garhwal Signed-off-by: Stefano Stabellini Signed-off-by: Henry Wang --- v2: - Update the content based on the changes in this version. --- docs/misc/arm/overlay.txt | 99 +++ 1 file changed, 99 insertions

[PATCH v2 4/8] tools/arm: Introduce the "nr_spis" xl config entry

2024-05-16 Thread Henry Wang
for user to decide the number of SPIs. This would help to avoid bumping the `config->arch.nr_spis` in libxl everytime there is a new platform with increased SPI numbers. Update the doc and the golang bindings accordingly. Signed-off-by: Henry Wang --- v2: - New patch to replace the original pa

[PATCH v2 1/8] xen/common/dt-overlay: Fix lock issue when add/remove the device

2024-05-16 Thread Henry Wang
ter handle_device(). Fixes: 7e5c4a8b86f1 ("xen/arm: Implement device tree node removal functionalities") Signed-off-by: Henry Wang --- v2: - Take the lock as soon as getting hold of overlay_node. Also release the lock after handle_device() when adding dtbo. v1.1: - Move the unlock position

[PATCH v2 0/8] Remaining patches for dynamic node programming using overlay dtbo

2024-05-16 Thread Henry Wang
ch 1 and 2 are fixes of the existing code which is noticed during my local tests, details please see the commit message. Gitlab CI for this series can be found in [1]. [1] https://gitlab.com/xen-project/people/henryw/xen/-/pipelines/1293126857 Henry Wang (6): xen/common/dt-overlay: Fix lock i

Re: [PATCH] drivers/xen: Improve the late XenStore init protocol

2024-05-15 Thread Henry Wang
Hi Stefano, On 5/16/2024 6:30 AM, Stefano Stabellini wrote: On Wed, 15 May 2024, Henry Wang wrote: Currently, the late XenStore init protocol is only triggered properly for the case that HVM_PARAM_STORE_PFN is ~0ULL (invalid). For the case that XenStore interface is allocated but not ready

Re: Proposal to Extend Feature Freeze Deadline

2024-05-14 Thread Henry Wang
Hi Oleksii, On 5/14/2024 11:43 PM, Andrew Cooper wrote: On 14/05/2024 4:40 pm, Oleksii K. wrote: Hello everyone, We're observing fewer merged patches/series across several architectures for the current 4.19 release in comparison to previous release. For example: 1. For Arm, significant

[PATCH] drivers/xen: Improve the late XenStore init protocol

2024-05-14 Thread Henry Wang
, and return error early if the memremap() fails. Signed-off-by: Henry Wang Signed-off-by: Michal Orzel --- drivers/xen/xenbus/xenbus_probe.c | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus

Re: [PATCH v2 1/4] xen/arm: Alloc hypervisor reserved pages as magic pages for Dom0less DomUs

2024-05-12 Thread Henry Wang
Hi Julien, On 5/11/2024 7:03 PM, Julien Grall wrote: Hi Henry, On 11/05/2024 01:56, Henry Wang wrote:   +static int __init alloc_magic_pages(struct domain *d) +{ +    struct page_info *magic_pg; +    mfn_t mfn; +    gfn_t gfn; +    int rc; + +    d->max_pages += NR_MAGIC_PAGES; +    magic

Re: [PATCH v2 1/4] xen/arm: Alloc hypervisor reserved pages as magic pages for Dom0less DomUs

2024-05-11 Thread Henry Wang
Hi Julien, On 5/11/2024 4:46 PM, Julien Grall wrote: Hi Henry, On 11/05/2024 01:56, Henry Wang wrote: There are use cases (for example using the PV driver) in Dom0less setup that require Dom0less DomUs start immediately with Dom0, but initialize XenStore later after Dom0's successful boot

Re: [PATCH 02/15] xen/arm/gic: Enable interrupt assignment to running VM

2024-05-11 Thread Henry Wang
Hi Julien, On 5/11/2024 4:22 PM, Julien Grall wrote: Hi Henry, On 11/05/2024 08:29, Henry Wang wrote: +    /* + * Handle the LR where the physical interrupt is de-assigned from the + * guest before it was EOIed + */ +    struct vcpu *v_target

Re: [PATCH 02/15] xen/arm/gic: Enable interrupt assignment to running VM

2024-05-11 Thread Henry Wang
Hi Julien, On 5/10/2024 4:54 PM, Julien Grall wrote: Hi, On 09/05/2024 16:31, Henry Wang wrote: On 5/9/2024 4:46 AM, Julien Grall wrote: Hi Henry, [...] ``` diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index a775f886ed..d3f9cd2299 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm

[PATCH v2 0/4] Guest magic region allocation for 11 Dom0less domUs - Take two

2024-05-10 Thread Henry Wang
ct/people/henryw/xen/-/pipelines/1285727622 Henry Wang (4): xen/arm: Alloc hypervisor reserved pages as magic pages for Dom0less DomUs xen/arm: Add new HVM_PARAM_HV_RSRV_{BASE_PFN,SIZE} keys in HVMOP tools/init-dom0less: Avoid hardcoding GUEST_MAGIC_BASE docs/features/dom0less: Update th

[PATCH v2 4/4] docs/features/dom0less: Update the late XenStore init protocol

2024-05-10 Thread Henry Wang
With the new allocation strategy of Dom0less DomUs magic page region, update the documentation of the late XenStore init protocol accordingly. Signed-off-by: Henry Wang --- v2: - New patch. --- docs/features/dom0less.pandoc | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff

[PATCH v2 2/4] xen/arm: Add new HVM_PARAM_HV_RSRV_{BASE_PFN,SIZE} keys in HVMOP

2024-05-10 Thread Henry Wang
h64__)". The values will be set at Dom0less DomU construction time after Dom0less DomU's magic pages region has been allocated. Reported-by: Alec Kwapis Signed-off-by: Henry Wang --- v2: - Rename the HVMOP keys to HVM_PARAM_HV_RSRV_{BASE_PFN,SIZE}. (Daniel) - Add comment on top of HVM_PARA

[PATCH v2 3/4] tools/init-dom0less: Avoid hardcoding GUEST_MAGIC_BASE

2024-05-10 Thread Henry Wang
possible. Reported-by: Alec Kwapis Signed-off-by: Henry Wang --- v2: - Update HVMOP keys name. --- tools/helpers/init-dom0less.c | 40 +++ 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/tools/helpers/init-dom0less.c b/tools/helpers/init

[PATCH v2 1/4] xen/arm: Alloc hypervisor reserved pages as magic pages for Dom0less DomUs

2024-05-10 Thread Henry Wang
es) for Arm Dom0less DomUs at the domain construction time. The base address/PFN of the region will be noted and communicated to the init-dom0less application in Dom0. Reported-by: Alec Kwapis Suggested-by: Daniel P. Smith Signed-off-by: Henry Wang --- v2: - Reword the commit msg to explain what is

Re: [PATCH 1/3] xen/arm/dom0less-build: Alloc magic pages for Dom0less DomUs from hypervisor

2024-05-10 Thread Henry Wang
Hi Michal, Thanks very much for taking a look! On 5/10/2024 3:37 PM, Michal Orzel wrote: Hi Henry, On 26/04/2024 05:14, Henry Wang wrote: There are use cases (for example using the PV driver) in Dom0less setup that require Dom0less DomUs start immediately with Dom0, but initialize XenStore

Re: [PATCH 02/15] xen/arm/gic: Enable interrupt assignment to running VM

2024-05-09 Thread Henry Wang
Hi Julien, On 5/9/2024 4:46 AM, Julien Grall wrote: Hi Henry, [...] we have 3 possible states which can be read from LR for this case : active, pending, pending and active. - I don't think we can do anything about the active state, so we should return -EBUSY and reject the whole operation of

Re: [PATCH 02/15] xen/arm/gic: Enable interrupt assignment to running VM

2024-05-08 Thread Henry Wang
Hi Julien, On 5/8/2024 5:54 AM, Julien Grall wrote: Hi Henry, What if the DT overlay is unloaded and then reloaded? Wouldn't the same interrupt be re-used? As a more generic case, this could also be a new bitstream for the FPGA. But even if the interrupt is brand new every time for the DT

Re: [PATCH 05/15] tools/libs/light: Increase nr_spi to 160

2024-05-07 Thread Henry Wang
Hi Julien, On 5/7/2024 10:35 PM, Julien Grall wrote: Hi, On 06/05/2024 06:17, Henry Wang wrote: On 5/1/2024 9:58 PM, Anthony PERARD wrote: On Wed, Apr 24, 2024 at 11:34:39AM +0800, Henry Wang wrote: Increase number of spi to 160 i.e. gic_number_lines() for Xilinx ZynqMP - 32. This was done

[PATCH v2 0/2] Some fixes for the existing dynamic dtbo code

2024-05-07 Thread Henry Wang
these fixes for now. [1] https://lore.kernel.org/xen-devel/835099c8-6cf0-4f6d-899b-07388df89...@xen.org/ [2] https://lore.kernel.org/xen-devel/eaea1986-a27e-4d6c-932f-1d0a9918861f@perard/ Henry Wang (2): xen/common/dt-overlay: Fix missing lock when remove the device tools/xl: Correct

[PATCH v2 2/2] tools/xl: Correct the help information and exit code of the dt-overlay command

2024-05-07 Thread Henry Wang
ice tree overlay support") Suggested-by: Anthony PERARD Signed-off-by: Henry Wang --- v2: - New patch --- tools/xl/xl_vmcontrol.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/xl/xl_vmcontrol.c b/tools/xl/xl_vmcontrol.c index 98f6bd2e76..02575d5d36 100644

[PATCH v2 1/2] xen/common/dt-overlay: Fix missing lock when remove the device

2024-05-07 Thread Henry Wang
the DT node will not disappear behind back. So fix the issue by taking the lock as soon as getting hold of overlay_node. Fixes: 7e5c4a8b86f1 ("xen/arm: Implement device tree node removal functionalities") Signed-off-by: Henry Wang --- v2: - Take the lock as soon as getting hold of

Re: [PATCH 02/15] xen/arm/gic: Enable interrupt assignment to running VM

2024-05-06 Thread Henry Wang
Hi Julien, On 5/1/2024 4:13 AM, Julien Grall wrote: Hi Henry, On 30/04/2024 04:50, Henry Wang wrote: On 4/25/2024 10:28 PM, Julien Grall wrote: Thanks for your feeedback. After checking the b8577547236f commit message I think I now understand your point. Do you have any suggestion about how

Re: [PATCH 08/15] tools: Add domain_id and expert mode for overlay operations

2024-05-05 Thread Henry Wang
Hi Anthony, On 5/1/2024 10:46 PM, Anthony PERARD wrote: On Wed, Apr 24, 2024 at 11:34:42AM +0800, Henry Wang wrote: From: Vikram Garhwal Add domain_id and expert mode for overlay assignment. This enables dynamic programming of nodes during runtime. Take the opportunity to fix the name

Re: [PATCH 09/15] tools/libs/light: Modify dtbo to domU linux dtbo format

2024-05-05 Thread Henry Wang
Hi Anthony, On 5/1/2024 11:09 PM, Anthony PERARD wrote: On Wed, Apr 24, 2024 at 11:34:43AM +0800, Henry Wang wrote: diff --git a/tools/libs/light/libxl_dt_overlay.c b/tools/libs/light/libxl_dt_overlay.c index cdb62b28cf..eaf11a0f9c 100644 --- a/tools/libs/light/libxl_dt_overlay.c +++ b/tools

Re: [PATCH 07/15] xen/overlay: Enable device tree overlay assignment to running domains

2024-05-05 Thread Henry Wang
Hi Julien, On 4/30/2024 5:47 PM, Julien Grall wrote: On 30/04/2024 05:00, Henry Wang wrote: Hi Julien, Hi Henry, On 4/30/2024 1:34 AM, Julien Grall wrote: On 29/04/2024 04:36, Henry Wang wrote: Hi Jan, Julien, Stefano, Hi Henry, On 4/24/2024 2:05 PM, Jan Beulich wrote: On 24.04.2024

Re: [PATCH 05/15] tools/libs/light: Increase nr_spi to 160

2024-05-05 Thread Henry Wang
Hi Anthony, (+Arm maintainers) On 5/1/2024 9:58 PM, Anthony PERARD wrote: On Wed, Apr 24, 2024 at 11:34:39AM +0800, Henry Wang wrote: Increase number of spi to 160 i.e. gic_number_lines() for Xilinx ZynqMP - 32. This was done to allocate and assign IRQs to a running domain. Signed-off

Re: [PATCH 04/15] tools/libs/light: Always enable IOMMU

2024-05-05 Thread Henry Wang
Hi Anthony, On 5/1/2024 9:47 PM, Anthony PERARD wrote: On Wed, Apr 24, 2024 at 11:34:38AM +0800, Henry Wang wrote: For overlay with iommu functionality to work with running VMs, we need to enable IOMMU when iomem presents for the domains. Signed-off-by: Vikram Garhwal Signed-off-by: Henry

Re: [PATCH 07/15] xen/overlay: Enable device tree overlay assignment to running domains

2024-05-05 Thread Henry Wang
Hi Stefano, Julien, On 5/3/2024 2:02 AM, Stefano Stabellini wrote: On Tue, 30 Apr 2024, Henry Wang wrote: Hi Julien, On 4/30/2024 1:34 AM, Julien Grall wrote: On 29/04/2024 04:36, Henry Wang wrote: Hi Jan, Julien, Stefano, Hi Henry, On 4/24/2024 2:05 PM, Jan Beulich wrote: On 24.04.2024

Re: [PATCH 1/3] xen/arm/dom0less-build: Alloc magic pages for Dom0less DomUs from hypervisor

2024-05-05 Thread Henry Wang
Hi Daniel, On 4/30/2024 6:22 PM, Daniel P. Smith wrote: On 4/29/24 22:55, Henry Wang wrote: Hi Daniel, On 4/30/2024 8:27 AM, Daniel P. Smith wrote: On 4/25/24 23:14, Henry Wang wrote: There are use cases (for example using the PV driver) in Dom0less setup that require Dom0less DomUs start

Re: [PATCH v1.1] xen/commom/dt-overlay: Fix missing lock when remove the device

2024-05-05 Thread Henry Wang
Hi Julien, On 5/3/2024 9:04 PM, Julien Grall wrote: Hi Henry, On 26/04/2024 02:55, Henry Wang wrote: If CONFIG_DEBUG=y, below assertion will be triggered: (XEN) Assertion 'rw_is_locked(_host_lock)' failed at drivers/passthrough/device_tree.c:146 (XEN) [ Xen-4.19-unstable  arm64  debug=y

Re: [PATCH 2/3] xen/arm, tools: Add a new HVM_PARAM_MAGIC_BASE_PFN key in HVMOP

2024-05-05 Thread Henry Wang
Hi Stefano, On 5/3/2024 2:08 AM, Stefano Stabellini wrote: On Fri, 26 Apr 2024, Henry Wang wrote: For use cases such as Dom0less PV drivers, a mechanism to communicate Dom0less DomU's static data with the runtime control plane (Dom0) is needed. Since on Arm HVMOP is already the existing

Re: [PATCH 2/3] xen/arm, tools: Add a new HVM_PARAM_MAGIC_BASE_PFN key in HVMOP

2024-04-30 Thread Henry Wang
Hi Jan, On 4/30/2024 2:11 PM, Jan Beulich wrote: On 30.04.2024 04:51, Henry Wang wrote: On 4/30/2024 8:31 AM, Daniel P. Smith wrote: On 4/26/24 02:21, Jan Beulich wrote: On 26.04.2024 05:14, Henry Wang wrote: --- a/xen/include/public/hvm/params.h +++ b/xen/include/public/hvm/params.h

Re: [PATCH 07/15] xen/overlay: Enable device tree overlay assignment to running domains

2024-04-29 Thread Henry Wang
Hi Julien, On 4/30/2024 1:34 AM, Julien Grall wrote: On 29/04/2024 04:36, Henry Wang wrote: Hi Jan, Julien, Stefano, Hi Henry, On 4/24/2024 2:05 PM, Jan Beulich wrote: On 24.04.2024 05:34, Henry Wang wrote: --- a/xen/include/public/sysctl.h +++ b/xen/include/public/sysctl.h @@ -1197,7

Re: [PATCH 02/15] xen/arm/gic: Enable interrupt assignment to running VM

2024-04-29 Thread Henry Wang
Hi Julien, Sorry for the late reply, On 4/25/2024 10:28 PM, Julien Grall wrote: Hi, On 25/04/2024 08:06, Henry Wang wrote: Hi Julien, On 4/24/2024 8:58 PM, Julien Grall wrote: Hi Henry, On 24/04/2024 04:34, Henry Wang wrote: From: Vikram Garhwal Enable interrupt assign/remove

Re: [PATCH 1/3] xen/arm/dom0less-build: Alloc magic pages for Dom0less DomUs from hypervisor

2024-04-29 Thread Henry Wang
Hi Daniel, On 4/30/2024 8:27 AM, Daniel P. Smith wrote: On 4/25/24 23:14, Henry Wang wrote: There are use cases (for example using the PV driver) in Dom0less setup that require Dom0less DomUs start immediately with Dom0, but initialize XenStore later after Dom0's successful boot and call

Re: [PATCH 2/3] xen/arm, tools: Add a new HVM_PARAM_MAGIC_BASE_PFN key in HVMOP

2024-04-29 Thread Henry Wang
Hi Daniel, On 4/30/2024 8:31 AM, Daniel P. Smith wrote: On 4/26/24 02:21, Jan Beulich wrote: On 26.04.2024 05:14, Henry Wang wrote: --- a/xen/include/public/hvm/params.h +++ b/xen/include/public/hvm/params.h @@ -76,6 +76,7 @@    */   #define HVM_PARAM_STORE_PFN    1   #define

Re: [PATCH 07/15] xen/overlay: Enable device tree overlay assignment to running domains

2024-04-28 Thread Henry Wang
Hi Jan, Julien, Stefano, On 4/24/2024 2:05 PM, Jan Beulich wrote: On 24.04.2024 05:34, Henry Wang wrote: --- a/xen/include/public/sysctl.h +++ b/xen/include/public/sysctl.h @@ -1197,7 +1197,9 @@ struct xen_sysctl_dt_overlay { #define XEN_SYSCTL_DT_OVERLAY_ADD 1 #define

Re: [PATCH 2/3] xen/arm, tools: Add a new HVM_PARAM_MAGIC_BASE_PFN key in HVMOP

2024-04-26 Thread Henry Wang
Hi Jan, On 4/26/2024 2:50 PM, Jan Beulich wrote: On 26.04.2024 08:30, Henry Wang wrote: On 4/26/2024 2:21 PM, Jan Beulich wrote: On 26.04.2024 05:14, Henry Wang wrote: --- a/xen/include/public/hvm/params.h +++ b/xen/include/public/hvm/params.h @@ -76,6 +76,7 @@ */ #define

Re: [PATCH 2/3] xen/arm, tools: Add a new HVM_PARAM_MAGIC_BASE_PFN key in HVMOP

2024-04-26 Thread Henry Wang
Hi Jan, On 4/26/2024 2:21 PM, Jan Beulich wrote: On 26.04.2024 05:14, Henry Wang wrote: --- a/xen/include/public/hvm/params.h +++ b/xen/include/public/hvm/params.h @@ -76,6 +76,7 @@ */ #define HVM_PARAM_STORE_PFN1 #define HVM_PARAM_STORE_EVTCHN 2 +#define HVM_PARAM_MAGIC_BASE_PFN

Re: [PATCH v4 0/5] DOMCTL-based guest magic region allocation for 11 domUs

2024-04-25 Thread Henry Wang
Hi Stefano, Daniel, On 4/26/2024 6:18 AM, Stefano Stabellini wrote: On Thu, 18 Apr 2024, Daniel P. Smith wrote: On 4/9/24 00:53, Henry Wang wrote: An error message can seen from the init-dom0less application on direct-mapped 1:1 domains: ``` Allocating magic pages memory.c:238:d0v0 mfn

[PATCH 2/3] xen/arm, tools: Add a new HVM_PARAM_MAGIC_BASE_PFN key in HVMOP

2024-04-25 Thread Henry Wang
(). Reported-by: Alec Kwapis Signed-off-by: Henry Wang --- tools/libs/guest/xg_dom_arm.c | 2 ++ xen/arch/arm/dom0less-build.c | 2 ++ xen/arch/arm/hvm.c | 1 + xen/include/public/hvm/params.h | 1 + 4 files changed, 6 insertions(+) diff --git a/tools/libs/guest/xg_dom_arm.c b/tools

[PATCH 0/3] Guest magic region allocation for 11 Dom0less domUs - Take two

2024-04-25 Thread Henry Wang
in.wa...@amd.com/ [2] https://lore.kernel.org/xen-devel/c7857223-eab8-409a-b618-6ec70f616...@apertussolutions.com/ [3] https://lore.kernel.org/xen-devel/alpine.DEB.2.22.394.2404251508470.3940@ubuntu-linux-20-04-desktop/ [4] https://gitlab.com/xen-project/people/henryw/xen/-/pipelines/1268643360 H

[PATCH 3/3] tools/init-dom0less: Avoid hardcoding GUEST_MAGIC_BASE

2024-04-25 Thread Henry Wang
possible. Reported-by: Alec Kwapis Signed-off-by: Henry Wang --- tools/helpers/init-dom0less.c | 38 +++ 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/tools/helpers/init-dom0less.c b/tools/helpers/init-dom0less.c index fee93459c4..7f6953a818

[PATCH 1/3] xen/arm/dom0less-build: Alloc magic pages for Dom0less DomUs from hypervisor

2024-04-25 Thread Henry Wang
Reported-by: Alec Kwapis Suggested-by: Daniel P. Smith Signed-off-by: Henry Wang --- tools/libs/guest/xg_dom_arm.c | 1 - xen/arch/arm/dom0less-build.c | 22 ++ xen/include/public/arch-arm.h | 1 + 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/tools/

[PATCH v1.1] xen/commom/dt-overlay: Fix missing lock when remove the device

2024-04-25 Thread Henry Wang
the lock properly. Fixes: 7e5c4a8b86f1 ("xen/arm: Implement device tree node removal functionalities") Signed-off-by: Henry Wang --- v1.1: - Move the unlock position before the check of rc. --- xen/common/dt-overlay.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/comm

Re: [PATCH 11/15] tools/helpers: Add get_overlay

2024-04-25 Thread Henry Wang
Hi Stewart, On 4/26/2024 9:45 AM, Stewart Hildebrand wrote: On 4/24/24 20:43, Henry Wang wrote: Hi Jan, On 4/24/2024 2:08 PM, Jan Beulich wrote: On 24.04.2024 05:34, Henry Wang wrote: From: Vikram Garhwal This user level application copies the overlay dtbo shared by dom0 while doing

Re: [PATCH 02/15] xen/arm/gic: Enable interrupt assignment to running VM

2024-04-25 Thread Henry Wang
Hi Julien, On 4/24/2024 8:58 PM, Julien Grall wrote: Hi Henry, On 24/04/2024 04:34, Henry Wang wrote: From: Vikram Garhwal Enable interrupt assign/remove for running VMs in CONFIG_OVERLAY_DTB. Currently, irq_route and mapping is only allowed at the domain creation. Adding exception

Re: [PATCH 14/15] add a domU script to fetch overlays and applying them to linux

2024-04-25 Thread Henry Wang
Hi Jan, On 4/25/2024 2:46 PM, Jan Beulich wrote: On 25.04.2024 02:54, Henry Wang wrote: On 4/24/2024 2:16 PM, Jan Beulich wrote: On 24.04.2024 05:34, Henry Wang wrote: From: Vikram Garhwal Introduce a shell script that runs in the background and calls get_overlay to retrive overlays

Re: [PATCH 03/15] xen/arm: Always enable IOMMU

2024-04-24 Thread Henry Wang
Hi Julien, On 4/24/2024 9:03 PM, Julien Grall wrote: Hi Henry, On 24/04/2024 04:34, Henry Wang wrote: From: Vikram Garhwal For overlay with iommu functionality to work with running VMs, we need to enable IOMMU by default for the domains. Signed-off-by: Vikram Garhwal Signed-off

Re: [PATCH 14/15] add a domU script to fetch overlays and applying them to linux

2024-04-24 Thread Henry Wang
Hi Jan, On 4/24/2024 2:16 PM, Jan Beulich wrote: On 24.04.2024 05:34, Henry Wang wrote: From: Vikram Garhwal Introduce a shell script that runs in the background and calls get_overlay to retrive overlays and add them (or remove them) to Linux device tree (running as a domU). Signed-off

  1   2   3   4   5   6   7   8   9   10   >