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:
 <SN6PR02MB41576BE5D8E86D8F3B75E11AD491A@SN6PR02MB4157.namprd02.prod.outlook.com>
Date: Wed, 14 May 2025 16:54:39 +0000
From: Michael Kelley <mhklinux@...look.com>
To: Tianyu Lan <ltykernel@...il.com>, "kys@...rosoft.com" <kys@...rosoft.com>,
	"haiyangz@...rosoft.com" <haiyangz@...rosoft.com>, "wei.liu@...nel.org"
	<wei.liu@...nel.org>, "decui@...rosoft.com" <decui@...rosoft.com>,
	"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>, "Neeraj.Upadhyay@....com"
	<Neeraj.Upadhyay@....com>, "yuehaibing@...wei.com" <yuehaibing@...wei.com>,
	"kvijayab@....com" <kvijayab@....com>, "jacob.jun.pan@...ux.intel.com"
	<jacob.jun.pan@...ux.intel.com>, "jpoimboe@...nel.org" <jpoimboe@...nel.org>,
	"tiala@...rosoft.com" <tiala@...rosoft.com>
CC: "linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [RFC PATCH 4/6] x86/Hyper-V: Allow Hyper-V to inject Hyper-V
 vectors

From: Tianyu Lan <ltykernel@...il.com> Sent: Tuesday, May 6, 2025 6:07 AM
> 

Update Subject prefix to "x86/hyperv".

> When Secure AVIC is enabled, call Secure AVIC
> function to allow Hyper-V to inject REENLIGHTENMENT,
> STIMER0 and CALLBACK vectors.
> 
> Signed-off-by: Tianyu Lan <tiala@...rosoft.com>
> ---
>  arch/x86/hyperv/hv_init.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
> index ddeb40930bc8..d75df5c3965d 100644
> --- a/arch/x86/hyperv/hv_init.c
> +++ b/arch/x86/hyperv/hv_init.c
> @@ -131,6 +131,18 @@ static int hv_cpu_init(unsigned int cpu)
>  		wrmsrl(HV_X64_MSR_VP_ASSIST_PAGE, msr.as_uint64);
>  	}
> 
> +	/* Allow Hyper-V vector to be injected from Hypervisor. */
> +	if (ms_hyperv.features & HV_ACCESS_REENLIGHTENMENT)
> +		x2apic_savic_update_vector(cpu,
> +					   HYPERV_REENLIGHTENMENT_VECTOR, true);

This will allow Hyper-V to submit the re-enlightenment interrupt on
any vCPU, even though the Linux guest has programmed the interrupt
to only arrive to a particular vCPU.  That selected vCPU is set up in
set_hv_tscchange_cb(), and maintained in clear_hv_tscchange_cb()
and in hv_cpu_die(). I'm not super familiar with the re-enlightenment
code, but I don't see a problem if Hyper-V sends the interrupt on an
unexpected vCPU.  So it's probably OK to enable this interrupt vector
on all vCPUs.

> +
> +	if (ms_hyperv.misc_features & HV_STIMER_DIRECT_MODE_AVAILABLE)
> +		x2apic_savic_update_vector(cpu,
> +					   HYPERV_STIMER0_VECTOR, true);
> +
> +	x2apic_savic_update_vector(cpu, HYPERVISOR_CALLBACK_VECTOR, true);

This is redundant with Patch 3 of your patch set. In Patch 3, vmbus_interrupt
is set to HYPERVISOR_CALLBACK_VECTOR.

> +
> +
>  	return hyperv_init_ghcb();
>  }
> 
> --
> 2.25.1
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