public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Leif Lindholm <leif.lindholm@linaro.org>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: edk2-devel@lists.01.org, marc.zyngier@arm.com, heyi.guo@linaro.org
Subject: Re: [PATCH] ArmPkg/TimerDxe: remove workaround for KVM timer handling
Date: Thu, 15 Mar 2018 20:47:58 +0100	[thread overview]
Message-ID: <9a1184f2-dede-eba8-1dc7-026bfb3bde01@redhat.com> (raw)
In-Reply-To: <20180315190148.gc74gfdnttvoy3i5@bivouac.eciton.net>

On 03/15/18 20:01, Leif Lindholm wrote:
> On Thu, Mar 15, 2018 at 10:28:26AM +0000, Ard Biesheuvel wrote:
>> When we first ported EDK2 to KVM/arm, we implemented a workaround for
>> the quirky timer handling on the KVM side. This has been fixed in
>> Linux commit f120cd6533d2 ("KVM: arm/arm64: timer: Allow the timer to
>> control the active state") dated 23 June 2014, which was incorporated
>> into Linux release 4.3.
>>
>> So almost 4 years later, it should be safe to drop this workaround on
>> the EDK2 side.
>>
>> This reverts commit b1a633434ddc.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> 
> I'm happy with this, with Marc's Ack.
> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
> 
> However, if this can affect old kernels running in vms, could you ping
> cross-distro@lists.linaro.org as well, so it doesn't catch anyone by
> surprise?

If I understand correctly, the patch could negatively affect old kernels
that run on *hosts*. (Discounting nested virtualization, which I'm
perfectly willing to ignore for this discussion.)

Emailing the cross-distro list shouldn't hurt in any case.

>From my side (since I was CC'd):

Acked-by: Laszlo Ersek <lersek@redhat.com>

Thanks!
Laszlo

> 
> /
>     Leif
> 
>> ---
>>  ArmPkg/Drivers/TimerDxe/TimerDxe.c                                           |  1 -
>>  ArmPkg/Library/ArmGenericTimerVirtCounterLib/ArmGenericTimerVirtCounterLib.c | 10 ----------
>>  2 files changed, 11 deletions(-)
>>
>> diff --git a/ArmPkg/Drivers/TimerDxe/TimerDxe.c b/ArmPkg/Drivers/TimerDxe/TimerDxe.c
>> index a3202fa056f3..bd616d2efc73 100644
>> --- a/ArmPkg/Drivers/TimerDxe/TimerDxe.c
>> +++ b/ArmPkg/Drivers/TimerDxe/TimerDxe.c
>> @@ -337,7 +337,6 @@ TimerInterruptHandler (
>>  
>>      // Set next compare value
>>      ArmGenericTimerSetCompareVal (CompareValue);
>> -    ArmGenericTimerEnableTimer ();
>>      ArmInstructionSynchronizationBarrier ();
>>    }
>>  
>> diff --git a/ArmPkg/Library/ArmGenericTimerVirtCounterLib/ArmGenericTimerVirtCounterLib.c b/ArmPkg/Library/ArmGenericTimerVirtCounterLib/ArmGenericTimerVirtCounterLib.c
>> index 69a4ceb62db6..c941895a3574 100644
>> --- a/ArmPkg/Library/ArmGenericTimerVirtCounterLib/ArmGenericTimerVirtCounterLib.c
>> +++ b/ArmPkg/Library/ArmGenericTimerVirtCounterLib/ArmGenericTimerVirtCounterLib.c
>> @@ -26,16 +26,6 @@ ArmGenericTimerEnableTimer (
>>  
>>    TimerCtrlReg = ArmReadCntvCtl ();
>>    TimerCtrlReg |= ARM_ARCH_TIMER_ENABLE;
>> -
>> -  //
>> -  // When running under KVM, we need to unmask the interrupt on the timer side
>> -  // as KVM will mask it when servicing the interrupt at the hypervisor level
>> -  // and delivering the virtual timer interrupt to the guest. Otherwise, the
>> -  // interrupt will fire again, trapping into the hypervisor again, etc. etc.
>> -  // This is scheduled to be fixed on the KVM side, but there is no harm in
>> -  // leaving this in once KVM gets fixed.
>> -  //
>> -  TimerCtrlReg &= ~ARM_ARCH_TIMER_IMASK;
>>    ArmWriteCntvCtl (TimerCtrlReg);
>>  }
>>  
>> -- 
>> 2.15.1
>>



  reply	other threads:[~2018-03-15 19:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-15 10:28 [PATCH] ArmPkg/TimerDxe: remove workaround for KVM timer handling Ard Biesheuvel
2018-03-15 10:40 ` Marc Zyngier
2018-03-15 19:01 ` Leif Lindholm
2018-03-15 19:47   ` Laszlo Ersek [this message]
2018-03-16 11:28   ` Ard Biesheuvel
2018-03-16 11:46     ` Leif Lindholm
2018-03-16 13:25       ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9a1184f2-dede-eba8-1dc7-026bfb3bde01@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox