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

Re: [Xen-devel] [PATCH 3/3] x86: tighten MMU_*PT_UPDATE* check and combine error paths



>>> On 12.10.17 at 13:31, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 12/10/17 11:01, Jan Beulich wrote:
>> Don't accept anything other than r/w RAM pages and move the paged-out
>> check into the (unlikely) error path following that check.
>>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> How does dom0 boot with this change in place?  You appear to have
> prohibited mapping MMIO frames.

The page in question is a page table one, which can't be MMIO.
Dom0 is booting fine.

Jan

>> --- a/xen/arch/x86/mm.c
>> +++ b/xen/arch/x86/mm.c
>> @@ -3507,18 +3507,18 @@ long do_mmu_update(
>>              gmfn = req.ptr >> PAGE_SHIFT;
>>              page = get_page_from_gfn(pt_owner, gmfn, &p2mt, P2M_ALLOC);
>>  
>> -            if ( p2m_is_paged(p2mt) )
>> +            if ( unlikely(!page) || p2mt != p2m_ram_rw )
>>              {
>> -                ASSERT(!page);
>> -                p2m_mem_paging_populate(pt_owner, gmfn);
>> -                rc = -ENOENT;
>> -                break;
>> -            }
>> -
>> -            if ( unlikely(!page) )
>> -            {
>> -                gdprintk(XENLOG_WARNING,
>> -                         "Could not get page for normal update\n");
>> +                if ( page )
>> +                    put_page(page);
>> +                if ( p2m_is_paged(p2mt) )
>> +                {
>> +                    p2m_mem_paging_populate(pt_owner, gmfn);
>> +                    rc = -ENOENT;
>> +                }
>> +                else
>> +                    gdprintk(XENLOG_WARNING,
>> +                             "Could not get page for normal update\n");
>>                  break;
>>              }
>>  
>>
>>
>>




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

 


Rackspace

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