Re: [Qemu-devel] [patch] cocoa.m - Core Graphics support

2008-01-30 Thread Pierre d'Herbemont


On Jan 30, 2008, at 9:30 PM, Mike Kronenberg wrote:

Unfortunateley, there is no official direct access to the  
framebuffer anymore, since apple depreciated QuickDraw. [1]


Well, you can using OpenGL and Apple's Extension have a nearly direct  
VRAM access, the idea is to use


glEnable( GL_UNPACK_CLIENT_STORAGE_APPLE );
glPixelStorei( GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE );

and

glTexParameteri( VLCGL_TARGET, GL_TEXTURE_STORAGE_HINT_APPLE,  
GL_STORAGE_SHARED_APPLE );


On the texture on which you want to draw. See:

http://developer.apple.com/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_texturedata/chapter_10_section_2.html

Pierre.




Re: [Qemu-devel] [PATCH] OSX x86_64 host support

2007-12-07 Thread Pierre d'Herbemont


On Dec 7, 2007, at 1:42 PM, Alexander Graf wrote:

Right now there is no graphical output available except for VNC, as  
the cocoa output depends on deprecated APIs that are no longer  
available in 64-bit mode and SDL does not compile on x86_64 Darwin  
yet.


This is the QuickDraw API? If so, it should be quite straight forward  
to use OpenGL or CoreGraphics instead...
What about not disabling Cocoa, and simply print a nice #error or  
#warning that explains that the quickdraw part needs fixing?


Pierre.




[Qemu-devel] [Patch] darwin-user: Compile fix for ppc targets

2007-08-16 Thread Pierre d'Herbemont

Hello,

this should address an darwin-user issue that has been creeping in  
trunk for sometime.


Thanks,

Pierre.



601-darwin-user-fix.diff
Description: Binary data


Re: QEMU Automated Testing (was [Qemu-devel] qemu Makefile.target vl.h hw/acpi.c hw/adlib.c ...)

2007-04-10 Thread Pierre d'Herbemont


On 8 avr. 07, at 22:43, Natalia Portillo wrote:

But that required some macro interface click at x,y, wait some  
seconds,

press 'k' key, that is not currently under QEMU.


There is cxtest (GPL) which has been created for that matter, it  
should be interesting to give it a try:

http://www.cxtest.org/

Cxtest is an open source project that provides visual regression  
testing facilities for X11 based systems. It can automate basic X  
Window functionality, including finding X windows by title or by  
graphic picture



Pierre.




Re: [Qemu-devel] Page protection and i386 cmpxchg8b

2007-02-27 Thread Pierre d'Herbemont


On 27 févr. 07, at 08:22, Ilya Shar wrote:


Please see the diff file attached.


I meant send a diff to the qemu-devel in a new mail with [Patch] in  
the subject so that it can be committed :-)


However, at second thought, I think that it might need some re-work,  
see [1], and the arguments might need to be byte-swapped.



Any suggestions how to fix this?


As I said before, I think that the problem appears because:

qemu signal handlers might be overridden by some mach calls, that  
could explain the problem you are encountering. We need to work on  
this.


That's really not easy to fix, in two words. [1] I think it should  
consist in writing a custom implementation of semaphore_signal_trap,  
semaphore_signal_thread_trap, semaphore_wait_signal_trap, etc. that  
hook into signal.c. Tell me if you want more info on this.


Pierre.

___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] Page protection and i386 cmpxchg8b

2007-02-24 Thread Pierre d'Herbemont


On 23 févr. 07, at 23:56, Ilya Shar wrote:


Sure.  At first I was hitting unsupported mach
syscalls, so I modified darwin-user/syscall.h
according to
/Developer/SDKs/MacOSX10.3.9.sdk/usr/include/mach/syscall_sw.h
:

$ diff syscall.c syscall.c.orig
458,465d457
 case -33:
 DPRINTF(semaphore_signal_trap(0x%x)\n,
arg1);
 ret = semaphore_signal_trap(arg1);
 break;
 case -34:
 DPRINTF(semaphore_signal_all_trap(0x%x)\n,
arg1);
 ret = semaphore_signal_all_trap(arg1);
 break;
471,474d462
 case -37:
 DPRINTF(semaphore_wait_signal_trap(0x%x,
0x%x)\n, arg1, arg2);
 ret = semaphore_wait_signal_trap(arg1,arg2);

 break;


cvs diff -u would be easier to read for me. (or diff -u). You could  
send this patch to the qemu-devel, that would be cool.



With this Sfari went past the unsupported call -33 and
now stops in call -61 (syscall_thread_switch).  Can I
just modify syscalls.c in a similar way to fix it?


Yes you can!


But a really alarming thing happens before it gets
there.  If my ethernet cable is not plugged in,
cmpxchg8b write to a nonwritable page brings my system
down.  I suppose it happens in somewhere in the
drivers.


Ouch! I have noticed the same: qemu can trigger bugs really easily at  
the kernel level :( Could you explain how you know that cmpxchg8b is  
the key to our problem? Also qemu signal handlers might be overridden  
by some mach calls, that could explain the problem you are  
encountering. We need to work on this.


Pierre.


___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] Page protection and i386 cmpxchg8b

2007-02-23 Thread Pierre d'Herbemont

Hi Ilya!

On 23 févr. 07, at 21:32, Ilya Shar wrote:


I'm running i386-darwin-usrer on i386 and some apps
(Safari browser) crash because cmpxchg8b attempts to
wrie to a qemu-allocated page which is readable but
write-protected.  When I comment out mprotect in
exec.c


Are you sure it does Safari does crash because of that call? I have  
the Apple Bug Reporter which complains about the fact that qemu gets  
a EXC_BAD_ACCESS, but then I get this error:
qemu: Unsupported mach syscall: -61(0xffc3) (=  
semaphore_signal_trap)

or
qemu: Unsupported mach syscall: -33(0xffdf) (=  
syscall_thread_switch)


To fix this we have to implement those syscalls.


//mprotect(g2h(page_addr),
qemu_host_page_size,
// (prot  PAGE_BITS)  ~PAGE_WRITE);

I can proceed further.  I would guess mprotect is
there for a reason so it doesn't seem like a good
solution, besides the runs get substantially slower
without mprotect.  Is there a solution to this problem
or a way to better understand what is going on?


I think the idea behind the mprotect is to make sure that any changes  
to this pages gets monitored, and that the tb can be invalidated if  
the code was modified (self modify-ing code).


