printf: Remove unused 'bprintf'
[drm/drm-misc.git] / arch / x86 / virt / svm / cmdline.c
blobaffa2759fa20ae743796c246ab585bc9fff5e44e
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
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>
8 */
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)
21 char *s;
23 while ((s = strsep(&str, ","))) {
24 if (!strcmp(s, "debug")) {
25 sev_cfg.debug = true;
26 continue;
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);
33 continue;
34 } else {
35 goto warn;
39 warn:
40 pr_info("SEV command-line option '%s' was not recognized\n", s);
43 return 1;
45 __setup("sev=", init_sev_config);