All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pcnet: switch to use qemu_receive_packet() for loopback
       [not found] <20210301073947.39451-1-jasowang@redhat.com>
@ 2021-03-01 15:33 ` Alexander Bulekov
  2021-03-01 19:08   ` Philippe Mathieu-Daudé
  2021-03-01 19:33 ` [PATCH] cadence_gem: " Alexander Bulekov
  2021-03-01 19:35 ` [PATCH] lan9118: " Alexander Bulekov
  2 siblings, 1 reply; 5+ messages in thread
From: Alexander Bulekov @ 2021-03-01 15:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: alxndr, Jason Wang, philmd, qemu-security, ppandit

This patch switches to use qemu_receive_packet() which can detect
reentrancy and return early.

Buglink: https://bugs.launchpad.net/qemu/+bug/1917085
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
---

Here's another one, that looks like the same issue.
-Alex

 hw/net/pcnet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/net/pcnet.c b/hw/net/pcnet.c
index f3f18d8598..dcd3fc4948 100644
--- a/hw/net/pcnet.c
+++ b/hw/net/pcnet.c
@@ -1250,7 +1250,7 @@ txagain:
             if (BCR_SWSTYLE(s) == 1)
                 add_crc = !GET_FIELD(tmd.status, TMDS, NOFCS);
             s->looptest = add_crc ? PCNET_LOOPTEST_CRC : PCNET_LOOPTEST_NOCRC;
-            pcnet_receive(qemu_get_queue(s->nic), s->buffer, s->xmit_pos);
+            qemu_receive_packet(qemu_get_queue(s->nic), s->buffer, s->xmit_pos);
             s->looptest = 0;
         } else {
             if (s->nic) {
-- 
2.28.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] pcnet: switch to use qemu_receive_packet() for loopback
  2021-03-01 15:33 ` [PATCH] pcnet: switch to use qemu_receive_packet() for loopback Alexander Bulekov
@ 2021-03-01 19:08   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-03-01 19:08 UTC (permalink / raw)
  To: Alexander Bulekov, qemu-devel; +Cc: Jason Wang, qemu-security, ppandit

On 3/1/21 4:33 PM, Alexander Bulekov wrote:
> This patch switches to use qemu_receive_packet() which can detect
> reentrancy and return early.
> 
> Buglink: https://bugs.launchpad.net/qemu/+bug/1917085
> Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
> ---
> 
> Here's another one, that looks like the same issue.
> -Alex
> 
>  hw/net/pcnet.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] cadence_gem: switch to use qemu_receive_packet() for loopback
       [not found] <20210301073947.39451-1-jasowang@redhat.com>
  2021-03-01 15:33 ` [PATCH] pcnet: switch to use qemu_receive_packet() for loopback Alexander Bulekov
@ 2021-03-01 19:33 ` Alexander Bulekov
  2021-03-09 14:26   ` Alistair Francis
  2021-03-01 19:35 ` [PATCH] lan9118: " Alexander Bulekov
  2 siblings, 1 reply; 5+ messages in thread
From: Alexander Bulekov @ 2021-03-01 19:33 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Jason Wang, Alistair Francis, qemu-security,
	ppandit, alxndr, open list:Xilinx Zynq, Edgar E. Iglesias,
	philmd

This patch switches to use qemu_receive_packet() which can detect
reentrancy and return early.

Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
---
 hw/net/cadence_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c
index 9a4474a084..1c576a130c 100644
--- a/hw/net/cadence_gem.c
+++ b/hw/net/cadence_gem.c
@@ -1275,7 +1275,7 @@ static void gem_transmit(CadenceGEMState *s)
                 /* Send the packet somewhere */
                 if (s->phy_loop || (s->regs[GEM_NWCTRL] &
                                     GEM_NWCTRL_LOCALLOOP)) {
-                    gem_receive(qemu_get_queue(s->nic), s->tx_packet,
+                    qemu_receive_packet(qemu_get_queue(s->nic), s->tx_packet,
                                 total_bytes);
                 } else {
                     qemu_send_packet(qemu_get_queue(s->nic), s->tx_packet,
-- 
2.28.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] lan9118: switch to use qemu_receive_packet() for loopback
       [not found] <20210301073947.39451-1-jasowang@redhat.com>
  2021-03-01 15:33 ` [PATCH] pcnet: switch to use qemu_receive_packet() for loopback Alexander Bulekov
  2021-03-01 19:33 ` [PATCH] cadence_gem: " Alexander Bulekov
@ 2021-03-01 19:35 ` Alexander Bulekov
  2 siblings, 0 replies; 5+ messages in thread
From: Alexander Bulekov @ 2021-03-01 19:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: alxndr, Jason Wang, philmd, qemu-security, ppandit

This patch switches to use qemu_receive_packet() which can detect
reentrancy and return early.

Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
---

I think this is the last one that directly calls its own receive
function to do loopback (or the last one within my grepping
capapbilities).
-Alex

 hw/net/lan9118.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/net/lan9118.c b/hw/net/lan9118.c
index abc796285a..6aff424cbe 100644
--- a/hw/net/lan9118.c
+++ b/hw/net/lan9118.c
@@ -680,7 +680,7 @@ static void do_tx_packet(lan9118_state *s)
     /* FIXME: Honor TX disable, and allow queueing of packets.  */
     if (s->phy_control & 0x4000)  {
         /* This assumes the receive routine doesn't touch the VLANClient.  */
-        lan9118_receive(qemu_get_queue(s->nic), s->txp->data, s->txp->len);
+        qemu_receive_packet(qemu_get_queue(s->nic), s->txp->data, s->txp->len);
     } else {
         qemu_send_packet(qemu_get_queue(s->nic), s->txp->data, s->txp->len);
     }
-- 
2.28.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] cadence_gem: switch to use qemu_receive_packet() for loopback
  2021-03-01 19:33 ` [PATCH] cadence_gem: " Alexander Bulekov
@ 2021-03-09 14:26   ` Alistair Francis
  0 siblings, 0 replies; 5+ messages in thread
