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:   Sun, 18 Mar 2018 16:42:34 +0100 (CET)
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Vitaly Kuznetsov <vkuznets@...hat.com>
cc:     kvm@...r.kernel.org, x86@...nel.org,
        Paolo Bonzini <pbonzini@...hat.com>,
        Radim Krčmář <rkrcmar@...hat.com>,
        "K. Y. Srinivasan" <kys@...rosoft.com>,
        Haiyang Zhang <haiyangz@...rosoft.com>,
        Stephen Hemminger <sthemmin@...rosoft.com>,
        "Michael Kelley (EOSG)" <Michael.H.Kelley@...rosoft.com>,
        Mohammed Gamal <mmorsy@...hat.com>,
        Cathy Avery <cavery@...hat.com>, Bandan Das <bsd@...hat.com>,
        Christoph Hellwig <hch@...radead.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 4/7] x86/hyper-v: allocate and use Virtual Processor
 Assist Pages

On Fri, 16 Mar 2018, Vitaly Kuznetsov wrote:
>  static int hv_cpu_init(unsigned int cpu)
> @@ -101,6 +104,23 @@ static int hv_cpu_init(unsigned int cpu)
>  	if (msr_vp_index > hv_max_vp_index)
>  		hv_max_vp_index = msr_vp_index;
>  
> +	if (!hv_vp_assist_page)
> +		return 0;
> +
> +	if (!hv_vp_assist_page[smp_processor_id()])
> +		hv_vp_assist_page[smp_processor_id()] =
> +			__vmalloc(PAGE_SIZE, GFP_KERNEL, PAGE_KERNEL);

Please avoid the ugly line break which makes the statement appear as
multiline - which would require curly braces for readability - and simply
have a local variable

	struct hv_vp_assist_page **hvp = hv_vp_assist_page[smp_processor_id()];

and use that throughout the function.
     
> +	if (hv_vp_assist_page[smp_processor_id()]) {
> +		u64 val;
> +
> +		val = vmalloc_to_pfn(hv_vp_assist_page[smp_processor_id()]);
> +		val = (val << HV_X64_MSR_VP_ASSIST_PAGE_ADDRESS_SHIFT) |
> +			HV_X64_MSR_VP_ASSIST_PAGE_ENABLE;
> +
> +		wrmsrl(HV_X64_MSR_VP_ASSIST_PAGE, val);
> +	}
> +
>  	return 0;

Other than that:

Reviewed-by: Thomas Gleixner <tglx@...utronix.de>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