[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 00/16] x86: indirect call overhead reduction

>>> On 13.07.18 at 15:00, <julien.grall@xxxxxxx> wrote:
> Hi Jan,
> On 13/07/18 09:10, Jan Beulich wrote:
>>>>> On 11.07.18 at 15:15, <JBeulich@xxxxxxxx> wrote:
>>> While indirect calls have always been more expensive than direct ones,
>>> their cost has further increased with the Spectre v2 mitigations. In a
>>> number of cases we simply pointlessly use them in the first place. In
>>> many other cases the indirection solely exists to abstract from e.g.
>>> vendor specific hardware details, and hence the pointers used never
>>> change once set. Here we can use alternatives patching to get rid of
>>> the indirection.
>>>  From patch 8 onwards dependencies exist on earlier, yet to be reviewed
>>> patches ("x86/alternatives: fully leverage automatic NOP filling" as well
>>> as the "x86: improve PDX <-> PFN and alike translations" series at the
>>> very least). I nevertheless wanted to enable a first round of review of
>>> the series, the more that some of the patches (not just initial ones)
>>> could perhaps be taken irrespective of those dependencies.
>>> Further areas where indirect calls could be eliminated (and that I've put
>>> on my todo list in case the general concept here is deemed reasonable)
>>> are IOMMU, cpufreq, vPMU, and XSM. For some of these, the ARM side
>>> would need dealing with as well - I'm not sure whether replacing indirect
>>> calls by direct ones is worthwhile there as well; if not, the wrappers
>>> would simply need to become function invocations in the ARM case.
>> Btw, I didn't want to Cc you on the whole series, but input on the above
>> would certainly be helpful to decide how to deal with indirect calls in code
>> shared between the architectures.
> For the IOMMU, we want to keep the indirect call as it might be possible 
> to have a platform support different IOMMUs (not yet supported in Xen).
> For CPUFreq and vPMU, they are not yet supported on Arm and I haven't 
> spent much time looking at them. So I can't confirm whether indirect 
> call could be dropped.
> For XSM, I guess indirect call could be dropped.

But you didn't answer the fundamental question: Is this worthwhile on

> 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).


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.