From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH v3] xen: handle paged gfn in wrmsr_hypervisor_regs Date: Fri, 03 May 2013 16:58:51 +0100 Message-ID: References: <5183F44602000078000D330F@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5183F44602000078000D330F@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , Olaf Hering Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 03/05/2013 16:30, "Jan Beulich" wrote: >> if ( idx > 0 ) >> { >> gdprintk(XENLOG_WARNING, >> "Out of range index %u to MSR %08x\n", >> idx, 0x40000000); >> - return 0; >> + return -EINVAL; > > But I'd stay away from converting to actual errors both here ... > >> } >> >> - page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC); >> + page = get_page_from_gfn(d, gmfn, &t, P2M_ALLOC); >> >> if ( !page || !get_page_type(page, PGT_writable_page) ) >> { >> if ( page ) >> put_page(page); >> + >> + if ( p2m_is_paging(t) ) >> + { >> + p2m_mem_paging_populate(d, gmfn); >> + return -EAGAIN; >> + } >> + >> gdprintk(XENLOG_WARNING, >> "Bad GMFN %lx (MFN %lx) to MSR %08x\n", >> - gmfn, page_to_mfn(page), base + idx); >> - return 0; >> + gmfn, page ? page_to_mfn(page) : -1UL, base); >> + return -EINVAL; > > ... and here. If at all these ought to go into a separate patch > (which we'd likely postpone until after 4.3). But they are errors? Could agree with postponing to post-4.3 though. -- Keir