Re: [PATCH v5 09/11] s390/mm: Add huge pmd storage key handling

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

 




On 07/06/2018 03:55 PM, Janosch Frank wrote:
>  		skey = (unsigned long) page_get_storage_key(address);
> @@ -839,14 +863,33 @@ EXPORT_SYMBOL(cond_set_guest_storage_key);
>  int reset_guest_reference_bit(struct mm_struct *mm, unsigned long addr)
>  {
>  	spinlock_t *ptl;
> +	unsigned long address;
>  	pgste_t old, new;
> +	pmd_t *pmdp;
>  	pte_t *ptep;
>  	int cc = 0;
>  
> -	ptep = get_locked_pte(mm, addr, &ptl);
> -	if (unlikely(!ptep))
> +	pmdp = (pmd_t *)huge_pte_offset(mm, addr, HPAGE_SIZE);
> +	if (!pmdp)
>  		return -EFAULT;
>  
> +	ptl = pmd_lock(mm, pmdp);
> +	if (!pmd_present(*pmdp)) {
> +		spin_unlock(ptl);
> +		return -EFAULT;
> +	}
> +	if (pmd_large(*pmdp)) {
> +		address = pmd_val(*pmdp) & HPAGE_MASK;
> +		address |= addr & ~HPAGE_MASK;
> +		cc = page_reset_referenced(addr);

address?




[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