qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] SPARC - host support in vl.c
@ 2004-08-31 22:04 Bochnig, Martin
  2004-08-31 22:14 ` Falk Hueffner
  2004-08-31 23:24 ` [Qemu-devel] The very best I can get on SPARC Bochnig, Martin
  0 siblings, 2 replies; 7+ messages in thread
From: Bochnig, Martin @ 2004-08-31 22:04 UTC (permalink / raw)
  To: qemu-devel

Here my patch suggestions to add SPARC host support to vl.c :


#elif defined(__sparc__)

  /* Derived from: "m68k updates #2" by Richard Zidlicky
  "crude hack to get some sort of rdtsc support" */

#include <sys/time.h>
static int64_t cputicks=0;
static struct timeval lastcptcall={0,0};

// assume 5 MHz Pentium, min 80 ticks between rdtsc calls

int64_t cpu_get_real_ticks(void)
{
      struct timeval tp;
      gettimeofday(&tp,(void*)0);
      if (tp.tv_sec == lastcptcall.tv_sec &&
         tp.tv_usec == lastcptcall.tv_usec ){
        cputicks += 1;
      } else {
        cputicks=0;
        lastcptcall=tp;
      }
      return ((int64_t)tp.tv_sec*1000000+tp.tv_usec)*5+cputicks;
}


#elif defined(__sparc64__)

/* I'm not sure it was worth it, personally.
*
*UltraSparc:
*
*  unsigned long x;
*  asm volatile ("rd %tick, %0" : "=r"(x));
*
* Earlier Sparcs do not have this feature.
*
*
*/

int64_t cpu_get_real_ticks(void)
{
     int64_t val;
    asm volatile ("rd %%tick, %0" : "=r"(val));
     return val;
}

#else
#error unsupported CPU
#endif

Any ideas would be appreciated.

Martin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] SPARC - host support in vl.c
  2004-08-31 22:04 [Qemu-devel] SPARC - host support in vl.c Bochnig, Martin
@ 2004-08-31 22:14 ` Falk Hueffner
  2004-08-31 22:24   ` Bochnig, Martin
  2004-09-01 15:44   ` Richard Zidlicky
  2004-08-31 23:24 ` [Qemu-devel] The very best I can get on SPARC Bochnig, Martin
  1 sibling, 2 replies; 7+ messages in thread
From: Falk Hueffner @ 2004-08-31 22:14 UTC (permalink / raw)
  To: bochnig; +Cc: qemu-devel

"Bochnig, Martin" <mb1x@gmx.com> writes:

> Here my patch suggestions to add SPARC host support to vl.c :
>
> #elif defined(__sparc__)

Why conditionalize this to __sparc__? Seems like a generally sensible
fallback.

-- 
	Falk

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] SPARC - host support in vl.c
  2004-08-31 22:14 ` Falk Hueffner
@ 2004-08-31 22:24   ` Bochnig, Martin
  2004-08-31 22:41     ` Falk Hueffner
  2004-09-01 15:44   ` Richard Zidlicky
  1 sibling, 1 reply; 7+ messages in thread
From: Bochnig, Martin @ 2004-08-31 22:24 UTC (permalink / raw)
  To: qemu-devel


>>#elif defined(__sparc__)
> 
> 
> Why conditionalize this to __sparc__? Seems like a generally sensible
> fallback.
> 

Huh?

It is to be conditionalized among powerpc, i386, x86_64 and so.

SPARC32's didn't support the UltraSPARC specific %tick instruction.

What do you mean?


