From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04B58C433FF for ; Wed, 14 Aug 2019 13:26:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CC6C0206C1 for ; Wed, 14 Aug 2019 13:26:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727898AbfHNN0T (ORCPT ); Wed, 14 Aug 2019 09:26:19 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:36865 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727721AbfHNN0T (ORCPT ); Wed, 14 Aug 2019 09:26:19 -0400 Received: by mail-wm1-f67.google.com with SMTP id z23so4464888wmf.2 for ; Wed, 14 Aug 2019 06:26:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=xAZiPJjmd3PI+GZoBuvq/KNF0BWtwepJ9HhFWDTukEY=; b=GWtn0WdS6r2+eY+weE5gOw3x0Xo9jN91+bxk4qgjeDn4wh4tmKD1Qwh0703+Q47xj5 Q5yLvMABeirBxNIEafyS0Whne/qaOSJdEkwt/ck5Yb8DbJra1sD4u0UVLTfmxg+C0a6+ iDm0cm4l1AzPMgK8hPQVKAYIGebG7sEwEIdCW/Uk2rlifUcrTBmEpNqSs8mhyzClHAjM jnzaEUMmV6FQWnSeU+hyoH2e7duz3HhB2drsJcKfuADuky2l31/KWYXOKSZlBqje3EVm 0a4/49jp3FLMl2+QY30xpCiv0WUvp7O0DPURV/kyoeQLv7p26+fROKPBdSn70h8TcDZv SKUg== X-Gm-Message-State: APjAAAU0q75H7CFrViAr2fWrGzsM6Bcv1w5xBdhmX54gfBSGo3/Y8QG9 R9RoVCI2E2m+w6XPoT3iK8Opvg== X-Google-Smtp-Source: APXvYqw5R7ojamwpGp9GNDYM/3FlDkueNtnfQMNYbHyZwrsXb2PfA9JrdUUz9Jm+0mWhZEM/oEFv/w== X-Received: by 2002:a1c:3587:: with SMTP id c129mr8953730wma.90.1565789177208; Wed, 14 Aug 2019 06:26:17 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:2cae:66cd:dd43:92d9? ([2001:b07:6468:f312:2cae:66cd:dd43:92d9]) by smtp.gmail.com with ESMTPSA id z6sm25300600wre.76.2019.08.14.06.26.16 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 14 Aug 2019 06:26:16 -0700 (PDT) Subject: Re: [PATCH V2 1/3] x86/Hyper-V: Fix definition of struct hv_vp_assist_page To: lantianyu1986@gmail.com, rkrcmar@redhat.com, corbet@lwn.net, kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, sashal@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, x86@kernel.org, michael.h.kelley@microsoft.com Cc: Tianyu Lan , kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, vkuznets@redhat.com References: <20190814073447.96141-1-Tianyu.Lan@microsoft.com> <20190814073447.96141-2-Tianyu.Lan@microsoft.com> From: Paolo Bonzini Openpgp: preference=signencrypt Message-ID: Date: Wed, 14 Aug 2019 15:26:15 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190814073447.96141-2-Tianyu.Lan@microsoft.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-hyperv-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hyperv@vger.kernel.org On 14/08/19 09:34, lantianyu1986@gmail.com wrote: > From: Tianyu Lan > > The struct hv_vp_assist_page was defined incorrectly. > The "vtl_control" should be u64[3], "nested_enlightenments > _control" should be a u64 and there is 7 reserved bytes > following "enlighten_vmentry". This patch is to fix it. How did the assignment to vp_ap->current_nested_vmcs work then? Does the guest simply not care? Paolo > Signed-off-by: Tianyu Lan > -- > Change since v1: > Move definition of struct hv_nested_enlightenments_control > into this patch to fix offset issue. > --- > arch/x86/include/asm/hyperv-tlfs.h | 20 +++++++++++++++----- > 1 file changed, 15 insertions(+), 5 deletions(-) > > diff --git a/arch/x86/include/asm/hyperv-tlfs.h b/arch/x86/include/asm/hyperv-tlfs.h > index af78cd72b8f3..cf0b2a04271d 100644 > --- a/arch/x86/include/asm/hyperv-tlfs.h > +++ b/arch/x86/include/asm/hyperv-tlfs.h > @@ -514,14 +514,24 @@ struct hv_timer_message_payload { > __u64 delivery_time; /* When the message was delivered */ > } __packed; > > +struct hv_nested_enlightenments_control { > + struct { > + __u32 directhypercall:1; > + __u32 reserved:31; > + } features; > + struct { > + __u32 reserved; > + } hypercallControls; > +} __packed; > + > /* Define virtual processor assist page structure. */ > struct hv_vp_assist_page { > __u32 apic_assist; > - __u32 reserved; > - __u64 vtl_control[2]; > - __u64 nested_enlightenments_control[2]; > - __u32 enlighten_vmentry; > - __u32 padding; > + __u32 reserved1; > + __u64 vtl_control[3]; > + struct hv_nested_enlightenments_control nested_control; > + __u8 enlighten_vmentry; > + __u8 reserved2[7]; > __u64 current_nested_vmcs; > } __packed; > >