qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/3] Trivial patches for 18 to 23 November 2011
@ 2011-11-23 10:42 Stefan Hajnoczi
  2011-11-23 10:42 ` [Qemu-devel] [PATCH 1/3] slirp: Clean up net_slirp_hostfwd_remove()'s use of get_str_sep() Stefan Hajnoczi
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2011-11-23 10:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Liguori, Stefan Hajnoczi

Please add these fixes to QEMU 1.0, if possible.

The following changes since commit 40897c9c160393df922dfdb59cfa210048d3071d:

  Update version for 1.0-rc3 release (2011-11-21 15:05:59 -0600)

are available in the git repository at:
  ssh://repo.or.cz/srv/git/qemu/stefanha.git trivial-patches

Julian Pidancet (1):
      rtl8139: Fix invalid IO access alignment

Markus Armbruster (1):
      slirp: Clean up net_slirp_hostfwd_remove()'s use of get_str_sep()

Stefano Stabellini (1):
      fix out of tree build

 Makefile     |    2 +-
 hw/rtl8139.c |   14 +-------------
 net/slirp.c  |    9 ++++-----
 3 files changed, 6 insertions(+), 19 deletions(-)

-- 
1.7.7.1

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

* [Qemu-devel] [PATCH 1/3] slirp: Clean up net_slirp_hostfwd_remove()'s use of get_str_sep()
  2011-11-23 10:42 [Qemu-devel] [PULL 0/3] Trivial patches for 18 to 23 November 2011 Stefan Hajnoczi
@ 2011-11-23 10:42 ` Stefan Hajnoczi
  2011-11-23 10:42 ` [Qemu-devel] [PATCH 2/3] rtl8139: Fix invalid IO access alignment Stefan Hajnoczi
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2011-11-23 10:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Liguori, Markus Armbruster, Stefan Hajnoczi

From: Markus Armbruster <armbru@redhat.com>

get_str_sep() can fail, but net_slirp_hostfwd_remove() doesn't check.
Works, because it initializes buf[] to "", which get_str_sep() doesn't
touch when it fails.  Coverity doesn't like it, and neither do I.

Change it to work exactly like slirp_hostfwd().

Acked-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 net/slirp.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/net/slirp.c b/net/slirp.c
index c6cda5d..6646ecb 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -305,7 +305,7 @@ void net_slirp_hostfwd_remove(Monitor *mon, const QDict *qdict)
 {
     struct in_addr host_addr = { .s_addr = INADDR_ANY };
     int host_port;
-    char buf[256] = "";
+    char buf[256];
     const char *src_str, *p;
     SlirpState *s;
     int is_udp = 0;
@@ -325,11 +325,10 @@ void net_slirp_hostfwd_remove(Monitor *mon, const QDict *qdict)
         return;
     }
 
-    if (!src_str || !src_str[0])
-        goto fail_syntax;
-
     p = src_str;
-    get_str_sep(buf, sizeof(buf), &p, ':');
+    if (!p || get_str_sep(buf, sizeof(buf), &p, ':') < 0) {
+        goto fail_syntax;
+    }
 
     if (!strcmp(buf, "tcp") || buf[0] == '\0') {
         is_udp = 0;
-- 
1.7.7.1

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

* [Qemu-devel] [PATCH 2/3] rtl8139: Fix invalid IO access alignment
  2011-11-23 10:42 [Qemu-devel] [PULL 0/3] Trivial patches for 18 to 23 November 2011 Stefan Hajnoczi
  2011-11-23 10:42 ` [Qemu-devel] [PATCH 1/3] slirp: Clean up net_slirp_hostfwd_remove()'s use of get_str_sep() Stefan Hajnoczi
