|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v6 2/2] add a new p2m type - p2m_mmio_write_dm
>>> On 11.12.14 at 13:04, <tim@xxxxxxx> wrote:
> At 11:55 +0800 on 06 Dec (1417863337), Yu Zhang wrote:
>> From: Yu Zhang <yu.c.zhang@xxxxxxxxx>
>>
>> A new p2m type, p2m_mmio_write_dm, is added to trap and emulate
>> the write operations on GPU's page tables. Handling of this new
>> p2m type are similar with existing p2m_ram_ro in most condition
>> checks, with only difference on final policy of emulation vs. drop.
>> For p2m_ram_ro types, write operations will not trigger the device
>> model, and will be discarded later in __hvm_copy(); while for the
>> p2m_mmio_write_dm type pages, writes will go to the device model
>> via ioreq-server.
>>
>> Signed-off-by: Yu Zhang <yu.c.zhang@xxxxxxxxxxxxxxx>
>> Signed-off-by: Wei Ye <wei.ye@xxxxxxxxx>
>
> Sorry not to have seen this before, but it looks like the new type isn't
> handled in the shadow-pagetable code. I think you need this as well:
>
> diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
> index 225290e..58c0cca 100644
> --- a/xen/arch/x86/mm/shadow/multi.c
> +++ b/xen/arch/x86/mm/shadow/multi.c
> @@ -3181,7 +3181,8 @@ static int sh_page_fault(struct vcpu *v,
> }
>
> /* Need to hand off device-model MMIO to the device model */
> - if ( p2mt == p2m_mmio_dm )
> + if ( p2mt == p2m_mmio_dm
> + || p2mt == p2m_mmio_readonly && ft == ft_demand_write )
> {
> gpa = guest_walk_to_gpa(&gw);
> goto mmio;
>
> With that hunk added, you can add
>
> Reviewed-by: Tim Deegan <tim@xxxxxxx>
But please add parentheses around the && operands, even if not
strictly needed.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |