Gleb Natapov | 1 Sep 09:25 2008

[PATCH v4 3/8] Add "info uuid" command to monitor.

Signed-off-by: Gleb Natapov <gleb <at> qumranet.com>
---

 monitor.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/monitor.c b/monitor.c
index 43b188a..dfcf025 100644
--- a/monitor.c
+++ b/monitor.c
 <at>  <at>  -253,6 +253,15  <at>  <at>  static void do_info_name(void)
         term_printf("%s\n", qemu_name);
 }

+static void do_info_uuid(void)
+{
+    term_printf(UUID_FMT "\n", qemu_uuid[0], qemu_uuid[1], qemu_uuid[2],
+            qemu_uuid[3], qemu_uuid[4], qemu_uuid[5], qemu_uuid[6],
+            qemu_uuid[7], qemu_uuid[8], qemu_uuid[9], qemu_uuid[10],
+            qemu_uuid[11], qemu_uuid[12], qemu_uuid[13], qemu_uuid[14],
+            qemu_uuid[15]);
+}
+
 static void do_info_block(void)
 {
     bdrv_info();
 <at>  <at>  -1501,6 +1510,8  <at>  <at>  static term_cmd_t info_cmds[] = {
       "", "show the vnc server status"},
     { "name", "", do_info_name,
       "", "show the current VM name" },
(Continue reading)

Gleb Natapov | 1 Sep 09:25 2008

[PATCH v4 4/8] Use libuuid if available.

If libuuid is available use it for UUID generation in case a user asks for it.

Signed-off-by: Gleb Natapov <gleb <at> qumranet.com>
---

 Makefile.target |    4 ++++
 configure       |   21 +++++++++++++++++++++
 vl.c            |   16 ++++++++++++++++
 3 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/Makefile.target b/Makefile.target
index 02bb553..681073d 100644
--- a/Makefile.target
+++ b/Makefile.target
 <at>  <at>  -519,6 +519,10  <at>  <at>  CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
 LIBS += $(CONFIG_VNC_TLS_LIBS)
 endif

+ifdef CONFIG_UUID
+LIBS += -luuid
+endif
+
 # SCSI layer
 OBJS+= lsi53c895a.o esp.o

diff --git a/configure b/configure
index acb4a4a..fa46a64 100755
--- a/configure
+++ b/configure
 <at>  <at>  -110,6 +110,7  <at>  <at>  curses="yes"
(Continue reading)

Gleb Natapov | 1 Sep 09:26 2008

[PATCH v4 8/8] Add sparc keys to firmware configuration.

From: Blue Swirl <blauwirbel <at> gmail.com>

---

 hw/sun4m.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/hw/sun4m.c b/hw/sun4m.c
index 88bb0d4..0797574 100644
--- a/hw/sun4m.c
+++ b/hw/sun4m.c
 <at>  <at>  -80,6 +80,7  <at>  <at> 
 #define PROM_VADDR           0xffd00000
 #define PROM_FILENAME        "openbios-sparc32"
 #define CFG_ADDR             0xd00000510ULL
+#define FW_CFG_SUN4M_DEPTH   (FW_CFG_ARCH_LOCAL + 0x00)

 // Control plane, 8-bit and 24-bit planes
 #define TCX_SIZE             (9 * 1024 * 1024)
 <at>  <at>  -582,6 +583,7  <at>  <at>  static void sun4m_hw_init(const struct hwdef *hwdef, ram_addr_t RAM_size,
     fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1);
     fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size);
     fw_cfg_add_i16(fw_cfg, FW_CFG_MACHINE_ID, hwdef->machine_id);
