Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1800001pxu; Tue, 24 Nov 2020 09:11:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJwxvme4d2/vWEWS4WcStHRdeNb8QYgNq8IVaJi9h3LLJbKwMPFWlTAirEc+HXfQpyp4q7om X-Received: by 2002:a17:906:82d9:: with SMTP id a25mr5127962ejy.101.1606237885550; Tue, 24 Nov 2020 09:11:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606237885; cv=none; d=google.com; s=arc-20160816; b=Fz2ORMTYwYHJ2nhQnqwKiciMC08ZoHUiZqLxIIJIsB2AKlrsBbVKNygaU1rrBNw1EJ APWUnaLLrcQYn1+8bP645vE48d5qcD2X48KmCMCxoA4zzbLTcoATmPb1AwKPUNsf8e/X 4GnqdBTKYLvr/4zfhoS1sG/k50aosMjhnJlQVjiBG1PIDk+9F85HmT03lHxgz28741hc 96Pg8Ul+1rtPIKkvnVRN38olEIqb/nXYi8XwRSjtmeL7FfU3zGoPWYOdwxTAG3wxu66E MxRgr0TnGtzI6nW1XD3UcF1/yvpfQrHOd9RFvNO5HA0iAme2DfCvlAXO2MN63m/cN5kA B55g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=DAKijZroIKQByX8CE0+1w/bE11gheXfs1vD8PWKgeTU=; b=C72kSU07TukD/VKlaekN3yTOalqNZzaw1QbUbo5e3qAfA29tjKGxZ8fWlHmYxWRT5N gcusoh4IZQOoz5uLSRaycU7nYE5bc2vE59/eJKcmrGnwoycR84ak4W9I0MeIbdSh4L5r T1J3N6ZG1Dx8gtpUZ3tf5srEP3byv/AAF5LpIrBQdTx0wPjqrJxJv6CImjs25QQBEFJd 2lgKjjaGYkX8ZKd97yJ24u0gvhOyohWexCeI3s3g+yVmReehgIzuOoC9DgkPJRAYv+98 CmDSl76XeSUX8/zGFyi5iZP9Iq04GQQ31phKr4+MwtgX2B/ysGavFd8k1nLZNNtbKZ72 RPuA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b18si8402263ejq.277.2020.11.24.09.11.00; Tue, 24 Nov 2020 09:11:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403780AbgKXRIF (ORCPT + 99 others); Tue, 24 Nov 2020 12:08:05 -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-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-kernel@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