From patchwork Wed Apr 18 18:21:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Farhan Ali X-Patchwork-Id: 10348775 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EBB966031B for ; Wed, 18 Apr 2018 18:22:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA273287CD for ; Wed, 18 Apr 2018 18:22:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CEF52287D3; Wed, 18 Apr 2018 18:22:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 90B7D287CD for ; Wed, 18 Apr 2018 18:22:25 +0000 (UTC) Received: from localhost ([::1]:43351 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f8rip-0002p5-HN for patchwork-qemu-devel@patchwork.kernel.org; Wed, 18 Apr 2018 14:22:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f8ri0-0002NE-LQ for qemu-devel@nongnu.org; Wed, 18 Apr 2018 14:21:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f8rhx-0003O3-Ey for qemu-devel@nongnu.org; Wed, 18 Apr 2018 14:21:32 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:39014) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f8rhx-0003My-5C for qemu-devel@nongnu.org; Wed, 18 Apr 2018 14:21:29 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3IIK7jT028697 for ; Wed, 18 Apr 2018 14:21:27 -0400 Received: from e36.co.us.ibm.com (e36.co.us.ibm.com [32.97.110.154]) by mx0a-001b2d01.pphosted.com with ESMTP id 2hea4ju5mr-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Wed, 18 Apr 2018 14:21:27 -0400 Received: from localhost by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 18 Apr 2018 12:21:26 -0600 Received: from b03cxnp08027.gho.boulder.ibm.com (9.17.130.19) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 18 Apr 2018 12:21:23 -0600 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w3IILK2V12190138; Wed, 18 Apr 2018 11:21:20 -0700 Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3E3F9BE044; Wed, 18 Apr 2018 12:21:20 -0600 (MDT) Received: from [9.80.215.88] (unknown [9.80.215.88]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP id 73E55BE03A; Wed, 18 Apr 2018 12:21:19 -0600 (MDT) To: Thomas Huth , Christian Borntraeger , qemu-s390x@nongnu.org, Viktor Mihajlovski References: <1524054707-20663-1-git-send-email-thuth@redhat.com> From: Farhan Ali Date: Wed, 18 Apr 2018 14:21:18 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1524054707-20663-1-git-send-email-thuth@redhat.com> Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 18041818-0020-0000-0000-00000DC29FC5 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008878; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000257; SDB=6.01019804; UDB=6.00520295; IPR=6.00799046; MB=3.00020645; MTD=3.00000008; XFM=3.00000015; UTC=2018-04-18 18:21:25 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18041818-0021-0000-0000-000060F6811B Message-Id: <307f8b80-fca2-d55f-6bc6-85b794afa15e@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-04-18_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1804180164 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: Re: [Qemu-devel] [PATCH v1 for-2.13 0/4] pc-bios/s390-ccw: Network boot improvements X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Collin Walling , Cornelia Huck , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP On 04/18/2018 08:31 AM, Thomas Huth wrote: > Some patches to improve the network boot experience on s390x: > > First, make sure that we shut down the virtio-net device before jumping > into the kernel. Otherwise some incoming packets might destroy some of > the kernel's data if it has not taken over the device yet. > > Then the last two patches add support for loading kernels via > configuration files - pxelinux-style and .INS-file style. This way > you don't have to manually glue your ramdisk to your kernel anymore, > so this should be quite a relieve for all users who want to boot > Linux via the network. > > The config file parsers have been completely written by myself from > scratch and only tested with some config files that I came up with > on my own. So if anybody has some pre-existing pxelinux config files > already for booting a s390x, I'd appreciate some testing to see whether > this works as expected for you, too! > > Thomas Huth (4): > pc-bios/s390-ccw/net: Split up net_load() into init, load and uninit > parts > pc-bios/s390-ccw/net: Stop virtio-net device before jumping into the > OS > pc-bios/s390-ccw/net: Add support for pxelinux-style config files > pc-bios/s390-ccw/net: Add support for .INS config files > > pc-bios/s390-ccw/netboot.mak | 5 +- > pc-bios/s390-ccw/netmain.c | 312 ++++++++++++++++++++++++++++++++++++++---- > pc-bios/s390-ccw/virtio-net.c | 8 ++ > pc-bios/s390-ccw/virtio.c | 19 ++- > pc-bios/s390-ccw/virtio.h | 3 + > 5 files changed, 312 insertions(+), 35 deletions(-) > I have tried with pxelinux default config file I had and it worked fine. I will try a couple more tests. Also while going through the code again, I noticed a memory leak in the function virtio_net_init, and fixed it. I could send a formal patch for it, if you want to queue it as part of this series as I think we might have missed 2.12 window? diff --git a/pc-bios/s390-ccw/virtio-net.c b/pc-bios/s390-ccw/virtio-net.c index ff7f4da..e83ba08 100644 --- a/pc-bios/s390-ccw/virtio-net.c +++ b/pc-bios/s390-ccw/virtio-net.c @@ -61,6 +61,7 @@ int virtio_net_init(void *mac_addr) IPL_assert(buf != NULL, "Can not allocate memory for receive buffers"); vring_send_buf(rxvq, buf, ETH_MTU_SIZE + sizeof(VirtioNetHdr), VRING_DESC_F_WRITE); + free(buf); } vring_notify(rxvq);