[edk2-devel] [PATCH 5/5] OvmfPkg/VirtioSerialDxe: use TPL_NOTIFY

Gerd Hoffmann posted 5 patches 1 year, 3 months ago
There is a newer version of this series
[edk2-devel] [PATCH 5/5] OvmfPkg/VirtioSerialDxe: use TPL_NOTIFY
Posted by Gerd Hoffmann 1 year, 3 months ago
Apparently TPL_CALLBACK is too low, code runs into an ASSERT
complaining the new TPL is lower than the old TPL.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 OvmfPkg/VirtioSerialDxe/VirtioSerialPort.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/OvmfPkg/VirtioSerialDxe/VirtioSerialPort.c b/OvmfPkg/VirtioSerialDxe/VirtioSerialPort.c
index 522b25e9698c..e4a58deff162 100644
--- a/OvmfPkg/VirtioSerialDxe/VirtioSerialPort.c
+++ b/OvmfPkg/VirtioSerialDxe/VirtioSerialPort.c
@@ -158,7 +158,7 @@ VirtioSerialIoWrite (
 
   VirtioSerialRingClearTx (SerialIo->Dev, PortTx (SerialIo->PortId));
 
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
+  OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
   if (SerialIo->WriteOffset &&
       (SerialIo->WriteOffset + *BufferSize > PORT_TX_BUFSIZE))
   {
@@ -201,7 +201,7 @@ VirtioSerialIoRead (
     goto NoData;
   }
 
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
+  OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
   if (SerialIo->WriteOffset) {
     DEBUG ((DEBUG_VERBOSE, "%a:%d: WriteFlush %d\n", __func__, __LINE__, SerialIo->WriteOffset));
     VirtioSerialRingSendBuffer (
-- 
2.40.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104803): https://edk2.groups.io/g/devel/message/104803
Mute This Topic: https://groups.io/mt/98850082/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 5/5] OvmfPkg/VirtioSerialDxe: use TPL_NOTIFY
Posted by Ard Biesheuvel 1 year, 3 months ago
On Fri, 12 May 2023 at 16:23, Gerd Hoffmann <kraxel@redhat.com> wrote:
>
> Apparently TPL_CALLBACK is too low, code runs into an ASSERT
> complaining the new TPL is lower than the old TPL.
>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

Acked-by: Ard Biesheuvel <ardb@kernel.org>

I'll take this as a separate fix.

> ---
>  OvmfPkg/VirtioSerialDxe/VirtioSerialPort.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/OvmfPkg/VirtioSerialDxe/VirtioSerialPort.c b/OvmfPkg/VirtioSerialDxe/VirtioSerialPort.c
> index 522b25e9698c..e4a58deff162 100644
> --- a/OvmfPkg/VirtioSerialDxe/VirtioSerialPort.c
> +++ b/OvmfPkg/VirtioSerialDxe/VirtioSerialPort.c
> @@ -158,7 +158,7 @@ VirtioSerialIoWrite (
>
>    VirtioSerialRingClearTx (SerialIo->Dev, PortTx (SerialIo->PortId));
>
> -  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
> +  OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
>    if (SerialIo->WriteOffset &&
>        (SerialIo->WriteOffset + *BufferSize > PORT_TX_BUFSIZE))
>    {
> @@ -201,7 +201,7 @@ VirtioSerialIoRead (
>      goto NoData;
>    }
>
> -  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
> +  OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
>    if (SerialIo->WriteOffset) {
>      DEBUG ((DEBUG_VERBOSE, "%a:%d: WriteFlush %d\n", __func__, __LINE__, SerialIo->WriteOffset));
>      VirtioSerialRingSendBuffer (
> --
> 2.40.1
>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#105532): https://edk2.groups.io/g/devel/message/105532
Mute This Topic: https://groups.io/mt/98850082/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 5/5] OvmfPkg/VirtioSerialDxe: use TPL_NOTIFY
Posted by Ard Biesheuvel 1 year, 3 months ago
On Thu, 1 Jun 2023 at 09:56, Ard Biesheuvel <ardb@kernel.org> wrote:
>
> On Fri, 12 May 2023 at 16:23, Gerd Hoffmann <kraxel@redhat.com> wrote:
> >
> > Apparently TPL_CALLBACK is too low, code runs into an ASSERT
> > complaining the new TPL is lower than the old TPL.
> >
> > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
>
> Acked-by: Ard Biesheuvel <ardb@kernel.org>
>
> I'll take this as a separate fix.
>

Merged as #4461

> > ---
> >  OvmfPkg/VirtioSerialDxe/VirtioSerialPort.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/OvmfPkg/VirtioSerialDxe/VirtioSerialPort.c b/OvmfPkg/VirtioSerialDxe/VirtioSerialPort.c
> > index 522b25e9698c..e4a58deff162 100644
> > --- a/OvmfPkg/VirtioSerialDxe/VirtioSerialPort.c
> > +++ b/OvmfPkg/VirtioSerialDxe/VirtioSerialPort.c
> > @@ -158,7 +158,7 @@ VirtioSerialIoWrite (
> >
> >    VirtioSerialRingClearTx (SerialIo->Dev, PortTx (SerialIo->PortId));
> >
> > -  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
> > +  OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
> >    if (SerialIo->WriteOffset &&
> >        (SerialIo->WriteOffset + *BufferSize > PORT_TX_BUFSIZE))
> >    {
> > @@ -201,7 +201,7 @@ VirtioSerialIoRead (
> >      goto NoData;
> >    }
> >
> > -  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
> > +  OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
> >    if (SerialIo->WriteOffset) {
> >      DEBUG ((DEBUG_VERBOSE, "%a:%d: WriteFlush %d\n", __func__, __LINE__, SerialIo->WriteOffset));
> >      VirtioSerialRingSendBuffer (
> > --
> > 2.40.1
> >



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#105547): https://edk2.groups.io/g/devel/message/105547
Mute This Topic: https://groups.io/mt/98850082/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-