From: Stephen Rothwell <sfr@canb•auug.org.au>
To: Marcelo Tosatti <mtosatti@redhat•com>,
Gleb Natapov <gleb@kernel•org>,
Martin Schwidefsky <schwidefsky@de•ibm.com>,
Heiko Carstens <heiko.carstens@de•ibm.com>
Cc: linux-next@vger•kernel.org, linux-kernel@vger•kernel.org,
Dominik Dingel <dingel@linux•vnet.ibm.com>,
Christian Borntraeger <borntraeger@de•ibm.com>,
Paolo Bonzini <pbonzini@redhat•com>
Subject: linux-next: manual merge of the kvm tree with the s390 tree
Date: Tue, 7 Oct 2014 15:59:26 +1100 [thread overview]
Message-ID: <20141007155926.7ac19cdf@canb.auug.org.au> (raw)
[-- Attachment #1: Type: text/plain, Size: 4720 bytes --]
Hi all,
Today's linux-next merge of the kvm tree got a conflict in
arch/s390/mm/pgtable.c between commit 9511571c4f0e ("s390: mm: fixing
calls of pte_unmap_unlock") from the s390 tree and commit dc77d344b41f
("KVM: s390/mm: fix up indentation of set_guest_storage_key") from the
kvm tree.
I fixed it up (see below) and can carry the fix as necessary (no action
is required).
--
Cheers,
Stephen Rothwell sfr@canb•auug.org.au
diff --cc arch/s390/mm/pgtable.c
index a0f934a435e2,296b61a4af59..000000000000
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@@ -644,82 -656,29 +656,29 @@@ void __gmap_zap(struct gmap *gmap, unsi
}
pgste_set_unlock(ptep, pgste);
out_pte:
- pte_unmap_unlock(*ptep, ptl);
+ pte_unmap_unlock(ptep, ptl);
}
-
- /*
- * this function is assumed to be called with mmap_sem held
- */
- void __gmap_zap(unsigned long address, struct gmap *gmap)
- {
- unsigned long *table, *segment_ptr;
- unsigned long segment, pgstev, ptev;
- struct gmap_pgtable *mp;
- struct page *page;
-
- segment_ptr = gmap_table_walk(address, gmap);
- if (IS_ERR(segment_ptr))
- return;
- segment = *segment_ptr;
- if (segment & _SEGMENT_ENTRY_INVALID)
- return;
- page = pfn_to_page(segment >> PAGE_SHIFT);
- mp = (struct gmap_pgtable *) page->index;
- address = mp->vmaddr | (address & ~PMD_MASK);
- /* Page table is present */
- table = (unsigned long *)(segment & _SEGMENT_ENTRY_ORIGIN);
- table = table + ((address >> 12) & 0xff);
- pgstev = table[PTRS_PER_PTE];
- ptev = table[0];
- /* quick check, checked again with locks held */
- if (((pgstev & _PGSTE_GPS_USAGE_MASK) == _PGSTE_GPS_USAGE_UNUSED) ||
- ((pgstev & _PGSTE_GPS_ZERO) && (ptev & _PAGE_INVALID)))
- gmap_zap_unused(gmap->mm, address);
- }
EXPORT_SYMBOL_GPL(__gmap_zap);
- void gmap_discard(unsigned long from, unsigned long to, struct gmap *gmap)
+ void gmap_discard(struct gmap *gmap, unsigned long from, unsigned long to)
{
-
- unsigned long *table, address, size;
+ unsigned long gaddr, vmaddr, size;
struct vm_area_struct *vma;
- struct gmap_pgtable *mp;
- struct page *page;
down_read(&gmap->mm->mmap_sem);
- address = from;
- while (address < to) {
- /* Walk the gmap address space page table */
- table = gmap->table + ((address >> 53) & 0x7ff);
- if (unlikely(*table & _REGION_ENTRY_INVALID)) {
- address = (address + PMD_SIZE) & PMD_MASK;
- continue;
- }
- table = (unsigned long *)(*table & _REGION_ENTRY_ORIGIN);
- table = table + ((address >> 42) & 0x7ff);
- if (unlikely(*table & _REGION_ENTRY_INVALID)) {
- address = (address + PMD_SIZE) & PMD_MASK;
+ for (gaddr = from; gaddr < to;
+ gaddr = (gaddr + PMD_SIZE) & PMD_MASK) {
+ /* Find the vm address for the guest address */
+ vmaddr = (unsigned long)
+ radix_tree_lookup(&gmap->guest_to_host,
+ gaddr >> PMD_SHIFT);
+ if (!vmaddr)
continue;
- }
- table = (unsigned long *)(*table & _REGION_ENTRY_ORIGIN);
- table = table + ((address >> 31) & 0x7ff);
- if (unlikely(*table & _REGION_ENTRY_INVALID)) {
- address = (address + PMD_SIZE) & PMD_MASK;
- continue;
- }
- table = (unsigned long *)(*table & _REGION_ENTRY_ORIGIN);
- table = table + ((address >> 20) & 0x7ff);
- if (unlikely(*table & _SEGMENT_ENTRY_INVALID)) {
- address = (address + PMD_SIZE) & PMD_MASK;
- continue;
- }
- page = pfn_to_page(*table >> PAGE_SHIFT);
- mp = (struct gmap_pgtable *) page->index;
- vma = find_vma(gmap->mm, mp->vmaddr);
- size = min(to - address, PMD_SIZE - (address & ~PMD_MASK));
- zap_page_range(vma, mp->vmaddr | (address & ~PMD_MASK),
- size, NULL);
- address = (address + PMD_SIZE) & PMD_MASK;
+ vmaddr |= gaddr & ~PMD_MASK;
+ /* Find vma in the parent mm */
+ vma = find_vma(gmap->mm, vmaddr);
+ size = min(to - gaddr, PMD_SIZE - (gaddr & ~PMD_MASK));
+ zap_page_range(vma, vmaddr, size, NULL);
}
up_read(&gmap->mm->mmap_sem);
}
@@@ -994,13 -943,13 +943,13 @@@ retry
}
if (!(pte_val(*ptep) & _PAGE_INVALID) &&
(pte_val(*ptep) & _PAGE_PROTECT)) {
- pte_unmap_unlock(ptep, ptl);
- if (fixup_user_fault(current, mm, addr, FAULT_FLAG_WRITE)) {
- up_read(&mm->mmap_sem);
- return -EFAULT;
- }
- goto retry;
- pte_unmap_unlock(*ptep, ptl);
++ pte_unmap_unlock(ptep, ptl);
+ if (fixup_user_fault(current, mm, addr, FAULT_FLAG_WRITE)) {
+ up_read(&mm->mmap_sem);
+ return -EFAULT;
}
+ goto retry;
+ }
new = old = pgste_get_lock(ptep);
pgste_val(new) &= ~(PGSTE_GR_BIT | PGSTE_GC_BIT |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next reply other threads:[~2014-10-07 4:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-07 4:59 Stephen Rothwell [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-05-29 6:46 linux-next: manual merge of the kvm tree with the s390 tree Stephen Rothwell
2020-06-04 3:05 ` Stephen Rothwell
2016-07-14 4:03 Stephen Rothwell
2016-07-14 6:58 ` David Hildenbrand
2016-06-29 4:36 Stephen Rothwell
2016-06-29 5:47 ` Heiko Carstens
2013-06-06 3:55 Stephen Rothwell
2013-01-03 1:06 Stephen Rothwell
2013-01-03 7:31 ` Martin Schwidefsky
2013-01-03 10:56 ` Stephen Rothwell
2012-08-16 3:49 Stephen Rothwell
2011-09-21 3:55 Stephen Rothwell
2010-10-21 1:16 Stephen Rothwell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141007155926.7ac19cdf@canb.auug.org.au \
--to=sfr@canb$(echo .)auug.org.au \
--cc=borntraeger@de$(echo .)ibm.com \
--cc=dingel@linux$(echo .)vnet.ibm.com \
--cc=gleb@kernel$(echo .)org \
--cc=heiko.carstens@de$(echo .)ibm.com \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-next@vger$(echo .)kernel.org \
--cc=mtosatti@redhat$(echo .)com \
--cc=pbonzini@redhat$(echo .)com \
--cc=schwidefsky@de$(echo .)ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox