diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2017-07-26 09:23:27 +0300 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2017-07-26 09:23:27 +0300 |
commit | 810fa7efe0e50693e9ef81d182c29be067fb84d6 (patch) | |
tree | 589d90c8ec4385aae77003e8499650837ba7139a /arch/s390/kernel | |
parent | fd2b2c57ec2020ae1b5e24717a876c71e31e5ab8 (diff) | |
parent | cd774b9076845312caf76ad52523bd9219e89ae1 (diff) | |
download | linux-810fa7efe0e50693e9ef81d182c29be067fb84d6.tar.xz |
Merge branch 'tlb-flushing' into features
Add the TLB flushing changes via a tip branch to ease merging with
the KVM tree.
Diffstat (limited to 'arch/s390/kernel')
-rw-r--r-- | arch/s390/kernel/suspend.c | 24 | ||||
-rw-r--r-- | arch/s390/kernel/vdso.c | 2 |
2 files changed, 21 insertions, 5 deletions
diff --git a/arch/s390/kernel/suspend.c b/arch/s390/kernel/suspend.c index 39e2f41b6cf0..c8ea715bfe10 100644 --- a/arch/s390/kernel/suspend.c +++ b/arch/s390/kernel/suspend.c @@ -98,10 +98,16 @@ int page_key_alloc(unsigned long pages) */ void page_key_read(unsigned long *pfn) { + struct page *page; unsigned long addr; - - addr = (unsigned long) page_address(pfn_to_page(*pfn)); - *(unsigned char *) pfn = (unsigned char) page_get_storage_key(addr); + unsigned char key; + + page = pfn_to_page(*pfn); + addr = (unsigned long) page_address(page); + key = (unsigned char) page_get_storage_key(addr) & 0x7f; + if (arch_test_page_nodat(page)) + key |= 0x80; + *(unsigned char *) pfn = key; } /* @@ -126,8 +132,16 @@ void page_key_memorize(unsigned long *pfn) */ void page_key_write(void *address) { - page_set_storage_key((unsigned long) address, - page_key_rp->data[page_key_rx], 0); + struct page *page; + unsigned char key; + + key = page_key_rp->data[page_key_rx]; + page_set_storage_key((unsigned long) address, key & 0x7f, 0); + page = virt_to_page(address); + if (key & 0x80) + arch_set_page_nodat(page, 0); + else + arch_set_page_dat(page, 0); if (++page_key_rx >= PAGE_KEY_DATA_SIZE) return; page_key_rp = page_key_rp->next; diff --git a/arch/s390/kernel/vdso.c b/arch/s390/kernel/vdso.c index b89d19f6f2ab..eacda05b45d7 100644 --- a/arch/s390/kernel/vdso.c +++ b/arch/s390/kernel/vdso.c @@ -157,6 +157,8 @@ int vdso_alloc_per_cpu(struct lowcore *lowcore) page_frame = get_zeroed_page(GFP_KERNEL); if (!segment_table || !page_table || !page_frame) goto out; + arch_set_page_dat(virt_to_page(segment_table), SEGMENT_ORDER); + arch_set_page_dat(virt_to_page(page_table), 0); /* Initialize per-cpu vdso data page */ vd = (struct vdso_per_cpu_data *) page_frame; |