From nobody Wed Nov 27 11:51:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1699267237; cv=none; d=zohomail.com; s=zohoarc; b=QwE0ObZ9u5ZoUR7JDW7FP80fUeHWF8RNyqUkvfF1dQaGGirNwPVPWci4VkWtnq+MGsLLRTuKCkuKKnlZBpppy4GLVuXnVkSXq2Z2dkJeZbCVGTa1e5c6NqOfCeZ+nRiB1cmF3EoHQeO4d6g6IIU2uIGtQTgYGbO6mhv0PvJl+vU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699267237; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4uz818AY0/m+FRzGeIhGz1ZTqpxzLihnWApmCN46dps=; b=W8J/VsEU9W+/c4KiVvxDE6cQYiMiWSU6YxqUJHrYmKzDnQkjFpGltN4c2g8wAo8+6yblbOzzdIghBieHCCKtGciE7bHcPzKsSCdj01zwFITUOsfhn7bc4ajGjhxvCqZIXk5gddKFE2YMtpprteDgKdu7K81M9tynGbn7cg5nSL4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1699267237205119.04872075117441; Mon, 6 Nov 2023 02:40:37 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.627877.978737 (Exim 4.92) (envelope-from ) id 1qzx1g-00014j-F8; Mon, 06 Nov 2023 10:40:12 +0000 Received: by outflank-mailman (output) from mailman id 627877.978737; Mon, 06 Nov 2023 10:40:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qzx1g-00013Y-CJ; Mon, 06 Nov 2023 10:40:12 +0000 Received: by outflank-mailman (input) for mailman id 627877; Mon, 06 Nov 2023 10:40:11 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qzx1f-00010s-1h for xen-devel@lists.xenproject.org; Mon, 06 Nov 2023 10:40:11 +0000 Received: from casper.infradead.org (casper.infradead.org [2001:8b0:10b:1236::1]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id d9cf4d07-7c90-11ee-9b0e-b553b5be7939; Mon, 06 Nov 2023 11:40:07 +0100 (CET) Received: from [2001:8b0:10b:1::ebe] (helo=i7.infradead.org) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1qzx1P-005R1j-Rh; Mon, 06 Nov 2023 10:39:56 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.96.2 #2 (Red Hat Linux)) id 1qzx1Q-000qGL-0i; Mon, 06 Nov 2023 10:39:56 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list X-Inumbo-ID: d9cf4d07-7c90-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=4uz818AY0/m+FRzGeIhGz1ZTqpxzLihnWApmCN46dps=; b=fKwQs5UAJQKDc4KMhJikM8x0P+ jPOTGf+YxCgZTG/biDh3QzX3JwAbu0gE40tBY8XR/RZ3HilkTvWvdgtoMbVM/GryZUjrqPv/srYx4 +ipkc9VhfDcYvAyXEPUXUUHSwPPlvgV05kdutHUN0YQWlbfVFPhtzdPr9P3gzllPa+c2RQrgYl6xO 6BYbsvGDvWMmLVvsAho+MJkjTcjB/wbjsPkkpXi882fTxrvbre3s1QCQSJw92wKxWoLxH0GOWQ49U osQBPzD5cm4z9Xb9QrnOHQjCv0800KW3Xgu428Cxh5JoUgybYy4O1wohQagI+6cxYjmo5Ua7CiFYT qbjp+IOg==; From: David Woodhouse To: qemu-devel@nongnu.org, qemu-stable@nongnu.org Cc: Stefano Stabellini , Anthony Perard , Paul Durrant , Kevin Wolf , Hanna Reitz , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcelo Tosatti , xen-devel@lists.xenproject.org, qemu-block@nongnu.org, kvm@vger.kernel.org Subject: [PULL 7/7] hw/xen: use correct default protocol for xen-block on x86 Date: Mon, 6 Nov 2023 10:39:55 +0000 Message-ID: <20231106103955.200867-8-dwmw2@infradead.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106103955.200867-1-dwmw2@infradead.org> References: <20231106103955.200867-1-dwmw2@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: David Woodhouse X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-ZohoMail-DKIM: pass (identity @infradead.org) X-ZM-MESSAGEID: 1699267238562100007 Content-Type: text/plain; charset="utf-8" From: David Woodhouse Even on x86_64 the default protocol is the x86-32 one if the guest doesn't specifically ask for x86-64. Cc: qemu-stable@nongnu.org Fixes: b6af8926fb85 ("xen: add implementations of xen-block connect and dis= connect functions...") Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- hw/block/xen-block.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c index a07cd7eb5d..bfa53960c3 100644 --- a/hw/block/xen-block.c +++ b/hw/block/xen-block.c @@ -115,9 +115,13 @@ static void xen_block_connect(XenDevice *xendev, Error= **errp) return; } =20 - if (xen_device_frontend_scanf(xendev, "protocol", "%ms", - &str) !=3D 1) { - protocol =3D BLKIF_PROTOCOL_NATIVE; + if (xen_device_frontend_scanf(xendev, "protocol", "%ms", &str) !=3D 1)= { + /* x86 defaults to the 32-bit protocol even for 64-bit guests. */ + if (object_dynamic_cast(OBJECT(qdev_get_machine()), "x86-machine")= ) { + protocol =3D BLKIF_PROTOCOL_X86_32; + } else { + protocol =3D BLKIF_PROTOCOL_NATIVE; + } } else { if (strcmp(str, XEN_IO_PROTO_ABI_X86_32) =3D=3D 0) { protocol =3D BLKIF_PROTOCOL_X86_32; --=20 2.41.0