Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp358314pxb; Wed, 3 Feb 2021 07:13:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJxBcza3+JajPNfiAubMlM6wNdXedlx7JbsjlnbDH6akYZq2XuuVpnJGz8BHiduTlOYxafzj X-Received: by 2002:a7b:c853:: with SMTP id c19mr3288602wml.118.1612365225804; Wed, 03 Feb 2021 07:13:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612365225; cv=none; d=google.com; s=arc-20160816; b=zCgqU0S1NG3CFLG5pUvt26v09djEoJGgdL7JDR5cWSUC0VlufwBro0PGAGkh6J7Oz4 +95ZbBUnrVql0s3cx2tXKeUHGMZP6oC1ugMuLFkR0eZafrFmRbgqaGZhp6sIUPo0L+PF L7soB8caWc855g1vm9Ov9h9w2WCd5T2FIIRAD/82nb9QdatizQzF/1XKi/FzzhhNAOY/ kHaKLP42FQA/p3nAt5QQUufJUZ3yA/MlxjEsDA8q0h+3HhJ3R6w2NoewECsny5TR0zOG lpAHX1OVGJmniotkGy4SqDJoRsZlPGPzHZovSWJ0d84VfeSjjiQgMJLNX5RkNveQFp7d scLg== 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=PZiSx8DcXexhF7XidCd/ZpJVY2ebrAncvKdkNoX1KpQ=; b=PEDoUAAlgmq6PRxWYTOUCsot5Qp2T+d/tQcc7sg3AmCPFY97tf1I71DBWx4ISiHqYo Q2lEPPcuN3H+33bjHtNGFvaKbo33Jy8tbNNCdDSa2gqMqu5pcXATh6PVqTz84AfhpE+w phsc422y9V8crdNmCUOp1WuLtTHuOEyoFrqDKmm7GkxLa5EnmC58Ksl7K4biuuVirkYa DtwOG70W8ixZysLLNO+xgJFE448HGqddkS1aQ/3XY7a+Ofac30rG6/RPcC+UsJbVkTTi yIa3DX8yIVjiV640xULqC8A95qXL5Q8+4nvvFQ4398cyDR6JqgAXZ+3nkcLmzVg03gGD f8bQ== 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 g1si1535560ejc.697.2021.02.03.07.13.12; Wed, 03 Feb 2021 07:13:45 -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 S234048AbhBCPLZ (ORCPT + 99 others); Wed, 3 Feb 2021 10:11:25 -0500 Received: from mail-wr1-f43.google.com ([209.85.221.43]:33795 "EHLO mail-wr1-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233992AbhBCPFg (ORCPT ); Wed, 3 Feb 2021 10:05:36 -0500 Received: by mail-wr1-f43.google.com with SMTP id g10so24730190wrx.1; Wed, 03 Feb 2021 07:05:18 -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=PZiSx8DcXexhF7XidCd/ZpJVY2ebrAncvKdkNoX1KpQ=; b=oi7yoNJNvOjtUtgTDe4RlMEXrD6UWks+L1/BTZG9RTiyooJrhusKgrHBLshd28Y9eU PaanmxuuCaBJClVhOxlEo79QudTN7x1txupdlh273yeeGW79N0BRANZntwuECqPsbaB5 Vdcn0y7D3SU6YPzsw9pW0IJEZ41OxNhbqpFKYr6mXVB5+Yr/qAFKeqeWbRoIrogWFWcj tIL7QYQIu+ax3DHhQmPktcwGUg/PxBMAblEnauiDfKeEqcPcsu9gb3lbxDHU0Ho0q/g6 cvOQGm3kQ6ujW2mSIR5ilJMY/UxT49+giJXJpNk7X4SJ4P/7kcOdJHIdQEKCdo8vUpuV UWog== X-Gm-Message-State: AOAM530EqHMzBBq/TWYnNcBDyjMiiWy1aJzHRiksVIMXVGerARe8V4sT 6DIaRYF5sveCieKWWUtcDggtBEojKho= X-Received: by 2002:a5d:4d8d:: with SMTP id b13mr3867418wru.178.1612364690949; Wed, 03 Feb 2021 07:04:50 -0800 (PST) Received: from liuwe-devbox-debian-v2.j3c5onc20sse1dnehy4noqpfcg.zx.internal.cloudapp.net ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id r17sm4051704wro.46.2021.02.03.07.04.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 07:04:50 -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 , pasha.tatashin@soleen.com, 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 v6 11/16] asm-generic/hyperv: update hv_msi_entry Date: Wed, 3 Feb 2021 15:04:30 +0000 Message-Id: <20210203150435.27941-12-wei.liu@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210203150435.27941-1-wei.liu@kernel.org> References: <20210203150435.27941-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 Reviewed-by: Michael Kelley --- 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 69de4e3d89d3..4669f9a4e1f1 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