All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Alistair Francis <alistair.francis@wdc.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2 37/39] xen/rirscv: add minimal amount of stubs to build full Xen
Date: Mon, 18 Dec 2023 18:00:55 +0100	[thread overview]
Message-ID: <f52b19eb-7633-48df-85b9-c6a545dc4232@suse.com> (raw)
In-Reply-To: <091887466560fbd6b66239f7fee5193eb97570b9.1700761381.git.oleksii.kurochko@gmail.com>

On 24.11.2023 11:30, Oleksii Kurochko wrote:
> --- a/xen/arch/riscv/mm.c
> +++ b/xen/arch/riscv/mm.c
> @@ -1,19 +1,23 @@
>  /* SPDX-License-Identifier: GPL-2.0-only */
>  
> +#include <xen/bug.h>
>  #include <xen/cache.h>
>  #include <xen/compiler.h>
>  #include <xen/init.h>
>  #include <xen/kernel.h>
>  #include <xen/macros.h>
> +#include <xen/mm.h>
>  #include <xen/pfn.h>
>  
>  #include <asm/early_printk.h>
>  #include <asm/csr.h>
>  #include <asm/current.h>
> -#include <asm/mm.h>
>  #include <asm/page.h>
>  #include <asm/processor.h>
>  
> +unsigned long frametable_base_pdx __read_mostly;
> +unsigned long frametable_virt_end __read_mostly;

Nit (style):

unsigned long __read_mostly frametable_base_pdx;
unsigned long __read_mostly frametable_virt_end;

(i.e. attributes generally between type and identifier). Plus
__read_mostly or __ro_after_init?

> @@ -294,3 +298,49 @@ unsigned long __init calc_phys_offset(void)
>      phys_offset = load_start - XEN_VIRT_START;
>      return phys_offset;
>  }
> +
> +void put_page(struct page_info *page)
> +{
> +    assert_failed(__func__);
> +}
> +
> +unsigned long get_upper_mfn_bound(void)
> +{
> +    /* No memory hotplug yet, so current memory limit is the final one. */
> +    return max_page - 1;
> +}
> +
> +void arch_dump_shared_mem_info(void)
> +{
> +    WARN();
> +}
> +
> +int populate_pt_range(unsigned long virt, unsigned long nr_mfns)
> +{
> +    assert_failed(__func__);
> +    return -1;
> +}

Whats the pattern between picking WARN(), assert_failed() (which I don't
think you should be using anyway; if an assertion, then ASSERT_UNREACHABLE())
and BUG() (as used earlier in stubs living in header files)?

> --- /dev/null
> +++ b/xen/arch/riscv/stubs.c
> @@ -0,0 +1,426 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +#include <xen/cpumask.h>
> +#include <xen/domain.h>
> +#include <xen/irq.h>
> +#include <xen/nodemask.h>
> +#include <xen/time.h>
> +#include <public/domctl.h>
> +#include <public/vm_event.h>

I think I can see why you need the former of these last two, but do you
really need the latter?

> +#include <asm/current.h>
> +
> +/* smpboot.c */
> +
> +cpumask_t cpu_online_map;
> +cpumask_t cpu_present_map;
> +cpumask_t cpu_possible_map;
> +
> +/* ID of the PCPU we're running on */
> +DEFINE_PER_CPU(unsigned int, cpu_id);
> +/* XXX these seem awfully x86ish... */
> +/* representing HT siblings of each logical CPU */
> +DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_sibling_mask);
> +/* representing HT and core siblings of each logical CPU */
> +DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_core_mask);
> +
> +nodemask_t __read_mostly node_online_map = { { [0] = 1UL } };
> +
> +/* time.c */
> +
> +unsigned long __read_mostly cpu_khz;  /* CPU clock frequency in kHz. */
> +
> +s_time_t get_s_time(void)
> +{
> +    BUG();
> +}
> +
> +int reprogram_timer(s_time_t timeout)
> +{
> +    BUG();
> +}
> +
> +void send_timer_event(struct vcpu *v)
> +{
> +    BUG();
> +}
> +
> +void domain_set_time_offset(struct domain *d, int64_t time_offset_seconds)
> +{
> +    BUG();
> +}
> +
> +/* shutdown.c */
> +
> +void machine_restart(unsigned int delay_millisecs)
> +{
> +    BUG();
> +}
> +
> +void machine_halt(void)
> +{
> +    BUG();
> +}
> +
> +/* vm_event.c */
> +
> +void vm_event_fill_regs(vm_event_request_t *req)
> +{
> +    BUG();
> +}
> +
> +void vm_event_set_registers(struct vcpu *v, vm_event_response_t *rsp)
> +{
> +    BUG();
> +}
> +
> +void vm_event_monitor_next_interrupt(struct vcpu *v)
> +{
> +    /* Not supported on RISCV. */
> +}
> +
> +void vm_event_reset_vmtrace(struct vcpu *v)
> +{
> +    /* Not supported on RISCV. */
> +}
> +
> +/* domctl.c */
> +
> +long arch_do_domctl(struct xen_domctl *domctl, struct domain *d,
> +                    XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
> +{
> +    BUG();
> +}
> +
> +void arch_get_domain_info(const struct domain *d,
> +                          struct xen_domctl_getdomaininfo *info)
> +{
> +    BUG();
> +}
> +
> +void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c)
> +{
> +    BUG();
> +}
> +
> +/* monitor.c */
> +
> +int arch_monitor_domctl_event(struct domain *d,
> +                              struct xen_domctl_monitor_op *mop)
> +{
> +    BUG();
> +}
> +
> +/* smp.c */
> +
> +void arch_flush_tlb_mask(const cpumask_t *mask)
> +{
> +    BUG();
> +}
> +
> +void smp_send_event_check_mask(const cpumask_t *mask)
> +{
> +    BUG();
> +}
> +
> +void smp_send_call_function_mask(const cpumask_t *mask)
> +{
> +    BUG();
> +}
> +
> +/* irq.c */
> +
> +struct pirq *alloc_pirq_struct(struct domain *d)
> +{
> +    BUG();
> +}
> +
> +int pirq_guest_bind(struct vcpu *v, struct pirq *pirq, int will_share)
> +{
> +    BUG();
> +}
> +
> +void pirq_guest_unbind(struct domain *d, struct pirq *pirq)
> +{
> +    BUG();
> +}
> +
> +void pirq_set_affinity(struct domain *d, int pirq, const cpumask_t *mask)
> +{
> +    BUG();
> +}
> +
> +static void ack_none(struct irq_desc *irq)
> +{
> +    BUG();
> +}
> +
> +static void end_none(struct irq_desc *irq)
> +{
> +    BUG();
> +}

Much like I said for PPC - I don't think you need the two, as ...

