Skip to content

Commit

Permalink
s390/mm: do not initialize storage keys
Browse files Browse the repository at this point in the history
With dirty and referenced bits implemented in software it is unnecessary
to initialize the storage key for every page. With this patch not a single
storage key operation is done for a system that does not use KVM.
For KVM set_pte_at/pgste_set_key will do the initialization for the guest
view of the storage key when the mapping for the page is established in
the host.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Martin Schwidefsky committed Oct 24, 2013
1 parent 6cef300 commit 127c1fe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion arch/s390/include/asm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@
#include <asm/setup.h>
#ifndef __ASSEMBLY__

void storage_key_init_range(unsigned long start, unsigned long end);
static inline void storage_key_init_range(unsigned long start, unsigned long end)
{
#if PAGE_DEFAULT_KEY
__storage_key_init_range(start, end);
#endif
}

static inline void clear_page(void *page)
{
Expand Down
2 changes: 2 additions & 0 deletions arch/s390/kernel/early.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,15 @@ static noinline __init void clear_bss_section(void)
*/
static noinline __init void init_kernel_storage_key(void)
{
#if PAGE_DEFAULT_KEY
unsigned long end_pfn, init_pfn;

end_pfn = PFN_UP(__pa(&_end));

for (init_pfn = 0 ; init_pfn < end_pfn; init_pfn++)
page_set_storage_key(init_pfn << PAGE_SHIFT,
PAGE_DEFAULT_KEY, 0);
#endif
}

static __initdata char sysinfo_page[PAGE_SIZE] __aligned(PAGE_SIZE);
Expand Down
4 changes: 3 additions & 1 deletion arch/s390/mm/pageattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
#include <asm/pgtable.h>
#include <asm/page.h>

#if PAGE_DEFAULT_KEY
static inline unsigned long sske_frame(unsigned long addr, unsigned char skey)
{
asm volatile(".insn rrf,0xb22b0000,%[skey],%[addr],9,0"
: [addr] "+a" (addr) : [skey] "d" (skey));
return addr;
}

void storage_key_init_range(unsigned long start, unsigned long end)
void __storage_key_init_range(unsigned long start, unsigned long end)
{
unsigned long boundary, size;

Expand All @@ -36,6 +37,7 @@ void storage_key_init_range(unsigned long start, unsigned long end)
start += PAGE_SIZE;
}
}
#endif

static pte_t *walk_page_table(unsigned long addr)
{
Expand Down

0 comments on commit 127c1fe

Please sign in to comment.