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

Re: [Xen-devel] [PATCH v3 04/18] x86/hvm: make sure translated MMIO reads or writes fall within a page



>>> On 23.06.15 at 12:39, <paul.durrant@xxxxxxxxxx> wrote:
> ...otherwise they will simply carry on to the next page using a normal
> linear-to-phys translation.

And what's wrong about this?

> --- a/xen/arch/x86/hvm/emulate.c
> +++ b/xen/arch/x86/hvm/emulate.c
> @@ -586,7 +586,6 @@ static int __hvmemul_read(
>                                          p_data);
>              if ( rc != X86EMUL_OKAY || bytes == chunk )
>                  return rc;
> -            addr += chunk;
>              off += chunk;
>              gpa += chunk;
>              p_data += chunk;
> @@ -594,6 +593,8 @@ static int __hvmemul_read(
>              if ( bytes < chunk )
>                  chunk = bytes;
>          }
> +
> +        return X86EMUL_UNHANDLEABLE;
>      }

All the loop above does is leverage that we don't need to do a
translation, as we already know the physical address. Continuing
if the access crosses a page boundary is not wrong at all afaict.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.