xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jiandi An <anjiandi@codeaurora.org>
Cc: Julien Grall <julien.grall@arm.com>,
	sstabellini@kernel.org, shannon.zhao@linaro.org,
	shankerd@codeaurora.org, xen-devel@lists.xen.org
Subject: Re: Xen: ARM: Support for mapping OperationRegion in ACPI ASL
Date: Wed, 14 Dec 2016 08:40:21 -0500	[thread overview]
Message-ID: <20161214134021.GD6555@char.us.oracle.com> (raw)
In-Reply-To: <58509CF3.5060406@codeaurora.org>

On Tue, Dec 13, 2016 at 07:14:27PM -0600, Jiandi An wrote:
> Hi Guys,
> 
> Xen currently does not handle mapping of MMIO regions specified under OperationRegion in ACPI ASL.  OperationRegion is well defined in ACPI specification.  I'm seeking for architectural direction on adding support for mapping OperationRegion.
> 
> Some context here.  Mapping of resources specificed under _CRS in ACPI is handled by dom0 requesting Xen to map as platform devices are added.  https://lwn.net/Articles/674666/ provided service xen_map_device_mmio() in dom0 to call Xen to map and it's done so by registering xen_platform_notifier() platform bus driver.  This covers the platform devices.
> 
> The OperationRegion access in dom0 is in acpica path.  The following is a stack of the code path where OperationRegion is parsed.  acpi_ex_system_memory_space_handler() gets the parsed address specified in OperationRegion in ACPI and maps it then performs the memory read or write.  
> 
> acpi_ex_system_memory_space_handler+0x378/0x424
> acpi_ev_address_space_dispatch+0x294/0x310
> acpi_ex_access_region+0x3c0/0x468
> acpi_ex_field_datum_io+0x14c/0x380
> acpi_ex_extract_from_field+0xe8/0x2f4
> acpi_ex_read_data_from_field+0x330/0x38c
> acpi_ex_resolve_node_to_value+0x310/0x3fc
> acpi_ex_resolve_to_value+0x354/0x3e8
> acpi_ds_evaluate_name_path+0xa4/0x15c
> acpi_ds_exec_end_op+0xbc/0x6c8
> acpi_ps_parse_loop+0x7ac/0x840
> acpi_ps_parse_aml+0x1c4/0x434
> acpi_ps_execute_method+0x1f0/0x2a0
> acpi_ns_evaluate+0x2e4/0x424
> acpi_ut_evaluate_object+0xb0/0x250
> acpi_ut_execute_STA+0xb0/0x164
> acpi_ns_init_one_device+0xac/0x250
> acpi_ns_walk_namespace+0x108/0x254
> acpi_ns_initialize_devices+0x274/0x35c
> acpi_initialize_objects+0x90/0xf0
> acpi_init+0xc0/0x30c
> do_one_initcall+0x44/0x138
> kernel_init_freeable+0x148/0x1ec
> kernel_init+0x18/0x108
> 
> The workaround in testing for handling OperationRegion I did is to call xen_map_device_mmio() to map the resource specificied in OperationRegion if it's dom0 running under XEN in acpi_ex_system_memory_space_handler().  But this is a fairly generic ACPI code path.  Looking for achitectural suggestion to properly handle OperationRegion for Xen on ARM.

The ACPI code path obviously calls the underlaying OS code to map it.
Could this path have an wrapper around it (so one could register
different underlaying 'map_device_mmio' function calls)?

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-12-14 13:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-14  1:14 Xen: ARM: Support for mapping OperationRegion in ACPI ASL Jiandi An
2016-12-14 13:40 ` Konrad Rzeszutek Wilk [this message]
2016-12-19 23:01   ` Xen: " Stefano Stabellini
2016-12-20  7:56     ` Jan Beulich
2016-12-20 22:50       ` Stefano Stabellini
2016-12-22  7:48         ` Jan Beulich
2017-01-03 19:10           ` Stefano Stabellini

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=20161214134021.GD6555@char.us.oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=anjiandi@codeaurora.org \
    --cc=julien.grall@arm.com \
    --cc=shankerd@codeaurora.org \
    --cc=shannon.zhao@linaro.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xen.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).