From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 2A2A6AC169B for ; Wed, 23 Aug 2023 18:11:06 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=WidVYcGqjxQ9uoPuALSido97muRzAfMRuxa/68unodc=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20140610; t=1692814265; v=1; b=ID0n0+j5XY170m4VRpL48y9NWvqbMtL+tM5E2/OOif86x4D++F7h5pRwQuX4Oigtr+n0fFvL MjygOtK/MU1rPZejYug4VHvnxhPNKoV9y/7pa6U4NUrXWcoMRqc8bcKzAXWkxsuyEsI8q9hkrtJ z7Z80tWwZ8ja2Heogzd89a7Q= X-Received: by 127.0.0.2 with SMTP id eXDCYY7687511xpjVV25pwWn; Wed, 23 Aug 2023 11:11:05 -0700 X-Received: from mail-vk1-f170.google.com (mail-vk1-f170.google.com [209.85.221.170]) by mx.groups.io with SMTP id smtpd.web11.102.1692814265060355603 for ; Wed, 23 Aug 2023 11:11:05 -0700 X-Received: by mail-vk1-f170.google.com with SMTP id 71dfb90a1353d-48d2c072030so71021e0c.0 for ; Wed, 23 Aug 2023 11:11:04 -0700 (PDT) X-Gm-Message-State: eikEtmIh2Hxj969EFtlsitVix7686176AA= X-Google-Smtp-Source: AGHT+IH+uMhJeSMlPPBB0nlgT+0+gYdeccoaebnSmkbggT3eh9vw5zgfR1RCBLvmE6RBZaDsPMK9tzGRkkbC3luSrl4= X-Received: by 2002:a05:6122:2527:b0:48d:969:af8b with SMTP id cl39-20020a056122252700b0048d0969af8bmr7786065vkb.1.1692814263770; Wed, 23 Aug 2023 11:11:03 -0700 (PDT) MIME-Version: 1.0 References: <20230720134557.3903923-1-ardb@kernel.org> In-Reply-To: From: "Pedro Falcato" Date: Wed, 23 Aug 2023 19:10:52 +0100 Message-ID: Subject: Re: [edk2-devel] [RFC/RFT PATCH] OvmfPkg/IoMmuDxe: don't rely on TPLs for re-entrancy To: devel@edk2.groups.io, ardb@kernel.org Cc: kraxel@redhat.com, Jiewen Yao , Michael Brown Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pedro.falcato@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=ID0n0+j5; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io On Wed, Aug 23, 2023 at 4:12=E2=80=AFPM Ard Biesheuvel wr= ote: > > On Wed, 23 Aug 2023 at 13:08, Gerd Hoffmann wrote: > > > > On Tue, Aug 22, 2023 at 09:57:12AM +0200, Ard Biesheuvel wrote: > > > On Tue, 22 Aug 2023 at 08:25, Gerd Hoffmann wrote= : > > > > > > > > Looks good to me. > > > > > > > > What is the status? Merged? Or waiting for testing still? If so = I can > > > > create a test build with the patch and ask our QE department to che= ck > > > > it. > > > > > > > > > > Still waiting for testing, so yes, please test. > > > > Hmm, QE reports back it slows down the boot alot. No boot hangs yet > > with 12 test runs so far, which isn't that much for a reproduce rate > > below 20% ... > > > > https://bugzilla.redhat.com//show_bug.cgi?id=3D2211060#c28 > > > > So I guess we go with the TPL version for the coming stable tag and > > leave any improvements for later ... > > > > Yeah, this was not going to make the stable tag in any case. > > The boot speed regression seems odd, though - this is effectively UP > code so there shouldn't be any contention, the only thing this patch > does is ensure that the critical section is restarted if it was > interrupted FWIW: Given completely correct logic, straightforward logic, a lock cmpxchg is much slower(3-4x) than an a non-lock cmpxchg, which itself is around 2x as slow as a regular relaxed load + store. See https://gist.github.com/heatd/49c9be23ccb1f4ad8dfeac231da2647a for a nice fun test benchmark. HOWEVER, given this is likely in IO paths, I would *really* not expect this to make a difference, right? Even virtio drivers will themselves trap with a VMEXIT whenever you touch a hardware register... Gerd, could you folks get a perf kvm (perf-kvm(1)) recording out of that OVMF build? Assuming you can get that thing to work, that is, personally it mysteriously stopped working 6 years ago for me :) --=20 Pedro -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107988): https://edk2.groups.io/g/devel/message/107988 Mute This Topic: https://groups.io/mt/100256049/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-