--
	Martin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] SPARC - host support in vl.c
  2004-08-31 22:24   ` Bochnig, Martin
@ 2004-08-31 22:41     ` Falk Hueffner
  2004-09-01  7:57       ` Bochnig, Martin
  0 siblings, 1 reply; 7+ messages in thread
From: Falk Hueffner @ 2004-08-31 22:41 UTC (permalink / raw)
  To: bochnig; +Cc: qemu-devel

"Bochnig, Martin" <mb1x@gmx.com> writes:

>>>#elif defined(__sparc__)
>> Why conditionalize this to __sparc__? Seems like a generally sensible
>> fallback.
>
> It is to be conditionalized among powerpc, i386, x86_64 and so.
>
> SPARC32's didn't support the UltraSPARC specific %tick instruction.
>
> What do you mean?

I mean that what is now for __sparc__ should just be a global #else,
since it should work everywhere if a more specialized version is not
available.

-- 
	Falk

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Qemu-devel] The very best I can get on SPARC
  2004-08-31 22:04 [Qemu-devel] SPARC - host support in vl.c Bochnig, Martin
  2004-08-31 22:14 ` Falk Hueffner
@ 2004-08-31 23:24 ` Bochnig, Martin
  1 sibling, 0 replies; 7+ messages in thread
From: Bochnig, Martin @ 2004-08-31 23:24 UTC (permalink / raw)
  To: qemu-devel

Please see my recent postings first.

The very best I can get on SPARC (compiled on UltraSPARC IIi for SPARC32) :

debian:~/QEMU/qemu-0.6.0# uname -a
Linux debian 2.4.18 #2 Thu Apr 11 14:37:17 EDT 2002 sparc64 unknown
debian:~/QEMU/qemu-0.6.0#
debian:~/QEMU/qemu-0.6.0# file /usr/local/bin/qemu
/usr/local/bin/qemu: ELF 32-bit MSB executable, SPARC, version 1 (SYSV), 
statically linked, stripped
debian:~/QEMU/qemu-0.6.0#
debian:~/QEMU/qemu-0.6.0# /usr/local/bin/qemu -nographic -hda 
hd10meg.img -kernel vmlinuz-2.6.5-1.358 -append "console=ttyS0 
root=/dev/hda sb=0x220,5,1,5 ide2=noprobe ide3=noprobe ide4=noprobe 
ide5=noprobe"
warning: could not open /dev/net/tun: no virtual network emulation
Linux version 2.6.5-1.358 (bhcompile@bugs.build.redhat.com) (gcc version 
3.3.3 20040412 (Red Hat Linux 3.3.3-7)) #1 Sat May 8 09:04:50 EDT 2004
BIOS-provided physical RAM map:
  BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
  BIOS-e820: 0000000000100000 - 0000000008000000 (usable)
0MB HIGHMEM available.
128MB LOWMEM available.
zapping low mappings.
On node 0 totalpages: 32768
   DMA zone: 4096 pages, LIFO batch:1
   Normal zone: 28672 pages, LIFO batch:7
   HighMem zone: 0 pages, LIFO batch:1
DMI not present.
ACPI: Unable to locate RSDP
Built 1 zonelists
Kernel command line: console=ttyS0 root=/dev/hda sb=0x220,5,1,5 
ide2=noprobe ide3=noprobe ide4=noprobe ide5=noprobe
ide_setup: ide2=noprobe
ide_setup: ide3=noprobe
ide_setup: ide4=noprobe
ide_setup: ide5=noprobe
mapped 4G/4G trampoline to ffff3000.
Initializing CPU#0
CPU 0 irqstacks, hard=02345000 soft=02344000
PID hash table entries: 1024 (order 10: 8192 bytes)
Detected 5.036 MHz processor.
Using tsc for high-res timesource
Console: colour VGA+ 80x25
Losing too many ticks!
TSC cannot be used as a timesource.
Possible reasons for this are:
   You're running with Speedstep,
   You don't have DMA enabled for your hard disk (see hdparm),
   Incorrect TSC synchronization on an SMP system (see dmesg).
Falling back to a sane timesource now.
Memory: 126804k/131072k available (1540k kernel code, 3696k reserved, 
599k data, 144k init, 0k highmem)
Calibrating delay loop... 142.33 BogoMIPS
Security Scaffold v1.0.0 initialized
SELinux:  Initializing.
SELinux:  Starting in permissive mode
There is already a security framework initialized, register_security failed.
Failure registering capabilities with the kernel
selinux_register_security:  Registering secondary module capability
Capability LSM initialized
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
CPU: L1 I cache: 8K
CPU: L2 cache: 128K
CPU: Intel Pentium Pro stepping 03
Unable to handle kernel paging request at virtual address fffffc01
  printing eip:
023180c4
*pde = 00002067
Oops: 0002 [#1]
CPU:    0
EIP:    0060:[<023180c4>]    Not tainted
EFLAGS: 00000246   (2.6.5-1.358)
EIP is at check_fpu+0x91/0xcb
eax: 0000000d   ebx: 02378d00   ecx: 00000000   edx: 000003f8
esi: 0000000d   edi: 0000270f   ebp: 02349c03   esp: 02317f54
ds: 007b   es: 007b   ss: 0068
Process swapper (pid: 0, threadinfo=02317000 task=022c5aa0)
Stack: 00000060 02191439 021d7b4a 0000000d 00000000 0000000d 022d9380 
021d79d4
        022d9380 021d79d4 02118726 00000964 fffff69c 00000964 00000964 
02118840
        00000246 fffff69c 00000246 fffff69c 00000246 02348e8d 00000246 
021189cd
Call Trace:
  [<02191439>] __delay+0x9/0xa
  [<021d7b4a>] serial8250_console_write+0x176/0x1bc
  [<021d79d4>] serial8250_console_write+0x0/0x1bc
  [<021d79d4>] serial8250_console_write+0x0/0x1bc
  [<02118726>] __call_console_drivers+0x36/0x42
  [<02118840>] call_console_drivers+0xbe/0xe3
  [<021189cd>] printk+0x106/0x113
  [<0231cf7f>] print_cpu_info+0x94/0xa8
  [<02318176>] check_bugs+0x28/0x50
  [<023185f2>] start_kernel+0x154/0x176

Code: db e3 dd 05 a0 ff 32 02 dc 35 a8 ff 32 02 dc 0d a8 ff 32 02
  <0>Kernel panic: Attempted to kill the idle task!
In idle task - not syncing
  Killed

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] SPARC - host support in vl.c
  2004-08-31 22:41     ` Falk Hueffner
