陳韋任 | 17 May 05:09
Picon

Is it possible to retrieve pre-process information in QEMU?

Hi all,

  I would like to know if I can retrieve pre-process information in QEMU
system mode. For example, I want to know each process's page fault ratio.
Is there a way to do that?

  Thanks.

Regards,
chenwj

--

-- 
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj

Zhang, Yang Z | 17 May 04:29
Picon
Favicon

[PATCH v6 7/7] RTC:Allow to migrate from old QEMU

The new logic is compatible with old. So should not block to migrate
from old QEMU. But new version cannot migrate to old.

Signed-off-by: Yang Zhang <yang.z.zhang <at> Intel.com>
---
 hw/mc146818rtc.c |   43 ++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
index 956f10b..3c31c0b 100644
--- a/hw/mc146818rtc.c
+++ b/hw/mc146818rtc.c
@@ -808,11 +808,48 @@ static int rtc_post_load(void *opaque, int version_id)
     return 0;
 }

+static int rtc_load_old(QEMUFile *f, void *opaque, int version_id)
+{
+    RTCState *s = opaque;
+    uint8_t buf[77];
+
+    if (version_id > 2) {
+        return -EINVAL;
+    }
+
+    qemu_get_buffer(f, s->cmos_data, sizeof(s->cmos_data));
+    qemu_get_8s(f, &s->cmos_index);
+
+    /* Skip loading of s->current_tm, we already have the
+     * information in cmos_data.
(Continue reading)

Zhang, Yang Z | 17 May 04:29
Picon
Favicon

[PATCH v6 5/7] RTC:Add RTC update-ended interrupt support

There are no need to run a periodic timer to emulate updated-end
logic. Only run the timer when the UF is cleared.

Signed-off-by: Yang Zhang <yang.z.zhang <at> Intel.com>
---
 hw/mc146818rtc.c |   95 +++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 87 insertions(+), 8 deletions(-)

diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
index 3dd71ac..461e8f3 100644
--- a/hw/mc146818rtc.c
+++ b/hw/mc146818rtc.c
@@ -67,6 +67,11 @@ typedef struct RTCState {
     /* periodic timer */
     QEMUTimer *periodic_timer;
     int64_t next_periodic_time;
+    /* update-ended timer */
+    QEMUTimer *update_timer;
+    QEMUTimer *update_timer2;
+    uint64_t next_update_time;
+    uint32_t use_timer;
     uint16_t irq_reinject_on_ack_count;
     uint32_t irq_coalesced;
     uint32_t period;
@@ -132,7 +137,8 @@ static void rtc_coalesced_timer(void *opaque)
 }
 #endif

-static void rtc_timer_update(RTCState *s, int64_t current_time)
+/* handle periodic timer */
(Continue reading)

Zhang, Yang Z | 17 May 04:28
Picon
Favicon

[PATCH v6 4/7] RTC: Add divider reset support

The first update cycle begins one - half seconds later when divider reset is removing.

Signed-off-by: Yang Zhang <yang.z.zhang <at> Intel.com>
---
 hw/mc146818rtc.c |   46 ++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 40 insertions(+), 6 deletions(-)

diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
index b03c420..3dd71ac 100644
--- a/hw/mc146818rtc.c
+++ b/hw/mc146818rtc.c
@@ -80,6 +80,14 @@ static void rtc_set_time(RTCState *s);
 static void rtc_calibrate_time(RTCState *s);
 static void rtc_set_cmos(RTCState *s);

+static int32_t divider_reset;
+
+static inline bool rtc_running(RTCState *s)
+{
+    return (!(s->cmos_data[RTC_REG_B] & REG_B_SET) &&
+            (s->cmos_data[RTC_REG_A] & 0x70) <= 0x20);
+}
+
 static uint64_t get_guest_rtc_us(RTCState *s)
 {
     uint64_t guest_rtc;
@@ -221,12 +229,30 @@ static void cmos_ioport_write(void *opaque, uint32_t addr, uint32_t data)
         case RTC_YEAR:
             s->cmos_data[s->cmos_index] = data;
             /* if in set mode, do not update the time */
(Continue reading)

Joel Martin | 17 May 00:54
Gravatar

[PATCH] ui/vnc: Only report/use TIGHT_PNG encoding if enabled.

If TIGHT_PNG is not enabled by the --enable-vnc-png configure flag
then do not report to the client that it is supported.

Also, since TIGHT_PNG is the same as the TIGHT encoding but with the
filter/copy replaced with PNG data, adding it to the supported
encodings list when it is disabled will cause the TIGHT encoding to be
used even though the client requested TIGHT_PNG.

Signed-off-by: Joel Martin <github <at> martintribe.org>
---
 ui/vnc.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/ui/vnc.c b/ui/vnc.c
index be384a5..517d5fa 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -1818,10 +1818,12 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)
             vs->features |= VNC_FEATURE_TIGHT_MASK;
             vs->vnc_encoding = enc;
             break;
