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

Re: [Xen-devel] [PATCH V6 4/4] x86/mm: Make use of the default access param from xc_altp2m_create_view


  • To: George Dunlap <george.dunlap@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Alexandru Stefan ISAILA <aisaila@xxxxxxxxxxxxxxx>
  • Date: Tue, 24 Dec 2019 10:19:48 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=bitdefender.com; dmarc=pass action=none header.from=bitdefender.com; dkim=pass header.d=bitdefender.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kdkR4iXglSVMCf479wulRKDXiKrcKTw4I5DFn8TtEJ4=; b=WAtV+JlQWfDyyE8Z3Y97g8qKSebztuOccbJIZ3/P7Kz1EvHu2sPbRB8FlPSF9vLSn19MZkwFEwS/KtEdsbJZ/G8OsEjzxCrgOV1u57nGpWAIpnt3qdQoAcTROApr10p5OtVjkKqzRRwA5qOATupJPa4VZA/63PyeTImuDnUsf4hi/xUCQ6UtFlyn6uInFs0TwukNX4Q7MygO9O1y9jfT8hRWG2yGOMe5+EQ37JDOpf9pYgZ+OOC5W3UXrtioZePelgBx9aqc91T7gywUd8axuPdeTUFa030/Sv8zWmSvdG51twTRCnrPknMh5dkJoQ/8vFqKso1Rgh7BYutrrs9W5w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hCWxcyqmlECy0We8x/jIgBgmVUdjGztzNQA84ZebRef4QZB+p1o7lH9q5UC+Tna73hjaOdwGM6zgtj1HJtVPExNoF0yDHQo9l82sv7S3kNNmi/7YuM2ks7pFqOy8K5bsOEzYH8DrrCnXQKYh5z8ND4q+Ed4t/sEID4a0PhUWqAaXMBxoRIUaNG2m/FaqBH3HNDorPE8qaRtyOhIRsciqeuBmxe1+M2nEpiv2HZbsi+aCDP7tzKikQkcXc7qV9cW8sIsg/z4/LKRf0v+AXW8Ctql+0vGn+62RyMSpq5XnzirevStdR/n4+W32+nRt/D+Ru85tVeXGUovE7fT3WoYCCA==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=aisaila@xxxxxxxxxxxxxxx;
  • Cc: Petre Ovidiu PIRCALABU <ppircalabu@xxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Razvan COJOCARU <rcojocaru@xxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, Tamas K Lengyel <tamas@xxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 24 Dec 2019 10:20:03 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVuZnrNlPztLTziE+Y8R0jH4JRdKfI+p+AgAAZgIA=
  • Thread-topic: [PATCH V6 4/4] x86/mm: Make use of the default access param from xc_altp2m_create_view


On 24.12.2019 10:48, George Dunlap wrote:
> On 12/23/19 2:04 PM, Alexandru Stefan ISAILA wrote:
>> At this moment the default_access param from xc_altp2m_create_view is
>> not used.
>>
>> This patch assigns default_access to p2m->default_access at the time of
>> initializing a new altp2m view.
> 
> That's certainly not what it looks like.  It looks like you're changing
> it from...
> 
>> @@ -2562,7 +2564,7 @@ static int p2m_activate_altp2m(struct domain *d,
> unsigned int idx)
>>           goto out;
>>       }
>>
>> -    p2m->default_access = hostp2m->default_access;
>> +    p2m->default_access = hvmmem_default_access;
>>       p2m->domain = hostp2m->domain;
>>       p2m->global_logdirty = hostp2m->global_logdirty;
>>       p2m->min_remapped_gfn = gfn_x(INVALID_GFN);
> 
> ...hostp2m->default_access to...
> 
>> @@ -340,7 +340,10 @@ static bool xenmem_access_to_p2m_access(struct
> p2m_domain *p2m,
>>           *paccess = memaccess[xaccess];
>>           break;
>>       case XENMEM_access_default:
>> -        *paccess = p2m->default_access;
>> +        if ( !p2m )
>> +            *paccess = p2m_access_rwx;
>> +        else
>> +            *paccess = p2m->default_access;
>>           break;
>>       default:
>>           return false;
> 
> ...p2m_access_rwx (by passing NULL in to this function in
> p2m_init_next_altp2m).
> 
> Why don't you...
> 
>> -int p2m_init_next_altp2m(struct domain *d, uint16_t *idx)
>> +int p2m_init_next_altp2m(struct domain *d, uint16_t *idx,
>> +                         xenmem_access_t hvmmem_default_access)
>>   {
>>       int rc = -EINVAL;
>>       unsigned int i;
>> +    p2m_access_t a;
>> +    struct p2m_domain *p2m;
>> +
>> +    if ( hvmmem_default_access > XENMEM_access_default ||
>> +         !xenmem_access_to_p2m_access(NULL, hvmmem_default_access, &a) )
>> +        return rc;
>>
>>       altp2m_list_lock(d);
>>
> 
> ...pass in hostp2m here?

That sound better then the current version, thanks.

> 
> Also...
> 
>> @@ -2606,7 +2616,8 @@ int p2m_init_next_altp2m(struct domain *d,
> uint16_t *idx)
>>           if ( d->arch.altp2m_eptp[i] != mfn_x(INVALID_MFN) )
>>               continue;
>>
>> -        rc = p2m_activate_altp2m(d, i);
>> +        p2m = d->arch.altp2m_p2m[i];
> 
> What's this about?
> 

This is an artifact form v3 when xenmem_access_to_p2m_access() needed 
p2m. I will clean it.

Alex
_______________________________________________
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®.