[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1801142132500.2371@nanos>
Date: Sun, 14 Jan 2018 21:32:57 +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>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.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>,
Andy Lutomirski <luto@...nel.org>,
Mohammed Gamal <mmorsy@...hat.com>,
Cathy Avery <cavery@...hat.com>,
Roman Kagan <rkagan@...tuozzo.com>,
linux-kernel@...r.kernel.org, devel@...uxdriverproject.org
Subject: Re: [PATCH v2 1/7] x86/hyper-v: check for required priviliges in
hyperv_init()
On Wed, 13 Dec 2017, Vitaly Kuznetsov wrote:
> In hyperv_init() we presume we always have access to VP index and hypercall
> MSRs while according to the specification we should check if we're allowed
> to access the corresponding MSRs before accessing them.
>
> Signed-off-by: Vitaly Kuznetsov <vkuznets@...hat.com>
Reviewed-by: Thomas Gleixner <tglx@...utronix.de>
> ---
> arch/x86/hyperv/hv_init.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
> index 189a398290db..21f9d53d9f00 100644
> --- a/arch/x86/hyperv/hv_init.c
> +++ b/arch/x86/hyperv/hv_init.c
> @@ -110,12 +110,19 @@ static int hv_cpu_init(unsigned int cpu)
> */
> void hyperv_init(void)
> {
> - u64 guest_id;
> + u64 guest_id, required_msrs;
> union hv_x64_msr_hypercall_contents hypercall_msr;
>
> if (x86_hyper_type != X86_HYPER_MS_HYPERV)
> return;
>
> + /* Absolutely required MSRs */
> + required_msrs = HV_X64_MSR_HYPERCALL_AVAILABLE |
> + HV_X64_MSR_VP_INDEX_AVAILABLE;
> +
> + if ((ms_hyperv.features & required_msrs) != required_msrs)
> + return;
> +
> /* Allocate percpu VP index */
> hv_vp_index = kmalloc_array(num_possible_cpus(), sizeof(*hv_vp_index),
> GFP_KERNEL);
> --
> 2.14.3
>
>
Powered by blists - more mailing lists