• Paul Mackerras's avatar
    KVM: PPC: Book3s HV: Maintain separate guest and host views of R and C bits · bad3b507
    Paul Mackerras authored
    This allows both the guest and the host to use the referenced (R) and
    changed (C) bits in the guest hashed page table.  The guest has a view
    of R and C that is maintained in the guest_rpte field of the revmap
    entry for the HPTE, and the host has a view that is maintained in the
    rmap entry for the associated gfn.
    
    Both view are updated from the guest HPT.  If a bit (R or C) is zero
    in either view, it will be initially set to zero in the HPTE (or HPTEs),
    until set to 1 by hardware.  When an HPTE is removed for any reason,
    the R and C bits from the HPTE are ORed into both views.  We have to
    be careful to read the R and C bits from the HPTE after invalidating
    it, but before unlocking it, in case of any late updates by the hardware.
    Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
    Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
    Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
    bad3b507
book3s_64_mmu_hv.c 23.3 KB