From nobody Wed Feb 01 16:38:11 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P6SK16CZPz3cflS for ; Wed, 1 Feb 2023 16:38:13 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P6SK14Jyyz3HJZ for ; Wed, 1 Feb 2023 16:38:13 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wr1-f52.google.com with SMTP id t7so9525886wrp.5 for ; Wed, 01 Feb 2023 08:38:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+B0bEiMBX/tOySysOiWbG7Q3J19t6PZyhYWVbxTYV1I=; b=iLz3hDSEvBOl31mJzr0DR2IXM1NKCVG4LC60bhxitzkSf1ZEo17hN6kq/cRbRHHsqr gcMrDIp/zPx/IZz2fwmLs1BIMV26IzAOUtPAMfcuzchisyjTwgu4fJSUW4NZbRTB/3aM 56wvdJOh2Zj0BPoxtMI28tHKyXBTQ4u86nvxg30WVpxEXOYy3doGBGFXnlDW1A3AxoaM JVaFzNgUjKpnWv31xiRBGPf8fx4lUWTwnR4eiA+s7oapvdQZsvYm6FAPv5OKC8FBMjPg 6WhSH/rD3iq5aOdOqQnlYwAUTm/RIc3aH7iTjVG/Ngg3OvZhmJmlpl72rKQP39zPk59f Hkvg== X-Gm-Message-State: AO0yUKULllZdJCpw7qQe5cqy5XKLlfwwKT9M6RaQWdgr67XLGiEYQGvi 8clfEeFsfE/7LS1pQdbCR08ZrUiSBIwe/vEsXVY= X-Google-Smtp-Source: AK7set+g5zU8eOs0APyEB+uK6F7kLvWLfRMnaEA0ag35J0N6N4OXulcsA7CJyUPECjWmvgG1e2J1Fg== X-Received: by 2002:a5d:4651:0:b0:2bf:d333:219d with SMTP id j17-20020a5d4651000000b002bfd333219dmr2681608wrs.17.1675269492134; Wed, 01 Feb 2023 08:38:12 -0800 (PST) Received: from smtpclient.apple (global-5-143.n-2.net.cam.ac.uk. [131.111.5.143]) by smtp.gmail.com with ESMTPSA id t8-20020a5d6908000000b002bc7e5a1171sm18013406wru.116.2023.02.01.08.38.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Feb 2023 08:38:11 -0800 (PST) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: 6e5b082cab8d - main - arm64: Hyper-V: vPCI: Adding Hyper-V PCI protocol 1.4 From: Jessica Clarke In-Reply-To: <202302011601.311G1tQY026686@gitrepo.freebsd.org> Date: Wed, 1 Feb 2023 16:38:11 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <928C844E-EBB1-4AFF-968C-46D387E954BA@freebsd.org> References: <202302011601.311G1tQY026686@gitrepo.freebsd.org> To: Wei Hu X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4P6SK14Jyyz3HJZ X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 1 Feb 2023, at 16:01, Wei Hu wrote: >=20 > The branch main has been updated by whu: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D6e5b082cab8d9dd0eb0bce65cf8cf268= f11c7a25 >=20 > commit 6e5b082cab8d9dd0eb0bce65cf8cf268f11c7a25 > Author: Wei Hu > AuthorDate: 2023-02-01 15:55:03 +0000 > Commit: Wei Hu > CommitDate: 2023-02-01 16:00:10 +0000 >=20 > arm64: Hyper-V: vPCI: Adding Hyper-V PCI protocol 1.4 >=20 > This is enabling the PCI protocol 1.4 and corresponding structures > in order to support arm64 Hyper-V. >=20 > This is the 2nd of the three patches to enable Hyper-V vPCI support > in arm64. >=20 > Reviewed by: whu > Tested by: Souradeep Chakrabarti > Obtained from: Souradeep Chakrabarti > Sponsored by: Microsoft > Differential Revision: https://reviews.freebsd.org/D37780 > --- > sys/dev/hyperv/pcib/vmbus_pcib.c | 83 = ++++++++++++++++++++++++++++++++++++++-- > 1 file changed, 80 insertions(+), 3 deletions(-) >=20 > diff --git a/sys/dev/hyperv/pcib/vmbus_pcib.c = b/sys/dev/hyperv/pcib/vmbus_pcib.c > index 98e1320e4379..ca495dab9516 100644 > --- a/sys/dev/hyperv/pcib/vmbus_pcib.c > +++ b/sys/dev/hyperv/pcib/vmbus_pcib.c > @@ -28,6 +28,7 @@ > __FBSDID("$FreeBSD$"); >=20 > #ifdef NEW_PCIB > +#include "opt_acpi.h" >=20 > #include > #include > @@ -50,6 +51,9 @@ __FBSDID("$FreeBSD$"); > #include > #include >=20 > +#if defined(__aarch64__) > +#include > +#endif > #include > #include > #include > @@ -62,10 +66,16 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include "pcib_if.h" > - > +#if defined(__i386__) || defined(__amd64__) > #include > #include > - > +#endif > +#if defined(__aarch64__) > +#include > +#include > +#include > +#include > +#endif > #include > #include > #include > @@ -142,7 +152,7 @@ wait_for_completion_timeout(struct completion *c, = int timeout) > return (ret); > } >=20 > -#define PCI_MAKE_VERSION(major, minor) ((uint32_t)(((major) << 16) | = (major))) > +#define PCI_MAKE_VERSION(major, minor) ((uint32_t)(((major) << 16) | = (minor))) >=20 > enum { > PCI_PROTOCOL_VERSION_1_1 =3D PCI_MAKE_VERSION(1, 1), > @@ -182,6 +192,12 @@ enum pci_message_type { > PCI_QUERY_PROTOCOL_VERSION =3D PCI_MESSAGE_BASE + 0x13, > PCI_CREATE_INTERRUPT_MESSAGE =3D PCI_MESSAGE_BASE + 0x14, > PCI_DELETE_INTERRUPT_MESSAGE =3D PCI_MESSAGE_BASE + 0x15, > + PCI_RESOURCES_ASSIGNED2 =3D PCI_MESSAGE_BASE + 0x16, > + PCI_CREATE_INTERRUPT_MESSAGE2 =3D PCI_MESSAGE_BASE + 0x17, > + PCI_DELETE_INTERRUPT_MESSAGE2 =3D PCI_MESSAGE_BASE + 0x18, /* = unused */ > + PCI_BUS_RELATIONS2 =3D PCI_MESSAGE_BASE + 0x19, > + PCI_RESOURCES_ASSIGNED3 =3D PCI_MESSAGE_BASE + 0x1A, > + PCI_CREATE_INTERRUPT_MESSAGE3 =3D PCI_MESSAGE_BASE + 0x1B, > PCI_MESSAGE_MAXIMUM > }; >=20 > @@ -223,6 +239,22 @@ struct pci_func_desc { > uint32_t ser; /* serial number */ > } __packed; >=20 > +struct pci_func_desc2 { > + uint16_t v_id; /* vendor ID */ > + uint16_t d_id; /* device ID */ > + uint8_t rev; > + uint8_t prog_intf; > + uint8_t subclass; > + uint8_t base_class; > + uint32_t subsystem_id; > + union win_slot_encoding wslot; > + uint32_t ser; /* serial number */ > + uint32_t flags; > + uint16_t virtual_numa_node; > + uint16_t reserved; > +} __packed; > + > + > struct hv_msi_desc { > uint8_t vector; > uint8_t delivery_mode; > @@ -231,6 +263,15 @@ struct hv_msi_desc { > uint64_t cpu_mask; > } __packed; >=20 > +struct hv_msi_desc3 { > + uint32_t vector; > + uint8_t delivery_mode; > + uint8_t reserved; > + uint16_t vector_count; > + uint16_t processor_count; > + uint16_t processor_array[32]; > +} __packed; > + > struct tran_int_desc { > uint16_t reserved; > uint16_t vector_count; > @@ -288,6 +329,12 @@ struct pci_bus_relations { > struct pci_func_desc func[0]; > } __packed; >=20 > +struct pci_bus_relations2 { > + struct pci_incoming_message incoming; > + uint32_t device_count; > + struct pci_func_desc2 func[0]; > +} __packed; > + > #define MAX_NUM_BARS (PCIR_MAX_BAR_0 + 1) > struct pci_q_res_req_response { > struct vmbus_chanpkt_hdr hdr; > @@ -303,12 +350,26 @@ struct pci_resources_assigned { > uint32_t reserved[4]; > } __packed; >=20 > +struct pci_resources_assigned2 { > + struct pci_message message_type; > + union win_slot_encoding wslot; > + uint8_t memory_range[0x14][6]; /* not used here */ > + uint32_t msi_descriptor_count; > + uint8_t reserved[70]; > +} __packed; > + > struct pci_create_interrupt { > struct pci_message message_type; > union win_slot_encoding wslot; > struct hv_msi_desc int_desc; > } __packed; >=20 > +struct pci_create_interrupt3 { > + struct pci_message message_type; > + union win_slot_encoding wslot; > + struct hv_msi_desc3 int_desc; > +} __packed; > + > struct pci_create_int_response { > struct pci_response response; > uint32_t reserved; > @@ -356,12 +417,28 @@ struct hv_pcibus { >=20 > struct mtx config_lock; /* Avoid two threads writing index page = */ > struct mtx device_list_lock; /* Protect lists below */ > + uint32_t protocol_version; > TAILQ_HEAD(, hv_pci_dev) children; > TAILQ_HEAD(, hv_dr_state) dr_list; >=20 > volatile int detaching; > }; >=20 > +struct hv_pcidev_desc { > + uint16_t v_id; /* vendor ID */ > + uint16_t d_id; /* device ID */ > + uint8_t rev; > + uint8_t prog_intf; > + uint8_t subclass; > + uint8_t base_class; > + uint32_t subsystem_id; > + union win_slot_encoding wslot; > + uint32_t ser; /* serial number */ > + uint32_t flags; > + uint16_t virtual_numa_node; > +} __packed; The indentation for these structs is all over the place. > + > + Extra blank line. Jess > struct hv_pci_dev { > TAILQ_ENTRY(hv_pci_dev) link; >=20