All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christoph Egger" <Christoph.Egger@amd.com>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH][TOOLS] ioemu: Build fixes for BSD and bug fixes from BSD
Date: Fri, 28 Sep 2007 10:07:23 +0200	[thread overview]
Message-ID: <200709281007.23409.Christoph.Egger@amd.com> (raw)
In-Reply-To: <C3218D36.16153%Keir.Fraser@cl.cam.ac.uk>

[-- Attachment #1: Type: text/plain, Size: 1929 bytes --]

On Thursday 27 September 2007 17:39:18 Keir Fraser wrote:
> On 27/9/07 12:35, "Christoph Egger" <Christoph.Egger@amd.com> wrote:
> > Hi!
> >
> > Attached patch makes ioemu build on *BSD.
> > It also applies bug fixes from *BSD for Linux and *BSD :-)
> >
> > Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
>
> I checked in all the bits that look like they are there just to make ioemu
> build and run on *BSD (that's about 90-95% of the patch). The remainder I
> rejected -- that's generic bug fixes to ioemu (belongs upstream and/or as
> separate patches to xen-devel) and anything that looked like it merely
> fixes a build warning (we don't build ioemu with -Werror, and we tolerate
> build warnings because they should really be fixed upstream first).

I agree with you, this also should go into qemu. But I don't have contact to
the qemu people. That's why I asked in the first signed-off mail, if there is
someone with contact to qemu.
Maybe someone from qemu is subscribed on xen-devel, so I resubmit
the remainder as separate patch.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>


> You may want to check that I didn't cut too hard, and resubmit a few bits.
>
>  -- Keir

I just checked. I can live with that what you committed. But I resubmit
the remainder for the case someone from qemu is on xen-devel or
someone with contact to qemu people is on xen-devel, in hope the
*full* patch goes into qemu the one or the other way.

Christoph


-- 
AMD Saxony, Dresden, Germany
Operating System Research Center

Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
   Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
   AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
   Dr. Hans-R. Deppe, Thomas McCoy

[-- Attachment #2: tools_ioemu2.diff --]
[-- Type: text/plain, Size: 4149 bytes --]

diff -r 8817a53c030f tools/ioemu/aes.c
--- a/tools/ioemu/aes.c	Thu Sep 27 18:08:11 2007 +0100
+++ b/tools/ioemu/aes.c	Fri Sep 28 09:48:44 2007 +0000
@@ -30,7 +30,9 @@
 #include "vl.h"
 #include "aes.h"
 
+#ifndef NDEBUG
 #define NDEBUG
+#endif
 #include <assert.h>
 
 typedef uint32_t u32;
diff -r 8817a53c030f tools/ioemu/block-qcow2.c
--- a/tools/ioemu/block-qcow2.c	Thu Sep 27 18:08:11 2007 +0100
+++ b/tools/ioemu/block-qcow2.c	Fri Sep 28 09:48:44 2007 +0000
@@ -1884,6 +1884,8 @@ static int grow_refcount_table(BlockDriv
     int new_table_size, new_table_size2, refcount_table_clusters, i, ret;
     uint64_t *new_table;
     int64_t table_offset;
+    int old_table_size;
+    int64_t old_table_offset;
     uint64_t data64;
     uint32_t data32;
 
@@ -1931,10 +1933,14 @@ static int grow_refcount_table(BlockDriv
                     &data32, sizeof(data32)) != sizeof(data32))
         goto fail;
     qemu_free(s->refcount_table);
+    old_table_offset = s->refcount_table_offset;
+    old_table_size = s->refcount_table_size;
     s->refcount_table = new_table;
     s->refcount_table_size = new_table_size;
+    s->refcount_table_offset = table_offset;
 
     update_refcount(bs, table_offset, new_table_size2, 1);
+    free_clusters(bs, old_table_offset, old_table_size * sizeof(uint64_t));
     return 0;
  fail:
     free_clusters(bs, table_offset, new_table_size2);
diff -r 8817a53c030f tools/ioemu/cpu-all.h
--- a/tools/ioemu/cpu-all.h	Thu Sep 27 18:08:11 2007 +0100
+++ b/tools/ioemu/cpu-all.h	Fri Sep 28 09:48:44 2007 +0000
@@ -1010,13 +1010,22 @@ static inline int64_t cpu_get_real_ticks
 #endif
 }
 #else
