Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package hwinfo for openSUSE:Factory checked 
in at 2021-01-29 14:56:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/hwinfo (Old)
 and      /work/SRC/openSUSE:Factory/.hwinfo.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "hwinfo"

Fri Jan 29 14:56:42 2021 rev:176 rq:867138 version:21.72

Changes:
--------
--- /work/SRC/openSUSE:Factory/hwinfo/hwinfo.changes    2020-11-23 
18:45:38.033067134 +0100
+++ /work/SRC/openSUSE:Factory/.hwinfo.new.28504/hwinfo.changes 2021-01-29 
14:56:59.473500046 +0100
@@ -1,0 +2,8 @@
+Wed Jan 27 10:09:24 UTC 2021 - [email protected]
+
+- merge gh#openSUSE/hwinfo#92
+- improve getting video mode info (bsc#1181101)
+- try harder to break out of infinite I/O loops
+- 21.72
+
+--------------------------------------------------------------------

Old:
----
  hwinfo-21.71.tar.xz

New:
----
  hwinfo-21.72.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ hwinfo.spec ++++++
--- /var/tmp/diff_new_pack.BWXTOH/_old  2021-01-29 14:57:00.025500858 +0100
+++ /var/tmp/diff_new_pack.BWXTOH/_new  2021-01-29 14:57:00.029500864 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package hwinfo
 #
-# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2021 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -37,7 +37,7 @@
 License:        GPL-2.0-or-later
 Group:          Hardware/Other
 Url:            http://gitorious.org/opensuse/hwinfo
-Version:        21.71
+Version:        21.72
 Release:        0
 Source:         %{name}-%{version}.tar.xz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ hwinfo-21.71.tar.xz -> hwinfo-21.72.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hwinfo-21.71/VERSION new/hwinfo-21.72/VERSION
--- old/hwinfo-21.71/VERSION    2020-11-20 17:22:55.000000000 +0100
+++ new/hwinfo-21.72/VERSION    2021-01-27 11:09:24.000000000 +0100
@@ -1 +1 @@
-21.71
+21.72
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hwinfo-21.71/changelog new/hwinfo-21.72/changelog
--- old/hwinfo-21.71/changelog  2020-11-20 17:22:55.000000000 +0100
+++ new/hwinfo-21.72/changelog  2021-01-27 11:09:24.000000000 +0100
@@ -1,3 +1,8 @@
+2021-01-27:    21.72
+       - merge gh#openSUSE/hwinfo#92
+       - improve getting video mode info (bsc#1181101)
+       - try harder to break out of infinite I/O loops
+
 2020-11-20:    21.71
        - merge gh#openSUSE/hwinfo#89
        - rework network device detection on aarch64 (bsc#1177600,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hwinfo-21.71/src/hd/mdt.c 
new/hwinfo-21.72/src/hd/mdt.c
--- old/hwinfo-21.71/src/hd/mdt.c       2020-11-20 17:22:55.000000000 +0100
+++ new/hwinfo-21.72/src/hd/mdt.c       2021-01-27 11:09:24.000000000 +0100
@@ -24,14 +24,32 @@
 
 #define STR_SIZE 128
 
+#define VBIOS_MEM      0xa0000
+#define VBIOS_MEM_SIZE 0x10000
+
 #define VBIOS_ROM      0xc0000
 #define VBIOS_ROM_SIZE 0x10000
 
-#define VBIOS_MEM      0xa0000
-#define VBIOS_MEM_SIZE 0x10000
+#define VBIOS_GAP1     0xd0000
+#define VBIOS_GAP1_SIZE        0x20000
+
+#define SBIOS_ROM      0xf0000
+#define SBIOS_ROM_SIZE 0x10000
 
 #define VBE_BUF                0x8000
 
+/*
+ * I/O loop detection (if vm->no_io is set)
+ *
+ * IO_LOOP_MAX_SIZE: max number of instructions between reading the same I/O 
port
+ *   again (and no other I/O in between)
+ *
+ * IO_LOOP_MIN_MATCHES: at least this number of read accesses will return 0 
before
+ *   starting to emulate a counter
+ */
+#define IO_LOOP_MAX_SIZE       20
+#define IO_LOOP_MIN_MATCHES    50
+
 #define ADD_RES(w, h, f, i) \
   res[res_cnt].width = w, \
   res[res_cnt].height = h, \
@@ -61,6 +79,13 @@
 
   int exec_count;
 
+  struct {
+    u64 last_tsc;
+    u32 last_addr;
+    u32 value;
+    unsigned matched;
+  } io_loop;
+
   hd_data_t *hd_data;
 } vm_t;
 
@@ -410,6 +435,9 @@
   // stack & buffer space
   x86emu_set_perm(vm->emu, VBE_BUF, 0xffff, X86EMU_PERM_RW);
 
+  // make memory between mapped VBIOS ROM areas writable
+  x86emu_set_perm(vm->emu, VBIOS_GAP1, VBIOS_GAP1 + VBIOS_GAP1_SIZE - 1, 
X86EMU_PERM_RW);
+
   vm->emu->timeout = vm->timeout ?: 20;
 
   vm->old_memio = x86emu_set_memio_handler(vm->emu, new_memio);
@@ -421,8 +449,15 @@
 
 
 /*
- * Use our own memory and i/o access handler to block all i/o accesses if 
vm->no_io
- * is set.
+ * I/O emulation used if vm->no_io is set. Otherwise real port accesses are 
done.
+ *
+ * The emulated I/O always returns 0. Unless a close loop reading a specific
+ * port is detected. In that case it starts to emulate a counter on this
+ * specific port, assuming the code waits for something to change.
+ *
+ * Reading any other port in between resets the logic.
+ *
+ * The detailed behavior is controlled by IO_LOOP_MAX_SIZE and 
IO_LOOP_MIN_MATCHES.
  */
 unsigned new_memio(x86emu_t *emu, u32 addr, u32 *val, unsigned type)
 {
@@ -430,7 +465,26 @@
 
   if(vm->no_io) {
     if((type & ~0xff) == X86EMU_MEMIO_I) {
-      *val = 0;
+      // tsc is incremented by 1 on each instruction in x86emu
+      u64 tsc = emu->x86.R_TSC;
+
+      if(addr == vm->io_loop.last_addr && tsc - vm->io_loop.last_tsc < 
IO_LOOP_MAX_SIZE) {
+        if(vm->io_loop.matched > IO_LOOP_MIN_MATCHES) {
+          vm->io_loop.value++;
+        }
+        else {
+          vm->io_loop.matched++;
+        }
+      }
+      else {
+        vm->io_loop.matched = 0;
+        vm->io_loop.value = 0;
+      }
+      vm->io_loop.last_addr = addr;
+      vm->io_loop.last_tsc = tsc;
+
+      *val = vm->io_loop.value;
+
       return 0;
     }
 

Reply via email to