From: Paolo Bonzini <pbonzini@redhat.com>
To: Leon Alrae <leon.alrae@imgtec.com>
Cc: James Hogan <james.hogan@imgtec.com>,
qemu-devel <qemu-devel@nongnu.org>, vt <vt@sangfor.com.cn>
Subject: Re: [Qemu-devel] [Question]Support of China loogson processor
Date: Thu, 16 Apr 2015 21:40:15 +0200 [thread overview]
Message-ID: <5530101F.4060100@redhat.com> (raw)
In-Reply-To: <55300CAC.20103@imgtec.com>
On 16/04/2015 21:25, Leon Alrae wrote:
> On 16/04/15 16:17, Paolo Bonzini wrote:
>>
>>
>> On 16/04/2015 17:05, Leon Alrae wrote:
>>> On 16/04/2015 13:02, Paolo Bonzini wrote:
>>>>
>>>>
>>>> On 16/04/2015 13:07, Leon Alrae wrote:
>>>>> Since I also haven't had a chance to test Loongson emulation, I thought
>>>>> I'd give it a try (TCG only, Loongson-2E cpu and fulong2e machine).
>>>>>
>>>>> Good news is that I'm able to get to the login prompt using ancient QEMU
>>>>> v1.0, kernel 2.6.33 (with additional patch from
>>>>> https://lists.gnu.org/archive/html/qemu-devel/2010-06/msg02566.html) and
>>>>> some old debian image I had handy. However, in any newer version
>>>>> starting from v1.1.0 of QEMU something goes horribly wrong and it just
>>>>> segfaults somewhere inside hw/bonito.c quite early during kernel
>>>>> booting.
>>>>
>>>> Where exactly? If it's related to the memory API conversion, it may be
>>>> easy to fix. I can look at a backtrace (or you can just put the Debian
>>>> image somewhere I can grab it).
>>>
>>> Bisect points at: 5312bd8b3152f8d4fcf9389ba54e32b09f4b4093
>>>
>>> Crash occurs during the first access, below there is backtrace from
>>> working and not working case:
>>
>> This is my best guess...
>>
>> diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
>> index 8bdd569..8134d0b 100644
>> --- a/hw/pci-host/bonito.c
>> +++ b/hw/pci-host/bonito.c
>> @@ -233,7 +233,7 @@ static void bonito_writel(void *opaque, hwaddr addr,
>> uint32_t saddr;
>> int reset = 0;
>>
>> - saddr = (addr - BONITO_REGBASE) >> 2;
>> + saddr = addr >> 2;
>>
>> DPRINTF("bonito_writel "TARGET_FMT_plx" val %x saddr %x\n", addr, val, saddr);
>> switch (saddr) {
>> @@ -295,7 +295,7 @@ static uint64_t bonito_readl(void *opaque, hwaddr addr,
>> PCIBonitoState *s = opaque;
>> uint32_t saddr;
>>
>> - saddr = (addr - BONITO_REGBASE) >> 2;
>> + saddr = addr >> 2;
>>
>> DPRINTF("bonito_readl "TARGET_FMT_plx"\n", addr);
>> switch (saddr) {
>>
>
> Nice. Thanks!
>
> Would you send the patch or should I do this? With this fix fulong2e
> machine is brought back to life. It would be great to have it in 2.3.
You can send a pull request directly (add my Signed-off-by and Cc:
qemu-stable@nongnu.org, please), but it is possible Peter will tell you
to wait for 2.3.1. It's been broken for a few years already. :)
Paolo
next prev parent reply other threads:[~2015-04-16 19:40 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-13 11:29 [Qemu-devel] [Question]Support of China loogson processor vt
2015-04-15 1:08 ` Rob Landley
2015-04-15 3:53 ` vt
2015-04-15 9:19 ` Andreas Färber
2015-04-15 9:35 ` James Hogan
2015-04-16 11:07 ` Leon Alrae
2015-04-16 12:02 ` Paolo Bonzini
2015-04-16 15:05 ` Leon Alrae
2015-04-16 15:17 ` Paolo Bonzini
2015-04-16 19:25 ` Leon Alrae
2015-04-16 19:40 ` Paolo Bonzini [this message]
2015-04-16 22:00 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5530101F.4060100@redhat.com \
--to=pbonzini@redhat.com \
--cc=james.hogan@imgtec.com \
--cc=leon.alrae@imgtec.com \
--cc=qemu-devel@nongnu.org \
--cc=vt@sangfor.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).