Pierre.

___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


[Qemu-devel] [resent] [Patch] darwin-user: revert host_info patch and don't fail if sysctl is unknown when we are on the same host/target

2007-02-22 Thread Pierre d'Herbemont

Hi,

This fix x86-on-x86 and ppc-on-ppc.

Pierre.

ChangeLog:
Revert host_info changes and don't fail if sysctl is unknown when we  
are on the same host/target.


Index: darwin-user/syscall.c
===
RCS file: /sources/qemu/qemu/darwin-user/syscall.c,v
retrieving revision 1.2
diff -u -r1.2 syscall.c
--- darwin-user/syscall.c   5 Feb 2007 19:47:42 -   1.2
+++ darwin-user/syscall.c   16 Feb 2007 09:36:54 -
@@ -367,7 +367,14 @@
 case 200: /* host_info */
 {
 mig_reply_error_t *err = (mig_reply_error_t *)hdr;
-struct host_basic_info *data = (void *)(err+1);
+struct {
+uint32_t unknow1;
+uint32_t max_cpus;
+uint32_t avail_cpus;
+uint32_t memory_size;
+uint32_t cpu_type;
+uint32_t cpu_subtype;
+} *data = (void *)(err+1);
 
 DPRINTF(maxcpu = 0x%x\n,   data-max_cpus);
 DPRINTF(numcpu = 0x%x\n,   data-avail_cpus);
@@ -1342,9 +1349,12 @@
 if(name) /* Sometimes sysctl is called with no arg1, ignore */
 ret = get_errno(sysctl(name, namelen, oldp, oldlenp, newp, newlen));
 
+#if defined(TARGET_I386) ^ defined(__i386__) || defined(TARGET_PPC) ^ 
defined(__ppc__)
 if (!is_error(ret)  bswap_syctl(name, namelen, oldp, *oldlenp) != 0) {
 return -ENOTDIR;
 }
+#endif
+
 if(name) {
 //bswap_syctl(name, namelen, newp, newlen);
 tswap32s((uint32_t*)oldlenp);
___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] Please help fix an illegal instruction / SSE problem

2007-02-16 Thread Pierre d'Herbemont


On 16 févr. 07, at 04:51, Ilya Shar wrote:


Every Cocoa application I try to run under
i386-darwin-user/qemu-i386 exits on an illegal
instruction:

Starting
/Applications/Calculator.app/Contents/MacOS/Calculator
with qemu

queue_signal: sig=4
qemu: uncaught target signal 4 (Illegal instruction) -
exiting

The last block always executes SSE instructions:

IN:
0x0ab7:  movdqa 0xfffa(%esi,%edx,1),%xmm0
0x0abd:  movdqa 0xa(%esi,%edx,1),%xmm1
0x0ac3:  movdqa 0x1a(%esi,%edx,1),%xmm2
0x0ac9:  movdqa 0x2a(%esi,%edx,1),%xmm3
0x0acf:  movdqa 0x3a(%esi,%edx,1),%xmm4
0x0ad5:  movdqa %xmm0,%xmm5
0x0ad9:  movdqa %xmm4,%xmm0
0x0add:  data16
0x0ade:  (bad)

Non-graphics applications run fine.

Could it be a configuration/compilation problem
(although some SEE instructions seem to be handled
fine)?  If not, is there a way to better diagnose the
problem?  I on Mac OS Intel with QEMU 0.9.0.


Calculator is crashing in the commpage (see darwin-user/commpage.c).  
Commpage is for now shared with the host for x86-on-x86 (and for ppc- 
on-ppc too). As the commpage is optimized by the kernel for your host  
specific proc, there tends to be problem with qemu. You could try to  
play a bit with qemu cpuid (darwin-user/main.c:788), or implement the  
needed instructions in qemu. An other way would be to use what's in  
commpage.c (see commpage_init()), by translating the target address  
space.


Pierre.

___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


[Qemu-devel] [Patch] darwin-user: revert host_info patch and don't fail if sysctl is unknown when we are on the same host/target

2007-02-16 Thread Pierre d'Herbemont

Hi,

This fix the x86-on-x86 and ppc-on-ppc.

Pierre.

ChangeLog:
Revert host_info changes and don't fail if sysctl is unknown when we  
are on the same host/target.


Index: darwin-user/syscall.c
===
RCS file: /sources/qemu/qemu/darwin-user/syscall.c,v
retrieving revision 1.2
diff -u -r1.2 syscall.c
--- darwin-user/syscall.c   5 Feb 2007 19:47:42 -   1.2
+++ darwin-user/syscall.c   16 Feb 2007 09:36:54 -
@@ -367,7 +367,14 @@
 case 200: /* host_info */
 {
 mig_reply_error_t *err = (mig_reply_error_t *)hdr;
-struct host_basic_info *data = (void *)(err+1);
+struct {
+uint32_t unknow1;
+uint32_t max_cpus;
+uint32_t avail_cpus;
+uint32_t memory_size;
+uint32_t cpu_type;
+uint32_t cpu_subtype;
+} *data = (void *)(err+1);
 
 DPRINTF(maxcpu = 0x%x\n,   data-max_cpus);
 DPRINTF(numcpu = 0x%x\n,   data-avail_cpus);
@@ -1342,9 +1349,12 @@
 if(name) /* Sometimes sysctl is called with no arg1, ignore */
 ret = get_errno(sysctl(name, namelen, oldp, oldlenp, newp, newlen));
 
+#if defined(TARGET_I386) ^ defined(__i386__) || defined(TARGET_PPC) ^ 
defined(__ppc__)
 if (!is_error(ret)  bswap_syctl(name, namelen, oldp, *oldlenp) != 0) {
 return -ENOTDIR;
 }
+#endif
+
 if(name) {
 //bswap_syctl(name, namelen, newp, newlen);
 tswap32s((uint32_t*)oldlenp);
___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] Help with gdb on Mac OS

2007-02-12 Thread Pierre d'Herbemont


On 12 févr. 07, at 07:54, Ilya Shar wrote:


I am trying to step through i386-darwin-user/qemu-i386

Program received signal EXC_BAD_ACCESS, Could not
access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x2115eaf5
helper_cmpxchg8b () at ../cpu-all.h:344
344 ((uint32_t *)ptr)[0] = x.p[0];
(gdb)

The offending value of ptr is misalligned, can this
indicate a problem?  Reducing optimization or setting
-g3 doesn't change this behavior.  Strangely, the same
example runs fine without gdb.


qemu will handle the signal fine. Actually it is more a feature than  
a bug ;-)


Unfortunately
(gdb) handle EXC_BAD_ACCESS pass
is kind of broken as EXC_BAD_ACCESS is not translated to the  
corresponding bsd signal, so qemu won't handle it.


You should probably try to use the gdb interface provided by qemu if  
you wan't to debug the target program instead of qemu:

# i386-darwin-user/qemu-i386 -g /bin/ls

You can now connect to the gdb interface using:
#gdb -arch i386
(gdb) target remote localhost:1234
(gdb) c

Pierre.

___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] [Patch] documentation: Change qemu-darwin-* to qemu-* and fix a typo about supported target

