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=-17.0 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 40B43C2D0E4 for ; Tue, 24 Nov 2020 17:08:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EB5D320897 for ; Tue, 24 Nov 2020 17:08:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390732AbgKXRIE (ORCPT ); Tue, 24 Nov 2020 12:08:04 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:53600 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390674AbgKXRID (ORCPT ); Tue, 24 Nov 2020 12:08:03 -0500 Received: by mail-wm1-f68.google.com with SMTP id p22so3046858wmg.3; Tue, 24 Nov 2020 09:08:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DAKijZroIKQByX8CE0+1w/bE11gheXfs1vD8PWKgeTU=; b=RK2G1CpGGNya9WcKCxGm4lqqnwHChLZ9M0NBrvPzZe40gXC6CPTe5+WQms3dPjxI1E 7VjBQhF0lEkqaoTC4pfpUHXYuv72mXbzYNgY7K1gDdxew5aJbQnHbsI6a9857TzW7YS2 xlQWVnmAibXNNMxm6R7G9SElin3NG51R+hNZv6OUy4wtWABGR/FuJWFkkTpFiH24Uasb 6Ob8dofxqp0JGbsAB8NEzPek+JtGA/X1+LUExBx4M+LuqBCNQjYglPdnukUUDhNIyU96 utOdq1PH7kcFvOmrdhvVeaOOmb9W5aZreAoCxo1sgs+BSBi27/262G6iQeSxb3tkoCqh 49Dg== X-Gm-Message-State: AOAM5312YBAtFtd5BIdORlVuWhLAJfaYNqDuYPEdIcOkMP2KB3gzfQ7R W3yRzP93zbU9afSxml1fu2OuG4XRrbg= X-Google-Smtp-Source: ABdhPJzuspN0QqJbsAekcMvy+bG487Tf/0vZ2st7hEJvszJ7Z3duEaK/KQiValK1UVYZhxQdfCTvUQ== X-Received: by 2002:a1c:660b:: with SMTP id a11mr5470751wmc.159.1606237681096; Tue, 24 Nov 2020 09:08:01 -0800 (PST) Received: from liuwe-devbox-debian-v2.j3c5onc20sse1dnehy4noqpfcg.zx.internal.cloudapp.net ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id v20sm6419874wmh.44.2020.11.24.09.08.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 09:08:00 -0800 (PST) From: Wei Liu To: Linux on Hyper-V List Cc: virtualization@lists.linux-foundation.org, Linux Kernel List , Michael Kelley , Vineeth Pillai , Sunil Muthuswamy , Nuno Das Neves , Wei Liu , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)), "H. Peter Anvin" , Arnd Bergmann , linux-arch@vger.kernel.org (open list:GENERIC INCLUDE/ASM HEADER FILES) Subject: [PATCH v3 11/17] asm-generic/hyperv: update hv_msi_entry Date: Tue, 24 Nov 2020 17:07:38 +0000 Message-Id: <20201124170744.112180-12-wei.liu@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201124170744.112180-1-wei.liu@kernel.org> References: <20201124170744.112180-1-wei.liu@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-hyperv@vger.kernel.org We will soon need to access fields inside the MSI address and MSI data fields. Introduce hv_msi_address_register and hv_msi_data_register. Fix up one user of hv_msi_entry in mshyperv.h. No functional change expected. Signed-off-by: Wei Liu --- arch/x86/include/asm/mshyperv.h | 4 ++-- include/asm-generic/hyperv-tlfs.h | 28 ++++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h index 4e590a167160..cbee72550a12 100644 --- a/arch/x86/include/asm/mshyperv.h +++ b/arch/x86/include/asm/mshyperv.h @@ -257,8 +257,8 @@ static inline void hv_apic_init(void) {} static inline void hv_set_msi_entry_from_desc(union hv_msi_entry *msi_entry, struct msi_desc *msi_desc) { - msi_entry->address = msi_desc->msg.address_lo; - msi_entry->data = msi_desc->msg.data; + msi_entry->address.as_uint32 = msi_desc->msg.address_lo; + msi_entry->data.as_uint32 = msi_desc->msg.data; } #else /* CONFIG_HYPERV */ diff --git a/include/asm-generic/hyperv-tlfs.h b/include/asm-generic/hyperv-tlfs.h index ec53570102f0..7e103be42799 100644 --- a/include/asm-generic/hyperv-tlfs.h +++ b/include/asm-generic/hyperv-tlfs.h @@ -480,12 +480,36 @@ struct hv_create_vp { u64 flags; } __packed; +union hv_msi_address_register { + u32 as_uint32; + struct { + u32 reserved1:2; + u32 destination_mode:1; + u32 redirection_hint:1; + u32 reserved2:8; + u32 destination_id:8; + u32 msi_base:12; + }; +} __packed; + +union hv_msi_data_register { + u32 as_uint32; + struct { + u32 vector:8; + u32 delivery_mode:3; + u32 reserved1:3; + u32 level_assert:1; + u32 trigger_mode:1; + u32 reserved2:16; + }; +} __packed; + /* HvRetargetDeviceInterrupt hypercall */ union hv_msi_entry { u64 as_uint64; struct { - u32 address; - u32 data; + union hv_msi_address_register address; + union hv_msi_data_register data; } __packed; }; -- 2.20.1