Skip to contentSkip to conversation

ARM: grant table setup

DISCUSSION Jonathan Daugherty 2 participants 2 messages Apr 22, 2014 – Apr 23, 2014

lore
Share & tools
lore
#0 lore raw

Hi,

I'm modifying FreeRTOS to run as a Xen guest and I'm working on grant table setup. The documentation for the Xen ARM ABI states:

The grant table is mapped using the HYPERVISOR_memory_op sub-op XENMEM_add_to_physmap, passing XENMAPSPACE_grant_table as space parameter. The memory range specified under the Xen compatible hypervisor node on device tree can be used as target gpfn for the mapping.

However, I noticed that there is also the GNTTABOP_setup_table operation. The two seem to overlap in things they do (such as growing the grant table if the request requires it). Linux appears to use the physmap operation for ARM ("hvm") guests and setup_table otherwise. However, early on my implementation called setup_table to very strange effect (bogus MFNs in the frame_list). Provided that is indeed inappropriate, would it be reasonable to make setup_table return a failure status if called for HVM domains?

Thanks,

Signature · 3 lines
  Jonathan Daugherty
  Software Engineer
  Galois, Inc.
#1 lore raw
Quoted 11 lines · Jonathan Daugherty

Hi,

I'm modifying FreeRTOS to run as a Xen guest and I'm working on grant table setup. The documentation for the Xen ARM ABI states:

The grant table is mapped using the HYPERVISOR_memory_op sub-op XENMEM_add_to_physmap, passing XENMAPSPACE_grant_table as space parameter. The memory range specified under the Xen compatible hypervisor node on device tree can be used as target gpfn for the mapping.

Quoted 4 lines

However, I noticed that there is also the GNTTABOP_setup_table operation. The two seem to overlap in things they do (such as growing the grant table if the request requires it). Linux appears to use the physmap operation for ARM ("hvm") guests and setup_table otherwise.

I think Linux uses the physmap interface for x86 HVM and PVH guests too.

Quoted 4 lines

However, early on my implementation called setup_table to very strange effect (bogus MFNs in the frame_list). Provided that is indeed inappropriate, would it be reasonable to make setup_table return a failure status if called for HVM domains?

I think that would make sense, but the correct condition would probably be autotranslated guests rather than hvm.

Ian.