Re: [Xen-devel] [PATCH v4] x86: add p2m_mmio_write_dm

2014-12-04 Thread Yu, Zhang
On 12/4/2014 5:36 PM, Tim Deegan wrote: Hi, At 17:01 +0800 on 04 Dec (1417708878), Yu, Zhang wrote: I just noticed that in __hvm_copy()/__hvm_clear(), the grant types are handled before the p2m_ram_ro - will return HVMCOPY_unhandleable. So if p2m_is_discard_write() is supposed to replace the

Re: [Xen-devel] [PATCH v4] x86: add p2m_mmio_write_dm

2014-12-04 Thread Tim Deegan
Hi, At 17:01 +0800 on 04 Dec (1417708878), Yu, Zhang wrote: > I just noticed that in __hvm_copy()/__hvm_clear(), the grant types are > handled before the p2m_ram_ro - will return HVMCOPY_unhandleable. So if > p2m_is_discard_write() is supposed to replace the handling of > p2m_ram_ro, handling o

Re: [Xen-devel] [PATCH v4] x86: add p2m_mmio_write_dm

2014-12-04 Thread Yu, Zhang
On 12/2/2014 7:40 PM, Tim Deegan wrote: At 15:38 +0800 on 02 Dec (1417531126), Yu, Zhang wrote: On 12/1/2014 8:13 PM, Tim Deegan wrote: At 11:17 + on 01 Dec (1417429027), Jan Beulich wrote: On 01.12.14 at 11:30, wrote: During this bit of archaeology I realised that either this new type

Re: [Xen-devel] [PATCH v4] x86: add p2m_mmio_write_dm

2014-12-02 Thread Yu, Zhang
On 12/2/2014 7:40 PM, Tim Deegan wrote: At 15:38 +0800 on 02 Dec (1417531126), Yu, Zhang wrote: On 12/1/2014 8:13 PM, Tim Deegan wrote: At 11:17 + on 01 Dec (1417429027), Jan Beulich wrote: On 01.12.14 at 11:30, wrote: During this bit of archaeology I realised that either this new type

Re: [Xen-devel] [PATCH v4] x86: add p2m_mmio_write_dm

2014-12-02 Thread Jan Beulich
>>> On 02.12.14 at 12:40, wrote: > At 15:38 +0800 on 02 Dec (1417531126), Yu, Zhang wrote: >> 2> p2m_grant_map_ro is also supposed to be discarded? Will handling of >> this type of pages goes into __hvm_copy()/__hvm_clear(), or should? > > I think so, yes. At the moment we inject #GP when the g

Re: [Xen-devel] [PATCH v4] x86: add p2m_mmio_write_dm

2014-12-02 Thread Tim Deegan
At 15:38 +0800 on 02 Dec (1417531126), Yu, Zhang wrote: > On 12/1/2014 8:13 PM, Tim Deegan wrote: > > At 11:17 + on 01 Dec (1417429027), Jan Beulich wrote: > > On 01.12.14 at 11:30, wrote: > >>> During this bit of archaeology I realised that either this new type > >>> should _not_ be made

Re: [Xen-devel] [PATCH v4] x86: add p2m_mmio_write_dm

2014-12-02 Thread Jan Beulich
>>> On 02.12.14 at 11:37, wrote: > At 12:31 + on 01 Dec (1417433464), Jan Beulich wrote: >> >>> On 01.12.14 at 13:13, wrote: >> > At 11:17 + on 01 Dec (1417429027), Jan Beulich wrote: >> >> >>> On 01.12.14 at 11:30, wrote: >> >> > At 09:32 + on 01 Dec (1417422746), Jan Beulich wrote:

Re: [Xen-devel] [PATCH v4] x86: add p2m_mmio_write_dm

2014-12-02 Thread Tim Deegan
At 12:31 + on 01 Dec (1417433464), Jan Beulich wrote: > >>> On 01.12.14 at 13:13, wrote: > > At 11:17 + on 01 Dec (1417429027), Jan Beulich wrote: > >> >>> On 01.12.14 at 11:30, wrote: > >> > At 09:32 + on 01 Dec (1417422746), Jan Beulich wrote: > >> >> >>> On 01.12.14 at 09:49, wrot

Re: [Xen-devel] [PATCH v4] x86: add p2m_mmio_write_dm

2014-12-02 Thread Jan Beulich
>>> On 02.12.14 at 08:48, wrote: > > On 12/1/2014 8:31 PM, Jan Beulich wrote: > On 01.12.14 at 13:13, wrote: >>> At 11:17 + on 01 Dec (1417429027), Jan Beulich wrote: >>> On 01.12.14 at 11:30, wrote: > At 09:32 + on 01 Dec (1417422746), Jan Beulich wrote: > On 01.12

Re: [Xen-devel] [PATCH v4] x86: add p2m_mmio_write_dm

