From: Julien Grall <julien.grall@linaro.org>
To: manish.jaggi@linaro.org, xen-devel@lists.xenproject.org,
sameer.goel@linaro.org, andre.przywara@linaro.org
Cc: manish.jaggi@cavium.com
Subject: Re: [RFC 09/11] Xen IORT Changes
Date: Thu, 18 Jan 2018 19:10:21 +0000 [thread overview]
Message-ID: <2cc45328-64fb-1f5c-51b3-94aecd1c8fe4@linaro.org> (raw)
In-Reply-To: <20180102092809.1841-10-manish.jaggi@linaro.org>
Hi Manish,
On 02/01/18 09:28, manish.jaggi@linaro.org wrote:
> From: Manish Jaggi <manish.jaggi@linaro.org>
>
> This patch adds xen specific changes to iort.c
When I see the diff below, it is not changed but fully rewrite.
The original file contains 1279 lines, but you remove 978 lines and add
71. In that context, I see no value to re-use Linux code.
>
> Signed-off-by: Manish Jaggi <manish.jaggi@linaro.org>
> ---
> xen/arch/arm/setup.c | 2 +
> xen/drivers/acpi/arm/Makefile | 1 +
> xen/drivers/acpi/arm/iort.c | 1040 +++--------------------------------------
> xen/include/acpi/acpi_iort.h | 6 +-
> 4 files changed, 71 insertions(+), 978 deletions(-)
>
> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
> index 16a3b1be8e..7ada48920f 100644
> --- a/xen/arch/arm/setup.c
> +++ b/xen/arch/arm/setup.c
> @@ -37,6 +37,7 @@
> #include <xen/vmap.h>
> #include <xen/libfdt/libfdt.h>
> #include <xen/acpi.h>
> +#include <acpi/acpi_iort.h>
> #include <asm/alternative.h>
> #include <asm/page.h>
> #include <asm/current.h>
> @@ -800,6 +801,7 @@ void __init start_xen(unsigned long boot_phys_offset,
>
> tasklet_subsys_init();
>
> + acpi_iort_init();
Please no. I can't see any reason to call acpi_iort_init() in common
code. Instead this should be an initcall().
If you think differently, please explain why.
>
> xsm_dt_init();
>
> diff --git a/xen/drivers/acpi/arm/Makefile b/xen/drivers/acpi/arm/Makefile
> index 13f1a9159f..5d16161016 100644
> --- a/xen/drivers/acpi/arm/Makefile
> +++ b/xen/drivers/acpi/arm/Makefile
> @@ -1,2 +1,3 @@
> obj-y = ridmap.o
> obj-y += gen-iort.o
> +obj-y += iort.o
> diff --git a/xen/drivers/acpi/arm/iort.c b/xen/drivers/acpi/arm/iort.c
> index de56394dd1..a47ee2df4c 100644
> --- a/xen/drivers/acpi/arm/iort.c
> +++ b/xen/drivers/acpi/arm/iort.c
> @@ -14,17 +14,20 @@
> * This file implements early detection/parsing of I/O mapping
> * reported to OS through firmware via I/O Remapping Table (IORT)
> * IORT document number: ARM DEN 0049A
> + *
> + * Imported from Linux 4.14.0
> + * Xen Modifications : Manish Jaggi <manish.jaggi@linaro.org>
> */
>
> #define pr_fmt(fmt) "ACPI: IORT: " fmt
>
> -#include <linux/acpi_iort.h>
> -#include <linux/iommu.h>
> -#include <linux/kernel.h>
> -#include <linux/list.h>
> -#include <linux/pci.h>
> -#include <linux/platform_device.h>
> -#include <linux/slab.h>
> +#include <acpi/acpi_iort.h>
> +#include <acpi/ridmap.h>
> +#include <xen/iommu.h>
> +#include <xen/kernel.h>
> +#include <xen/list.h>
> +#include <xen/lib.h>
> +#include <xen/pci.h>
>
> #define IORT_TYPE_MASK(type) (1 << (type))
> #define IORT_MSI_TYPE (1 << ACPI_IORT_NODE_ITS_GROUP)
> @@ -36,6 +39,22 @@
> #define ACPI_IORT_SMMU_V3_CAVIUM_CN99XX 0x2
> #endif
>
> +/* Redefine WARN macros */
> +#undef WARN
> +#undef WARN_ON
> +#define WARN(condition, format...) ({ \
> + int __ret_warn_on = !!(condition); \
> + if (unlikely(__ret_warn_on)) \
> + printk(format); \
> + unlikely(__ret_warn_on); \
> +})
> +#define WARN_TAINT(cond, taint, format...) WARN(cond, format)
> +#define WARN_ON(cond) (!!cond)
Again, I would have appreciated if you look at the comment I made on
Sameer series.
> +
> +
> +#define MAX_ERRNO 4095
> +#define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO)
IS_ERR_VALUE already exists in Xen (see include/xen/err.h).
For the rest of the code, I will wait your answer on my first comment in
that e-mail.
Cheers,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-01-18 19:10 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-02 9:27 [RFC 00/11] acpi: arm: IORT Support for Xen manish.jaggi
2018-01-02 9:27 ` [RFC 01/11] acpi: arm: Public API for populating and query based on requesterid manish.jaggi
2018-01-16 17:53 ` Julien Grall
2018-01-16 18:31 ` Julien Grall
2018-01-19 6:05 ` Manish Jaggi
2018-01-19 12:03 ` Julien Grall
2018-01-22 5:07 ` Manish Jaggi
2018-01-22 13:40 ` Julien Grall
2018-01-02 9:28 ` [RFC 02/11] acpi: arm: API to query estimated size of hardware domain's IORT manish.jaggi
2018-01-16 18:52 ` Julien Grall
2018-01-19 6:10 ` Manish Jaggi
2018-01-22 13:45 ` Julien Grall
2018-01-02 9:28 ` [RFC 03/11] acpi: arm: Code to generate Hardware Domains IORT manish.jaggi
2018-01-18 18:32 ` Julien Grall
2018-01-02 9:28 ` [RFC 04/11] Import iort.c and acpi_iort.h manish.jaggi
2018-01-02 9:28 ` [RFC 05/11] Import fwnode.h from linux manish.jaggi
2018-01-02 9:28 ` [RFC 06/11] fwnode xen spacific changes manish.jaggi
2018-01-18 18:51 ` Julien Grall
2018-03-06 10:27 ` Manish Jaggi
2018-03-06 14:29 ` Julien Grall
2018-03-06 13:43 ` Manish Jaggi
2018-03-06 13:44 ` Manish Jaggi
2018-03-06 14:22 ` Julien Grall
2018-01-02 9:28 ` [RFC 07/11] Add kernel helper functions manish.jaggi
2018-01-18 18:55 ` Julien Grall
2018-01-19 9:33 ` Jan Beulich
2018-02-08 21:56 ` Sameer Goel
2018-01-02 9:28 ` [RFC 08/11] Add ACPI_IORT config manish.jaggi
2018-01-18 19:01 ` Julien Grall
2018-01-02 9:28 ` [RFC 09/11] Xen IORT Changes manish.jaggi
2018-01-18 19:10 ` Julien Grall [this message]
2018-01-02 9:28 ` [RFC 10/11] IORT parsing functions to prepare requesterId maps manish.jaggi
2018-01-02 9:28 ` [RFC 11/11] Add to_pci_dev macro manish.jaggi
2018-01-18 19:15 ` Julien Grall
2018-02-08 21:54 ` Sameer Goel
2018-01-16 17:53 ` [RFC 00/11] acpi: arm: IORT Support for Xen Julien Grall
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=2cc45328-64fb-1f5c-51b3-94aecd1c8fe4@linaro.org \
--to=julien.grall@linaro.org \
--cc=andre.przywara@linaro.org \
--cc=manish.jaggi@cavium.com \
--cc=manish.jaggi@linaro.org \
--cc=sameer.goel@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).