@ 2004-09-01  7:57       ` Bochnig, Martin
  0 siblings, 0 replies; 7+ messages in thread
From: Bochnig, Martin @ 2004-09-01  7:57 UTC (permalink / raw)
  To: qemu-devel

Falk Hueffner wrote:

> I mean that what is now for __sparc__ should just be a global #else,
> since it should work everywhere if a more specialized version is not
> available.
> 

Oh, of course - that's true.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] SPARC - host support in vl.c
  2004-08-31 22:14 ` Falk Hueffner
  2004-08-31 22:24   ` Bochnig, Martin
@ 2004-09-01 15:44   ` Richard Zidlicky
  1 sibling, 0 replies; 7+ messages in thread
From: Richard Zidlicky @ 2004-09-01 15:44 UTC (permalink / raw)
  To: qemu-devel

On Wed, Sep 01, 2004 at 12:14:47AM +0200, Falk Hueffner wrote:
> "Bochnig, Martin" <mb1x@gmx.com> writes:
> 
> > Here my patch suggestions to add SPARC host support to vl.c :
> >
> > #elif defined(__sparc__)
> 
> Why conditionalize this to __sparc__? Seems like a generally sensible
> fallback.

Fabrice had plans to do this properly, by counting executed
instructions.

Any idea what happened with this plan?

Richard

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-09-01 15:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-31 22:04 [Qemu-devel] SPARC - host support in vl.c Bochnig, Martin
2004-08-31 22:14 ` Falk Hueffner
2004-08-31 22:24   ` Bochnig, Martin
2004-08-31 22:41     ` Falk Hueffner
2004-09-01  7:57       ` Bochnig, Martin
2004-09-01 15:44   ` Richard Zidlicky
2004-08-31 23:24 ` [Qemu-devel] The very best I can get on SPARC Bochnig, Martin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).