Hi Jan,

On 13/07/18 15:27, Jan Beulich wrote:
On 13.07.18 at 15:39, <julien.gr...@arm.com> wrote:
On 13/07/18 14:27, Jan Beulich wrote:
On 13.07.18 at 15:00, <julien.gr...@arm.com> wrote:
What would be the generic interface here? I saw it was based on
alternative for the plumbing.

Yes, I'd prefer to use the same mechanism as presented in the series.
As per above for the IOMMU case we'd then need another abstraction
layer put in the middle (to produce a patch site on x86, but a normal
[indirect] call on ARM).

I will have a look. Could you point to the patch adding the abstraction?

Patch 9 is where the x86 side infrastructure gets added. Typical uses
would then be (taken from patch 10)

  hvm_guest_x86_mode(struct vcpu *v)
  {
      ASSERT(v == current);
-    return hvm_funcs.guest_x86_mode(v);
+    return alternative_call1(hvm_funcs.guest_x86_mode, v);
OOI, is there any reason for you to define alternative_callN and not providing a generic version (similar to arm_smccc_1_1_smc in include/asm-arm/smccc.h)?

  }
static inline void
  hvm_update_host_cr3(struct vcpu *v)
  {
      if ( hvm_funcs.update_host_cr3 )
-        hvm_funcs.update_host_cr3(v);
+        alternative_vcall1(hvm_funcs.update_host_cr3, v);
  }

And actually there was one more question I meant to ask: Are all
locations within Xen reachable by direct calls on ARM? I.e. can an
indirect call, when we know its target, always be replaced, no
matter at what address (within Xen) it lives?

For direct branch, the range supported is +/- 32MB for 32-bit Arm, +/- 128MB for 64-bit Arm. With the current layout all Xen text (including livepatch payload) will always be below 12MB.

So we should be able to reach all Xen by direct calls.

Cheers,

--
Julien Grall

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

Reply via email to