2007-02-06 Thread Pierre d'Herbemont


On 6 févr. 07, at 09:51, Phil Krylov wrote:


Hi Pierre,

[EMAIL PROTECTED]
+target x86 on x86: Most apps (Cocoa and Carbon too) works. [1]
[EMAIL PROTECTED]
+target PowerPC on x86: Not working as the ppc commpage can't be  
mapped (yet!)

[EMAIL PROTECTED]
+target x86 on x86: Most apps (Cocoa and Carbon too) works. [1]

Did you mean PowerPC on PowerPC in the last line?


Yes I do. Thanks Phil :)

BTW, last patch was the wrong diff.

ChangeLog:
Change qemu-darwin-* to qemu-*
Fix a typo about supported target (reported by Phil Krylov).

Index: qemu-doc.texi
===
RCS file: /sources/qemu/qemu/qemu-doc.texi,v
retrieving revision 1.128
diff -u -r1.128 qemu-doc.texi
--- qemu-doc.texi   5 Feb 2007 19:42:07 -   1.128
+++ qemu-doc.texi   6 Feb 2007 10:34:01 -
@@ -1747,7 +1747,7 @@
 libraries:
 
 @example 
-qemu-i386 -L / /bin/ls
+qemu-linux-i386 -L / /bin/ls
 @end example
 
 @code{-L /} tells that the x86 dynamic linker must be searched with a
@@ -1870,7 +1870,7 @@
 @item
 target PowerPC on x86: Not working as the ppc commpage can't be mapped (yet!)
 @item
-target x86 on x86: Most apps (Cocoa and Carbon too) works. [1]
+target PowerPC on PowerPC: Most apps (Cocoa and Carbon too) works. [1]
 @item
 target x86 on PowerPC: most utilities work. Cocoa and Carbon apps are not yet 
supported.
 @end itemize
@@ -1891,20 +1891,20 @@
 libraries:
 
 @example 
-qemu-darwin-i386 /bin/ls
+qemu-i386 /bin/ls
 @end example
 
 or to run the ppc version of the executable:
 
 @example 
-qemu-darwin-ppc /bin/ls
+qemu-ppc /bin/ls
 @end example
 
 @item On ppc, you'll have to tell qemu where your x86 libraries (and dynamic 
linker)
 are installed:
 
 @example 
-qemu-darwin-i386 -L /opt/x86_root/ /bin/ls
+qemu-i386 -L /opt/x86_root/ /bin/ls
 @end example
 
 @code{-L /opt/x86_root/} tells that the dynamic linker (dyld) path is in
___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


[Qemu-devel] [Patch] cpu-exec.c: Make cpu_signal_handler work on Mac OS X/Darwin x86

2007-02-05 Thread Pierre d'Herbemont

Hi,

This should fix:

/Users/ilya/tmp/feb4/qemu_cvs_user/qemu/cpu-exec.c: In function  
'cpu_x86_signal_handler':

/Users/ilya/tmp/feb4/qemu_cvs_user/qemu/cpu-exec.c:1307:
error: request for member 'gregs' in something not a structure or union
/Users/ilya/tmp/feb4/qemu_cvs_user/qemu/cpu-exec.c:1307:
error: 'EIP' undeclared (first use in this function)
...

on Mac OS X/x86.
Index: cpu-exec.c
===
RCS file: /sources/qemu/qemu/cpu-exec.c,v
retrieving revision 1.91
diff -u -r1.91 cpu-exec.c
--- cpu-exec.c  2 Feb 2007 03:57:09 -   1.91
+++ cpu-exec.c  5 Feb 2007 09:32:32 -
@@ -1261,6 +1261,20 @@
 
 #if defined(__i386__)
 
+#ifdef linux
+
+# define EIP_sig(context) ((context)-uc_mcontext.gregs[REG_EIP])
+# define TRAP_sig(context)((context)-uc_mcontext.gregs[REG_TRAPNO])
+# define ERROR_sig(context)   ((context)-uc_mcontext.gregs[REG_ERR])
+
+#elif defined(__APPLE__)
+# include sys/ucontext.h
+
+# define EIP_sig(context) (*((unsigned 
long*)(context)-uc_mcontext-ss.eip))
+# define TRAP_sig(context)((context)-uc_mcontext-es.trapno)
+# define ERROR_sig(context)   ((context)-uc_mcontext-es.err)
+#endif
+
 #if defined(USE_CODE_COPY)
 static void cpu_send_trap(unsigned long pc, int trap, 
   struct ucontext *uc)
@@ -1295,8 +1309,8 @@
 #define REG_ERRERR
 #define REG_TRAPNO TRAPNO
 #endif
-pc = uc-uc_mcontext.gregs[REG_EIP];
-trapno = uc-uc_mcontext.gregs[REG_TRAPNO];
+pc = EIP_sig(uc);
+trapno = TRAP_sig(uc);
 #if defined(TARGET_I386)  defined(USE_CODE_COPY)
 if (trapno == 0x00 || trapno == 0x05) {
 /* send division by zero or bound exception */
@@ -1306,7 +1320,7 @@
 #endif
 return handle_cpu_signal(pc, (unsigned long)info-si_addr, 
  trapno == 0xe ? 
- (uc-uc_mcontext.gregs[REG_ERR]  1)  1 : 0,
+ (ERROR_sig(uc)  1)  1 : 0,
  uc-uc_sigmask, puc);
 }
 


Ilya, Hope this will work for you.

Pierre.___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


[Qemu-devel] [Patch] darwin-user: fix com mpage entry offset

2007-02-05 Thread Pierre d'Herbemont

Hi,

This patch fix typos in the commpage definition.

Pierre.

