s390x: implement rrbe instruction properly

The rrbe instruction resets the reference bit in the given storage key.
So far, we merely made it a nop and also returned an invalid CC value,
so that the kernel never knew if a page actually got accessed.

This patch implements it properly, flushing the R bit and returning the
correct CC value.

Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
Alexander Graf 2011-07-14 11:50:33 +02:00
parent b995913853
commit 17bb18ce16
1 changed files with 7 additions and 5 deletions

View File

@ -2779,14 +2779,15 @@ void HELPER(sske)(uint32_t r1, uint64_t r2)
/* reset reference bit extended */ /* reset reference bit extended */
uint32_t HELPER(rrbe)(uint32_t r1, uint64_t r2) uint32_t HELPER(rrbe)(uint32_t r1, uint64_t r2)
{ {
uint8_t re;
uint8_t key;
if (r2 > ram_size) { if (r2 > ram_size) {
return 0; return 0;
} }
/* XXX implement */ key = env->storage_keys[r2 / TARGET_PAGE_SIZE];
#if 0 re = key & (SK_R | SK_C);
env->storage_keys[r2 / TARGET_PAGE_SIZE] &= ~SK_REFERENCED; env->storage_keys[r2 / TARGET_PAGE_SIZE] = (key & ~SK_R);
#endif
/* /*
* cc * cc
@ -2796,7 +2797,8 @@ uint32_t HELPER(rrbe)(uint32_t r1, uint64_t r2)
* 2 Reference bit one; change bit zero * 2 Reference bit one; change bit zero
* 3 Reference bit one; change bit one * 3 Reference bit one; change bit one
*/ */
return 0;
return re >> 1;
} }
/* compare and swap and purge */ /* compare and swap and purge */