From: Alistair Francis @ 2021-03-09 14:26 UTC (permalink / raw)
  To: Alexander Bulekov
  Cc: Peter Maydell, Jason Wang, Alistair Francis,
	qemu-devel@nongnu.org Developers, qemu-security, P J P,
	open list:Xilinx Zynq, Edgar E. Iglesias,
	Philippe Mathieu-Daudé

On Mon, Mar 1, 2021 at 2:34 PM Alexander Bulekov <alxndr@bu.edu> wrote:
>
> This patch switches to use qemu_receive_packet() which can detect
> reentrancy and return early.
>
> Signed-off-by: Alexander Bulekov <alxndr@bu.edu>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  hw/net/cadence_gem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c
> index 9a4474a084..1c576a130c 100644
> --- a/hw/net/cadence_gem.c
> +++ b/hw/net/cadence_gem.c
> @@ -1275,7 +1275,7 @@ static void gem_transmit(CadenceGEMState *s)
>                  /* Send the packet somewhere */
>                  if (s->phy_loop || (s->regs[GEM_NWCTRL] &
>                                      GEM_NWCTRL_LOCALLOOP)) {
> -                    gem_receive(qemu_get_queue(s->nic), s->tx_packet,
> +                    qemu_receive_packet(qemu_get_queue(s->nic), s->tx_packet,
>                                  total_bytes);
>                  } else {
>                      qemu_send_packet(qemu_get_queue(s->nic), s->tx_packet,
> --
> 2.28.0
>
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-03-09 15:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210301073947.39451-1-jasowang@redhat.com>
2021-03-01 15:33 ` [PATCH] pcnet: switch to use qemu_receive_packet() for loopback Alexander Bulekov
2021-03-01 19:08   ` Philippe Mathieu-Daudé
2021-03-01 19:33 ` [PATCH] cadence_gem: " Alexander Bulekov
2021-03-09 14:26   ` Alistair Francis
2021-03-01 19:35 ` [PATCH] lan9118: " Alexander Bulekov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.