2014-12-01 Thread Yu, Zhang
On 12/1/2014 8:31 PM, Jan Beulich wrote: On 01.12.14 at 13:13, wrote: At 11:17 + on 01 Dec (1417429027), Jan Beulich wrote: On 01.12.14 at 11:30, wrote: At 09:32 + on 01 Dec (1417422746), Jan Beulich wrote: On 01.12.14 at 09:49, wrote: To my understanding, pages with p2m_ram_ro

Re: [Xen-devel] [PATCH v4] x86: add p2m_mmio_write_dm

2014-12-01 Thread Yu, Zhang
On 12/1/2014 8:13 PM, Tim Deegan wrote: At 11:17 + on 01 Dec (1417429027), Jan Beulich wrote: On 01.12.14 at 11:30, wrote: At 09:32 + on 01 Dec (1417422746), Jan Beulich wrote: On 01.12.14 at 09:49, wrote: To my understanding, pages with p2m_ram_ro are not supposed to be modified

Re: [Xen-devel] [PATCH v4] x86: add p2m_mmio_write_dm

2014-12-01 Thread Jan Beulich
>>> On 01.12.14 at 13:13, wrote: > At 11:17 + on 01 Dec (1417429027), Jan Beulich wrote: >> >>> On 01.12.14 at 11:30, wrote: >> > At 09:32 + on 01 Dec (1417422746), Jan Beulich wrote: >> >> >>> On 01.12.14 at 09:49, wrote: >> >> > To my understanding, pages with p2m_ram_ro are not suppos

Re: [Xen-devel] [PATCH v4] x86: add p2m_mmio_write_dm

2014-12-01 Thread Tim Deegan
At 11:17 + on 01 Dec (1417429027), Jan Beulich wrote: > >>> On 01.12.14 at 11:30, wrote: > > At 09:32 + on 01 Dec (1417422746), Jan Beulich wrote: > >> >>> On 01.12.14 at 09:49, wrote: > >> > To my understanding, pages with p2m_ram_ro are not supposed to be > >> > modified by guest. So i

Re: [Xen-devel] [PATCH v4] x86: add p2m_mmio_write_dm

2014-12-01 Thread Jan Beulich
>>> On 01.12.14 at 11:30, wrote: > At 09:32 + on 01 Dec (1417422746), Jan Beulich wrote: >> >>> On 01.12.14 at 09:49, wrote: >> > To my understanding, pages with p2m_ram_ro are not supposed to be >> > modified by guest. So in __hvm_copy(), when p2m type of a page is >> > p2m_ram_rom, no cop

Re: [Xen-devel] [PATCH v4] x86: add p2m_mmio_write_dm

2014-12-01 Thread Tim Deegan
At 09:32 + on 01 Dec (1417422746), Jan Beulich wrote: > >>> On 01.12.14 at 09:49, wrote: > > On 11/28/2014 5:57 PM, Jan Beulich wrote: > > On 28.11.14 at 08:59, wrote: > >>> --- a/xen/arch/x86/hvm/hvm.c > >>> +++ b/xen/arch/x86/hvm/hvm.c > >>> @@ -2838,7 +2838,8 @@ int hvm_hap_nested_page

Re: [Xen-devel] [PATCH v4] x86: add p2m_mmio_write_dm

2014-12-01 Thread Jan Beulich
>>> On 01.12.14 at 09:49, wrote: > On 11/28/2014 5:57 PM, Jan Beulich wrote: > On 28.11.14 at 08:59, wrote: >>> --- a/xen/arch/x86/hvm/hvm.c >>> +++ b/xen/arch/x86/hvm/hvm.c >>> @@ -2838,7 +2838,8 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned >>> long gla, >>>* to the mmio h

Re: [Xen-devel] [PATCH v4] x86: add p2m_mmio_write_dm

2014-12-01 Thread Yu, Zhang
On 11/28/2014 5:57 PM, Jan Beulich wrote: On 28.11.14 at 08:59, wrote: --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -2838,7 +2838,8 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla, * to the mmio handler. */ if ( (p2mt == p2m_mmio_dm) || -

Re: [Xen-devel] [PATCH v4] x86: add p2m_mmio_write_dm

2014-11-28 Thread Jan Beulich
>>> On 28.11.14 at 08:59, wrote: > --- a/xen/arch/x86/hvm/hvm.c > +++ b/xen/arch/x86/hvm/hvm.c > @@ -2838,7 +2838,8 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned > long gla, > * to the mmio handler. > */ > if ( (p2mt == p2m_mmio_dm) || > - (npfec.write_access &&

[Xen-devel] [PATCH v4] x86: add p2m_mmio_write_dm

2014-11-28 Thread Yu Zhang
XenGT (Intel Graphics Virtualization technology, please refer to https://01.org/xen/blogs/srclarkx/2013/graphics-virtualization- xengt) driver runs inside Dom0 as a virtual graphics device model, and needs to trap and emulate the guest's write operations to some specific memory pages, like memory p