@ 2011-11-23 10:42 ` Stefan Hajnoczi
  2011-11-23 10:42 ` [Qemu-devel] [PATCH 3/3] fix out of tree build Stefan Hajnoczi
  2011-11-28 22:32 ` [Qemu-devel] [PULL 0/3] Trivial patches for 18 to 23 November 2011 Anthony Liguori
  3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2011-11-23 10:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Liguori, Stefan Hajnoczi, Julian Pidancet

From: Julian Pidancet <julian.pidancet@gmail.com>

This patch makes iPXE work with the rtl8139 emulation. The rtl8139
driver in iPXE issues a 16bit access on the ChipCmd register
(offset 0x37) to check the status of the rx buffer. The offset of the
ioport access was getting fixed up to 0x36 in qemu, causing the value
read in iPXE to be invalid.

This fixes an issue with iPXE reporting timeouts during TFTP transfers.

Reposting this here because it is trivial enough and the original post
on qemu-devel didn't attract much attention.

Also, the inw() which was causing the issue has been replaced with an
inb() in upstream iPXE:
https://git.ipxe.org/ipxe.git/commit/91dd64ad25baa27954a7518e73df4fca8a2d0c93

Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 hw/rtl8139.c |   14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)

diff --git a/hw/rtl8139.c b/hw/rtl8139.c
index 4c37993..aa8ed0a 100644
--- a/hw/rtl8139.c
+++ b/hw/rtl8139.c
@@ -1971,7 +1971,7 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
     cplus_tx_ring_desc += 16 * descriptor;
 
     DPRINTF("+++ C+ mode reading TX descriptor %d from host memory at "
-        "%08x0x%08x = 0x"DMA_ADDR_FMT"\n", descriptor, s->TxAddr[1],
+        "%08x %08x = 0x"DMA_ADDR_FMT"\n", descriptor, s->TxAddr[1],
         s->TxAddr[0], cplus_tx_ring_desc);
 
     uint32_t val, txdw0,txdw1,txbufLO,txbufHI;
@@ -2713,8 +2713,6 @@ static void rtl8139_io_writeb(void *opaque, uint8_t addr, uint32_t val)
 {
     RTL8139State *s = opaque;
 
-    addr &= 0xff;
-
     switch (addr)
     {
         case MAC0 ... MAC0+5:
@@ -2800,8 +2798,6 @@ static void rtl8139_io_writew(void *opaque, uint8_t addr, uint32_t val)
 {
     RTL8139State *s = opaque;
 
-    addr &= 0xfe;
-
     switch (addr)
     {
         case IntrMask:
@@ -2900,8 +2896,6 @@ static void rtl8139_io_writel(void *opaque, uint8_t addr, uint32_t val)
 {
     RTL8139State *s = opaque;
 
-    addr &= 0xfc;
-
     switch (addr)
     {
         case RxMissed:
@@ -2969,8 +2963,6 @@ static uint32_t rtl8139_io_readb(void *opaque, uint8_t addr)
     RTL8139State *s = opaque;
     int ret;
 
-    addr &= 0xff;
-
     switch (addr)
     {
         case MAC0 ... MAC0+5:
@@ -3043,8 +3035,6 @@ static uint32_t rtl8139_io_readw(void *opaque, uint8_t addr)
     RTL8139State *s = opaque;
     uint32_t ret;
 
-    addr &= 0xfe; /* mask lower bit */
-
     switch (addr)
     {
         case IntrMask:
@@ -3120,8 +3110,6 @@ static uint32_t rtl8139_io_readl(void *opaque, uint8_t addr)
     RTL8139State *s = opaque;
     uint32_t ret;
 
-    addr &= 0xfc; /* also mask low 2 bits */
-
     switch (addr)
     {
         case RxMissed:
-- 
1.7.7.1

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

* [Qemu-devel] [PATCH 3/3] fix out of tree build
  2011-11-23 10:42 [Qemu-devel] [PULL 0/3] Trivial patches for 18 to 23 November 2011 Stefan Hajnoczi
  2011-11-23 10:42 ` [Qemu-devel] [PATCH 1/3] slirp: Clean up net_slirp_hostfwd_remove()'s use of get_str_sep() Stefan Hajnoczi
  2011-11-23 10:42 ` [Qemu-devel] [PATCH 2/3] rtl8139: Fix invalid IO access alignment Stefan Hajnoczi
@ 2011-11-23 10:42 ` Stefan Hajnoczi
  2011-11-28 22:32 ` [Qemu-devel] [PULL 0/3] Trivial patches for 18 to 23 November 2011 Anthony Liguori
  3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2011-11-23 10:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Liguori, Stefan Hajnoczi, Stefano Stabellini

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 7c93739..b06599c 100644
--- a/Makefile
+++ b/Makefile
@@ -168,7 +168,7 @@ check-qjson: check-qjson.o $(qobject-obj-y) $(tools-obj-y)
 test-coroutine: test-coroutine.o qemu-timer-common.o async.o $(coroutine-obj-y) $(tools-obj-y)
 
 $(qapi-obj-y): $(GENERATED_HEADERS)
-qapi-dir := qapi-generated
+qapi-dir := $(SRC_PATH)/qapi-generated
 test-visitor.o test-qmp-commands.o qemu-ga$(EXESUF): QEMU_CFLAGS += -I $(qapi-dir)
 qemu-ga$(EXESUF): LIBS = $(LIBS_QGA)
 
-- 
1.7.7.1

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

* Re: [Qemu-devel] [PULL 0/3] Trivial patches for 18 to 23 November 2011
  2011-11-23 10:42 [Qemu-devel] [PULL 0/3] Trivial patches for 18 to 23 November 2011 Stefan Hajnoczi
                   ` (2 preceding siblings ...)
  2011-11-23 10:42 ` [Qemu-devel] [PATCH 3/3] fix out of tree build Stefan Hajnoczi
@ 2011-11-28 22:32 ` Anthony Liguori
  3 siblings, 0 replies; 5+ messages in thread
