From 1a7ff195d913437da6eff22817ca09acb612d0e8 Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Wed, 28 Jun 2023 09:35:28 +0200 Subject: [PATCH] pc_linux: enable EFI and EFI_STUB With these options enabled comparative testing between pc_linux drivers and bzImages becomes much easier on EFI-only machines. The impact on the actual Genode drivers is minimal. --- .../shadow/arch/x86/include/asm/page.h | 3 ++ repos/pc/src/lib/pc/lx_emul/common_dummies.c | 8 +++- repos/pc/src/lib/pc_wifi/dummies.c | 37 +++++++++++++++++++ repos/pc/src/lib/pc_wifi/generated_dummies.c | 26 +------------ repos/pc/src/pc_linux/target.inc | 16 ++++++-- 5 files changed, 59 insertions(+), 31 deletions(-) diff --git a/repos/dde_linux/src/include/lx_emul/shadow/arch/x86/include/asm/page.h b/repos/dde_linux/src/include/lx_emul/shadow/arch/x86/include/asm/page.h index 4b623f65d9..2e84355826 100644 --- a/repos/dde_linux/src/include/lx_emul/shadow/arch/x86/include/asm/page.h +++ b/repos/dde_linux/src/include/lx_emul/shadow/arch/x86/include/asm/page.h @@ -71,4 +71,7 @@ static inline struct page *virt_to_page(void const *v) { return lx_emul_virt_to_ #include #include +/* referenced in pgtable_64_types.h by VMALLOC_START */ +extern unsigned long vmalloc_base; + #endif /* __ASM_GENERIC_PAGE_H */ diff --git a/repos/pc/src/lib/pc/lx_emul/common_dummies.c b/repos/pc/src/lib/pc/lx_emul/common_dummies.c index f3c01076a4..ea7d2fda25 100644 --- a/repos/pc/src/lib/pc/lx_emul/common_dummies.c +++ b/repos/pc/src/lib/pc/lx_emul/common_dummies.c @@ -13,6 +13,10 @@ #include + +/* arch/x86/kernel/head64.c */ +unsigned long vmalloc_base; + #include char __start_rodata[] = {}; @@ -194,6 +198,8 @@ void register_irq_proc(unsigned int irq,struct irq_desc * desc) } +struct cdev; + int cdev_add(struct cdev * p,dev_t dev,unsigned count) { lx_emul_trace(__func__); @@ -392,5 +398,3 @@ DEFINE_PER_CPU(bool, hardirq_stack_inuse); DEFINE_PER_CPU_READ_MOSTLY(struct cpuinfo_x86, cpu_info); EXPORT_PER_CPU_SYMBOL(cpu_info); - - diff --git a/repos/pc/src/lib/pc_wifi/dummies.c b/repos/pc/src/lib/pc_wifi/dummies.c index e8710fc143..b77759e9fb 100644 --- a/repos/pc/src/lib/pc_wifi/dummies.c +++ b/repos/pc/src/lib/pc_wifi/dummies.c @@ -544,3 +544,40 @@ void __crypto_xor(u8 *dst, const u8 *src1, const u8 *src2, unsigned int len) while (len--) *dst++ = *src1++ ^ *src2++; } + + +#include <../drivers/net/wireless/intel/iwlwifi/iwl-trans.h> +#include <../drivers/net/wireless/intel/iwlwifi/fw/uefi.h> + +void *iwl_uefi_get_pnvm(struct iwl_trans *trans, size_t *len) +{ + lx_emul_trace(__func__); + return ERR_PTR(-EOPNOTSUPP); +} + + +void *iwl_uefi_get_reduced_power(struct iwl_trans *trans, size_t *len) +{ + lx_emul_trace(__func__); + return ERR_PTR(-EOPNOTSUPP); +} + + +void iwl_uefi_get_sgom_table(struct iwl_trans *trans, struct iwl_fw_runtime *fwrt) +{ + lx_emul_trace(__func__); +} + + +#include + +int get_option(char ** str,int * pint) +{ + lx_emul_trace_and_stop(__func__); +} + + +char * strreplace(char * s,char old,char new) +{ + lx_emul_trace_and_stop(__func__); +} diff --git a/repos/pc/src/lib/pc_wifi/generated_dummies.c b/repos/pc/src/lib/pc_wifi/generated_dummies.c index 940e997c2a..80bbf173f8 100644 --- a/repos/pc/src/lib/pc_wifi/generated_dummies.c +++ b/repos/pc/src/lib/pc_wifi/generated_dummies.c @@ -1,7 +1,7 @@ /* * \brief Dummy definitions of Linux Kernel functions * \author Automatically generated file - do no edit - * \date 2023-03-23 + * \date 2023-06-30 */ #include @@ -447,22 +447,6 @@ ssize_t generic_splice_sendpage(struct pipe_inode_info * pipe,struct file * out, } -#include - -int get_option(char ** str,int * pint) -{ - lx_emul_trace_and_stop(__func__); -} - - -#include - -char * get_options(const char * str,int nints,int * ints) -{ - lx_emul_trace_and_stop(__func__); -} - - #include int get_unused_fd_flags(unsigned flags) @@ -1091,14 +1075,6 @@ int string_escape_mem(const char * src,size_t isz,char * dst,size_t osz,unsigned } -#include - -char * strreplace(char * s,char old,char new) -{ - lx_emul_trace_and_stop(__func__); -} - - #include int suppress_printk; diff --git a/repos/pc/src/pc_linux/target.inc b/repos/pc/src/pc_linux/target.inc index 8c2a3e4a01..a222d41b48 100644 --- a/repos/pc/src/pc_linux/target.inc +++ b/repos/pc/src/pc_linux/target.inc @@ -23,6 +23,9 @@ LX_ENABLE += IOMMU_SUPPORT INTEL_IOMMU # ACPI support LX_ENABLE += ACPI +# EFI support +LX_ENABLE += EFI EFI_STUB + # general network and WLAN support LX_ENABLE += NET NETDEVICES PACKET LX_ENABLE += WLAN CFG80211 MAC80211 @@ -44,9 +47,10 @@ LX_ENABLE += ATH9K_DEBUGFS LX_ENABLE += E1000 E1000E PCNET32 LX_ENABLE += R8169 -# USB host-controller support +# USB host-controller support (keep USB_USBNET hook) +LX_ENABLE += USB_USBNET LX_ENABLE += USB_SUPPORT USB USB_ARCH_HAS_HCD USB_XHCI_HCD USB_EHCI_HCD USB_OHCI_HCD -LX_ENABLE += USB_PCI USB_UHCI_HCD USB_USBNET +LX_ENABLE += USB_PCI USB_UHCI_HCD # Intel framebuffer LX_ENABLE += DRM DRM_I915 @@ -59,10 +63,14 @@ LX_ENABLE += PROC_FS SYSFS # Options for testing pc_linux images # -# - EFI support for tests on EFI-only devices -#LX_ENABLE += EFI EFI_STUB # - network support for NFS root #LX_ENABLE += INET IP_PNP IP_PNP_DHCP NFS_FS FILE_LOCKING MULTIUSER ROOT_NFS +# - log all input events (requires "debug" on the kernel commandline) +#LX_ENABLE += INPUT_EVBUG +# - in-kernel symbolic backtraces with show_stack(NULL, NULL, KERN_DEFAULT) +#LX_ENABLE += KALLSYMS +# - provide console on screen +#LX_ENABLE += FRAMEBUFFER_CONSOLE # disable cpu frequency scaling LX_DISABLE += SCHED_MC CPU_FREQ