+#ifdef CONFIG_VNC_PNG
         case VNC_ENCODING_TIGHT_PNG:
             vs->features |= VNC_FEATURE_TIGHT_PNG_MASK;
             vs->vnc_encoding = enc;
             break;
+#endif
         case VNC_ENCODING_ZLIB:
             vs->features |= VNC_FEATURE_ZLIB_MASK;
             vs->vnc_encoding = enc;
(Continue reading)

Brian W. Neu | 17 May 00:25

[Bug 498035] Re: qemu hangs on shutdown or reboot (XP guest)

Confirming under Fedora 15, qemu 14.0

Very frustrating for clients using Microsoft RDP who just get a blank
blue screen when it is stuck like this.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/498035

Title:
  qemu hangs on shutdown or reboot (XP guest)

Status in QEMU:
  Triaged

Bug description:
  When I shut down or reboot my Windows XP guest, about half the time,
  it hangs at the point where it says "Windows is shutting down...".  At
  that point qemu is using 100% of one host CPU, about 85% user, 15%
  system.  (Core 2 Quad 2.66GHz)

  This is the command line I use to start qemu:

  qemu-system-x86_64 -hda winxp.img -k en-us -m 2048 -smp 2 -vnc :3100
  -usbdevice tablet -boot c -enable-kvm &

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/498035/+subscriptions

(Continue reading)

Zhang, Yang Z | 17 May 04:29
Picon
Favicon

[PATCH v6 6/7] RTC:Add alarm support

Use a timer to emulate alarm. The timer runs only when the AF is cleared.

Signed-off-by: Yang Zhang <yang.z.zhang <at> Intel.com>
---
 hw/mc146818rtc.c |  276 ++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 257 insertions(+), 19 deletions(-)

diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
index 461e8f3..956f10b 100644
--- a/hw/mc146818rtc.c
+++ b/hw/mc146818rtc.c
@@ -47,6 +47,11 @@

 #define USEC_PER_SEC    1000000L
 #define NS_PER_USEC     1000L
+#define NS_PER_SEC      1000000000ULL
+#define SEC_PER_MIN     60
+#define SEC_PER_HOUR    3600
+#define MIN_PER_HOUR    60
+#define HOUR_PER_DAY    24

 #define RTC_REINJECT_ON_ACK_COUNT 20

@@ -84,6 +89,8 @@ typedef struct RTCState {
 static void rtc_set_time(RTCState *s);
 static void rtc_calibrate_time(RTCState *s);
 static void rtc_set_cmos(RTCState *s);
+static inline int rtc_from_bcd(RTCState *s, int a);
+static uint64_t get_next_alarm(RTCState *s);

(Continue reading)

Zhang, Yang Z | 17 May 04:28
Picon
Favicon

[PATCH v6 3/7] RTC: Add UIP(update in progress) check logic

The UIP will be set when updating cycle begins and cleared after updated cycle ended.

Signed-off-by: Yang Zhang <yang.z.zhang <at> Intel.com>
---
 hw/mc146818rtc.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
index 24db5cf..b03c420 100644
--- a/hw/mc146818rtc.c
+++ b/hw/mc146818rtc.c
@@ -344,6 +344,21 @@ static void rtc_calibrate_time(RTCState *s)
     s->current_tm = *ret;
 }

+static int update_in_progress(RTCState *s)
+{
+    int64_t guest_usec;
+
+    if (s->cmos_data[RTC_REG_B] & REG_B_SET) {
+        return 0;
+    }
+    guest_usec = get_guest_rtc_us(s);
+    /* UIP bit will be set at last 244us of every second. */
+    if ((guest_usec % USEC_PER_SEC) >= (USEC_PER_SEC - 244)) {
+        return 1;
+    }
+    return 0;
+}
+
(Continue reading)