+    fw_cfg_add_i16(fw_cfg, FW_CFG_SUN4M_DEPTH, graphic_depth);
 }

 static void sun4c_hw_init(const struct hwdef *hwdef, ram_addr_t RAM_size,

Gleb Natapov | 1 Sep 09:25 2008

[PATCH v4 0/8] Add new firmware configuration mechanism

Hi,

Here the latest version of the patch series. I hope now ready for inclusion.

This patch series implements simple key/value base communication channel
to pass firmware configuration from qemu to gues firmware in patch 1.
Patches 2-5 implement UUID support. Patch 6 implements CPU speed detection
needed by SMBIOS. Patch 7 adds more common keys that may be used by
various firmwares. Patch 8 add sparc specific keys.

---

Blue Swirl (2):
      Add sparc keys to firmware configuration.
      Add common keys to firmware configuration

Gleb Natapov (6):
      Pass cpu speed into SM BIOS.
      Add UUID to firmware configuration info.
      Use libuuid if available.
      Add "info uuid" command to monitor.
      Add -uuid command line option.
      Key/value based qemu<->guest firmware communication mechanism.

 Makefile.target |    5 +
 configure       |   21 +++++
 hw/fw_cfg.c     |  226 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/fw_cfg.h     |   26 ++++++
 hw/pc.c         |   96 +++++++++++++++++++++++
 hw/sun4m.c      |   93 ++++++++++++++++++-----
(Continue reading)

Gleb Natapov | 1 Sep 09:26 2008

[PATCH v4 6/8] Pass cpu speed into SM BIOS.

Signed-off-by: Gleb Natapov <gleb <at> qumranet.com>
---

 hw/fw_cfg.c |    4 +--
 hw/pc.c     |   88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 90 insertions(+), 2 deletions(-)

diff --git a/hw/fw_cfg.c b/hw/fw_cfg.c
index b5c7d46..603613b 100644
--- a/hw/fw_cfg.c
+++ b/hw/fw_cfg.c
 <at>  <at>  -27,7 +27,7  <at>  <at> 
 #include "fw_cfg.h"

 /* debug firmware config */
-//#define DEBUG_FW_CFG
+#define DEBUG_FW_CFG

 #ifdef DEBUG_FW_CFG
 #define FW_CFG_DPRINTF(fmt, args...)                     \
 <at>  <at>  -73,7 +73,7  <at>  <at>  static uint8_t fw_cfg_read(FWCfgState *s)
     FWCfgEntry *e = &s->entries[arch][s->cur_entry & ~FW_CFG_ARCH_LOCAL];
     uint8_t ret;

-    if (s->cur_entry != FW_CFG_INVALID || !e->data || s->cur_offset >= e->len)
+    if (s->cur_entry == FW_CFG_INVALID || !e->data || s->cur_offset >= e->len)
         ret = 0;
     else
         ret = e->data[s->cur_offset++];
diff --git a/hw/pc.c b/hw/pc.c
(Continue reading)

Gleb Natapov | 1 Sep 09:25 2008

[PATCH v4 2/8] Add -uuid command line option.

Let user specify UUID of the virtual machine.

Signed-off-by: Gleb Natapov <gleb <at> qumranet.com>
---

 sysemu.h |    2 ++
 vl.c     |   29 +++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/sysemu.h b/sysemu.h
index b12fae0..931ac3a 100644
--- a/sysemu.h
+++ b/sysemu.h
 <at>  <at>  -8,6 +8,8  <at>  <at>  extern const char *bios_dir;

 extern int vm_running;
 extern const char *qemu_name;
+extern uint8_t qemu_uuid[];
+#define UUID_FMT "%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"

 typedef struct vm_change_state_entry VMChangeStateEntry;
 typedef void VMChangeStateHandler(void *opaque, int running);
diff --git a/vl.c b/vl.c
index 8dc0708..6df0832 100644
--- a/vl.c
+++ b/vl.c
 <at>  <at>  -257,6 +257,8  <at>  <at>  static int64_t qemu_icount_bias;
 QEMUTimer *icount_rt_timer;
 QEMUTimer *icount_vm_timer;

(Continue reading)

Gleb Natapov | 1 Sep 09:25 2008

[PATCH v4 1/8] Key/value based qemu<->guest firmware communication mechanism.

Generic way to pass configuration info between qemu process and guest firmware.

Signed-off-by: Gleb Natapov <gleb <at> qumranet.com>
---

 Makefile.target |    1 
 hw/fw_cfg.c     |  220 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/fw_cfg.h     |   21 +++++
 hw/pc.c         |    7 ++
 hw/sun4m.c      |   14 ++++
 hw/sun4u.c      |    5 +
 6 files changed, 268 insertions(+), 0 deletions(-)
 create mode 100644 hw/fw_cfg.c
 create mode 100644 hw/fw_cfg.h

diff --git a/Makefile.target b/Makefile.target
index 2464484..02bb553 100644
--- a/Makefile.target
+++ b/Makefile.target
 <at>  <at>  -473,6 +473,7  <at>  <at>  endif #CONFIG_DARWIN_USER
 ifndef CONFIG_USER_ONLY

 OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o net-checksum.o
+OBJS+=fw_cfg.o
 ifdef CONFIG_WIN32
 OBJS+=block-raw-win32.o
 else
diff --git a/hw/fw_cfg.c b/hw/fw_cfg.c
new file mode 100644
index 0000000..e22cb27
(Continue reading)

Gleb Natapov | 1 Sep 09:44 2008

Re: [PATCH v4 1/8] Key/value based qemu<->guest firmware communication mechanism.

Sorry, use this one instead.

---
    Generic way to pass configuration info between qemu process and guest firmware.

    Signed-off-by: Gleb Natapov <gleb <at> qumranet.com>

diff --git a/Makefile.target b/Makefile.target
index 2464484..02bb553 100644
--- a/Makefile.target
+++ b/Makefile.target
 <at>  <at>  -473,6 +473,7  <at>  <at>  endif #CONFIG_DARWIN_USER
 ifndef CONFIG_USER_ONLY

 OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o net-checksum.o
+OBJS+=fw_cfg.o
 ifdef CONFIG_WIN32
 OBJS+=block-raw-win32.o
 else
diff --git a/hw/fw_cfg.c b/hw/fw_cfg.c
new file mode 100644
index 0000000..ee06905
--- /dev/null
+++ b/hw/fw_cfg.c
 <at>  <at>  -0,0 +1,220  <at>  <at> 
+/*
+ * QEMU Firmware configuration device emulation
+ *
+ * Copyright (c) 2008 Gleb Natapov
+ *
(Continue reading)

Gleb Natapov | 1 Sep 09:26 2008

[PATCH v4 7/8] Add common keys to firmware configuration

From: Blue Swirl <blauwirbel <at> gmail.com>

---

 hw/fw_cfg.c |    4 +++
 hw/fw_cfg.h |    4 +++
 hw/pc.c     |    1 +
 hw/sun4m.c  |   77 ++++++++++++++++++++++++++++++++++++++++++++---------------
 hw/sun4u.c  |   10 ++++++++
 5 files changed, 77 insertions(+), 19 deletions(-)

diff --git a/hw/fw_cfg.c b/hw/fw_cfg.c
index 603613b..6ec69f1 100644
--- a/hw/fw_cfg.c
+++ b/hw/fw_cfg.c
 <at>  <at>  -197,6 +197,7  <at>  <at>  void *fw_cfg_init(uint32_t port, target_phys_addr_t addr)
 {
     FWCfgState *s;
     int io_memory;
+    extern int nographic;

     s = qemu_mallocz(sizeof(FWCfgState));
     if (!s)
 <at>  <at>  -214,6 +215,9  <at>  <at>  void *fw_cfg_init(uint32_t port, target_phys_addr_t addr)
     }
     fw_cfg_add_bytes(s, FW_CFG_SIGNATURE, (uint8_t *)"QEMU", 4);
     fw_cfg_add_bytes(s, FW_CFG_UUID, qemu_uuid, 16);
+    fw_cfg_add_i16(s, FW_CFG_NOGRAPHIC, (uint16_t)nographic);
+    fw_cfg_add_i16(s, FW_CFG_NB_CPUS, (uint16_t)smp_cpus);
+
(Continue reading)

Gleb Natapov | 1 Sep 09:46 2008

Re: [PATCH v4 6/8] Pass cpu speed into SM BIOS.

Sorry, use this one instead.

---
    Signed-off-by: Gleb Natapov <gleb <at> qumranet.com>

diff --git a/hw/pc.c b/hw/pc.c
index 933e936..aae9fc6 100644
--- a/hw/pc.c
+++ b/hw/pc.c
 <at>  <at>  -49,6 +49,8  <at>  <at> 

 #define MAX_IDE_BUS 2

+#define FW_CFG_PC_CPUSPEED (FW_CFG_ARCH_LOCAL + 0x00)
+
 static fdctrl_t *floppy_controller;
 static RTCState *rtc_state;
 static PITState *pit;
 <at>  <at>  -369,6 +371,89  <at>  <at>  static uint32_t ioport92_read(void *opaque, uint32_t addr)
     return ioport_get_a20() << 1;
 }

+#ifdef __linux__
+/* get_freq () function is taken from conky source code */
+#define CPUFREQ_PREFIX "/sys/devices/system/cpu"
+#define CPUFREQ_POSTFIX "cpufreq/scaling_cur_freq"
+
+/* return system frequency in MHz (use divisor=1) or GHz (use divisor=1000) */
+static double get_freq(int divisor, unsigned int cpu)
+{
(Continue reading)


Gmane