From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.120]) by mx.groups.io with SMTP id smtpd.web10.10683.1592408781494671165 for ; Wed, 17 Jun 2020 08:46:21 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FPcAexwb; spf=pass (domain: redhat.com, ip: 205.139.110.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592408780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7Ab4JMq/8lpq+qKNVCKI3aesRvCyEPtyj/N3adgd56Q=; b=FPcAexwbBikyniUCfrj/3P0Wu++rnvtokVGecGlCQg4Su5ILh2ba71V1cM+fBfXhQ62Auy 94JM8PGzwMyqI4MPcSzJiSF3yRxUkbTBDMyGeRdACyIu+2Vs4/HQHK1XteKsmX/EqZevuA vLP23Bt0invMBgsbeMrrndz8veNLQG0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-160-1ml1OX2xORm95rzUzMlpLw-1; Wed, 17 Jun 2020 11:46:18 -0400 X-MC-Unique: 1ml1OX2xORm95rzUzMlpLw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 57E861005513; Wed, 17 Jun 2020 15:46:17 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-115-92.ams2.redhat.com [10.36.115.92]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5C6325C1D6; Wed, 17 Jun 2020 15:46:15 +0000 (UTC) Subject: Re: [PATCH] OvmfPkg: End timer interrupt later to avoid stack overflow under load To: Paolo Bonzini , Igor Druzhinin , devel@edk2.groups.io Cc: jordan.l.justen@intel.com, ard.biesheuvel@arm.com, anthony.perard@citrix.com, julien@xen.org, Ray Ni References: <1592275782-9369-1-git-send-email-igor.druzhinin@citrix.com> <1d4cd50f-9479-0361-2d23-edda83037243@redhat.com> From: "Laszlo Ersek" Message-ID: <8f885a46-f72b-bf13-db55-28e6db8b5bff@redhat.com> Date: Wed, 17 Jun 2020 17:46:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1d4cd50f-9479-0361-2d23-edda83037243@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 06/17/20 15:51, Paolo Bonzini wrote: > On 16/06/20 20:42, Laszlo Ersek wrote: >> (Hmmm... maybe the hypervisor *has* to queue the timer interrupts, >> otherwise some of them would simply be lost, and the guest would lose >> track of time.) > > Yes, there are various kinds of coalescing of interrupts that > hypervisors perform to help the guest keep track of time. This is > especially true of the PIT and RTC; newer OSes track time directly from > the TSC, the HPET or the APIC timer so they tolerate lost ticks much better. > > That said, Igor's patch seems correct to me. In fact, I'd even move > DisableInterrupts before gBS->RestoreTPL unless there's a good reason > not to do so. OK, thank you! Igor, please confirm if you'd like to submit v2 with the update suggested by Paolo, or if you prefer the current version. We're at the beginning of the current development cycle, so I guess we can apply the patch and see how it works in practice. If it ends up wreaking havoc on some platforms, we can always revert the patch in time for the next stable tag (edk2-stable202008). Perhaps we should also file a TianoCore BZ for this issue, with a clear problem statement, and the solution outline. The commit message is not lacking, but I think a TianoCore BZ could be easier to find with a web search, if users (not developers) want to comment after the patch is merged. It's also easier to round up (possibly) important changes, for stable tag content review, when there are BZs. Thanks! Laszlo