[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 07/42] xen/riscv: introduce device-agnostic MMIO emulation dispatch



> [ ... 206 lines skipped ... ]
> --- /dev/null
> +++ b/xen/arch/riscv/mmio.c
> @@ -0,0 +1,205 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +
> +#include <xen/bsearch.h>
> +#include <xen/lib.h>
> +#include <xen/rwlock.h>
> +#include <xen/sched.h>
> +#include <xen/string.h>
> +#include <xen/xvmalloc.h>
> +
> +#include <asm/current.h>
> +#include <asm/mmio.h>
> +
> +#define MAX_IO_HANDLER  16
Nit: Only one blank is needed here.
> [ ... 70 lines skipped ... ]
> +/*
> + * Check alignment and dispatch a decoded MMIO access to a registered
> + * handler. On success (0), info->data holds the read value for loads.
> + *
> + * There is no "retry" outcome to handle: find_mmio_handler() returns a
> + * copy of the matching handler taken under vmmio->lock and the ops
> + * structures are never freed, so the lookup result cannot go stale
> + * between finding the handler and invoking it.
> + */
Nit: As do_mmio() is non-static, this comment would better live on its
prototype in asm/mmio.h.
> [ ... 45 lines skipped ... ]
> +    /*
> +     * The array is kept sorted by base address, so rather than appending and
> +     * re-sorting, find the slot the new region belongs to and shift the tail
> +     * up by one.
> +     */
> +    for ( i = vmmio->num_entries;
> +          i > 0 && handlers[i - 1].addr > addr;
> +          i-- )
Nit: This fits on a single line.

Preferably with these adjusted:
Reviewed-by: Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>

-- 
Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.