Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 110826
b: refs/heads/master
c: 15e86b0
h: refs/heads/master
v: v3
  • Loading branch information
Florian Funke authored and Martin Schwidefsky committed Oct 10, 2008
1 parent 884670d commit 0c97757
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ab1d848fd6a9151b02c6cbf4bddce6e24707b094
refs/heads/master: 15e86b0c752d50e910b2cca6e83ce74c4440d06c
45 changes: 43 additions & 2 deletions trunk/arch/s390/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ extern char empty_zero_page[PAGE_SIZE];
#define RCP_GR_BIT 50
#define RCP_GC_BIT 49

/* User dirty bit for KVM's migration feature */
#define KVM_UD_BIT 47

#ifndef __s390x__

/* Bits in the segment table address-space-control-element */
Expand Down Expand Up @@ -575,12 +578,16 @@ static inline void ptep_rcp_copy(pte_t *ptep)
unsigned long *pgste = (unsigned long *) (ptep + PTRS_PER_PTE);

skey = page_get_storage_key(page_to_phys(page));
if (skey & _PAGE_CHANGED)
if (skey & _PAGE_CHANGED) {
set_bit_simple(RCP_GC_BIT, pgste);
set_bit_simple(KVM_UD_BIT, pgste);
}
if (skey & _PAGE_REFERENCED)
set_bit_simple(RCP_GR_BIT, pgste);
if (test_and_clear_bit_simple(RCP_HC_BIT, pgste))
if (test_and_clear_bit_simple(RCP_HC_BIT, pgste)) {
SetPageDirty(page);
set_bit_simple(KVM_UD_BIT, pgste);
}
if (test_and_clear_bit_simple(RCP_HR_BIT, pgste))
SetPageReferenced(page);
#endif
Expand Down Expand Up @@ -744,6 +751,40 @@ static inline pte_t pte_mkspecial(pte_t pte)
return pte;
}

#ifdef CONFIG_PGSTE
/*
* Get (and clear) the user dirty bit for a PTE.
*/
static inline int kvm_s390_test_and_clear_page_dirty(struct mm_struct *mm,
pte_t *ptep)
{
int dirty;
unsigned long *pgste;
struct page *page;
unsigned int skey;

if (!mm->context.pgstes)
return -EINVAL;
rcp_lock(ptep);
pgste = (unsigned long *) (ptep + PTRS_PER_PTE);
page = virt_to_page(pte_val(*ptep));
skey = page_get_storage_key(page_to_phys(page));
if (skey & _PAGE_CHANGED) {
set_bit_simple(RCP_GC_BIT, pgste);
set_bit_simple(KVM_UD_BIT, pgste);
}
if (test_and_clear_bit_simple(RCP_HC_BIT, pgste)) {
SetPageDirty(page);
set_bit_simple(KVM_UD_BIT, pgste);
}
dirty = test_and_clear_bit_simple(KVM_UD_BIT, pgste);
if (skey & _PAGE_CHANGED)
page_clear_dirty(page);
rcp_unlock(ptep);
return dirty;
}
#endif

#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
static inline int ptep_test_and_clear_young(struct vm_area_struct *vma,
unsigned long addr, pte_t *ptep)
Expand Down

0 comments on commit 0c97757

Please sign in to comment.