Re: [PATCH v4 3/9] s390/mm: add gmap pmd invalidation notification

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

 



On 28.06.2018 15:47, Janosch Frank wrote:
> On 28.06.2018 14:55, David Hildenbrand wrote:
>> On 27.06.2018 15:55, Janosch Frank wrote:
>>> From: Janosch Frank <frankja@xxxxxxxxxxxxxxxxxx>
>>>

>>> @@ -63,6 +63,7 @@ static struct gmap *gmap_alloc(unsigned long limit)
>>>  	INIT_LIST_HEAD(&gmap->crst_list);
>>>  	INIT_LIST_HEAD(&gmap->children);
>>>  	INIT_LIST_HEAD(&gmap->pt_list);
>>> +	INIT_LIST_HEAD(&gmap->split_list);
>>>  	INIT_RADIX_TREE(&gmap->guest_to_host, GFP_KERNEL);
>>>  	INIT_RADIX_TREE(&gmap->host_to_guest, GFP_ATOMIC);
>>>  	INIT_RADIX_TREE(&gmap->host_to_rmap, GFP_ATOMIC);
>>> @@ -194,6 +195,10 @@ static void gmap_free(struct gmap *gmap)
>>>  	gmap_radix_tree_free(&gmap->guest_to_host);
>>>  	gmap_radix_tree_free(&gmap->host_to_guest);
>>>  
>>> +	/* Free split pmd page tables */
>>> +	list_for_each_entry_safe(page, next, &gmap->split_list, lru)
>>> +		page_table_free_pgste(page);
>>> +
>>>  	/* Free additional data for a shadow gmap */
>>>  	if (gmap_is_shadow(gmap)) {
>>>  		/* Free all page tables. */
>>> @@ -599,10 +604,15 @@ int __gmap_link(struct gmap *gmap, unsigned long gaddr, unsigned long vmaddr)
>>>  	if (*table == _SEGMENT_ENTRY_EMPTY) {
>>>  		rc = radix_tree_insert(&gmap->host_to_guest,
>>>  				       vmaddr >> PMD_SHIFT, table);
>>> -		if (!rc)
>>> -			*table = pmd_val(*pmd);
>>> -	} else
>>> -		rc = 0;
>>> +		if (!rc) {
>>> +			if (pmd_large(*pmd)) {
>>> +				*table = pmd_val(*pmd) &
>>> +					_SEGMENT_ENTRY_HARDWARE_BITS_LARGE;
>>> +			} else
>>> +				*table = pmd_val(*pmd) &
>>> +					_SEGMENT_ENTRY_HARDWARE_BITS;
>>> +		}
>>> +	}
>>
>> Does this part really belong into this patch *confused*
> 
> Hmm, I'll move this to the enablement patch where we also remove the
> EFAULT on huge pmds.

It doesn't really fit into this patch, but it'll stay, as I make
additions to this afterwards with the dirty sync and split handling.

Maybe I'll find a suitable patch after splitting this one.

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux