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

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


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Alexandru Stefan ISAILA <aisaila@xxxxxxxxxxxxxxx>
  • Date: Mon, 2 Dec 2019 12:39:22 +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=9Nm0mgxSj13z4NCKTXNwisYSr29Q7Bn2UPIfyQIWEL4=; b=Gj1nbIMPgd2arRoZJnknwJ/dtvQ89EoZSK7KGQ3x7P5VuHYzrrUTNaWTNALfuFx2R4n6+y7WOPiyslcd/YOIAahK/SPdxlf9IjMTSrszo9QR9X4wjXOao5kLFTyfr7S7GGNgR8N0bR0p2Bi+xRvJvB4X6fHEbsUKujuRit8tbSQaLxZJR5Zv4IIV0kHur47QlatOqEqbWEsZamMW8Rd1iF5nT2YZgcA8uUmM38VOLt98cr8s5CfJCo4NBl0tiPA1jxgFO7h4es+GuGJG6sRzowYaJPTo4zVj2UYG8yOeW6Oy4egQVROuNsqubSBDxqEQgVYb8knj/bKDBTfXA+h1+w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hy9mgtFUGy3wQesryHdL6OvGUuLoFCYNp/VA+d9Ovd2+2PzWu2zZNAu8BjQvW8wW17OzVwKpanTkaVnI0JUkkvPLQS66Lca3WSDI4PSZ6eJielOv3iIurDu9G/Q5lnCnNpQJ6XFyQuCLF2Muxm3s8202pavqa1SwB8LOwwvnZFwDF57p3kN+iLfMSVL3j7QTEPJUMd1Wg4oYKznna63PCJZldFIrIB9oZgwloWmVQfUJ7QlF6KkuYje/4poTxUdSk+TCdN38hDxcqNI8xdpwph1CzVgoE+Wu1XWJnLPVl48m1YgmrkJBCZTvw26dTc71P0jf+3Q8S7FSlwD8Wet46A==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=aisaila@xxxxxxxxxxxxxxx;
  • Cc: Petre Ovidiu PIRCALABU <ppircalabu@xxxxxxxxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Wei Liu <wl@xxxxxxx>, Razvan COJOCARU <rcojocaru@xxxxxxxxxxxxxxx>, 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>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 02 Dec 2019 12:39:35 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVoHytGfGqS+cYyU6c6j3Ysa8x8qeiEvOAgATHHAA=
  • Thread-topic: [PATCH V3 2/2] x86/mm: Make use of the default access param from xc_altp2m_create_view


On 29.11.2019 13:41, Jan Beulich wrote:
> On 21.11.2019 16:02, Alexandru Stefan ISAILA wrote:
>> Changes since V2:
>>      - Drop static from xenmem_access_to_p2m_access() and declare it
>> in mem_access.h
>>      - Use xenmem_access_to_p2m_access() in p2m_init_next_altp2m()
>>      - Pull out the p2m specifics from p2m_init_altp2m_ept().
> 
> I guess this last point would better have been a prereq patch,
> but anyway.

Should I have a prereq patch for this in the next version?

> 
>> @@ -2577,16 +2586,23 @@ int p2m_init_altp2m_by_id(struct domain *d, unsigned 
>> int idx)
>>       altp2m_list_lock(d);
>>   
>>       if ( d->arch.altp2m_eptp[idx] == mfn_x(INVALID_MFN) )
>> -        rc = p2m_activate_altp2m(d, idx);
>> +        rc = p2m_activate_altp2m(d, idx, hostp2m->default_access);
>>   
>>       altp2m_list_unlock(d);
>>       return rc;
>>   }
>>   
>> -int p2m_init_next_altp2m(struct domain *d, uint16_t *idx)
>> +int p2m_init_next_altp2m(struct domain *d, uint16_t *idx,
>> +                         uint16_t hvmmem_default_access)
> 
> Does this new parameter really need to be a fixed width type,
> rather than simply unsigned int (or even a suitable enum
> type if there [hopefully] is one)?

I think xenmem_access_t would be a good fit here.

> 
>>   {
>>       int rc = -EINVAL;
>>       unsigned int i;
>> +    p2m_access_t a;
>> +    struct p2m_domain *p2m;
>> +
>> +
> 
> Two successive blank lines again.

I will fix that.

> 
>> @@ -2595,7 +2611,12 @@ 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];
>> +
>> +        if ( !xenmem_access_to_p2m_access(p2m, hvmmem_default_access, &a) )
>> +            return -EINVAL;
> 
> Returning with a lock still held?

Thanks for spotting this, it definitely needs a free.

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