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: <87cymk2rrj.ffs@tglx>
Date: Wed, 07 Aug 2024 18:59:28 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Yunhong Jiang <yunhong.jiang@...ux.intel.com>, mingo@...hat.com,
 bp@...en8.de, dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com,
 robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org,
 kys@...rosoft.com, haiyangz@...rosoft.com, wei.liu@...nel.org,
 decui@...rosoft.com, rafael@...nel.org, lenb@...nel.org,
 kirill.shutemov@...ux.intel.com
Cc: linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
 linux-hyperv@...r.kernel.org, linux-acpi@...r.kernel.org,
 yunhong.jiang@...ux.intel.com
Subject: Re: [PATCH 5/7] x86/hyperv: Mark ACPI wakeup mailbox page as private

On Tue, Aug 06 2024 at 15:12, Yunhong Jiang wrote:
> The ACPI wakeup mailbox is accessed by the OS and the firmware, both are
> in the guest's context, instead of the hypervisor/VMM context. Mark the
> address private explicitly.

This lacks information why the realmode area must be reserved and
initialized, which is what the change is doing implicitely.

> Signed-off-by: Yunhong Jiang <yunhong.jiang@...ux.intel.com>
>  
> +/*
> + * The ACPI wakeup mailbox are accessed by the OS and the BIOS, both are in the
> + * guest's context, instead of the hypervisor/VMM context.
> + */
> +static bool hv_is_private_mmio_tdx(u64 addr)
> +{
> +	if (wakeup_mailbox_addr && (addr >= wakeup_mailbox_addr &&
> +	    addr < (wakeup_mailbox_addr + PAGE_SIZE)))
> +		return true;
> +	return false;
> +}

static inline bool within_page(u64 addr, u64 start)
{
	return addr >= start && addr < (start + PAGE_SIZE);
}

static bool hv_is_private_mmio_tdx(u64 addr)
{
        return wakeup_mailbox_addr && within_page(addr, wakeup_mailbox_addr)
}

Hmm?

> +
>  void __init hv_vtl_init_platform(void)
>  {
>  	pr_info("Linux runs in Hyper-V Virtual Trust Level\n");
>  
> -	x86_platform.realmode_reserve = x86_init_noop;
> -	x86_platform.realmode_init = x86_init_noop;
> +	if (wakeup_mailbox_addr) {

Wants a comment vs. realmode here.

> +		x86_platform.hyper.is_private_mmio = hv_is_private_mmio_tdx;
> +	} else {
> +		x86_platform.realmode_reserve = x86_init_noop;
> +		x86_platform.realmode_init = x86_init_noop;
> +	}
>  	x86_init.irqs.pre_vector_init = x86_init_noop;
>  	x86_init.timers.timer_init = x86_init_noop;

Thanks,

        tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