Index: darwin-user/commpage.c
===
RCS file: /sources/qemu/qemu/darwin-user/commpage.c,v
retrieving revision 1.1
diff -u -r1.1 commpage.c
--- darwin-user/commpage.c  18 Jan 2007 20:06:33 -  1.1
+++ darwin-user/commpage.c  3 Feb 2007 16:47:47 -
@@ -114,10 +114,10 @@
 COMMPAGE_ENTRY(spinlock_lock, 1, 0x260,  OSSpinLockLock,
CALL_DIRECT),
 COMMPAGE_ENTRY(spinlock_unlock,   1, 0x2a0,  OSSpinLockUnlock,  
CALL_DIRECT),
 COMMPAGE_ENTRY(pthread_getspecific,   0, 0x2c0,  unimpl_commpage,   
CALL_INDIRECT),
-COMMPAGE_ENTRY(gettimeofday,  1, 0x2c0,  do_cgettimeofday,  
CALL_INDIRECT),
-COMMPAGE_ENTRY(sys_dcache_flush,  0, 0x2c0,  unimpl_commpage,   
CALL_INDIRECT),
-COMMPAGE_ENTRY(sys_icache_invalidate, 0, 0x2c0,  unimpl_commpage,   
CALL_INDIRECT),
-COMMPAGE_ENTRY(pthread_self,  0, 0x2c0,  unimpl_commpage,   
CALL_INDIRECT),
+COMMPAGE_ENTRY(gettimeofday,  1, 0x2e0,  do_cgettimeofday,  
CALL_INDIRECT),
+COMMPAGE_ENTRY(sys_dcache_flush,  0, 0x4e0,  unimpl_commpage,   
CALL_INDIRECT),
+COMMPAGE_ENTRY(sys_icache_invalidate, 0, 0x520,  unimpl_commpage,   
CALL_INDIRECT),
+COMMPAGE_ENTRY(pthread_self,  0, 0x580,  unimpl_commpage,   
CALL_INDIRECT),
 
 COMMPAGE_ENTRY(relinquish,0, 0x5c0,  unimpl_commpage,   
CALL_INDIRECT),
 
@@ -305,7 +305,7 @@
 
 void unimpl_commpage(void *cpu_env, int num)
 {
-gemu_log(qemu: commpage function 0x%x not implemented\n, num);
+qerror(qemu: commpage function 0x%x not implemented\n, num);
 }
 
 /___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


[Qemu-devel] [Patch] darwin-user: Update usage output, add a small comment on int 0x90 and suppress dead code.

2007-02-03 Thread Pierre d'Herbemont

Hi,

This patch alters a bit the qemu-darwin-user usage output. It also  
add a bit more documentation on int 0x90, and suppress dead code.


Pierre.Index: darwin-user/main.c
===
RCS file: /sources/qemu/qemu/darwin-user/main.c,v
retrieving revision 1.2
diff -u -r1.2 main.c
--- darwin-user/main.c  31 Jan 2007 12:08:13 -  1.2
+++ darwin-user/main.c  3 Feb 2007 16:47:48 -
@@ -646,17 +646,18 @@
Darwin CPU emulator (compiled for %s emulation)\n
\n
-h   print this help\n
-   -L path  set the elf interpreter prefix (default=%s)\n
+   -L path  set the %s library path (default='%s')\n
-s size  set the stack size in bytes (default=%ld)\n
\n
debug options:\n
 #ifdef USE_CODE_COPY
-no-code-copy   disable code copy acceleration\n
 #endif
-   -d options   activate log (logfile=%s)\n
+   -d options   activate log (logfile='%s')\n
-g wait for gdb on port 1234\n
-p pagesize  set the host page size to 'pagesize'\n,
TARGET_ARCH,
+   TARGET_ARCH,
interp_prefix,
stack_size,
DEBUG_LOGFILE);
@@ -753,11 +754,6 @@
 /* Zero out regs */
 memset(regs, 0, sizeof(struct target_pt_regs));
 
-#if 0
-/* Scan interp_prefix dir for replacement files. */
-init_paths(interp_prefix);
-#endif
-
 /* NOTE: we need to init the CPU at this stage to get
qemu_host_page_size */
 env = cpu_init();
@@ -888,7 +884,7 @@
 set_idt(0x81, 3); /* Mach Syscalls */
 set_idt(0x82, 3); /* thread Syscalls */
 
-set_idt(0x90, 3); /* Unix Syscall backdoor */
+set_idt(0x90, 3); /* qemu-darwin-user's Unix syscalls backdoor */
 
 
 cpu_x86_load_seg(env, R_CS, __USER_CS);
___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


[Qemu-devel] [Patch] ENOMEDIUM fix for Darwin and *BSD

2007-01-26 Thread Pierre d'Herbemont

Hi,

This fix,

/qemu/hw/ide.c: In function `ide_atapi_io_error':
/qemu/hw/ide.c:972: error: `ENOMEDIUM' undeclared (first use in this  
function)


on Darwin and certainly on other *BSDs

Pierre.

Index: vl.h
===
RCS file: /sources/qemu/qemu/vl.h,v
retrieving revision 1.177
diff -u -r1.177 vl.h
--- vl.h24 Jan 2007 21:40:21 -  1.177
+++ vl.h26 Jan 2007 14:51:15 -
@@ -44,6 +44,9 @@
 #ifndef O_BINARY
 #define O_BINARY 0
 #endif
+#ifndef ENOMEDIUM
+#define ENOMEDIUM ENODEV
+#endif
 
 #ifdef __sun__
 #define ENOMEDIUM 4097
___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] [Patch] ENOMEDIUM fix for Darwin and *BSD

2007-01-26 Thread Pierre d'Herbemont


On 26 janv. 07, at 16:39, Thiemo Seufer wrote:


Pierre d'Herbemont wrote:

Hi,

This fix,

/qemu/hw/ide.c: In function `ide_atapi_io_error':
/qemu/hw/ide.c:972: error: `ENOMEDIUM' undeclared (first use in this
function)


I committed a slightly different patch.


And it's better ;)

Pierre.


___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


[Qemu-devel] [Patch] darwin-user: Fix set_error return value

2007-01-24 Thread Pierre d'Herbemont

Hi,

This fix set_error return value typo.

Pierre.Index: darwin-user/main.c
===
RCS file: /sources/qemu/qemu/darwin-user/main.c,v
retrieving revision 1.1
diff -u -r1.1 main.c
--- darwin-user/main.c  18 Jan 2007 20:06:33 -  1.1
+++ darwin-user/main.c  24 Jan 2007 19:48:53 -
@@ -478,7 +478,7 @@
 }
 
 /* ABI convention: after a syscall if there was an error the CF flag is set */
