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: <20230516102305.GF2587705@hirez.programming.kicks-ass.net>
Date:   Tue, 16 May 2023 12:23:05 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Tianyu Lan <ltykernel@...il.com>
Cc:     luto@...nel.org, tglx@...utronix.de, mingo@...hat.com,
        bp@...en8.de, dave.hansen@...ux.intel.com, x86@...nel.org,
        hpa@...or.com, seanjc@...gle.com, pbonzini@...hat.com,
        jgross@...e.com, tiala@...rosoft.com, kirill@...temov.name,
        jiangshan.ljs@...group.com, ashish.kalra@....com,
        srutherford@...gle.com, akpm@...ux-foundation.org,
        anshuman.khandual@....com, pawan.kumar.gupta@...ux.intel.com,
        adrian.hunter@...el.com, daniel.sneddon@...ux.intel.com,
        alexander.shishkin@...ux.intel.com, sandipan.das@....com,
        ray.huang@....com, brijesh.singh@....com, michael.roth@....com,
        thomas.lendacky@....com, venu.busireddy@...cle.com,
        sterritt@...gle.com, tony.luck@...el.com, samitolvanen@...gle.com,
        fenghua.yu@...el.com, pangupta@....com,
        linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
        linux-hyperv@...r.kernel.org, linux-arch@...r.kernel.org
Subject: Re: [RFC PATCH V6 04/14] x86/sev: optimize system vector processing
 invoked from #HV exception

On Mon, May 15, 2023 at 12:59:06PM -0400, Tianyu Lan wrote:

So your subject states:

> Subject: [RFC PATCH V6 04/14] x86/sev: optimize system vector processing invoked from #HV exception
                                         ^^^^^^^^

> @@ -228,51 +238,11 @@ static void do_exc_hv(struct pt_regs *regs)
>  		} else if (pending_events.vector == IA32_SYSCALL_VECTOR) {
>  			WARN(1, "syscall shouldn't happen\n");
>  		} else if (pending_events.vector >= FIRST_SYSTEM_VECTOR) {
> -			switch (pending_events.vector) {
> -#if IS_ENABLED(CONFIG_HYPERV)
> -			case HYPERV_STIMER0_VECTOR:
> -				sysvec_hyperv_stimer0(regs);
> -				break;
> -			case HYPERVISOR_CALLBACK_VECTOR:
> -				sysvec_hyperv_callback(regs);
> -				break;
> -#endif
> -#ifdef CONFIG_SMP
> -			case RESCHEDULE_VECTOR:
> -				sysvec_reschedule_ipi(regs);
> -				break;
> -			case IRQ_MOVE_CLEANUP_VECTOR:
> -				sysvec_irq_move_cleanup(regs);
> -				break;
> -			case REBOOT_VECTOR:
> -				sysvec_reboot(regs);
> -				break;
> -			case CALL_FUNCTION_SINGLE_VECTOR:
> -				sysvec_call_function_single(regs);
> -				break;
> -			case CALL_FUNCTION_VECTOR:
> -				sysvec_call_function(regs);
> -				break;
> -#endif
> -#ifdef CONFIG_X86_LOCAL_APIC
> -			case ERROR_APIC_VECTOR:
> -				sysvec_error_interrupt(regs);
> -				break;
> -			case SPURIOUS_APIC_VECTOR:
> -				sysvec_spurious_apic_interrupt(regs);
> -				break;
> -			case LOCAL_TIMER_VECTOR:
> -				sysvec_apic_timer_interrupt(regs);
> -				break;
> -			case X86_PLATFORM_IPI_VECTOR:
> -				sysvec_x86_platform_ipi(regs);
> -				break;
> -#endif
> -			case 0x0:
> -				break;
> -			default:
> -				panic("Unexpected vector %d\n", vector);
> -				unreachable();
> +			if (!(sysvec_table[pending_events.vector - FIRST_SYSTEM_VECTOR])) {
> +				WARN(1, "system vector entry 0x%x is NULL\n",
> +				     pending_events.vector);
> +			} else {
> +				(*sysvec_table[pending_events.vector - FIRST_SYSTEM_VECTOR])(regs);
>  			}
>  		} else {
>  			common_interrupt(regs, pending_events.vector);

But your code replace direct calls with an indirect call. Now AFAIK,
this SNP shit came with Zen3, and Zen3 still uses retpolines for
indirect calls.

Can you connect the dots?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