From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mx.groups.io with SMTP id smtpd.web09.13561.1583154066360638472 for ; Mon, 02 Mar 2020 05:01:06 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=j8QGr8fV; spf=pass (domain: linaro.org, ip: 209.85.128.65, mailfrom: ard.biesheuvel@linaro.org) Received: by mail-wm1-f65.google.com with SMTP id a132so1088510wme.1 for ; Mon, 02 Mar 2020 05:01:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oRIOrfOAJQbAFANQJYWFzf15e0E9tf46RZ2jyooZ6Tc=; b=j8QGr8fVu4/MWuzKyo4WznZQiM0axD7m2Gb5UkSk+XfzEJDkgI9/86YDubsvY3Nsik hnjOloJpYz9M6ZncRJDMh1opQZ5CBLF/JXTu04DrHwFTALXulz0EtLCaqE1cpCZse7B1 WTMtLvccv9pn1p4qY0B3vE6UmyWZbkpAACH/iokNTKdPgbfRFQQE9CVSX5Yq6WYxvMIR F2ZAwbB56G1lUHfbN6rnbK8pVgxWYf2yaa+yO+J5GMhWlgxQm6/LvjUIUDoYkFljYiO7 5Kw1YtCXA6Qz1eYCyjF8LEjuj6VdqT266AKPWGKamVu4ouq/bFgvXYJi74SglAvcMNqd UJdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oRIOrfOAJQbAFANQJYWFzf15e0E9tf46RZ2jyooZ6Tc=; b=m3iMdykLF5oL1NVYKfb3vNIBnsR9tyRndFjZqTwVZHk+BDfTfRHCAdM5sFMCUNyVjd NS4XXuIj5rbMdCOk4lYlqsTPTqEeIP0Fqm08IVjQ0DCXVH7X8NIO4zuzWBGsKXOSy6jZ NBrmBkZEgFIJ1QTWsSH1ik3DJmNGVnR8hrUO/fA067ZodwujMa67LM8LuWZQeRSXCFln ZcTig4rowE7aiEVjcRZrpS2oQtkLrzb4jwHWcsCv1HkJz3Rfwdtc2MOMhvMCsUPvQYRN 8JFRkkS8L8KVekwMAPkwLN0CERTGxP3pc/gkhvHb7yZdTqGFi+M5n0QIZYv2GcTAM0Qc C7Vg== X-Gm-Message-State: ANhLgQ265cFrZFVletFaTIZCdbCFKwvVFyLNUTM3Jp53jp5pq7Yh3gG+ DWd9qgFQ5hFGxx4zTtluaX+EyXMFFJyDzum9g+PsP1p1Gpg= X-Google-Smtp-Source: ADFU+vvT61ZRAskNgTTD7v+2ILHEGcWxV7zXsrIy19njb0KCyzYKUWf9lkS1jYHt+1r2SxrHMBUfPJR3hzghKclCuQQ= X-Received: by 2002:a1c:2d88:: with SMTP id t130mr7211977wmt.68.1583154064829; Mon, 02 Mar 2020 05:01:04 -0800 (PST) MIME-Version: 1.0 References: <20200226124103.17125-1-ard.biesheuvel@linaro.org> <20200302125744.GG23627@bivouac.eciton.net> In-Reply-To: <20200302125744.GG23627@bivouac.eciton.net> From: "Ard Biesheuvel" Date: Mon, 2 Mar 2020 14:00:54 +0100 Message-ID: Subject: Re: [PATCH 1/1] ArmPkg/MmCommunicationDxe: fix logic bug in DXE driver entrypoint To: Leif Lindholm Cc: edk2-devel-groups-io , "Gao, Liming" Content-Type: text/plain; charset="UTF-8" On Mon, 2 Mar 2020 at 13:57, Leif Lindholm wrote: > > On Wed, Feb 26, 2020 at 13:41:03 +0100, Ard Biesheuvel wrote: > > Commit 2fe25a74d6fee3c2 ("ArmPkg/MmCommunicationDxe: relay architected PI > > events to MM context") update the ARM specific standalone MM client > > driver to register for certain events in the entrypoint code, but did > > so in a way that makes the entrypoint always return with an error. > > > > Instead, return EFI_SUCCESS if registering for those events succeeds, > > and back out the registrations that did succeed if one fails, and > > return an error. > > > > Fixes: 2fe25a74d6fee3c2 ("ArmPkg/MmCommunicationDxe: relay architected PI events to MM context") > > Signed-off-by: Ard Biesheuvel > > Reviewed-by: Leif Lindholm > Thanks. > Are you looking for this one to make the stable tag? You're not > explicitly asking for it, but you're cc:ing Liming. > I don't think it is terribly useful to get this into the stable tag, given that the standalone MM support is not complete yet, and stalled on a PI spec update. But by the same reasoning, it could go in as well, since it is an obvious bugfix, and the risk is low. I don't really care either way tbh, I just wanted to make Liming aware of it. > > --- > > ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c | 8 ++++++++ > > 1 file changed, 8 insertions(+) > > > > diff --git a/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c b/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c > > index a4ee4dcd864c..6c06b3574861 100644 > > --- a/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c > > +++ b/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c > > @@ -385,8 +385,16 @@ MmCommunication2Initialize ( > > MmGuidedEventNotify, mGuidedEventGuid[Index], > > mGuidedEventGuid[Index], &mGuidedEvent[Index]); > > ASSERT_EFI_ERROR (Status); > > + if (EFI_ERROR (Status)) { > > + while (Index-- > 0) { > > + gBS->CloseEvent (mGuidedEvent[Index]); > > + } > > + goto UninstallProtocol; > > + } > > } > > + return EFI_SUCCESS; > > > > +UninstallProtocol: > > gBS->UninstallProtocolInterface ( > > mMmCommunicateHandle, > > &gEfiMmCommunication2ProtocolGuid, > > -- > > 2.17.1 > >