-static inline set_error(CPUX86State *env, int ret)
+static inline void set_error(CPUX86State *env, int ret)
 {
 if(ret0)
 env-eflags = env-eflags | 0x1;
___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


[Qemu-devel] [Patch] siginfo fix for Darwin/Mac OS X

2007-01-24 Thread Pierre d'Herbemont

Hi,

This patch is an attempt to suppress the anonymous struct siginfo  
trick, as it doesn't work on darwin since struct siginfo isn't  
defined, and stay anonymous.


Here I use siginfo_t, assuming that it is defined on most platform.  
But feel free to add a typedef struct siginfo siginfo_t; for your  
platform if needed, or some other trick.


(Variation of this hack is possible as struct __siginfo is valid on  
darwin. Feel free to use)


Pierre.
Index: target-sparc/cpu.h
===
RCS file: /sources/qemu/qemu/target-sparc/cpu.h,v
retrieving revision 1.26
diff -u -r1.26 cpu.h
--- target-sparc/cpu.h  23 Dec 2006 14:18:40 -  1.26
+++ target-sparc/cpu.h  24 Jan 2007 20:18:37 -
@@ -275,8 +275,7 @@
 } while (0)
 #endif
 
-struct siginfo;
-int cpu_sparc_signal_handler(int hostsignum, struct siginfo *info, void *puc);
+int cpu_sparc_signal_handler(int host_signum, void *pinfo, void *puc);
 
 #include cpu-all.h
 
Index: target-sh4/cpu.h
===
RCS file: /sources/qemu/qemu/target-sh4/cpu.h,v
retrieving revision 1.4
diff -u -r1.4 cpu.h
--- target-sh4/cpu.h23 Dec 2006 14:18:40 -  1.4
+++ target-sh4/cpu.h24 Jan 2007 20:18:37 -
@@ -121,9 +121,8 @@
 
 CPUSH4State *cpu_sh4_init(void);
 int cpu_sh4_exec(CPUSH4State * s);
-struct siginfo;
-int cpu_sh4_signal_handler(int hostsignum, struct siginfo *info,
-  void *puc);
+int cpu_sh4_signal_handler(int host_signum, void *pinfo, 
+   void *puc);
 
 #include softfloat.h
 