> +hw_irq_controller no_irq_type = {
> +    .typename = "none",
> +    .startup = irq_startup_none,
> +    .shutdown = irq_shutdown_none,
> +    .enable = irq_enable_none,
> +    .disable = irq_disable_none,
> +    .ack = ack_none,
> +    .end = end_none

... there's nothing right now to invoke these hooks.

Jan


  reply	other threads:[~2023-12-18 17:01 UTC|newest]

Thread overview: 140+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-24 10:30 [PATCH v2 00/39] Enable build of full Xen for RISC-V Oleksii Kurochko
2023-11-24 10:30 ` [PATCH v2 01/39] xen/riscv: disable unnecessary configs Oleksii Kurochko
2023-12-05 15:38   ` Jan Beulich
2023-12-07  9:22     ` Oleksii
2023-12-07 10:00       ` Jan Beulich
2023-12-07 13:44         ` Oleksii
2023-12-07 14:11           ` Jan Beulich
2023-12-07 14:51             ` Oleksii
2023-12-07 15:18               ` Jan Beulich
2023-11-24 10:30 ` [PATCH v2 02/39] xen/riscv: use some asm-generic headers Oleksii Kurochko
2023-12-05 15:40   ` Jan Beulich
2023-12-07  9:36     ` Oleksii
2023-11-24 10:30 ` [PATCH v2 03/39] xen/riscv:introduce asm/byteorder.h Oleksii Kurochko
2023-12-05 15:48   ` Jan Beulich
2023-11-24 10:30 ` [PATCH v2 04/39] xen/riscv: add public arch-riscv.h Oleksii Kurochko
2023-12-14 13:20   ` Jan Beulich
2023-11-24 10:30 ` [PATCH v2 05/39] xen/riscv: introduce spinlock.h Oleksii Kurochko
2023-12-05 15:53   ` Jan Beulich
2023-11-24 10:30 ` [PATCH v2 06/39] xen/riscv: introduce fence.h Oleksii Kurochko
2023-12-05 15:56   ` Jan Beulich
2023-12-07  9:42     ` Oleksii
2023-12-07  9:45       ` Jan Beulich
2023-11-24 10:30 ` [PATCH v2 07/39] xen/riscv: introduce arch-riscv/hvm/save.h Oleksii Kurochko
2023-12-05 15:59   ` Jan Beulich
2023-12-07 18:09     ` Shawn Anastasio
2023-12-20 20:05     ` Oleksii
2023-12-21  7:58       ` Jan Beulich
2023-12-21  9:42         ` Oleksii
2023-11-24 10:30 ` [PATCH v2 08/39] xen/riscv: introduce asm/cpufeature.h Oleksii Kurochko
2023-12-07 14:19   ` Jan Beulich
2023-12-07 14:25     ` Jan Beulich
2023-12-08  9:21       ` Oleksii
2023-11-24 10:30 ` [PATCH v2 09/39] xen/riscv: introduce asm/guest_atomics.h Oleksii Kurochko
2023-12-07 14:20   ` Jan Beulich
2023-12-08  9:22     ` Oleksii
2023-11-24 10:30 ` [PATCH v2 10/39] xen/riscv: introduce asm/iommu.h Oleksii Kurochko
2023-12-07 14:22   ` Jan Beulich
2023-12-08  9:29     ` Oleksii
2023-12-08 10:21       ` Jan Beulich
2023-11-24 10:30 ` [PATCH v2 11/39] xen/riscv: introduce asm/nospec.h Oleksii Kurochko
2023-12-07 14:28   ` Jan Beulich
2023-12-08  9:33     ` Oleksii
2023-12-08 10:23       ` Jan Beulich
2023-11-24 10:30 ` [PATCH v2 12/39] xen/riscv: introduce asm/setup.h Oleksii Kurochko
2023-12-07 14:29   ` Jan Beulich
2023-11-24 10:30 ` [PATCH v2 13/39] xen/riscv: introduce asm/system.h Oleksii Kurochko
2023-12-07 15:07   ` Jan Beulich
2023-12-08  9:43     ` Oleksii
2023-11-24 10:30 ` [PATCH v2 14/39] xen/riscv: introduce bitops.h Oleksii Kurochko
2023-12-07 15:37   ` Jan Beulich
2023-12-08  9:50     ` Oleksii
2023-11-24 10:30 ` [PATCH v2 15/39] xen/riscv: introduce flushtlb.h Oleksii Kurochko
2023-12-07 15:39   ` Jan Beulich
2023-11-24 10:30 ` [PATCH v2 16/39] xen/riscv: introduce asm/smp.h Oleksii Kurochko
2023-12-07 15:43   ` Jan Beulich
2023-12-08  9:53     ` Oleksii
2023-11-24 10:30 ` [PATCH v2 17/39] xen/riscv: introduce asm/atomic.h Oleksii Kurochko
2023-12-07 15:57   ` Jan Beulich
2023-12-21 15:11     ` Oleksii
2023-11-24 10:30 ` [PATCH v2 18/39] xen/riscv: introduce cmpxchg.h Oleksii Kurochko
2023-12-12 16:51   ` Jan Beulich
2023-12-12 17:14     ` Oleksii
2023-11-24 10:30 ` [PATCH v2 19/39] xen/riscv: introduce asm/io.h Oleksii Kurochko
2023-12-12 16:56   ` Jan Beulich
2023-11-24 10:30 ` [PATCH v2 20/39] xen/riscv: define bug frame tables in xen.lds.S Oleksii Kurochko
2023-12-12 16:57   ` Jan Beulich
2023-11-24 10:30 ` [PATCH v2 21/39] xen/riscv: introduce bit operations Oleksii Kurochko
2023-12-14 13:27   ` Jan Beulich
2023-12-18  9:56     ` Oleksii
2023-12-18 10:06       ` Jan Beulich
2023-11-24 10:30 ` [PATCH v2 22/39] xen/riscv: introduce asm/domain.h Oleksii Kurochko
2023-12-14 13:41   ` Jan Beulich
2023-11-24 10:30 ` [PATCH v2 23/39] xen/riscv: introduce asm/guest_access.h Oleksii Kurochko
2023-12-14 14:06   ` Jan Beulich
2023-12-18 10:02     ` Oleksii
2023-12-18 10:10       ` Jan Beulich
2023-11-24 10:30 ` [PATCH v2 24/39] xen/riscv: introduce asm/irq.h Oleksii Kurochko
2023-12-14 14:09   ` Jan Beulich
2023-12-18 10:04     ` Oleksii
2023-12-18 10:12       ` Jan Beulich
2023-12-18 11:42         ` Oleksii
2023-11-24 10:30 ` [PATCH v2 25/39] xen/riscv: introduce asm/p2m.h Oleksii Kurochko
2023-12-14 14:19   ` Jan Beulich
2023-12-18 10:06     ` Oleksii
2023-12-14 15:01   ` Jan Beulich
2023-11-24 10:30 ` [PATCH v2 26/39] xen/riscv: introduce asm/regs.h Oleksii Kurochko
2023-12-14 15:05   ` Jan Beulich
2023-12-18 10:08     ` Oleksii
2023-11-24 10:30 ` [PATCH v2 27/39] xen/riscv: introduce asm/time.h Oleksii Kurochko
2023-12-14 15:06   ` Jan Beulich
2023-12-18 10:09     ` Oleksii
2023-11-24 10:30 ` [PATCH v2 28/39] xen/riscv: introduce asm/event.h Oleksii Kurochko
2023-12-14 15:08   ` Jan Beulich
2023-12-18 10:10     ` Oleksii
2023-11-24 10:30 ` [PATCH v2 29/39] xen/riscv: add definition of __read_mostly Oleksii Kurochko
2023-12-12 17:04   ` Jan Beulich
2023-12-21 15:23     ` Andrew Cooper
2024-01-04 13:56       ` Jan Beulich
2023-11-24 10:30 ` [PATCH v2 30/39] xen/riscv: define an address of frame table Oleksii Kurochko
2023-12-14 15:48   ` Jan Beulich
2023-12-18 10:36     ` Oleksii
2023-12-18 11:22       ` Jan Beulich
2023-12-21 19:59         ` Oleksii
2023-12-22  8:08           ` Jan Beulich
2023-12-22  9:16             ` Oleksii
2023-11-24 10:30 ` [PATCH v2 31/39] xen/riscv: add required things to asm/current.h Oleksii Kurochko
2023-12-14 15:55   ` Jan Beulich
2023-12-18 10:39     ` Oleksii
2023-12-18 11:28       ` Jan Beulich
2023-12-18 11:44         ` Oleksii
2023-11-24 10:30 ` [PATCH v2 32/39] xen/riscv: add minimal stuff to asm/page.h to build full Xen Oleksii Kurochko
2023-12-14 15:57   ` Jan Beulich
2023-12-18 10:45     ` Oleksii
2023-12-18 11:36       ` Jan Beulich
2023-12-18 11:57         ` Oleksii
2023-12-18 12:05           ` Jan Beulich
2023-11-24 10:30 ` [PATCH v2 33/39] xen/riscv: add minimal stuff to asm/processor.h " Oleksii Kurochko
2023-12-14 16:04   ` Jan Beulich
2023-12-18 10:49     ` Oleksii
2023-12-18 11:38       ` Jan Beulich
2023-11-24 10:30 ` [PATCH v2 34/39] xen: add RISCV support for pmu.h Oleksii Kurochko
2023-12-14 16:16   ` Jan Beulich
2023-11-24 10:30 ` [PATCH v2 35/39] xen: add necessary headers to common to build full Xen for RISC-V Oleksii Kurochko
2023-12-14 16:20   ` Jan Beulich
2023-12-18 11:03     ` Oleksii
2023-11-24 10:30 ` [PATCH v2 36/39] xen/riscv: add minimal stuff to asm/mm.h to build full Xen Oleksii Kurochko
2023-12-14 17:08   ` Jan Beulich
2023-12-18 11:35     ` Oleksii
2023-11-24 10:30 ` [PATCH v2 37/39] xen/rirscv: add minimal amount of stubs " Oleksii Kurochko
2023-12-18 17:00   ` Jan Beulich [this message]
2023-12-20 12:55     ` Oleksii
2023-12-21  8:02       ` Jan Beulich
2023-12-21 18:47         ` Oleksii
2023-11-24 10:30 ` [PATCH v2 38/39] xen/riscv: enable full Xen build Oleksii Kurochko
2023-12-18 15:28   ` Jan Beulich
2023-11-24 10:30 ` [PATCH v2 39/39] xen: fix compilation issue of serial.c Oleksii Kurochko
2023-12-14 16:24   ` Jan Beulich
2023-12-14 16:40     ` Oleksii
2023-12-07 14:30 ` [PATCH v2 00/39] Enable build of full Xen for RISC-V Jan Beulich
2023-12-08  9:56   ` Oleksii

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=f52b19eb-7633-48df-85b9-c6a545dc4232@suse.com \
    --to=jbeulich@suse.com \
    --cc=alistair.francis@wdc.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=bobbyeshleman@gmail.com \
    --cc=connojdavis@gmail.com \
    --cc=george.dunlap@citrix.com \
    --cc=julien@xen.org \
    --cc=oleksii.kurochko@gmail.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.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.