Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 28F4484E6C for ; Thu, 27 Jul 2023 17:56:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id JlSXoOCVLWfH for ; Thu, 27 Jul 2023 17:56:31 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 753C384CD0 for ; Thu, 27 Jul 2023 17:56:31 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 68C7DFBDB; Thu, 27 Jul 2023 17:56:31 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Thu, 27 Jul 2023 17:56:31 +0000 From: "Martin Husemann" Subject: CVS commit: [netbsd-10] src/sys/arch/xen/xen To: source-changes@NetBSD.org Approved: for-source-only Reply-To: martin@netbsd.org X-Mailer: log_accum Message-Id: <20230727175631.68C7DFBDB@cvs.NetBSD.org> Module Name: src Committed By: martin Date: Thu Jul 27 17:56:31 UTC 2023 Modified Files: src/sys/arch/xen/xen [netbsd-10]: xbd_xenbus.c Log Message: Pull up following revision(s) (requested by bouyer in ticket #248): sys/arch/xen/xen/xbd_xenbus.c: revision 1.132 (patch) sys/arch/xen/xen/xbd_xenbus.c: revision 1.133 (patch) sys/arch/xen/xen/xbd_xenbus.c: revision 1.134 (patch) The disk size reported in the xenstore is always in XEN_BSIZE units, not sector-size. Should fix the issue reported by Christian Kujau on netbsd-users and port-xen. Also use XEN_BSIZE when computing the number of bytes for format_bytes(). While there note in a comment that sc_sectors is in XEN_BSIZE units Propoerly handle 4k sector size backends: - report the backend's sector size to upper layers, not DEV_BSIZE. Adjust the number of sectors accordingly. - Use sc_secsize instead of XEN_BSIZE where appropriate. The sectors numbers in I/O requests are still in XEN_BSIZE units, but must be a multiple of sc_secsize/XEN_BSIZE. - As a consequence of previous, the buffer has to be aligned to sc_secsize, aligned to XEN_BSIZE may not be enough. This means that we may have to xbd_map_align() more buffer, including some without B_PHYS set. - Add some more DPRINTF lines, related to I/O requests Tested with a linux dom0. thanks to Christian Kujau for providing access to his hardware for testing and debugging. To generate a diff of this commit: cvs rdiff -u -r1.129 -r1.129.20.1 src/sys/arch/xen/xen/xbd_xenbus.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.