Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1604644 > unrolled thread
| Started by | Mark Rutland <mark.rutland@arm.com> |
|---|---|
| First post | 2017-03-20 15:40 +0100 |
| Last post | 2017-03-20 18:10 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH 06/17] arm64: arch_timer: Get rid of erratum_workaround_set_sne Mark Rutland <mark.rutland@arm.com> - 2017-03-20 15:40 +0100
Re: [PATCH 06/17] arm64: arch_timer: Get rid of erratum_workaround_set_sne Marc Zyngier <marc.zyngier@arm.com> - 2017-03-20 18:10 +0100
| From | Mark Rutland <mark.rutland@arm.com> |
|---|---|
| Date | 2017-03-20 15:40 +0100 |
| Subject | Re: [PATCH 06/17] arm64: arch_timer: Get rid of erratum_workaround_set_sne |
| Message-ID | <tn6Dw-63o-13@gated-at.bofh.it> |
On Mon, Mar 06, 2017 at 11:26:11AM +0000, Marc Zyngier wrote:
> Let's move the handling of workarounds affecting set_next_event
> to the affected function, instead of overwriding the pointers
Nit: overriding
> as an afterthough. Yes, this is an extra indirection on the
> erratum handling path, but the HW is busted anyway.
[...]
> +#define erratum_set_next_event_tval_virt(...) ({BUG_ON(1); 0;})
> +#define erratum_set_next_event_tval_phys(...) ({BUG_ON(1); 0;})
Nit: BUG()
[...]
> {
> + if (needs_unstable_timer_counter_workaround())
> + return erratum_set_next_event_tval_virt(evt, clk);
> +
> set_next_event(ARCH_TIMER_VIRT_ACCESS, evt, clk);
> return 0;
> }
> @@ -487,6 +490,9 @@ static int arch_timer_set_next_event_virt(unsigned long evt,
> static int arch_timer_set_next_event_phys(unsigned long evt,
> struct clock_event_device *clk)
> {
> + if (needs_unstable_timer_counter_workaround())
> + return erratum_set_next_event_tval_phys(evt, clk);
> +
> set_next_event(ARCH_TIMER_PHYS_ACCESS, evt, clk);
> return 0;
> }
I take it that the new conditionals are NOPs in the !erratum case, so
this doesn't adversely affect the usual case.
Thanks,
Mark.
[toc] | [next] | [standalone]
| From | Marc Zyngier <marc.zyngier@arm.com> |
|---|---|
| Date | 2017-03-20 18:10 +0100 |
| Message-ID | <tn8YG-7Pz-21@gated-at.bofh.it> |
| In reply to | #1604644 |
On 20/03/17 14:06, Mark Rutland wrote:
> On Mon, Mar 06, 2017 at 11:26:11AM +0000, Marc Zyngier wrote:
>> Let's move the handling of workarounds affecting set_next_event
>> to the affected function, instead of overwriding the pointers
>
> Nit: overriding
>
>> as an afterthough. Yes, this is an extra indirection on the
>> erratum handling path, but the HW is busted anyway.
>
> [...]
>
>> +#define erratum_set_next_event_tval_virt(...) ({BUG_ON(1); 0;})
>> +#define erratum_set_next_event_tval_phys(...) ({BUG_ON(1); 0;})
>
> Nit: BUG()
>
> [...]
>
>> {
>> + if (needs_unstable_timer_counter_workaround())
>> + return erratum_set_next_event_tval_virt(evt, clk);
>> +
>> set_next_event(ARCH_TIMER_VIRT_ACCESS, evt, clk);
>> return 0;
>> }
>> @@ -487,6 +490,9 @@ static int arch_timer_set_next_event_virt(unsigned long evt,
>> static int arch_timer_set_next_event_phys(unsigned long evt,
>> struct clock_event_device *clk)
>> {
>> + if (needs_unstable_timer_counter_workaround())
>> + return erratum_set_next_event_tval_phys(evt, clk);
>> +
>> set_next_event(ARCH_TIMER_PHYS_ACCESS, evt, clk);
>> return 0;
>> }
>
> I take it that the new conditionals are NOPs in the !erratum case, so
> this doesn't adversely affect the usual case.
Indeed, we only get an extra NOP on the normal path. The erratum path
triggers the insertion of a jump targeting the end of the function,
where the workaround gets handled.
Thanks,
M.
--
Jazz is not dead. It just smells funny...
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web