This is actually not an ARM specific question, so changing the subject
and CC'ing more people.

On Wed, 14 Dec 2016, Konrad Rzeszutek Wilk wrote:
> 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 via email to