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]
Message-ID: <SA1PR21MB1335D07F52F526341E5709D5BF15A@SA1PR21MB1335.namprd21.prod.outlook.com>
Date:   Wed, 16 Aug 2023 21:32:36 +0000
From:   Dexuan Cui <decui@...rosoft.com>
To:     Tianyu Lan <ltykernel@...il.com>,
        KY Srinivasan <kys@...rosoft.com>,
        Haiyang Zhang <haiyangz@...rosoft.com>,
        "wei.liu@...nel.org" <wei.liu@...nel.org>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "bp@...en8.de" <bp@...en8.de>,
        "dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
        "x86@...nel.org" <x86@...nel.org>, "hpa@...or.com" <hpa@...or.com>,
        "daniel.lezcano@...aro.org" <daniel.lezcano@...aro.org>,
        "arnd@...db.de" <arnd@...db.de>,
        "Michael Kelley (LINUX)" <mikelley@...rosoft.com>
CC:     Tianyu Lan <Tianyu.Lan@...rosoft.com>,
        "linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
        "linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        vkuznets <vkuznets@...hat.com>
Subject: RE: [PATCH v6 5/8] x86/hyperv: Use vmmcall to implement Hyper-V
 hypercall in sev-snp enlightened guest

> From: Tianyu Lan <ltykernel@...il.com>
> Sent: Wednesday, August 16, 2023 8:59 AM
> [...]
> --- a/arch/x86/include/asm/mshyperv.h
> +++ b/arch/x86/include/asm/mshyperv.h
> @@ -59,16 +59,25 @@ static inline u64 hv_do_hypercall(u64 control, void
> *input, void *output)
>  	u64 hv_status;
> 
>  #ifdef CONFIG_X86_64
> -	if (!hv_hypercall_pg)
> -		return U64_MAX;
> +	if (hv_isolation_type_en_snp()) {

I got a build failure:

In file included from arch/x86/hyperv/hv_spinlock.c:15:
./arch/x86/include/asm/mshyperv.h: In function 'hv_do_hypercall':
./arch/x86/include/asm/mshyperv.h:69:6: error: implicit declaration of function 'hv_isolation_type_en_snp' [-Werror=implicit-function-declaration]
   69 |  if (hv_isolation_type_en_snp()) {
      |      ^~~~~~~~~~~~~~~~~~~~~~~~

In arch/x86/include/asm/mshyperv.h, we do have 
	extern bool hv_isolation_type_en_snp(void);
but it's defined at a late place. I think we need to move it to before 
hv_do_hypercall().

We also have 
	extern bool hv_isolation_type_en_snp(void);
in include/asm-generic/mshyperv.h, but that header file
is included at the end of arch/x86/include/asm/mshyperv.h.


> +		__asm__ __volatile__("mov %4, %%r8\n"
> +				     "vmmcall"
> +				     : "=a" (hv_status),
> ASM_CALL_CONSTRAINT,
> +				       "+c" (control), "+d" (input_address)
> +				     :  "r" (output_address)
> +				     : "cc", "memory", "r8", "r9", "r10", "r11");

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