From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web08.8281.1630071925169839385 for ; Fri, 27 Aug 2021 06:45:25 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VyhFjm97; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630071924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GM23U8hk5axNAyPXEmmfcbdjH6U/cWe+5G3uYq8q+Og=; b=VyhFjm97FMdz0PqUKnsymoOm3BM/W2+OvvBW/jm/IfPERTOvfhjj041pzX/PNaiwPul2kZ IHVKHwfuPJW4Q0TVVK84piVuCzhQITyWAt2aJ4/rX7P7S2F/hajonCiE3WFYEmKqE6mJ8e cFOu9xneQnY0iJrGG8ZbGkJVmyjuvUk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-144-fw7LAD_JMduVLvFCSY3wkQ-1; Fri, 27 Aug 2021 09:45:20 -0400 X-MC-Unique: fw7LAD_JMduVLvFCSY3wkQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8C67D800493; Fri, 27 Aug 2021 13:45:19 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 990825F724; Fri, 27 Aug 2021 13:45:16 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id CD5EF18007AD; Fri, 27 Aug 2021 15:44:59 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Jiewen Yao , Gerd Hoffmann , Ard Biesheuvel , Jordan Justen , Philippe Mathieu-Daude Subject: [PATCH v5 3/7] OvmfPkg/VirtioMmioDeviceLib: virtio 1.0: Fix SetPageSize. Date: Fri, 27 Aug 2021 15:44:55 +0200 Message-Id: <20210827134459.635098-4-kraxel@redhat.com> In-Reply-To: <20210827134459.635098-1-kraxel@redhat.com> References: <20210827134459.635098-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Nothing to do here for virtio 1.0 devices. Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daude --- .../Library/VirtioMmioDeviceLib/VirtioMmioDeviceFunctions.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceFunctions.c b/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceFunctions.c index b0d75fb1dd24..50a4fd2100ee 100644 --- a/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceFunctions.c +++ b/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceFunctions.c @@ -151,7 +151,9 @@ VirtioMmioSetPageSize ( Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This); - VIRTIO_CFG_WRITE (Device, VIRTIO_MMIO_OFFSET_GUEST_PAGE_SIZE, PageSize); + if (Device->Version == VIRTIO_MMIO_DEVICE_VERSION_0_95) { + VIRTIO_CFG_WRITE (Device, VIRTIO_MMIO_OFFSET_GUEST_PAGE_SIZE, PageSize); + } return EFI_SUCCESS; } -- 2.31.1