qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v1 2/2] gdbstub: don't fail on vCont; C04:0; c p


From: Greg Kurz
Subject: Re: [Qemu-devel] [PATCH v1 2/2] gdbstub: don't fail on vCont; C04:0; c packets
Date: Wed, 31 May 2017 19:06:29 +0200

On Wed, 31 May 2017 18:51:06 +0200
Claudio Imbrenda <address@hidden> wrote:
[...]
> > > 
> > > This is strange. cpu_index() is defined as:
> > > 
> > > static inline int cpu_index(CPUState *cpu)
> > > {
> > > #if defined(CONFIG_USER_ONLY)
> > >     return cpu->host_tid;
> > > #else
> > >     return cpu->cpu_index + 1;
> > > #endif
> > > }
> > > 
> > > therefore it shouldn't return 0 under any circumstance, and    
> > 
> > I think it is 0 for first_cpu in user mode.  
> 
> in linux-user/syscall.c:
> 
> info->tid = gettid();
> cpu->host_tid = info->tid;
> 
> kernel thread-ids are system-wide unique and can't be 0
>  

This is correct but these lines are in clone_func(). This gets called for
all threads but the "main" thread which I believe to be associated to
first_cpu.

Attachment: pgpX4jP7MuZcl.pgp
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]