From: Jan Beulich <jbeulich@suse.com>
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: "Romain Caritey" <Romain.Caritey@microchip.com>,
"Baptiste Le Duc" <baptiste.le-duc@vates.tech>,
"Alistair Francis" <alistair.francis@wdc.com>,
"Connor Davis" <connojdavis@gmail.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Michal Orzel" <michal.orzel@amd.com>,
"Julien Grall" <julien@xen.org>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v4 16/25] xen/riscv: introduce minimal virtual APLIC (vAPLIC) infrastructure
Date: Mon, 29 Jun 2026 17:02:28 +0200 [thread overview]
Message-ID: <c6f63b4b-1237-4992-bf83-07569d2e6339@suse.com> (raw)
In-Reply-To: <61603c1548b7c685fb92e1b687445fc1b6a95c35.1782487661.git.oleksii.kurochko@gmail.com>
On 26.06.2026 17:46, Oleksii Kurochko wrote:
> Changes in v4:
> - Change subject of the commit.
> - s/APLIC_DOMAINCFG_RO80/APLIC_DOMAINCFG_RO + added a comment above definition.
> - Drop unnessary blank lines.
Did you? What about ...
> --- a/xen/arch/riscv/include/asm/aplic.h
> +++ b/xen/arch/riscv/include/asm/aplic.h
> @@ -15,6 +15,9 @@
>
> #include <asm/imsic.h>
>
> +
> +/* domaincfg bits 31:24 are read-only 0x80 */
> +#define APLIC_DOMAINCFG_RO (0x80U << 24)
> #define APLIC_DOMAINCFG_IE BIT(8, U)
> #define APLIC_DOMAINCFG_DM BIT(2, U)
... the one you pointlessly add here?
> --- a/xen/arch/riscv/include/asm/intc.h
> +++ b/xen/arch/riscv/include/asm/intc.h
> @@ -15,6 +15,7 @@ enum intc_version {
> struct cpu_user_regs;
> struct irq_desc;
> struct kernel_info;
> +struct vcpu;
>
> struct intc_info {
> enum intc_version hw_version;
> @@ -51,8 +52,17 @@ struct vintc_init_ops {
> int (*make_domu_dt_node)(struct kernel_info *kinfo);
> };
>
> +struct vintc_ops {
> + /* Initialize some vINTC-related stuff for a vCPU */
> + int (*vcpu_init)(struct vcpu *v);
> +
> + /* Deinitialize some vINTC-related stuff for a vCPU */
> + void (*vcpu_deinit)(struct vcpu *v);
> +};
> +
> struct vintc {
> const struct vintc_init_ops *init_ops;
> + const struct vintc_ops *ops;
> };
I may have asked before: Why two distinct structures, next to each other
(and without any comment guiding what is to go where)? Plus you only set
...
> --- /dev/null
> +++ b/xen/arch/riscv/vaplic.c
> @@ -0,0 +1,63 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * xen/arch/riscv/vaplic.c
> + *
> + * Virtual RISC-V Advanced Platform-Level Interrupt Controller support
> + *
> + * Copyright (c) Microchip.
> + * Copyright (c) Vates
> + */
> +
> +#include <xen/errno.h>
> +#include <xen/sched.h>
> +#include <xen/xvmalloc.h>
> +
> +#include <asm/aia.h>
> +#include <asm/imsic.h>
> +#include <asm/intc.h>
> +#include <asm/vaplic.h>
> +
> +#include "aplic-priv.h"
> +
> +static int cf_check vaplic_init(struct vcpu *v)
> +{
> + return vcpu_imsic_init(v);
> +}
> +
> +static void cf_check vaplic_deinit(struct vcpu *v)
> +{
> + return vcpu_imsic_deinit(v);
> +}
> +
> +static const struct vintc_ops vintc_ops = {
> + .vcpu_init = vaplic_init,
> + .vcpu_deinit = vaplic_deinit,
> +};
> +
> +int domain_vaplic_init(struct domain *d)
> +{
> + struct vaplic *vaplic = xvzalloc(struct vaplic);
> +
> + if ( !vaplic )
> + return -ENOMEM;
> +
> + d->arch.vintc = &vaplic->vintc;
> + d->arch.vintc->ops = &vintc_ops;
> +
> + vaplic->regs.domaincfg = APLIC_DOMAINCFG_IE | APLIC_DOMAINCFG_DM |
> + APLIC_DOMAINCFG_RO;
> +
> + return 0;
> +}
... ->ops here, leaving ->init_ops at NULL (prone to a deref that'll crash).
Jan
next prev parent reply other threads:[~2026-06-29 15:02 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-26 15:46 [PATCH v4 00/25] Introduce enablemenant of dom0less Oleksii Kurochko
2026-06-26 15:46 ` [PATCH v4 01/25] xen/dom0less: turn max_init_domid into a common variable Oleksii Kurochko
2026-06-29 14:34 ` Jan Beulich
2026-06-26 15:46 ` [PATCH v4 02/25] xen: arm: move declaration of map_device_irqs_to_domain() to common header Oleksii Kurochko
2026-06-29 7:10 ` Orzel, Michal
2026-06-26 15:46 ` [PATCH v4 03/25] xen: arm: update p2m_set_allocation() prototype Oleksii Kurochko
2026-06-29 7:14 ` Orzel, Michal
2026-06-26 15:46 ` [PATCH v4 04/25] xen/Kconfig: introduce HAS_STATIC_MEMORY Oleksii Kurochko
2026-06-29 7:05 ` Jan Beulich
2026-06-29 7:24 ` Orzel, Michal
2026-06-26 15:46 ` [PATCH v4 05/25] xen/riscv: Implement ARCH_PAGING_MEMPOOL Oleksii Kurochko
2026-06-26 15:46 ` [PATCH v4 06/25] xen/riscv: Implement construct_domain() Oleksii Kurochko
2026-06-26 15:46 ` [PATCH v4 07/25] xen/riscv: implement prerequisites for domain_create() Oleksii Kurochko
2026-06-26 15:46 ` [PATCH v4 08/25] xen/riscv: introduce guest riscv,isa string Oleksii Kurochko
2026-06-29 14:46 ` Jan Beulich
2026-06-30 16:06 ` Oleksii Kurochko
2026-07-01 6:22 ` Jan Beulich
2026-07-01 7:44 ` Oleksii Kurochko
2026-06-26 15:46 ` [PATCH v4 09/25] xen/riscv: implement make_cpus_node() Oleksii Kurochko
2026-06-26 15:46 ` [PATCH v4 10/25] xen/riscv: implement make_timer_node() Oleksii Kurochko
2026-06-26 15:46 ` [PATCH v4 11/25] xen/riscv: implement make_arch_nodes() Oleksii Kurochko
2026-06-29 7:07 ` Jan Beulich
2026-06-26 15:46 ` [PATCH v4 12/25] xen/riscv: introduce init interrupt controller operations Oleksii Kurochko
2026-06-26 15:46 ` [PATCH v4 13/25] xen/riscv: implement make_intc_domU_node() Oleksii Kurochko
2026-06-26 15:46 ` [PATCH v4 14/25] xen/riscv: introduce aia_init() and aia_usable() Oleksii Kurochko
2026-06-29 9:54 ` Oleksii Kurochko
2026-06-26 15:46 ` [PATCH v4 15/25] xen/riscv: introduce per-vCPU IMSIC state Oleksii Kurochko
2026-06-29 14:54 ` Jan Beulich
2026-06-26 15:46 ` [PATCH v4 16/25] xen/riscv: introduce minimal virtual APLIC (vAPLIC) infrastructure Oleksii Kurochko
2026-06-29 15:02 ` Jan Beulich [this message]
2026-07-01 10:24 ` Oleksii Kurochko
2026-06-26 15:46 ` [PATCH v4 17/25] xen/riscv: rename enum intc_version to intc_variant Oleksii Kurochko
2026-06-29 15:04 ` Jan Beulich
2026-07-01 10:32 ` Oleksii Kurochko
2026-06-26 15:46 ` [PATCH v4 18/25] xen/riscv: introduce (de)initialization helpers for vINTC Oleksii Kurochko
2026-06-29 15:07 ` Jan Beulich
2026-07-01 10:52 ` Oleksii Kurochko
2026-06-26 15:46 ` [PATCH v4 19/25] xen/riscv: generate IMSIC DT node for guest domains Oleksii Kurochko
2026-06-29 15:19 ` Jan Beulich
2026-07-01 11:21 ` Oleksii Kurochko
2026-07-01 11:55 ` Jan Beulich
2026-07-01 12:04 ` Oleksii Kurochko
2026-06-26 15:46 ` [PATCH v4 20/25] xen/riscv: create APLIC " Oleksii Kurochko
2026-06-29 15:26 ` Jan Beulich
2026-07-01 11:55 ` Oleksii Kurochko
2026-07-01 11:58 ` Jan Beulich
2026-06-26 15:46 ` [PATCH v4 21/25] xen/riscv: implement IRQ routing for device passthrough Oleksii Kurochko
2026-06-29 15:55 ` Jan Beulich
2026-07-01 14:49 ` Oleksii Kurochko
2026-07-02 6:38 ` Jan Beulich
2026-07-02 9:33 ` Oleksii Kurochko
2026-07-02 14:32 ` Jan Beulich
2026-07-02 16:04 ` Oleksii Kurochko
2026-07-03 7:21 ` Jan Beulich
2026-07-03 10:34 ` Oleksii Kurochko
2026-06-26 15:46 ` [PATCH v4 22/25] xen/riscv: implement init_intc_phandle() Oleksii Kurochko
2026-06-26 15:46 ` [PATCH v4 23/25] xen/riscv: initialize RCU, scheduler, and system domains in start_xen() Oleksii Kurochko
2026-06-26 15:46 ` [PATCH v4 24/25] xen/riscv: provide init_vuart() Oleksii Kurochko
2026-06-26 15:46 ` [PATCH v4 25/25] xen/riscv: add initial dom0less infrastructure support Oleksii Kurochko
2026-06-30 7:28 ` Jan Beulich
2026-07-01 15:24 ` Oleksii Kurochko
2026-07-02 6:41 ` Jan Beulich
2026-07-02 9:48 ` Oleksii Kurochko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c6f63b4b-1237-4992-bf83-07569d2e6339@suse.com \
--to=jbeulich@suse.com \
--cc=Romain.Caritey@microchip.com \
--cc=alistair.francis@wdc.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=baptiste.le-duc@vates.tech \
--cc=connojdavis@gmail.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=oleksii.kurochko@gmail.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.