Index: target-ppc/cpu.h
===
RCS file: /sources/qemu/qemu/target-ppc/cpu.h,v
retrieving revision 1.24
diff -u -r1.24 cpu.h
--- target-ppc/cpu.h23 Dec 2006 14:18:40 -  1.24
+++ target-ppc/cpu.h24 Jan 2007 20:18:38 -
@@ -575,8 +575,7 @@
 /* you can call this signal handler from your SIGBUS and SIGSEGV
signal handlers to inform the virtual CPU of exceptions. non zero
is returned if the signal was handled by the virtual CPU.  */
-struct siginfo;
-int cpu_ppc_signal_handler(int host_signum, struct siginfo *info, 
+int cpu_ppc_signal_handler(int host_signum, void *pinfo, 
void *puc);
 
 void do_interrupt (CPUPPCState *env);
Index: target-m68k/cpu.h
===
RCS file: /sources/qemu/qemu/target-m68k/cpu.h,v
retrieving revision 1.2
diff -u -r1.2 cpu.h
--- target-m68k/cpu.h   23 Dec 2006 14:18:40 -  1.2
+++ target-m68k/cpu.h   24 Jan 2007 20:18:38 -
@@ -97,8 +97,7 @@
 /* you can call this signal handler from your SIGBUS and SIGSEGV
signal handlers to inform the virtual CPU of exceptions. non zero
is returned if the signal was handled by the virtual CPU.  */
-struct siginfo;
-int cpu_m68k_signal_handler(int host_signum, struct siginfo *info, 
+int cpu_m68k_signal_handler(int host_signum, void *pinfo, 
void *puc);
 void cpu_m68k_flush_flags(CPUM68KState *, int);
 
Index: target-i386/cpu.h
===
RCS file: /sources/qemu/qemu/target-i386/cpu.h,v
retrieving revision 1.39
diff -u -r1.39 cpu.h
--- target-i386/cpu.h   23 Dec 2006 14:18:40 -  1.39
+++ target-i386/cpu.h   24 Jan 2007 20:18:38 -
@@ -628,8 +628,7 @@
 /* you can call this signal handler from your SIGBUS and SIGSEGV
signal handlers to inform the virtual CPU of exceptions. non zero
is returned if the signal was handled by the virtual CPU.  */
-struct siginfo;
-int cpu_x86_signal_handler(int host_signum, struct siginfo *info, 
+int cpu_x86_signal_handler(int host_signum, void *pinfo, 
void *puc);
 void cpu_x86_set_a20(CPUX86State *env, int a20_state);
 
Index: target-arm/cpu.h
===
RCS file: /sources/qemu/qemu/target-arm/cpu.h,v
retrieving revision 1.18
diff -u -r1.18 cpu.h
--- target-arm/cpu.h23 Dec 2006 14:18:40 -  1.18
+++ target-arm/cpu.h24 Jan 2007 20:18:38 -
@@ -133,8 +133,7 @@
 /* you can call this signal handler from your SIGBUS and SIGSEGV
signal handlers to inform the virtual CPU of exceptions. non zero
is returned if the signal was handled by the virtual CPU.  */
-struct siginfo;
-int cpu_arm_signal_handler(int host_signum, struct siginfo *info, 
+int cpu_arm_signal_handler(int host_signum, void *pinfo, 
void *puc);
 
 #define CPSR_M (0x1f)
Index: cpu-exec.c
===
RCS file: /sources/qemu/qemu/cpu-exec.c,v
retrieving revision 1.89
diff -u -r1.89 cpu-exec.c
--- cpu-exec.c  24 Jan 2007 01:47:51 -  1.89
+++ cpu-exec.c  24 Jan 2007 20:18:38 -
@@ -1280,9 +1280,10 @@
 }
 #endif
 
-int cpu_signal_handler(int host_signum, struct siginfo *info, 

[Qemu-devel] [PATCH] define ENOMEDIUM if not defined

2007-01-18 Thread Pierre d'Herbemont

Hi,

This patch fix block.c build on Mac OS X/Darwin.

Pierre.

Index: block.c
===
RCS file: /sources/qemu/qemu/block.c,v
retrieving revision 1.40
diff -u -r1.40 block.c
--- block.c 7 Jan 2007 18:22:37 -   1.40
+++ block.c 18 Jan 2007 12:29:58 -
@@ -35,6 +35,10 @@
 #define SECTOR_BITS 9
 #define SECTOR_SIZE (1  SECTOR_BITS)
 
+#ifndefENOMEDIUM
+#defineENOMEDIUM ENODEV
+#endif
+
 typedef struct BlockDriverAIOCBSync {
 BlockDriverAIOCB common;
 QEMUBH *bh;
___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


[Qemu-devel] [PATCH] siginfo fix for Darwin/Mac OS X on PowerPC and cleanup

2007-01-18 Thread Pierre d'Herbemont

Hi,

This patch addresses cpu-exec.c compilation on Mac OS X/ppc. It also  
cleans up unused Macro definition.


Pierre.
Index: cpu-exec.c
===
RCS file: /sources/qemu/qemu/cpu-exec.c,v
retrieving revision 1.88
diff -u -r1.88 cpu-exec.c
--- cpu-exec.c  7 Dec 2006 18:28:42 -   1.88
+++ cpu-exec.c  18 Jan 2007 12:30:04 -
@@ -1334,51 +1334,30 @@
 /* All Registers access - only for local access */
 # define REG_sig(reg_name, context)
((context)-uc_mcontext.regs-reg_name)
 /* Gpr Registers access  */
-# define GPR_sig(reg_num, context) REG_sig(gpr[reg_num], context)
 # define IAR_sig(context)  REG_sig(nip, context)   /* 
Program counter */
-# define MSR_sig(context)  REG_sig(msr, context)   /* 
Machine State Register (Supervisor) */
-# define CTR_sig(context)  REG_sig(ctr, context)   /* 
Count register */
-# define XER_sig(context)  REG_sig(xer, context) /* User's 
integer exception register */
-# define LR_sig(context)   REG_sig(link, context) /* Link 
register */
-# define CR_sig(context)   REG_sig(ccr, context) /* 
Condition register */
-/* Float Registers access  */
-# define FLOAT_sig(reg_num, context)   
(((double*)((char*)((context)-uc_mcontext.regs+48*4)))[reg_num])
 # define FPSCR_sig(context)
(*(int*)((char*)((context)-uc_mcontext.regs+(48+32*2)*4)))
 /* Exception Registers access */
-# define DAR_sig(context)  REG_sig(dar, context)
 # define DSISR_sig(context)REG_sig(dsisr, context)
 # define TRAP_sig(context) REG_sig(trap, context)
 #endif /* linux */
 
 #ifdef __APPLE__
 # include sys/ucontext.h
-typedef struct ucontext SIGCONTEXT;
 /* All Registers access - only for local access */
 # define REG_sig(reg_name, context)
((context)-uc_mcontext-ss.reg_name)
-# define FLOATREG_sig(reg_name, context)   
((context)-uc_mcontext-fs.reg_name)
 # define EXCEPREG_sig(reg_name, context)   
((context)-uc_mcontext-es.reg_name)
-# define VECREG_sig(reg_name, context) 
((context)-uc_mcontext-vs.reg_name)
 /* Gpr Registers access */
-# define GPR_sig(reg_num, context) REG_sig(r##reg_num, context)
 # define IAR_sig(context)  REG_sig(srr0, context)  /* 
Program counter */
-# define MSR_sig(context)  REG_sig(srr1, context)  /* 
Machine State Register (Supervisor) */
-# define CTR_sig(context)  REG_sig(ctr, context)
-# define XER_sig(context)  REG_sig(xer, context) /* Link 
register */
-# define LR_sig(context)   REG_sig(lr, context)  /* User's 
integer exception register */
-# define CR_sig(context)   REG_sig(cr, context)  /* 
Condition register */
-/* Float Registers access */
-# define FLOAT_sig(reg_num, context)   FLOATREG_sig(fpregs[reg_num], 
context)
-# define FPSCR_sig(context)((double)FLOATREG_sig(fpscr, 
context))
 /* Exception Registers access */
-# define DAR_sig(context)  EXCEPREG_sig(dar, context) 
/* Fault registers for coredump */
 # define DSISR_sig(context)EXCEPREG_sig(dsisr, context)
 # define TRAP_sig(context) EXCEPREG_sig(exception, 
context) /* number of powerpc exception taken */
 #endif /* __APPLE__ */
 
-int cpu_signal_handler(int host_signum, struct siginfo *info, 
+int cpu_signal_handler(int host_signum, struct siginfo *pinfo, 
void *puc)
 {
 struct ucontext *uc = puc;
+siginfo_t *info = pinfo;
 unsigned long pc;
 int is_write;
 
___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] [PATCH] darwin-user merge attempt - patch v3

2007-01-18 Thread Pierre d'Herbemont


On 17 janv. 07, at 23:13, Thiemo Seufer wrote:

I figure it needs some more work to keep the Linux build happy.


Oh sorry! Here goes the fix:


darwin_user.3.diff.txt.gz
Description: GNU Zip compressed data


Thanks for the report,

Pierre.___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] [PATCH] siginfo fix for Darwin/Mac OS X on PowerPC and cleanup

2007-01-18 Thread Pierre d'Herbemont


On 18 janv. 07, at 23:57, Thiemo Seufer wrote:



It might be better to keep the full set around for documentation.


It's a good point.


-int cpu_signal_handler(int host_signum, struct siginfo *info,
+int cpu_signal_handler(int host_signum, struct siginfo *pinfo,
void *puc)
 {
 struct ucontext *uc = puc;
+siginfo_t *info = pinfo;
 unsigned long pc;
 int is_write;


Why does this make a difference?


struct siginfo is not defined on darwin. (it works because struct  
siginfo is defined also as an anonymous structure in qemu header)


But after re-thinking, my patch is rather unelegant. I think we  
should definitely use a void * type for info, rather than using the  
anonymous struct siginfo trick. Any thought?


Pierre.


___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] [PATCH] darwin-user merge attempt - patch v2

2007-01-16 Thread Pierre d'Herbemont

Here is an updated version of the patch:



darwin_user.2.diff.txt.gz
Description: GNU Zip compressed data


It mostly fix i386-darwin-user on ppc which was broken in previous  
patch.


Pierre.

On 12 janv. 07, at 07:44, Pierre d'Herbemont wrote:


Hi,

Here is an attempt to merge the qemu tree hosted in darwine CVS  
repository [1]. This branch contains a darwin-user target for qemu,  
which goal is similar to linux-user on linux.


For now there is still much to do, like:
1- fill the ioctls*.h files
2- Accurately implement all the syscall.
3- have all the user access protected by lock_user/unlock_user and  
g2h/h2g macro.
4- Fix the bugs that prevent Cocoa apps from running i386-darwin- 
user on ppc


But darwin-user is starting to become functionnal:
- i386-darwin-user on x86: (Some) cocoa apps run fines.
- i386-darwin-user on ppc: (Some) command line utility work fines,  
but we may have some bugs left that prevent Cocoa applications from  
working.
- ppc-darwin-user on ppc: commpage issues can prevent qemu from  
running, hopefully todo#3 could fix that.
- ppc-darwin-user on x86: ppc and x86 commpage overlap, so the ppc  
commpage can't be mapped, hopefully todo#3 could fix that too.


I hope to ear some feedback about inclusion in the qemu TOT.

Pierre.

(Note that Matt Reda used to work on that too.)

[1] http://darwine.cvs.sourceforge.net/darwine/qemu/



___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


[Qemu-devel] [PATCH] darwin-user merge attempt

2007-01-11 Thread Pierre d'Herbemont

Hi,

Here is an attempt to merge the qemu tree hosted in darwine CVS  
repository [1]. This branch contains a darwin-user target for qemu,  
which goal is similar to linux-user on linux.


For now there is still much to do, like:
1- fill the ioctls*.h files
2- Accurately implement all the syscall.
3- have all the user access protected by lock_user/unlock_user and  
g2h/h2g macro.
4- Fix the bugs that prevent Cocoa apps from running i386-darwin-user  
on ppc


But darwin-user is starting to become functionnal:
- i386-darwin-user on x86: (Some) cocoa apps run fines.
- i386-darwin-user on ppc: (Some) command line utility work fines,  
but we may have some bugs left that prevent Cocoa applications from  
working.
- ppc-darwin-user on ppc: commpage issues can prevent qemu from  
running, hopefully todo#3 could fix that.
- ppc-darwin-user on x86: ppc and x86 commpage overlap, so the ppc  
commpage can't be mapped, hopefully todo#3 could fix that too.


I hope to ear some feedback about inclusion in the qemu TOT.

Pierre.

(Note that Matt Reda used to work on that too.)

[1] http://darwine.cvs.sourceforge.net/darwine/qemu/



darwin_user.1.diff.txt.bz2
Description: Binary data
___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] qemu Makefile configure

2007-01-07 Thread Pierre d'Herbemont


On 3 janv. 07, at 15:23, Bernhard Fischer wrote:


On Wed, Jan 03, 2007 at 01:59:50PM +, Thiemo Seufer wrote:

ifeq ($(ARCH),ppc)

- CFLAGS+= -D__powerpc__
+ CPPFLAGS += -D__powerpc__

(doesn't cpp already define that on ppc?)


That's for the Darwin/Mac OS X PowerPC platforms where __powerpc__ is  
not defined by gcc.


Pierre





___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] ENOMEDIUM OS X patch

2006-08-28 Thread Pierre d'Herbemont


On Aug 28, 2006, at 5:45 PM, Jose Renau wrote:

OS X does not include ENOMEDIUM on the error list (I think that the  
same is true for Solaris).

This patch solves the problem.


so this would be more appropriate:

+#ifndef ENOMEDIUM
+#define ENOMEDIUM 4097
+#endif

than:


+#ifdef CONFIG_COCOA
+#define ENOMEDIUM 4097
+#endif


Pierre.


___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] User-space emulation on Mac OS X to run Mac OS X Intel applications

