From nobody Mon Sep 16 20:06:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail(p=none dis=none) header.from=linux.alibaba.com Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1668398342704636.9219797097556; Sun, 13 Nov 2022 19:59:02 -0800 (PST) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id EABF022852; Mon, 14 Nov 2022 03:58:55 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id D29C52208B for ; Mon, 14 Nov 2022 03:58:31 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by smtp.aliyun-inc.com; Mon, 14 Nov 2022 11:58:21 +0800 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R831e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046060;MF=xuanzhuo@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0VUgGmq7_1668398300; From: Xuan Zhuo To: seabios@seabios.org Date: Mon, 14 Nov 2022 11:58:17 +0800 Message-Id: <20221114035818.109511-2-xuanzhuo@linux.alibaba.com> In-Reply-To: <20221114035818.109511-1-xuanzhuo@linux.alibaba.com> References: <20221114035818.109511-1-xuanzhuo@linux.alibaba.com> MIME-Version: 1.0 X-Git-Hash: 73ebbf4 Message-ID-Hash: BYOCH5VIV5R26FXCQSPVRRPFF33F7MBI X-Message-ID-Hash: BYOCH5VIV5R26FXCQSPVRRPFF33F7MBI X-MailFrom: xuanzhuo@linux.alibaba.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-seabios.seabios.org-0; header-match-seabios.seabios.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: lersek@redhat.com, jasowang@redhat.com, peter.maydell@linaro.org, kraxel@redhat.com, "Michael S. Tsirkin" X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [SeaBIOS] [PATCH v1 1/2] virtio-mmio: read/write the hi 32 features for mmio List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable Authentication-Results: coreboot.org; auth=pass smtp.auth=mailman@coreboot.org smtp.mailfrom=seabios-bounces@seabios.org X-Spamd-Bar: --- X-ZM-MESSAGEID: 1668398342946100001 Content-Type: text/plain; charset="utf-8" Under mmio, when we read the feature from the device, we should read the high 32-bit part. Similarly, when writing the feature back, we should also write back the high 32-bit feature. Signed-off-by: Xuan Zhuo --- src/hw/virtio-pci.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hw/virtio-pci.c b/src/hw/virtio-pci.c index 213c497..89a4f50 100644 --- a/src/hw/virtio-pci.c +++ b/src/hw/virtio-pci.c @@ -193,7 +193,8 @@ u64 vp_get_features(struct vp_device *vp) if (vp->use_mmio) { vp_write(&vp->common, virtio_mmio_cfg, device_feature_select, 0); f0 =3D vp_read(&vp->common, virtio_mmio_cfg, device_feature); - f1 =3D 0; + vp_write(&vp->common, virtio_mmio_cfg, device_feature_select, 1); + f1 =3D vp_read(&vp->common, virtio_mmio_cfg, device_feature); } else if (vp->use_modern) { vp_write(&vp->common, virtio_pci_common_cfg, device_feature_select= , 0); f0 =3D vp_read(&vp->common, virtio_pci_common_cfg, device_feature); @@ -214,8 +215,10 @@ void vp_set_features(struct vp_device *vp, u64 feature= s) f1 =3D features >> 32; =20 if (vp->use_mmio) { - vp_write(&vp->common, virtio_mmio_cfg, guest_feature_select, f0); + vp_write(&vp->common, virtio_mmio_cfg, guest_feature_select, 0); vp_write(&vp->common, virtio_mmio_cfg, guest_feature, f0); + vp_write(&vp->common, virtio_mmio_cfg, guest_feature_select, 1); + vp_write(&vp->common, virtio_mmio_cfg, guest_feature, f1); } else if (vp->use_modern) { vp_write(&vp->common, virtio_pci_common_cfg, guest_feature_select,= 0); vp_write(&vp->common, virtio_pci_common_cfg, guest_feature, f0); --=20 2.32.0.3.g01195cf9f _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org