ANDROID: KVM: arm64: mount procfs for pKVM module loading

modprobe needs /proc/cmdline to pass module arguments to the module
loader. Sadly, so early in the boot, nothing mounts that FS.

Bug: 301483379
Change-Id: Iaab3000e3b7f908fc81f7f36adf2f73c7d3129a4
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
This commit is contained in:
Vincent Donnefort
2023-11-06 14:03:24 +00:00
parent be8f9c8bf9
commit 17d202d85b

View File

@@ -14,6 +14,7 @@
#include <linux/of_fdt.h>
#include <linux/of_reserved_mem.h>
#include <linux/sort.h>
#include <linux/stat.h>
#include <asm/kvm_hyp.h>
#include <asm/kvm_mmu.h>
@@ -21,6 +22,9 @@
#include <asm/kvm_pkvm_module.h>
#include <asm/setup.h>
#include <uapi/linux/mount.h>
#include <linux/init_syscalls.h>
#include "hyp_constants.h"
DEFINE_STATIC_KEY_FALSE(kvm_protected_mode_initialized);
@@ -682,7 +686,11 @@ int __init pkvm_load_early_modules(void)
{
char *token, *buf = early_pkvm_modules;
char *module_path = CONFIG_PKVM_MODULE_PATH;
int err;
int err = init_mount("proc", "/proc", "proc",
MS_SILENT | MS_NOEXEC | MS_NOSUID, NULL);
if (err)
return err;
while (true) {
token = strsep(&buf, ",");