Re: [PATCH] slow_map: minor improvements to ROM BAR handling

2009-12-23 Thread Avi Kivity
On 12/22/2009 06:00 PM, Alexander Graf wrote: Plus, you have a fixed length instruction length, likely more regular too. I imagine powerpc is load/store, so you don't have to emulate a zillion ALU instructions? Well, it's certainly doable (and easier than on x86). But I'm on the same

Re: [PATCH] slow_map: minor improvements to ROM BAR handling

2009-12-23 Thread Michael S. Tsirkin
On Tue, Dec 22, 2009 at 05:39:22PM +0200, Avi Kivity wrote: On 12/22/2009 05:36 PM, Alexander Graf wrote: Is there a way to trap this and fprintf something? I don't think so. KVM will just trap on execution outside of RAM and either fail badly or throw something bad into the guest.

[PATCH] slow_map: minor improvements to ROM BAR handling

2009-12-22 Thread Michael S. Tsirkin
ROM BAR can be handled same as regular BAR: load_option_roms utility will take care of copying it to RAM as appropriate. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- This patch applies on top of agraf's one, it takes care of non-page aligned ROM BARs as well: they mostly are taken care

Re: [PATCH] slow_map: minor improvements to ROM BAR handling

2009-12-22 Thread Michael S. Tsirkin
On Tue, Dec 22, 2009 at 01:05:23PM +0100, Alexander Graf wrote: Michael S. Tsirkin wrote: ROM BAR can be handled same as regular BAR: load_option_roms utility will take care of copying it to RAM as appropriate. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- This patch

Re: [PATCH] slow_map: minor improvements to ROM BAR handling

2009-12-22 Thread Michael S. Tsirkin
On Tue, Dec 22, 2009 at 02:34:42PM +0100, Alexander Graf wrote: Michael S. Tsirkin wrote: On Tue, Dec 22, 2009 at 01:05:23PM +0100, Alexander Graf wrote: Michael S. Tsirkin wrote: ROM BAR can be handled same as regular BAR: load_option_roms utility will take care of copying

Re: [PATCH] slow_map: minor improvements to ROM BAR handling

2009-12-22 Thread Avi Kivity
On 12/22/2009 05:19 PM, Michael S. Tsirkin wrote: I'm not sure the BIOS is the only one executing ROMs. If it is, then I'm good with the change. Maybe it'd make sense to also add a read only flag so we don't accidently try to write to the ROM region with slow_map. Alex Correct: I think

Re: [PATCH] slow_map: minor improvements to ROM BAR handling

2009-12-22 Thread Alexander Graf
Avi Kivity wrote: On 12/22/2009 05:19 PM, Michael S. Tsirkin wrote: I'm not sure the BIOS is the only one executing ROMs. If it is, then I'm good with the change. Maybe it'd make sense to also add a read only flag so we don't accidently try to write to the ROM region with slow_map. Alex

Re: [PATCH] slow_map: minor improvements to ROM BAR handling

2009-12-22 Thread Alexander Graf
Avi Kivity wrote: On 12/22/2009 05:36 PM, Alexander Graf wrote: Is there a way to trap this and fprintf something? I don't think so. KVM will just trap on execution outside of RAM and either fail badly or throw something bad into the guest. MMIO access works by analyzing the

Re: [PATCH] slow_map: minor improvements to ROM BAR handling

2009-12-22 Thread Avi Kivity
On 12/22/2009 05:41 PM, Alexander Graf wrote: We could certainly extend emulate.c to fetch instruction bytes from userspace. It uses -read_std() now, so we'd need to switch to -read_emulated() and add appropriate buffering. I thought the policy on emulate.c was to not have a full

Re: [PATCH] slow_map: minor improvements to ROM BAR handling

2009-12-22 Thread Michael S. Tsirkin
On Tue, Dec 22, 2009 at 05:00:52PM +0100, Alexander Graf wrote: Avi Kivity wrote: On 12/22/2009 05:41 PM, Alexander Graf wrote: We could certainly extend emulate.c to fetch instruction bytes from userspace. It uses -read_std() now, so we'd need to switch to -read_emulated() and add

Re: [PATCH] slow_map: minor improvements to ROM BAR handling

2009-12-22 Thread Alexander Graf
Michael S. Tsirkin wrote: On Tue, Dec 22, 2009 at 05:00:52PM +0100, Alexander Graf wrote: Avi Kivity wrote: On 12/22/2009 05:41 PM, Alexander Graf wrote: We could certainly extend emulate.c to fetch instruction bytes from userspace. It uses -read_std() now, so we'd need to