mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-27 19:35:15 +07:00
abf09bed3c
The s390 architecture is unique in respect to dirty page detection,
it uses the change bit in the per-page storage key to track page
modifications. All other architectures track dirty bits by means
of page table entries. This property of s390 has caused numerous
problems in the past, e.g. see git commit ef5d437f71
"mm: fix XFS oops due to dirty pages without buffers on s390".
To avoid future issues in regard to per-page dirty bits convert
s390 to a fault based software dirty bit detection mechanism. All
user page table entries which are marked as clean will be hardware
read-only, even if the pte is supposed to be writable. A write by
the user process will trigger a protection fault which will cause
the user pte to be marked as dirty and the hardware read-only bit
is removed.
With this change the dirty bit in the storage key is irrelevant
for Linux as a host, but the storage key is still required for
KVM guests. The effect is that page_test_and_clear_dirty and the
related code can be removed. The referenced bit in the storage
key is still used by the page_test_and_clear_young primitive to
provide page age information.
For page cache pages of mappings with mapping_cap_account_dirty
there will not be any change in behavior as the dirty bit tracking
already uses read-only ptes to control the amount of dirty pages.
Only for swap cache pages and pages of mappings without
mapping_cap_account_dirty there can be additional protection faults.
To avoid an excessive number of additional faults the mk_pte
primitive checks for PageDirty if the pgprot value allows for writes
and pre-dirties the pte. That avoids all additional faults for
tmpfs and shmem pages until these pages are added to the swap cache.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
61 lines
1.4 KiB
C
61 lines
1.4 KiB
C
/*
|
|
* Copyright IBM Corp. 2007
|
|
* Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>
|
|
*/
|
|
|
|
#ifndef _ASM_S390_SCLP_H
|
|
#define _ASM_S390_SCLP_H
|
|
|
|
#include <linux/types.h>
|
|
#include <asm/chpid.h>
|
|
|
|
#define SCLP_CHP_INFO_MASK_SIZE 32
|
|
|
|
struct sclp_chp_info {
|
|
u8 recognized[SCLP_CHP_INFO_MASK_SIZE];
|
|
u8 standby[SCLP_CHP_INFO_MASK_SIZE];
|
|
u8 configured[SCLP_CHP_INFO_MASK_SIZE];
|
|
};
|
|
|
|
#define LOADPARM_LEN 8
|
|
|
|
struct sclp_ipl_info {
|
|
int is_valid;
|
|
int has_dump;
|
|
char loadparm[LOADPARM_LEN];
|
|
};
|
|
|
|
struct sclp_cpu_entry {
|
|
u8 address;
|
|
u8 reserved0[13];
|
|
u8 type;
|
|
u8 reserved1;
|
|
} __attribute__((packed));
|
|
|
|
struct sclp_cpu_info {
|
|
unsigned int configured;
|
|
unsigned int standby;
|
|
unsigned int combined;
|
|
int has_cpu_type;
|
|
struct sclp_cpu_entry cpu[255];
|
|
};
|
|
|
|
int sclp_get_cpu_info(struct sclp_cpu_info *info);
|
|
int sclp_cpu_configure(u8 cpu);
|
|
int sclp_cpu_deconfigure(u8 cpu);
|
|
void sclp_facilities_detect(void);
|
|
unsigned long long sclp_get_rnmax(void);
|
|
unsigned long long sclp_get_rzm(void);
|
|
int sclp_sdias_blk_count(void);
|
|
int sclp_sdias_copy(void *dest, int blk_num, int nr_blks);
|
|
int sclp_chp_configure(struct chp_id chpid);
|
|
int sclp_chp_deconfigure(struct chp_id chpid);
|
|
int sclp_chp_read_info(struct sclp_chp_info *info);
|
|
void sclp_get_ipl_info(struct sclp_ipl_info *info);
|
|
bool sclp_has_linemode(void);
|
|
bool sclp_has_vt220(void);
|
|
int sclp_pci_configure(u32 fid);
|
|
int sclp_pci_deconfigure(u32 fid);
|
|
|
|
#endif /* _ASM_S390_SCLP_H */
|