Zhang, Yang Z | 17 May 04:28
Picon
Favicon

[PATCH v6 1/7] RTC: Remove the logic to update time format when DM bit changed

Change DM(date mode) and 24/12 control bit doesn't affect the internal
registers. It only indicates what format is using for those registers.

Signed-off-by: Yang Zhang <yang.z.zhang <at> Intel.com>
---
 hw/mc146818rtc.c |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
index 9c64e0a..1ccfb50 100644
--- a/hw/mc146818rtc.c
+++ b/hw/mc146818rtc.c
@@ -220,15 +220,7 @@ static void cmos_ioport_write(void *opaque, uint32_t addr, uint32_t data)
                     rtc_set_time(s);
                 }
             }
-            if (((s->cmos_data[RTC_REG_B] ^ data) & (REG_B_DM | REG_B_24H)) &&
-                !(data & REG_B_SET)) {
-                /* If the time format has changed and not in set mode,
-                   update the registers immediately. */
-                s->cmos_data[RTC_REG_B] = data;
-                rtc_copy_date(s);
-            } else {
-                s->cmos_data[RTC_REG_B] = data;
-            }
+            s->cmos_data[RTC_REG_B] = data;
             rtc_timer_update(s, qemu_get_clock_ns(rtc_clock));
             break;
         case RTC_REG_C:
--
(Continue reading)

Zhang, Yang Z | 17 May 04:28
Picon
Favicon

[PATCH v6 2/7] RTC: Update the RTC clock only when reading it

Use offset instead of timer to calculate guest rtc. Guest rtc is calculated by (base_rtc + guest_time_now -
guest_time_last_update_rtc + offset).
Base_rtc means the rtc value of last update. 
Guest_time_now means the guest time that access happens.
Guest_time_last_update means the guest time of last update rtc.
Offset is used when divider reset happened or set bit is changed.

Signed-off-by: Yang Zhang <yang.z.zhang <at> Intel.com>
---
 hw/mc146818rtc.c |  209 ++++++++++++++++++------------------------------------
 qemu-timer.h     |    5 ++
 2 files changed, 73 insertions(+), 141 deletions(-)

diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
index 1ccfb50..24db5cf 100644
--- a/hw/mc146818rtc.c
+++ b/hw/mc146818rtc.c
@@ -45,6 +45,9 @@
 # define DPRINTF_C(format, ...)      do { } while (0)
 #endif

+#define USEC_PER_SEC    1000000L
+#define NS_PER_USEC     1000L
+
 #define RTC_REINJECT_ON_ACK_COUNT 20

 typedef struct RTCState {
@@ -54,27 +57,38 @@ typedef struct RTCState {
     uint8_t cmos_index;
     struct tm current_tm;
(Continue reading)

Zhang, Yang Z | 17 May 04:28
Picon
Favicon

[PATCH v6 0/7] RTC: New logic to emulate RTC

Changes in v6:
Rebase to latest QEMU
Fix a bug that fail to pass tests/rtc-test:
	In previous version, it uses host time as the base point to calculate guest RTC. It works when guest uses
host based clock. But for vm and rt based clock, it's wrong. Because guest's clock may not synchronous with
host. In current patch, it use rtc_clock as the reference point and successes to pass the testing.
Adapt paolo's suggestion to use more reasonable code for migration.

Changes in v5:
Rebase to latest head.
Add Checking of divider, because it also can stop the update.
Fixing some bugs.

Changes in v4:
Rebase to latest head.
Changing in patch 6: 
	Set the timer to one second earlier before target alarm when AF bit is clear. In version 3, in order to solve
the async between UF, AF and UIP, the timer will keep running when UF or AF are clear. This is a little ugly,
especially when a userspace program is using the alarm and we cannot achieve any power saving. In this
version, when the AF bit is cleared, we will set the timer to one second earlier before the alarm. With this
changing, we can avoid the unnecessary timer and keep the sync between UF, AF and UIP. Please help to review
the patch 6.

Changes in v3:
Rebase to latest head.
Remove the logic to update time format when DM bit changed.
Allow to migrate from old version.
Solve the async when reading UF and UIP

Changes in v2:
(Continue reading)


Gmane