-/* The host CPU doesn't have an easily accessible cycle counter.
-   Just return a monotonically increasing vlue.  This will be totally wrong,
-   but hopefully better than nothing.  */
+
+#include <sys/time.h>
+#include <time.h>
+
 static inline int64_t cpu_get_real_ticks (void)
 {
-    static int64_t ticks = 0;
-    return ticks++;
+	struct timeval tv;
+	static int64_t i = 0;
+	int64_t j;
+	
+	gettimeofday(&tv, NULL);
+	do {
+		j = (tv.tv_sec * (uint64_t) 1000000) + tv.tv_usec;
+	} while (i == j);
+	i = j;
+	return j;
 }
 #endif
 
diff -r 8817a53c030f tools/ioemu/dis-asm.h
--- a/tools/ioemu/dis-asm.h	Thu Sep 27 18:08:11 2007 +0100
+++ b/tools/ioemu/dis-asm.h	Fri Sep 28 09:48:44 2007 +0000
@@ -13,6 +13,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <inttypes.h>
+#include "config.h"
 
 #define PARAMS(x) x
 typedef void *PTR;
diff -r 8817a53c030f tools/ioemu/hw/acpi.c
--- a/tools/ioemu/hw/acpi.c	Thu Sep 27 18:08:11 2007 +0100
+++ b/tools/ioemu/hw/acpi.c	Fri Sep 28 09:48:44 2007 +0000
@@ -473,7 +473,7 @@ void piix4_pm_init(PCIBus *bus, int devf
 {
     PIIX4PMState *s;
     uint8_t *pci_conf;
-    uint32_t pm_io_base, smb_io_base;
+    uint32_t smb_io_base;
 
     s = (PIIX4PMState *)pci_register_device(bus,
                                          "PM", sizeof(PIIX4PMState),
diff -r 8817a53c030f tools/ioemu/hw/fdc.c
--- a/tools/ioemu/hw/fdc.c	Thu Sep 27 18:08:11 2007 +0100
+++ b/tools/ioemu/hw/fdc.c	Fri Sep 28 09:48:44 2007 +0000
@@ -176,7 +176,7 @@ typedef struct fd_format_t {
     uint8_t last_sect;
     uint8_t max_track;
     uint8_t max_head;
-    const unsigned char *str;
+    const char *str;
 } fd_format_t;
 
 static fd_format_t fd_formats[] = {
diff -r 8817a53c030f tools/ioemu/hw/ne2000.c
--- a/tools/ioemu/hw/ne2000.c	Thu Sep 27 18:08:11 2007 +0100
+++ b/tools/ioemu/hw/ne2000.c	Fri Sep 28 09:48:44 2007 +0000
@@ -207,7 +207,7 @@ static int ne2000_buffer_full(NE2000Stat
 
     index = s->curpag << 8;
     boundary = s->boundary << 8;
-    if (index <= boundary)
+    if (index < boundary)
         avail = boundary - index;
     else
         avail = (s->stop - s->start) - (index - boundary);
diff -r 8817a53c030f tools/ioemu/hw/pc.c
--- a/tools/ioemu/hw/pc.c	Thu Sep 27 18:08:11 2007 +0100
+++ b/tools/ioemu/hw/pc.c	Fri Sep 28 09:48:44 2007 +0000
@@ -480,7 +480,9 @@ static void pc_init1(uint64_t ram_size, 
     int piix3_devfn = -1;
     CPUState *env;
     NICInfo *nd;
+#ifdef CONFIG_PASSTHROUGH
     int rc;
+#endif
 
     linux_boot = (kernel_filename != NULL);
 

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

  reply	other threads:[~2007-09-28  8:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-27 11:35 [PATCH][TOOLS] ioemu: Build fixes for BSD and bug fixes from BSD Christoph Egger
2007-09-27 14:19 ` Keir Fraser
2007-09-27 14:35   ` Christoph Egger
2007-09-27 15:39 ` Keir Fraser
2007-09-28  8:07   ` Christoph Egger [this message]
2007-09-28 10:31     ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200709281007.23409.Christoph.Egger@amd.com \
    --to=christoph.egger@amd.com \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.