From 794494067be287795918ea168bfd7d6f9627f651 Mon Sep 17 00:00:00 2001 From: zyf1116 Date: Tue, 17 Dec 2024 15:10:46 +0800 Subject: [PATCH] support build qemu Signed-off-by: zyf1116 --- drivers/block/zram/zram_group/group_writeback.c | 2 ++ fs/Kconfig | 3 --- fs/Makefile | 2 +- fs/proc/Makefile | 4 +++- fs/verity/fsverity_private.h | 2 ++ include/linux/hck/lite_hck_code_sign.h | 2 ++ include/linux/memcontrol.h | 2 ++ include/linux/mm_types.h | 2 ++ include/linux/page-flags.h | 6 +++--- kernel/watchdog.c | 1 + mm/internal.h | 2 ++ mm/memcontrol.c | 2 ++ mm/memory_hotplug.c | 2 ++ mm/page_alloc.c | 2 ++ mm/rmap.c | 2 ++ mm/swapfile.c | 2 ++ mm/zswapd.c | 2 ++ mm/zswapd_control.c | 2 ++ security/Kconfig | 2 -- security/Makefile | 6 ++++++ 20 files changed, 40 insertions(+), 10 deletions(-) diff --git a/drivers/block/zram/zram_group/group_writeback.c b/drivers/block/zram/zram_group/group_writeback.c index 0956a2eb939a..5e78ba08ee12 100644 --- a/drivers/block/zram/zram_group/group_writeback.c +++ b/drivers/block/zram/zram_group/group_writeback.c @@ -8,7 +8,9 @@ #include #include #include +#ifdef CONFIG_HYPERHOLD_ZSWAPD #include +#endif #include "../zram_drv.h" #include "zram_group.h" diff --git a/fs/Kconfig b/fs/Kconfig index 62daaaf85830..562a57bc7d04 100644 --- a/fs/Kconfig +++ b/fs/Kconfig @@ -51,7 +51,6 @@ source "fs/btrfs/Kconfig" source "fs/nilfs2/Kconfig" source "fs/f2fs/Kconfig" source "fs/zonefs/Kconfig" -source "fs/proc/memory_security/Kconfig" endif # BLOCK @@ -129,8 +128,6 @@ config FILE_LOCKING source "fs/crypto/Kconfig" -source "fs/code_sign/Kconfig" - source "fs/verity/Kconfig" source "fs/notify/Kconfig" diff --git a/fs/Makefile b/fs/Makefile index d04ef3afb7ff..c27b2d72dbe3 100644 --- a/fs/Makefile +++ b/fs/Makefile @@ -30,7 +30,7 @@ obj-$(CONFIG_USERFAULTFD) += userfaultfd.o obj-$(CONFIG_AIO) += aio.o obj-$(CONFIG_FS_DAX) += dax.o obj-$(CONFIG_FS_ENCRYPTION) += crypto/ -obj-$(CONFIG_SECURITY_CODE_SIGN) += code_sign/ +#obj-$(CONFIG_SECURITY_CODE_SIGN) += code_sign/ obj-$(CONFIG_FS_VERITY) += verity/ obj-$(CONFIG_FILE_LOCKING) += locks.o obj-$(CONFIG_BINFMT_MISC) += binfmt_misc.o diff --git a/fs/proc/Makefile b/fs/proc/Makefile index 04a0dd7256c2..63ebbe2134a3 100644 --- a/fs/proc/Makefile +++ b/fs/proc/Makefile @@ -34,4 +34,6 @@ proc-$(CONFIG_PROC_VMCORE) += vmcore.o proc-$(CONFIG_PRINTK) += kmsg.o proc-$(CONFIG_PROC_PAGE_MONITOR) += page.o proc-$(CONFIG_BOOT_CONFIG) += bootconfig.o -obj-$(CONFIG_MEMORY_SECURITY) += memory_security/ +ifdef CONFIG_MEMORY_SECURITY + obj-$(CONFIG_MEMORY_SECURITY) += memory_security/ +endif diff --git a/fs/verity/fsverity_private.h b/fs/verity/fsverity_private.h index 095b5466767a..c81bf6debafa 100644 --- a/fs/verity/fsverity_private.h +++ b/fs/verity/fsverity_private.h @@ -12,7 +12,9 @@ #include #include +#ifdef CONFIG_SECURITY_XPM #include +#endif /* * Implementation limit: maximum depth of the Merkle tree. For now 8 is plenty; diff --git a/include/linux/hck/lite_hck_code_sign.h b/include/linux/hck/lite_hck_code_sign.h index cde82bc34ab1..aae4259d0315 100644 --- a/include/linux/hck/lite_hck_code_sign.h +++ b/include/linux/hck/lite_hck_code_sign.h @@ -6,7 +6,9 @@ #ifndef LITE_HCK_CODE_SIGN_H #define LITE_HCK_CODE_SIGN_H +#ifdef CONFIG_SECURITY_XPM #include +#endif #include #ifndef CONFIG_HCK diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 688ecee2f565..663b7cbf74bf 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -21,8 +21,10 @@ #include #include #include +#ifdef CONFIG_HYPERHOLD_MEMCG #include #include +#endif struct mem_cgroup; struct obj_cgroup; diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 7264a43f8d18..01e94a718893 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -19,7 +19,9 @@ #include #include #include +#ifdef CONFIG_SECURITY_XPM #include +#endif #include diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 3ed1e637e30f..516af2d60208 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -512,8 +512,8 @@ PAGEFLAG(Checked, checked, PF_NO_COMPOUND) /* Used by some filesystems */ PAGEFLAG(XPMReadonly, xpm_readonly, PF_HEAD) PAGEFLAG(XPMWritetainted, xpm_writetainted, PF_HEAD) #else -PAGEFLAG_FALSE(XPMReadonly) -PAGEFLAG_FALSE(XPMWritetainted) +PAGEFLAG_FALSE(XPMReadonly, xpmreadonly) +PAGEFLAG_FALSE(XPMWritetainted, xpmwritetainted) #endif /* Xen */ @@ -641,7 +641,7 @@ PAGEFLAG_FALSE(VmemmapSelfHosted, vmemmap_self_hosted) #ifdef CONFIG_MEM_PURGEABLE PAGEFLAG(Purgeable, purgeable, PF_ANY) #else -PAGEFLAG_FALSE(Purgeable) +PAGEFLAG_FALSE(Purgeable, purgeable) #endif /* diff --git a/kernel/watchdog.c b/kernel/watchdog.c index c904872be06c..14a458b773a0 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -282,6 +282,7 @@ static DEFINE_PER_CPU(unsigned long, watchdog_touch_ts); static DEFINE_PER_CPU(unsigned long, watchdog_report_ts); static DEFINE_PER_CPU(struct hrtimer, watchdog_hrtimer); static DEFINE_PER_CPU(bool, softlockup_touch_sync); +static DEFINE_PER_CPU(unsigned int, watchdog_en); static unsigned long soft_lockup_nmi_warn; static int __init softlockup_panic_setup(char *str) diff --git a/mm/internal.h b/mm/internal.h index 4fe51c90a1e5..cc83953f8cf6 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -14,7 +14,9 @@ #include #include #include +#ifdef CONFIG_RECLAIM_ACCT #include +#endif struct folio_batch; diff --git a/mm/memcontrol.c b/mm/memcontrol.c index e73a0df666da..9aa9948f79d4 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -71,7 +71,9 @@ #include "swap.h" #include +#ifdef CONFIG_HYPERHOLD_ZSWAPD #include +#endif #include diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index ace4f004cdaa..5f7b409125fd 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -35,7 +35,9 @@ #include #include #include +#ifdef CONFIG_HYPERHOLD_ZSWAPD #include +#endif #include diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 58ae2fe44989..c4d3cf5572bf 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -51,7 +51,9 @@ #include #include #include +#ifdef CONFIG_HYPERHOLD_ZSWAPD #include +#endif #ifdef CONFIG_RECLAIM_ACCT #include #endif diff --git a/mm/rmap.c b/mm/rmap.c index d61242e91b12..37c15b83f79b 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -75,7 +75,9 @@ #include #include #include +#ifdef CONFIG_MEM_PURGEABLE #include +#endif #include diff --git a/mm/swapfile.c b/mm/swapfile.c index 4ca5ad21d335..0a577f85aea4 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -46,7 +46,9 @@ #include #include #include +#ifdef CONFIG_HYPERHOLD_ZSWAPD #include +#endif #include "internal.h" #include "swap.h" diff --git a/mm/zswapd.c b/mm/zswapd.c index d80a00d9f1fd..f44026692ef9 100644 --- a/mm/zswapd.c +++ b/mm/zswapd.c @@ -10,7 +10,9 @@ #include #include #include +#ifdef CONFIG_HYPERHOLD_ZSWAPD #include +#endif #ifdef CONFIG_RECLAIM_ACCT #include #endif diff --git a/mm/zswapd_control.c b/mm/zswapd_control.c index 340b6830619a..49a8dd44bf22 100644 --- a/mm/zswapd_control.c +++ b/mm/zswapd_control.c @@ -11,7 +11,9 @@ #include #include #include +#ifdef CONFIG_HYPERHOLD_ZSWAPD #include +#endif #include "zswapd_internal.h" diff --git a/security/Kconfig b/security/Kconfig index 89e5dbcb46e0..52c9af08ad35 100644 --- a/security/Kconfig +++ b/security/Kconfig @@ -193,9 +193,7 @@ source "security/loadpin/Kconfig" source "security/yama/Kconfig" source "security/safesetid/Kconfig" source "security/lockdown/Kconfig" -source "security/xpm/Kconfig" source "security/landlock/Kconfig" -source "security/container_escape_detection/Kconfig" source "security/integrity/Kconfig" diff --git a/security/Makefile b/security/Makefile index 1fbed3e27486..f533f0f7ec26 100644 --- a/security/Makefile +++ b/security/Makefile @@ -4,7 +4,9 @@ # obj-$(CONFIG_KEYS) += keys/ +ifdef CONFIG_SECURITY_CONTAINER_ESCAPE_DETECTION subdir-$(CONFIG_SECURITY_CONTAINER_ESCAPE_DETECTION) += container_escape_detection +endif # always enable default capabilities obj-y += commoncap.o @@ -24,9 +26,13 @@ obj-$(CONFIG_SECURITY_SAFESETID) += safesetid/ obj-$(CONFIG_SECURITY_LOCKDOWN_LSM) += lockdown/ obj-$(CONFIG_CGROUPS) += device_cgroup.o obj-$(CONFIG_BPF_LSM) += bpf/ +ifdef CONFIG_SECURITY_XPM obj-$(CONFIG_SECURITY_XPM) += xpm/ +endif obj-$(CONFIG_SECURITY_LANDLOCK) += landlock/ +ifdef CONFIG_SECURITY_CONTAINER_ESCAPE_DETECTION obj-$(CONFIG_SECURITY_CONTAINER_ESCAPE_DETECTION) += container_escape_detection/ +endif # Object integrity file lists obj-$(CONFIG_INTEGRITY) += integrity/ -- Gitee