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

Re: [Xen-devel] [PATCH v2 1/6] x86/xpti: avoid copying L4 page table contents when possible



On 05/03/18 17:43, Jan Beulich wrote:
>>>> On 02.03.18 at 09:13, <jgross@xxxxxxxx> wrote:
>> --- a/xen/arch/x86/mm.c
>> +++ b/xen/arch/x86/mm.c
>> @@ -509,6 +509,8 @@ void make_cr3(struct vcpu *v, mfn_t mfn)
>>  
>>  void write_ptbase(struct vcpu *v)
>>  {
>> +    get_cpu_info()->root_pgt_changed = this_cpu(root_pgt) && is_pv_vcpu(v) 
>> &&
>> +                                       !is_pv_32bit_vcpu(v);
> 
> Why is_pv_vcpu() when you already check is_pv_32bit_vcpu()?
> 
>> @@ -3704,18 +3706,22 @@ long do_mmu_update(
>>                          break;
>>                      rc = mod_l4_entry(va, l4e_from_intpte(req.val), mfn,
>>                                        cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
>> -                    /*
>> -                     * No need to sync if all uses of the page can be 
>> accounted
>> -                     * to the page lock we hold, its pinned status, and 
>> uses on
>> -                     * this (v)CPU.
>> -                     */
>> -                    if ( !rc && !cpu_has_no_xpti &&
>> -                         ((page->u.inuse.type_info & PGT_count_mask) >
>> -                          (1 + !!(page->u.inuse.type_info & PGT_pinned) +
>> -                           (pagetable_get_pfn(curr->arch.guest_table) == 
>> mfn) 
>> +
>> -                           (pagetable_get_pfn(curr->arch.guest_table_user) 
>> ==
>> -                            mfn))) )

Is it really possible this code is running with the user page table
being active on the current cpu? I think this test can be dropped.


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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