From: Anthony Liguori @ 2011-11-28 22:32 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-devel

On 11/23/2011 04:42 AM, Stefan Hajnoczi wrote:
> Please add these fixes to QEMU 1.0, if possible.
>
> The following changes since commit 40897c9c160393df922dfdb59cfa210048d3071d:
>
>    Update version for 1.0-rc3 release (2011-11-21 15:05:59 -0600)

Pulled although I reverted Stefano's patch.  Thanks.

Regards,

Anthony Liguori

>
> are available in the git repository at:
>    ssh://repo.or.cz/srv/git/qemu/stefanha.git trivial-patches
>
> Julian Pidancet (1):
>        rtl8139: Fix invalid IO access alignment
>
> Markus Armbruster (1):
>        slirp: Clean up net_slirp_hostfwd_remove()'s use of get_str_sep()
>
> Stefano Stabellini (1):
>        fix out of tree build
>
>   Makefile     |    2 +-
>   hw/rtl8139.c |   14 +-------------
>   net/slirp.c  |    9 ++++-----
>   3 files changed, 6 insertions(+), 19 deletions(-)
>

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

end of thread, other threads:[~2011-11-28 22:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-23 10:42 [Qemu-devel] [PULL 0/3] Trivial patches for 18 to 23 November 2011 Stefan Hajnoczi
2011-11-23 10:42 ` [Qemu-devel] [PATCH 1/3] slirp: Clean up net_slirp_hostfwd_remove()'s use of get_str_sep() Stefan Hajnoczi
2011-11-23 10:42 ` [Qemu-devel] [PATCH 2/3] rtl8139: Fix invalid IO access alignment Stefan Hajnoczi
2011-11-23 10:42 ` [Qemu-devel] [PATCH 3/3] fix out of tree build Stefan Hajnoczi
2011-11-28 22:32 ` [Qemu-devel] [PULL 0/3] Trivial patches for 18 to 23 November 2011 Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).