Re: [Qemu-devel] 4G address space remapping on 64-bit host

2007-07-03 Thread Blue Swirl

On 6/29/07, Fabrice Bellard [EMAIL PROTECTED] wrote:

The kqemu part could be quite simple. A new execution mode could be
added so that:

- shadow page table faults generate a specific signal in the user guest
code.
- A kqemu syscall callable from the user guest code could be used to
do the equivalent of tlb_set_page(), tlb_flush_page() and tlb_flush().

Note that I don't think it is worth using Xen for that. Modifying kqemu
(or even KVM) should be more flexible. With kqemu it could also work on
FreeBSD, Solaris, Windows and Linux.

The more complicated part is to split QEMU in two parts : one part
containing the translator (and maybe some devices) would be executed as
guest user code in kqemu. The other part would be executed as a regular
process to handle what is left (graphic, disk access, etc).


The first step could be execution of TB code from kqemu, memory
accesses could bypass the TLB.


If TB where MMIO accesses are done are compiled specifically, I think it
can be quite efficient.

For the specific sparc32 case, I think that a better register window
handling and a faster soft mmu code (using 4MB TLBs as it was proposed
in a patch long ago) should already give an important speed boost (say a
factor 1.5 to 2). The kqemu optimisation should give at least as much
performance gain, depending on the ratio of instructions which do a
memory access and on the number of TLB faults.


About register windows, it's strange that enabling REG_REGWPTR
mysteriously does not work.




[Qemu-devel] [PATCH] arm-gic error message fix

2007-07-03 Thread Adam Lackorzynski
Hi,

this patch fixes two typos in the gic_cpu_write and gic_cpu_read
functions of arm_gic.c.


Index: arm_gic.c
===
RCS file: /sources/qemu/qemu/hw/arm_gic.c,v
retrieving revision 1.5
diff -u -r1.5 arm_gic.c
--- arm_gic.c   3 Jun 2007 15:19:31 -   1.5
+++ arm_gic.c   3 Jul 2007 09:27:05 -
@@ -460,7 +460,7 @@
 case 0x18: /* Highest Pending Interrupt */
 return s-current_pending;
 default:
-cpu_abort (cpu_single_env, gic_cpu_writeb: Bad offset %x\n, offset);
+cpu_abort (cpu_single_env, gic_cpu_read: Bad offset %x\n, offset);
 return 0;
 }
 }
@@ -484,7 +484,7 @@
 case 0x10: /* End Of Interrupt */
 return gic_complete_irq(s, value  0x3ff);
 default:
-cpu_abort (cpu_single_env, gic_cpu_writeb: Bad offset %x\n, offset);
+cpu_abort (cpu_single_env, gic_cpu_write: Bad offset %x\n, offset);
 return;
 }
 gic_update(s);

Adam
-- 
Adam [EMAIL PROTECTED]
  Lackorzynski http://os.inf.tu-dresden.de/~adam/




[Qemu-devel] qemu/hw iommu.c tcx.c

2007-07-03 Thread Blue Swirl
CVSROOT:/cvsroot/qemu
Module name:qemu
Changes by: Blue Swirl blueswir1  07/07/03 09:55:04

Modified files:
hw : iommu.c tcx.c 

Log message:
 Fix loadvm

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/iommu.c?cvsroot=qemur1=1.9r2=1.10
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/tcx.c?cvsroot=qemur1=1.20r2=1.21




[Qemu-devel] [PATCH] Fix a typo

2007-07-03 Thread Stuart Brady
Hi,

The patch below fixes the spelling of 'overridden' in several places.
Please apply.

Cheers,
-- 
Stuart Brady

