lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 29 Jan 2024 18:58:06 +0100
From: Borislav Petkov <bp@...en8.de>
To: Michael Roth <michael.roth@....com>
Cc: x86@...nel.org, kvm@...r.kernel.org, linux-coco@...ts.linux.dev,
	linux-mm@...ck.org, linux-crypto@...r.kernel.org,
	linux-kernel@...r.kernel.org, tglx@...utronix.de, mingo@...hat.com,
	jroedel@...e.de, thomas.lendacky@....com, hpa@...or.com,
	ardb@...nel.org, pbonzini@...hat.com, seanjc@...gle.com,
	vkuznets@...hat.com, jmattson@...gle.com, luto@...nel.org,
	dave.hansen@...ux.intel.com, slp@...hat.com, pgonda@...gle.com,
	peterz@...radead.org, srinivas.pandruvada@...ux.intel.com,
	rientjes@...gle.com, tobin@....com, vbabka@...e.cz,
	kirill@...temov.name, ak@...ux.intel.com, tony.luck@...el.com,
	sathyanarayanan.kuppuswamy@...ux.intel.com, alpergun@...gle.com,
	jarkko@...nel.org, ashish.kalra@....com, nikunj.dadhania@....com,
	pankaj.gupta@....com, liam.merwick@...cle.com,
	Brijesh Singh <brijesh.singh@....com>,
	Jarkko Sakkinen <jarkko@...fian.com>
Subject: Re: [PATCH v2 13/25] crypto: ccp: Add support to initialize the
 AMD-SP for SEV-SNP

On Thu, Jan 25, 2024 at 10:11:13PM -0600, Michael Roth wrote:
> diff --git a/include/linux/psp-sev.h b/include/linux/psp-sev.h
> index 006e4cdbeb78..8128de17f0f4 100644
> --- a/include/linux/psp-sev.h
> +++ b/include/linux/psp-sev.h
> @@ -790,10 +790,23 @@ struct sev_data_snp_shutdown_ex {
>  
>  #ifdef CONFIG_CRYPTO_DEV_SP_PSP
>  
> +/**
> + * struct sev_platform_init_args
> + *
> + * @error: SEV firmware error code
> + * @probe: True if this is being called as part of CCP module probe, which
> + *  will defer SEV_INIT/SEV_INIT_EX firmware initialization until needed
> + *  unless psp_init_on_probe module param is set
> + */
> +struct sev_platform_init_args {
> +	int error;
> +	bool probe;
> +};

This struct definition cannot be under the ifdef, otherwise:

arch/x86/kvm/svm/sev.c: In function ‘sev_guest_init’:
arch/x86/kvm/svm/sev.c:267:33: error: passing argument 1 of ‘sev_platform_init’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  267 |         ret = sev_platform_init(&init_args);
      |                                 ^~~~~~~~~~
      |                                 |
      |                                 struct sev_platform_init_args *
In file included from arch/x86/kvm/svm/sev.c:16:
/include/linux/psp-sev.h:952:42: note: expected ‘int *’ but argument is of type ‘struct sev_platform_init_args *’
  952 | static inline int sev_platform_init(int *error) { return -ENODEV; }
      |                                     ~~~~~^~~~~
cc1: all warnings being treated as errors

---

on a 32-bit allmodconfig.

Build fix:

---

diff --git a/include/linux/psp-sev.h b/include/linux/psp-sev.h
index beba10d6b39c..d0e184db9d37 100644
--- a/include/linux/psp-sev.h
+++ b/include/linux/psp-sev.h
@@ -797,8 +797,6 @@ struct sev_data_snp_commit {
 	u32 len;
 } __packed;
 
-#ifdef CONFIG_CRYPTO_DEV_SP_PSP
-
 /**
  * struct sev_platform_init_args
  *
@@ -812,6 +810,8 @@ struct sev_platform_init_args {
 	bool probe;
 };
 
+#ifdef CONFIG_CRYPTO_DEV_SP_PSP
+
 /**
  * sev_platform_init - perform SEV INIT command
  *
@@ -949,7 +949,7 @@ void snp_free_firmware_page(void *addr);
 static inline int
 sev_platform_status(struct sev_user_data_status *status, int *error) { return -ENODEV; }
 
-static inline int sev_platform_init(int *error) { return -ENODEV; }
+static inline int sev_platform_init(struct sev_platform_init_args *args) { return -ENODEV; }
 
 static inline int
 sev_guest_deactivate(struct sev_data_deactivate *data, int *error) { return -ENODEV; }

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