From patchwork Fri Jul 17 09:29:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Hartmayer X-Patchwork-Id: 11669693 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 68FC8159A for ; Fri, 17 Jul 2020 09:30:34 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 482242063A for ; Fri, 17 Jul 2020 09:30:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 482242063A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:40736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jwMhN-0007J1-ED for patchwork-qemu-devel@patchwork.kernel.org; Fri, 17 Jul 2020 05:30:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50788) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jwMgj-00065T-KY for qemu-devel@nongnu.org; Fri, 17 Jul 2020 05:29:53 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:30908 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jwMgh-0004GW-Qs for qemu-devel@nongnu.org; Fri, 17 Jul 2020 05:29:53 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06H938VJ184275 for ; Fri, 17 Jul 2020 05:29:49 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 32b61jwv6j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 17 Jul 2020 05:29:49 -0400 Received: from m0098416.ppops.net (m0098416.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 06H93JWb185383 for ; Fri, 17 Jul 2020 05:29:49 -0400 Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0b-001b2d01.pphosted.com with ESMTP id 32b61jwv65-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Jul 2020 05:29:49 -0400 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 06H99q7j003549; Fri, 17 Jul 2020 09:29:47 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma02fra.de.ibm.com with ESMTP id 327527xqdy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Jul 2020 09:29:47 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 06H9SM4X54985150 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 Jul 2020 09:28:22 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 42596AE051; Fri, 17 Jul 2020 09:29:45 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CD3AFAE045; Fri, 17 Jul 2020 09:29:44 +0000 (GMT) Received: from marcibm.ibmuc.com (unknown [9.145.17.123]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 17 Jul 2020 09:29:44 +0000 (GMT) From: Marc Hartmayer To: Subject: [RFC v2 0/3] Enable virtio-fs on s390x Date: Fri, 17 Jul 2020 11:29:26 +0200 Message-Id: <20200717092929.19453-1-mhartmay@linux.ibm.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-07-17_04:2020-07-17, 2020-07-17 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 clxscore=1015 bulkscore=0 mlxlogscore=999 adultscore=0 phishscore=0 priorityscore=1501 impostorscore=0 suspectscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007170066 Received-SPF: pass client-ip=148.163.158.5; envelope-from=mhartmay@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/17 05:29:50 X-ACL-Warn: Detected OS = Linux 3.x [generic] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , "Michael S. Tsirkin" , Cornelia Huck , "Dr. David Alan Gilbert" , Halil Pasic , Stefan Hajnoczi , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" This RFC is about enabling virtio-fs on s390x. For that we need + some shim code (first patch), and we need + libvhost-user to deal with virtio endiannes for non-legacy virtio devices as mandated by the spec. libvhost-access.h is based on hw/virtio/virtio-access.h. How to use? For general instructions how to use virtio-fs (on x86) please have a look at https://virtio-fs.gitlab.io/howto-qemu.html. Most of the instructions can also be applied on s390x. In short: 1. Install self-compiled QEMU with this patch series applied 2. Prepare host and guest kernel so they support virtio-fs Start virtiofsd on the host $ virtiofsd -f --socket-path=/tmp/vhostqemu -o source=/tmp/shared Now you can start QEMU in a separate shell on the host: $ qemu-system-s390x -machine type=s390-ccw-virtio,accel=kvm,memory-backend=mem \ -object memory-backend-file,id=mem,size=2G,mem-path=/dev/shm/virtiofs,share=on,prealloc=on,prealloc-threads=1 \ -chardev socket,id=char0,path=/tmp/vhostqemu -device vhost-user-fs-ccw,queue-size=1024,chardev=char0,tag=myfs \ -drive if=virtio,file=disk.qcow2 \ -m 2G -smp 2 -nographic Log into the guest and mount it $ mount -t virtiofs myfs /mnt Changelog: v1->v2: + rebased + drop patch "libvhost-user: print invalid address on vu_panic" as it's not related to this series + drop patch "[RFC 4/4] HACK: Hard-code the libvhost-user.o-cflags for s390x" + patch "virtio: add vhost-user-fs-ccw device": replace qdev_set_parent_bus and object_property_set_bool by qdev_realize + patch "libvhost-user: handle endianness as mandated by the spec": Drop support for legacy virtio devices + add patch to fence legacy virtio devices Halil Pasic (1): virtio: add vhost-user-fs-ccw device Marc Hartmayer (2): libvhost-user: handle endianness as mandated by the spec libvhost-user: fence legacy virtio devices contrib/libvhost-user/libvhost-access.h | 71 ++++++++++++++ contrib/libvhost-user/libvhost-user.c | 125 +++++++++++++----------- hw/s390x/Makefile.objs | 1 + hw/s390x/vhost-user-fs-ccw.c | 73 ++++++++++++++ 4 files changed, 211 insertions(+), 59 deletions(-) create mode 100644 contrib/libvhost-user/libvhost-access.h create mode 100644 hw/s390x/vhost-user-fs-ccw.c