Index: audio/alsaaudio.c
===
RCS file: /sources/qemu/qemu/audio/alsaaudio.c,v
retrieving revision 1.9
diff -u -p -r1.9 alsaaudio.c
--- audio/alsaaudio.c   2 May 2007 02:11:51 -   1.9
+++ audio/alsaaudio.c   3 Jul 2007 11:20:48 -
@@ -50,11 +50,11 @@ static struct {
 unsigned int period_size_out;
 unsigned int threshold;
 
-int buffer_size_in_overriden;
-int period_size_in_overriden;
+int buffer_size_in_overridden;
+int period_size_in_overridden;
 
-int buffer_size_out_overriden;
-int period_size_out_overriden;
+int buffer_size_out_overridden;
+int period_size_out_overridden;
 int verbose;
 } conf = {
 #define DEFAULT_BUFFER_SIZE 1024
@@ -75,10 +75,10 @@ static struct {
 .period_size_in = DEFAULT_PERIOD_SIZE * 4,
 .buffer_size_out = DEFAULT_BUFFER_SIZE,
 .period_size_out = DEFAULT_PERIOD_SIZE,
-.buffer_size_in_overriden = 0,
-.buffer_size_out_overriden = 0,
-.period_size_in_overriden = 0,
-.period_size_out_overriden = 0,
+.buffer_size_in_overridden = 0,
+.buffer_size_out_overridden = 0,
+.period_size_in_overridden = 0,
+.period_size_out_overridden = 0,
 #endif
 .threshold = 0,
 .verbose = 0
@@ -414,8 +414,8 @@ static int alsa_open (int in, struct als
 }
 else {
 if (period_size  minval) {
-if ((in  conf.period_size_in_overriden)
-|| (!in  conf.period_size_out_overriden)) {
+if ((in  conf.period_size_in_overridden)
+|| (!in  conf.period_size_out_overridden)) {
 dolog (%s period size(%d) is less 
than minmal period size(%ld)\n,
typ,
@@ -450,8 +450,8 @@ static int alsa_open (int in, struct als
 }
 else {
 if (buffer_size  minval) {
-if ((in  conf.buffer_size_in_overriden)
-|| (!in  conf.buffer_size_out_overriden)) {
+if ((in  conf.buffer_size_in_overridden)
+|| (!in  conf.buffer_size_out_overridden)) {
 dolog (
 %s buffer size(%d) is less 
 than minimal buffer size(%ld)\n,
@@ -945,16 +945,16 @@ static struct audio_option alsa_options[
 {DAC_SIZE_IN_USEC, AUD_OPT_BOOL, conf.size_in_usec_out,
  DAC period/buffer size in microseconds (otherwise in frames), NULL, 0},
 {DAC_PERIOD_SIZE, AUD_OPT_INT, conf.period_size_out,
- DAC period size, conf.period_size_out_overriden, 0},
+ DAC period size, conf.period_size_out_overridden, 0},
 {DAC_BUFFER_SIZE, AUD_OPT_INT, conf.buffer_size_out,
- DAC buffer size, conf.buffer_size_out_overriden, 0},
+ DAC buffer size, conf.buffer_size_out_overridden, 0},
 
 {ADC_SIZE_IN_USEC, AUD_OPT_BOOL, conf.size_in_usec_in,
  ADC period/buffer size in microseconds (otherwise in frames), NULL, 0},
 {ADC_PERIOD_SIZE, AUD_OPT_INT, conf.period_size_in,
- ADC period size, conf.period_size_in_overriden, 0},
+ ADC period size, conf.period_size_in_overridden, 0},
 {ADC_BUFFER_SIZE, AUD_OPT_INT, conf.buffer_size_in,
- ADC buffer size, conf.buffer_size_in_overriden, 0},
+ ADC buffer size, conf.buffer_size_in_overridden, 0},
 
 {THRESHOLD, AUD_OPT_INT, conf.threshold,
  (undocumented), NULL, 0},
Index: audio/audio.c
===
RCS file: /sources/qemu/qemu/audio/audio.c,v
retrieving revision 1.16
diff -u -p -r1.16 audio.c
--- audio/audio.c   17 Feb 2007 22:19:29 -  1.16
+++ audio/audio.c   3 Jul 2007 11:20:48 -
@@ -386,7 +386,7 @@ static void audio_print_options (const c
 const char *state = default;
 printf (  %s_%s: , uprefix, opt-name);
 
-if (opt-overridenp  *opt-overridenp) {
+if (opt-overriddenp  *opt-overriddenp) {
 state = current;
 }
 
@@ -516,10 +516,10 @@ static void audio_process_options (const
 break;
 }
 
-if (!opt-overridenp) {
-opt-overridenp = opt-overriden;
+if (!opt-overriddenp) {
+opt-overriddenp = opt-overridden;
 }
-*opt-overridenp = !def;
+*opt-overriddenp = !def;
 qemu_free (optname);
 }
 }
Index: audio/audio_int.h
===
RCS file: /sources/qemu/qemu/audio/audio_int.h,v
retrieving revision 1.10
diff -u -p -r1.10 audio_int.h
--- audio/audio_int.h   16 Jul 2006 18:57:03 -  1.10
+++ audio/audio_int.h   3 Jul 2007 11:20:48 -
@@ -44,8 +44,8 @@ struct audio_option {
 

[Qemu-devel] PATCH: fix configure for cygwin

2007-07-03 Thread Tristan Gingold

Hi,


this patch fixes two minors issue for cygwin:
* --disable-kqemu didn't work for this configuration (because  
overridden)

* -mno-cygwin was missing in the final link.

Tristan.


qemu-mingw.diff
Description: Binary data


Re: [Qemu-devel] How to try PXA270

2007-07-03 Thread Botond Kardos
On Sat, 2007-06-30 at 02:47 +0200, andrzej zaborowski wrote:
 Yes, the kernel in this tarball is for the Integrator board.
 
 There are some useful kernel and rootfs images at:
 http://pokylinux.org/autobuild/
 http://pokylinux.org/releases/
 (note: the qemuarm zImages are for Verstile, akita for Akita and spitz
 for Spitz).
 OpenZaurus and Angstrom distributions also support these PDAs.
 
 A nice piece of information was posted here:
 http://butterfeet.org/?p=22
 
 HTH,
 Andrzej
 
 

Wow, it works! Thanks!
But it is kind of slow. Do you eventually have ideas on what part of
the emulation is so slow? The display driver? Or the flash memory?





Re: [Qemu-devel] [PATCH] ARM7TDMI emulation

2007-07-03 Thread Ulrich Hecht
On Monday 02 July 2007 18:14, Ulrich Hecht wrote:
 Anyway, here's the 920T version. The magic numbers may or may not be
 correct.

And here's an even better version that implements both 920T and 7TDMI 
(with base-updated aborts).

CU
Uli

-- 
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
Index: target-arm/cpu.h
===
RCS file: /sources/qemu/qemu/target-arm/cpu.h,v
retrieving revision 1.28
diff -u -r1.28 cpu.h
--- target-arm/cpu.h	24 Jun 2007 12:09:48 -	1.28
+++ target-arm/cpu.h	3 Jul 2007 14:36:00 -
@@ -247,7 +247,10 @@
 ARM_FEATURE_AUXCR,  /* ARM1026 Auxiliary control register.  */
 ARM_FEATURE_XSCALE, /* Intel XScale extensions.  */
 ARM_FEATURE_IWMMXT, /* Intel iwMMXt extension.  */
-ARM_FEATURE_MPU /* Only has Memory Protection Unit, not full MMU.  */
+ARM_FEATURE_MPU,/* Only has Memory Protection Unit, not full MMU.  */
+ARM_FEATURE_V5, /* ARM v5 instruction set */
+ARM_FEATURE_NO_CP15, /* ARM7TDMI, ARM7TDMI-S, ARM7EJ-S, and ARM9TDMI cores do not have a CP15 */
+ARM_FEATURE_ABORT_BU /* base updated abort model, e.g. ARMxTDMI */
 };
 
 static inline int arm_feature(CPUARMState *env, int feature)
@@ -262,7 +265,9 @@
ARMReadCPFunc *cp_read, ARMWriteCPFunc *cp_write,
void *opaque);
 
+#define ARM_CPUID_ARM7TDMI  0x41807000 /* guess; no CP15 on ARM7TDMI */
 #define ARM_CPUID_ARM1026   0x4106a262
+#define ARM_CPUID_ARM920T   0x41129200
 #define ARM_CPUID_ARM9260x41069265
 #define ARM_CPUID_ARM9460x41059461
 #define ARM_CPUID_PXA2500x69052100
Index: target-arm/helper.c
===
RCS file: /sources/qemu/qemu/target-arm/helper.c,v
retrieving revision 1.17
diff -u -r1.17 helper.c
--- target-arm/helper.c	24 Jun 2007 12:09:48 -	1.17
+++ target-arm/helper.c	3 Jul 2007 14:36:00 -
@@ -14,20 +14,31 @@
 {
 env-cp15.c0_cpuid = id;
 switch (id) {
+case ARM_CPUID_ARM7TDMI:
+set_feature(env, ARM_FEATURE_ABORT_BU);
+set_feature(env, ARM_FEATURE_NO_CP15);
+break;
+case ARM_CPUID_ARM920T:
+env-cp15.c0_cachetype = 0x0d172172;
+env-cp15.c1_sys = 0x0078;
+break;
 case ARM_CPUID_ARM926:
 set_feature(env, ARM_FEATURE_VFP);
+set_feature(env, ARM_FEATURE_V5);
 env-vfp.xregs[ARM_VFP_FPSID] = 0x41011090;
 env-cp15.c0_cachetype = 0x1dd20d2;
 env-cp15.c1_sys = 0x00090078;
 break;
 case ARM_CPUID_ARM946:
 set_feature(env, ARM_FEATURE_MPU);
+set_feature(env, ARM_FEATURE_V5);
 env-cp15.c0_cachetype = 0x0f004006;
 env-cp15.c1_sys = 0x0078;
 break;
 case ARM_CPUID_ARM1026:
 set_feature(env, ARM_FEATURE_VFP);
 set_feature(env, ARM_FEATURE_AUXCR);
+set_feature(env, ARM_FEATURE_V5);
 env-vfp.xregs[ARM_VFP_FPSID] = 0x410110a0;
 env-cp15.c0_cachetype = 0x1dd20d2;
 env-cp15.c1_sys = 0x00090078;
@@ -38,6 +49,7 @@
 case ARM_CPUID_PXA261:
 case ARM_CPUID_PXA262:
 set_feature(env, ARM_FEATURE_XSCALE);
+set_feature(env, ARM_FEATURE_V5);
 /* JTAG_ID is ((id  28) | 0x09265013) */
 env-cp15.c0_cachetype = 0xd172172;
 env-cp15.c1_sys = 0x0078;
@@ -49,6 +61,7 @@
 case ARM_CPUID_PXA270_C0:
 case ARM_CPUID_PXA270_C5:
 set_feature(env, ARM_FEATURE_XSCALE);
+set_feature(env, ARM_FEATURE_V5);
 /* JTAG_ID is ((id  28) | 0x09265013) */
 set_feature(env, ARM_FEATURE_IWMMXT);
 env-iwmmxt.cregs[ARM_IWMMXT_wCID] = 0x69051000 | 'Q';
@@ -98,6 +111,8 @@
 };
 
 static const struct arm_cpu_t arm_cpu_names[] = {
+{ ARM_CPUID_ARM7TDMI, arm7tdmi},
+{ ARM_CPUID_ARM920T, arm920t},
 { ARM_CPUID_ARM926, arm926},
 { ARM_CPUID_ARM946, arm946},
 { ARM_CPUID_ARM1026, arm1026},
Index: target-arm/translate.c
===
RCS file: /sources/qemu/qemu/target-arm/translate.c,v
retrieving revision 1.53
diff -u -r1.53 translate.c
--- target-arm/translate.c	11 Jun 2007 18:59:35 -	1.53
+++ target-arm/translate.c	3 Jul 2007 14:36:00 -
@@ -1589,7 +1589,7 @@
 uint32_t rd;
 
 /* ??? Some cp15 registers are accessible from userspace.  */
-if (IS_USER(s)) {
+if (IS_USER(s) || arm_feature(env, ARM_FEATURE_NO_CP15)) {
 return 1;
 }
 if ((insn  0x0fff0fff) == 0x0e070f90
@@ -2780,6 +2780,7 @@
 case 0x09:
 {
 int j, n, user, loaded_base;
+int crement;
 /* load/store multiple words */
 /* XXX: store correct base if write back */
 user = 0;
@@ -2819,6 +2820,36 @@
 }
 }
 j = 0;
+
+crement = 0;
+if(insn  (1  21)) {
+/* 

[Qemu-devel] [PATCH] no mmap for alsa

2007-07-03 Thread Alexander Graf
Hi,

this is the last patch necessary to get pcm alsa running for i386-apps
on ppc.

Alsa does some fancy magic with mmap to share information with the
kernel. This is completely fine as long as we're talking about
arch(kernel) == arch(userspace), which apparently is not the case when
using qemu-user.
As a more or less hacky workaround on that I just disabled the mmap
calls alsa-lib uses to initiate communication with the kernel. If these
fail, alsa reverts to other means of communication which get converted.

Alex
Index: qemu/linux-user/mmap.c
===
--- qemu.orig/linux-user/mmap.c
+++ qemu/linux-user/mmap.c
@@ -152,6 +152,9 @@ static int mmap_frag(target_ulong real_s
 return 0;
 }
 
+#define SNDRV_PCM_MMAP_OFFSET_STATUS  0x8000;
+#define SNDRV_PCM_MMAP_OFFSET_CONTROL 0x8100;
+
 /* NOTE: all the constants are the HOST ones */
 long target_mmap(target_ulong start, target_ulong len, int prot, 
  int flags, int fd, target_ulong offset)
@@ -192,6 +195,17 @@ long target_mmap(target_ulong start, tar
 }
 #endif
 
+/* Alsa tries to communcate with the kernel via mmap. This usually
+ * is a good idea when user- and kernelspace are running on the 
+ * same architecture but does not work out when not. To make alsa
+ * not to use mmap, we can just have it fail on the mmap calls that
+ * would initiate this.
+ */
+if(offset == SNDRV_PCM_MMAP_OFFSET_STATUS || offset == 
SNDRV_PCM_MMAP_OFFSET_CONTROL) {
+   errno = EINVAL;
+   return -1;
+}
+
 if (offset  ~TARGET_PAGE_MASK) {
 errno = EINVAL;
 return -1;


Re: [Qemu-devel] [PATCH] no mmap for alsa

2007-07-03 Thread Alexander Graf
Oops, the patch did not compile. This is the updated version.

Alex
Index: qemu/linux-user/mmap.c
===
--- qemu.orig/linux-user/mmap.c
+++ qemu/linux-user/mmap.c
@@ -152,6 +152,9 @@ static int mmap_frag(target_ulong real_s
 return 0;
 }
 
+#define SNDRV_PCM_MMAP_OFFSET_STATUS  0x8000
+#define SNDRV_PCM_MMAP_OFFSET_CONTROL 0x8100
+
 /* NOTE: all the constants are the HOST ones */
 long target_mmap(target_ulong start, target_ulong len, int prot, 
  int flags, int fd, target_ulong offset)
@@ -192,6 +195,17 @@ long target_mmap(target_ulong start, tar
 }
 #endif
 
+/* Alsa tries to communcate with the kernel via mmap. This usually
+ * is a good idea when user- and kernelspace are running on the 
+ * same architecture but does not work out when not. To make alsa
+ * not to use mmap, we can just have it fail on the mmap calls that
+ * would initiate this.
+ */
+if(offset == SNDRV_PCM_MMAP_OFFSET_STATUS || offset == 
SNDRV_PCM_MMAP_OFFSET_CONTROL) {
+   errno = EINVAL;
+   return -1;
+}
+
 if (offset  ~TARGET_PAGE_MASK) {
 errno = EINVAL;
 return -1;


Re: [Qemu-devel] [PATCH] Fix two typos

2007-07-03 Thread Chris Wilson

Hi Stefan,

On Tue, 26 Jun 2007, Stefan Weil wrote:


The appended patch fixes recieve - receive, seperat - separat and
teh - the. Maybe this makes addition to CVS HEAD easier...


Shouldn't that be separate not separat? (assuming this is an English 
language typo).



Bernhard Fischer schrieb:

A few others, fwiw:
s/recieve/receive/g
s/seperat/separat/g


Cheers, Chris.
--
_ __ _
\  __/ / ,__(_)_  | Chris Wilson  at qwirx.com - Cambs UK |
/ (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer |
\ _/_/_/_//_/___/ | We are GNU-free your mind-and your software |




Re: [Qemu-devel] [PATCH] Fix two typos

2007-07-03 Thread Jason Gress
On Tuesday 03 July 2007 02:28:54 pm Chris Wilson wrote:
 Hi Stefan,

 On Tue, 26 Jun 2007, Stefan Weil wrote:
  The appended patch fixes recieve - receive, seperat - separat and
  teh - the. Maybe this makes addition to CVS HEAD easier...

 Shouldn't that be separate not separat? (assuming this is an English
 language typo).


Not if you want to cover 'separation' and similar things.

  Bernhard Fischer schrieb:
  A few others, fwiw:
  s/recieve/receive/g
  s/seperat/separat/g

 Cheers, Chris.

Jason




Re: [Qemu-devel] rtl8139 not working with VISTA 32bit

2007-07-03 Thread Adnan Misherfi
Steven Hu wrote:
 This is a tested step by step enable the network and audio under
 vista32 on Xen.
 1. Download latest Vista driver for the RTL8139 series cards from the
 Realtek site. There is one dated 2007/4/26, version 6.103. I used
 this file.
 2. Install the files, follow setup. If your Vista crashed, please go
 to the Save Mode and remove the network driver.
 3. Copy C:\Program Files\Realtek\VISTA_8139\WINVISTA\NetrtOEM.inf to
 a folder called 'Temp' on your Vista desktop.
 4. Find a Server 2003 machine, and copy C:\Windows\system32\drivers
 \rtl8139.sys (I Using ISO file under Linux) to the same Temp folder on
 your Vista desktop.
 5. Rename rtl8139.sys to rtnicxp.sys
 6. Open Device Manager, Click Update Driver.
 7. Browse my computer for drive software
 8. Let me pick from a list of drivers on my computer --- This is key.
 9. Click Have Disk, and navigate to the NetrtOEM.inf in the temp
 folder on your desktop 10. If you get an error about the driver not
 being digitally signed, that's good, you are installing the right
 driver.
 10. Now the network can work now.
 11. After the network is enabled, update the audio driver using the
 method Searching automatically for the updated driver software.

 2007/6/27, Adnan Misherfi [EMAIL PROTECTED]:
 I have posted/read other posts regarding rtl8139 in qemu not working
 with VISTA 32bit.
 Does any one know if there is a fix for this one? I have tried to debug
 this, but not sure what is
 VISTA 32bit driver is expecting. Qemu writes rx buffers to guest memory,
 but it looks like they are ignored
 by the guest rtl8139 driver.

 Any Ideas of what is going on?

 Regards

 Adnan



Steven,
Thanks for the reply, It is good work around the problem. I was hopping
to get the qmue emulation working with
32bit vista rtl8139 driver. After a long debugging sessions it is still
not clear where the problem is!.

Thanks

Adnan




[Qemu-devel] vnc with german keymap

2007-07-03 Thread Juergen Lock
Hi!

 I got a report yesterday of -vnc not working right with german
keymaps (I hadn't really played with -vnc yet so I hadn't noticed),
and came up with the following hack: (which still needs -k de,
that just wasn't enough)

Index: qemu/vnc.c
@@ -763,7 +763,31 @@
 {
 int keycode;
 
+#if 1
+/* XXX fixup some de keysyms (use with -k de) */
+if ((sym  0x) == 0xfe03)/* Alt_Gr - Alt_R */
+   sym = 0xffea;
+if ((sym  0x) == 0xfe50)/* grave */
+   sym = '`';
+#if 0
+if ((sym  0x) == 0xfe51)/* '/acute (gets mixed up with #) */
+   sym = '\'';
+#endif
+if ((sym  0x) == 0xfe52)/* asciicircum */
+   sym = '^';
+if ((sym  0x) == 0xfe53)/* asciitilde */
+   sym = '~';
+#endif
 keycode = keysym2scancode(vs-kbd_layout, sym  0x);
+#if 1
+/* '/acute key needs special treatment */
+if (!keycode  (sym  0x) == 0xfe51)/* acute */
+   keycode = 0xd;
+#endif
+#ifdef VNCDEBUGKEYS
+printf(do_key_event down %d, sym 0x%x, keycode 0x%x\n,
+   down, (int) sym, keycode);
+#endif
 
 /* QEMU console switch */
 switch(keycode) {

 I wasn't able to fix this by editing vnc_keysym.h and/or keymaps
because those dont take duplicate definitions, but this is certainly
`somewhat' ugly; anyone care to fix it for real? :)

 Thanx,
Juergen




Re: [Qemu-devel] sh4: more patches

2007-07-03 Thread Magnus Damm

On 6/25/07, Thiemo Seufer [EMAIL PROTECTED] wrote:

Can you also provide a regression test like some of the other targets
have? It would be very useful to detect breakage.


Sure, what about the attached hello-sh4 test patch?

And while at it I've attached two minor patches for fixing trapa
single stepping and enabling of sh4-linux-user in ./configure.

Thanks!

/ magnus


qemu-cvs_20070704-sh4-hello-test.patch
Description: Binary data


qemu-cvs_20070608-sh4-trapa-single-step.patch
Description: Binary data


qemu-cvs_20070625-configure-enable-sh4-linux-user.patch
Description: Binary data


Re: [Qemu-devel] sh4: more patches

2007-07-03 Thread Magnus Damm

On 6/26/07, Blue Swirl [EMAIL PROTECTED] wrote:

On 6/22/07, Magnus Damm [EMAIL PROTECTED] wrote:
 The method used to locate emulation bugs may be of value for other
 fellow qemu hackers. I've written a small gdb script that single steps
 in an endless loop dumping registers between each instruction. Then
 I've used this script on both real target hardware (using gdbserver)
 and using the gdbstub provided by qemu. Finally the traces have been
 compared. I have more patches for this if anyone is interested...

I'm interested in the scripts, those could be helpful to get Sparc64
bugs exterminated.


Ok, to begin with I've attached two patches needed for this to work on
sh4. They are in quite hairy shape and not ready for upstream merge. I
don't plan on submitting them upstream any time in the future - they
are just useful for debugging. Anyway, I suspect you need to implement
something similar for sparc64 as well.

Together with the patches I've attached two gdb scripts.

This is how I generate a trace on the target system:

1. Boot up a recent Linux kernel on your target hardware.
2. Bring up your network interfaces.
3. Disable vma randomization and maybe vdso as well using:
 # echo 0  /proc/sys/vm/vdso_enabled
 # echo 0  /proc/sys/kernel/randomize_va_space
4. Start your test program on the target using gdbserver and env -i:
 # env -i ./gdbserver localhost:1234 test-static-sh4
5. Start cross-gdb on your host and pass the target script:
 $ ./gdb -x gdb-script-target  trace-target
6. Wait until gdb exits, ignore error message

Then I do the same thing on the host using qemu-sh4:

1. Make sure vma randomization is disabled on the host:
 # echo 0  /proc/sys/kernel/randomize_va_space
2. Start your test program using qemu-sh4 and env -i
 $ env -i /path/to/qemu-sh4 -g 1234 test-static-sh4
3. Start cross-gdb on your host and pass the host script:
 $ ./gdb -x gdb-script  trace
4. Wait until gdb exits, ignore error message

Then just diff the two traces! Have fun!

/ magnus


qemu-cvs_20070703-sh4-behave-as-gdbserver.patch
Description: Binary data


qemu-cvs_20070607-sh4-stack-placement-elf-auxv.patch
Description: Binary data


gdb-script
Description: Binary data


gdb-script-target
Description: Binary data


[Qemu-devel] Time of day clock on arm?

2007-07-03 Thread Rob Landley
Does arm (versatilepb) have any kind of battery backed clock?  I can't find a 
way to init the linux kernel's clock from the kernel command line, and if 
there's clock hardware that should be initializing it I haven't enabled the 
driver in the kernel config.  It's coming up set to Jan 1 1970, which is 
making the binutils build I tried go a little screwy...

Rob
-- 
One of my most productive days was throwing away 1000 lines of code.
  - Ken Thompson.