2005-10-23 Thread Pierre d'Herbemont

On 21 oct. 05, at 22:16, Steven wrote:


Hi all,

Looking at qemu, it seems as if it could be possible to allow it to
run Intel OS X apps on PowerPC OS X, much like a reverse Rosetta. The
x86 frameworks/libraries are included with Xcode, so possibly
everything else could run natively, just have the app itself emulated.

Is anybody willing to try getting this to work?


I used to work on it. I will resume the work in 6 months.

http://wiki.opendarwin.org/index.php/Darwine:qemu-darwin-user

The remaining problems were mostly the apple only (that only dyld  
should call) syscalls like load_shared_file, which needs to be  
implemented properly.


Pierre.



___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] [PATCH] Embed QEmu screen on a custom window

2005-05-27 Thread Pierre d'Herbemont


On 26 mai 05, at 23:07, Christian MICHON wrote:

I do not know what cocoa.m implementation is, but I've seen
screenshots.


cocoa.m is just a qemu video driver which uses natives Mac OS X UI  
Libraries.



It does require space, and if you go full-screen,
you can't do modifications.


I am not sure that you speak about the cocoa driver. The cocoa video  
driver is lighter than the SDL one, since it doesn't require the SDL  
dependencies. And I don't get the full-screen point: cocoa.m still  
need much work, and that is why it doesn't support fullscreen (yet).  
(BTW Mike has been doing some great improvements which will be  
hopefully soon committed in the head cvs repository.)



Hence the suggestion to go
full SDL.


Fabrice would like to see the native GTK, or Win32 qemu video coded.  
Because then a decent UI could be added to qemu. The front ends will  
always be limited, and the previous hack seems a bit crazy, and  
nearly nasty: you can do that directly via a video driver for qemu,  
and moreover it will let you far more control over qemu.


Pierre.


___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] [PATCH] cocoa.m

2005-05-27 Thread Pierre d'Herbemont


On 27 mai 05, at 16:51, Mike Kronenberg wrote:

Pierre would like to put the whole thing in the head tree. I would  
be ready to do so, too, if this is wanted.


I didn't realize that the Q app was a front end. It would be much  
cleaner to have it running in qemu as the cocoa qemu driver. That  
should be done with not much troubles, if we manage to get qemu  
thread safe. Did you try that way?


Pierre.


___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] cocoa.m using openGL

2005-05-27 Thread Pierre d'Herbemont
On 24 mai 05, at 17:11, Mike Kronenberg wrote:Testbuild and diff are onhttp://www.kberg.ch/cocoaqemuIt doesn't work on my iMac DV G3 400. I know that its ATI Rage 128 is very limited, but I think that we'll had to keep both version...The PNG preview works but not the main screen.I'll be able to debug a bit more in the weekend.Pierre.___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] cocoa.m using openGL

