1 // SPDX-License-Identifier: GPL-2.0-only
3 * AMD SVM-SEV command line parsing support
5 * Copyright (C) 2023 - 2024 Advanced Micro Devices, Inc.
7 * Author: Michael Roth <michael.roth@amd.com>
10 #include <linux/string.h>
11 #include <linux/printk.h>
12 #include <linux/cache.h>
13 #include <linux/cpufeature.h>
15 #include <asm/sev-common.h>
17 struct sev_config sev_cfg __read_mostly
;
19 static int __init
init_sev_config(char *str
)
23 while ((s
= strsep(&str
, ","))) {
24 if (!strcmp(s
, "debug")) {
29 if (!strcmp(s
, "nosnp")) {
30 if (!cpu_feature_enabled(X86_FEATURE_HYPERVISOR
)) {
31 setup_clear_cpu_cap(X86_FEATURE_SEV_SNP
);
32 cc_platform_clear(CC_ATTR_HOST_SEV_SNP
);
40 pr_info("SEV command-line option '%s' was not recognized\n", s
);
45 __setup("sev=", init_sev_config
);