qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: "Hervé Poussineau" <hpoussin@reactos.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Leon Alrae <leon.alrae@imgtec.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH for 2.4 2/3] net/dp8393x: specify memory operations for PROM PROM
Date: Mon, 27 Jul 2015 00:08:28 +0200	[thread overview]
Message-ID: <20150726220828.GA19504@aurel32.net> (raw)
In-Reply-To: <55B544AE.7000709@reactos.org>

On 2015-07-26 22:35, Hervé Poussineau wrote:
> >How does it crashes in that case? I would have guess that write access
> >to ROM are ignored by default. Looking at other code, it seems they call
> >memory_region_set_readonly() instead of providing an accepts function.
> >Maybe readonly should be the default for a rom device?
> 
> The stack trace is:
> 0x000055555563a758 in memory_region_access_valid (mr=mr@entry=0x55555adb0d50, addr=addr@entry=0, size=size@entry=1, is_write=is_write@entry=true) at memory.c:1075
> 1075	    if (!mr->ops->valid.unaligned && (addr & (size - 1))) {
> (gdb) bt
> #0  0x000055555563a758 in memory_region_access_valid (mr=mr@entry=0x55555adb0d50, addr=addr@entry=0, size=size@entry=1, is_write=is_write@entry=true) at memory.c:1075
> #1  0x000055555563a968 in memory_region_dispatch_write (mr=0x55555adb0d50, addr=0, data=82, size=1, attrs=...) at memory.c:1155
> #2  0x00007fffe6516f35 in code_gen_buffer ()
> #3  0x000055555560e4f3 in cpu_tb_exec (tb_ptr=0x7fffe6516ec0 <code_gen_buffer+8625856> "A\213n\374\205\355\017\205\220", cpu=0x55555703f1c0) at cpu-exec.c:200
> #4  cpu_mips_exec (cpu=cpu@entry=0x55555703f1c0) at cpu-exec.c:518
> #5  0x000055555562aec6 in tcg_cpu_exec (cpu=0x55555703f1c0) at cpus.c:1402
> #6  tcg_exec_all () at cpus.c:1434
> #7  qemu_tcg_cpu_thread_fn (arg=<optimized out>) at cpus.c:1068
> #8  0x00007ffff1dbd0a4 in start_thread (arg=0x7fffdf8f8700) at pthread_create.c:309
> #9  0x00007ffff1af204d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
> 
> With mr being the dp8393x prom.
> 
> 
> I tested with memory_region_set_readonly() and a NULL operations, and the stack trace is the same.
> Only pflash devices use memory_region_init_rom_device. Other devices use memory_region_init_ram + memory_region_set_readonly, which work.
> Do you prefer the attached patch?
> 

I have to say I am not sure what is the best, I don't know this part of
the code enough. I have added Paolo in Cc:, I guess he might have an
idea about that.

Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net

  reply	other threads:[~2015-07-26 22:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-24 18:42 [Qemu-devel] [PATCH for 2.4 0/3] net/dp8393x: misc fixes Hervé Poussineau
2015-07-24 18:42 ` [Qemu-devel] [PATCH for 2.4 1/3] net/dp8393x: disable user creation Hervé Poussineau
2015-07-26 20:11   ` Aurelien Jarno
2015-07-24 18:42 ` [Qemu-devel] [PATCH for 2.4 2/3] net/dp8393x: specify memory operations for PROM PROM Hervé Poussineau
2015-07-26 20:11   ` Aurelien Jarno
2015-07-26 20:35     ` Hervé Poussineau
2015-07-26 22:08       ` Aurelien Jarno [this message]
2015-07-27 10:38       ` Paolo Bonzini
2015-07-24 18:42 ` [Qemu-devel] [PATCH for 2.4 3/3] net/dp8393x: remove check of runt packets Hervé Poussineau
2015-07-26 20:14   ` Aurelien Jarno

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=20150726220828.GA19504@aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=hpoussin@reactos.org \
    --cc=leon.alrae@imgtec.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).