2005-05-26 Thread Pierre d'Herbemont

Hi Peter,

That is really great!

To send your work:
1) download the cvs repository, see:
http://savannah.nongnu.org/cvs/?group=qemu
2) send your diff:
# cd /path/to/qemu
# cvs diff -u cocoa.m  cocoapatch.diff.txt

If you think your patch is clean enough, send it to Fabrice (and the  
list) so that it can be merged in qemu's repository.


It seems that cocoa.m is under heavy work, which is good :)

Pierre.

Le 22 mai 05 à 15:00, Peter Stewart a écrit :


Hello to all,

esp. Pierre d'Herbemont,

I have changed cocoa.m (0.7.0) to use openGL with very fast  
texturing. I removed the use of QuickDraw. The DisplayState data is  
now DMA'd to the graphics card instead of copied by the CPU. This  
uses apple's texture range extensions. The change means that the  
transfer of display memory incurs no CPU overhead. I also put in  
a bit more mouse stuff, and made some other fixes. I can't work out  
how to get the Window to get focus once it loses it, which is  
really a pain.


I Shark'd it to make sure there wasn't any overhead from the  
texturing. I tested with Knoppix and FreeDOS.


I am not sure if this is of interest to people, I just had a lazy  
weekend. I would like to give the code to the qemu project, but  
don't really know how to.



thanks,
peter.



___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel





___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] [Patch] target-ppc mtcrf instruction not recognized

2005-05-18 Thread Pierre d'Herbemont
On 16 mai 05, at 09:54, Benjamin Herrenschmidt wrote:

OK, I did put this in my working repository and I'll submit this to
Fabrice.
Please try to do this change to check if other bits need to be relax 
or
not:

Index: target-ppc/translate.c
===
RCS file: /cvsroot/qemu/qemu/target-ppc/translate.c,v
retrieving revision 1.31
diff -u -r1.31 translate.c
--- target-ppc/translate.c  12 May 2005 18:46:11 -  1.31
+++ target-ppc/translate.c  14 May 2005 17:14:35 -
@@ -2123,7 +2123,7 @@
 }
 /* mtcrf */
-GEN_HANDLER(mtcrf, 0x1F, 0x10, 0x04, 0x00100801, PPC_MISC)
+GEN_HANDLER(mtcrf, 0x1F, 0x10, 0x04, 0x0801, PPC_MISC)
 {
 gen_op_load_gpr_T0(rS(ctx-opcode));
 gen_op_store_cr(CRM(ctx-opcode));
I've tested it: it works fine as expected.
And maybe someone should fill an Apple bug report to tell them their 
as
is buggy ;-)
It is definitely a bug in Apple assembler I would say, so I suggest you
add a comment in the above patch in order to avoid somebody later on
fixing your mask :)
I thought it was, but it seems to be not so buggy ;)
I have had a look at the Apple's as source code of Darwin 8.0 (10.4) 
[1] and I have found an interesting comment :
	/*
	 * If this is the mtcrf opcode (0x7c000120) and val is not zero and
	 * has exactly one bit set then use the new form of the mtcrf
	 * opcode.  This has bit 0x0010 set and the FXM field is a bit
	 * mask. Else use the old form without bit 0x0010 set.
  */

I don't know what they are refering to, but that may have been 
introduced by the PowerPC 970 or an other new PPC, since it was not 
present on the Mac OS X 10.2's as [2].

Pierre.
 [1] http://darwinsource.opendarwin.org/10.4/cctools-576/as/ppc.c
 [2] http://darwinsource.opendarwin.org/10.2/cctools-435/as/ppc.c

___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


[Qemu-devel] [Patch] target-ppc mtcrf instruction not recognized

2005-05-14 Thread Pierre d'Herbemont
Hi,
I have been playing with ppc-darwin-user. And I have to say that qemu- 
ppc is too strict with ppc opcode validity:
On Mac OS X binary release called Tiger (or 10.4), the __bzero  
function [1] contains a mtcrf, which has been translated to  
0x7c901120, by Apple's as. Current qemu rejects it, saying it is  
invalid. According to the IBM Specification the mtcrf instruction  
[2], contains reserved flags, for which the values are unknown. qemu  
assumes that those are set to 1, which is obviously wrong. The  
attached patch provides a fix.

The mtcrf case might not be the only case in which such a situation  
occurs. That would need a special attention, though being strict is  
better than letting pass.

Pierre.
[1] http://fxr.watson.org/fxr/source/osfmk/ppc/commpage/bzero_32.s? 
v=DARWIN8#L98
[2] http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixassem/ 
alangref/mtcrf.htm

Index: target-ppc/translate.c
===
RCS file: /cvsroot/qemu/qemu/target-ppc/translate.c,v
retrieving revision 1.31
diff -u -r1.31 translate.c
--- target-ppc/translate.c  12 May 2005 18:46:11 -  1.31
+++ target-ppc/translate.c  14 May 2005 17:14:35 -
@@ -2123,7 +2123,7 @@
 }
 
 /* mtcrf */
-GEN_HANDLER(mtcrf, 0x1F, 0x10, 0x04, 0x00100801, PPC_MISC)
+GEN_HANDLER(mtcrf, 0x1F, 0x10, 0x04, 0x, PPC_MISC)
 {
 gen_op_load_gpr_T0(rS(ctx-opcode));
 gen_op_store_cr(CRM(ctx-opcode));
___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] Windows XP Home on qemu 0.6.0 and Mac OS X 10.3.8

2005-05-01 Thread Pierre d'Herbemont
On 1 mai 05, at 06:24, Karl Magdsick wrote:
http://fabrice.bellard.free.fr/qemu/kqemu-doc.html indicates kqemu is
only for x86 Linux 2.4.x and Linux 2.6.x, not PPC Xnu 7.9.x.   Qemu
0.6.0 might also be too old to take advantage of kqemu.
If he used the installer from Free OS Zoo, this would seem to indicate
he doesn't know which compile options were used.  In any case, I would
hope that if the kqemu options cause large overhad, they weren't
turned on for a compilation targeted at both an architecture and
kernel for which kqemu did not exist at the time of compiliation.
Are you suggesting that his emulator is running slowly because it is
repeatedly attempting and failing to use the accelerated kernel
interface?
The version martin uses is 0.6.0version0.6.1, so there were no  
kqemu support at this time.

Pierre
___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel