From patchwork Mon Feb 19 12:39:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viktor Mihajlovski X-Patchwork-Id: 10227655 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 D806E60392 for ; Mon, 19 Feb 2018 12:41:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C782F289E5 for ; Mon, 19 Feb 2018 12:41:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC33A28A13; Mon, 19 Feb 2018 12:41:05 +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=-6.9 required=2.0 tests=BAYES_00,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 499A3289E5 for ; Mon, 19 Feb 2018 12:41:04 +0000 (UTC) Received: from localhost ([::1]:49845 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enkkh-0007C7-QY for patchwork-qemu-devel@patchwork.kernel.org; Mon, 19 Feb 2018 07:41:03 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enkjw-0006if-Mg for qemu-devel@nongnu.org; Mon, 19 Feb 2018 07:40:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1enkjq-0002vd-Lr for qemu-devel@nongnu.org; Mon, 19 Feb 2018 07:40:16 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:60866) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1enkjq-0002uc-Dl for qemu-devel@nongnu.org; Mon, 19 Feb 2018 07:40:10 -0500 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w1JCdwca127005 for ; Mon, 19 Feb 2018 07:40:09 -0500 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 2g7wp5jtkc-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 19 Feb 2018 07:40:07 -0500 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 19 Feb 2018 12:39:47 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 19 Feb 2018 12:39:45 -0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w1JCdjXZ47513600; Mon, 19 Feb 2018 12:39:45 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 59D6342042; Mon, 19 Feb 2018 12:32:25 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0525D4204C; Mon, 19 Feb 2018 12:32:25 +0000 (GMT) Received: from [9.152.222.92] (unknown [9.152.222.92]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 19 Feb 2018 12:32:24 +0000 (GMT) To: Thomas Huth , "Collin L. Walling" , qemu-s390x@nongnu.org, qemu-devel@nongnu.org References: <1518818879-18608-1-git-send-email-walling@linux.vnet.ibm.com> <1518818879-18608-7-git-send-email-walling@linux.vnet.ibm.com> From: Viktor Mihajlovski Date: Mon, 19 Feb 2018 13:39:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-TM-AS-GCONF: 00 x-cbid: 18021912-0040-0000-0000-0000043534DF X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18021912-0041-0000-0000-000020D74061 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-02-19_06:, , 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-1802190157 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] [qemu-s390x] [PATCH v7 06/12] s390-ccw: parse and set boot menu options 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: alifm@linux.vnet.ibm.com, frankja@linux.vnet.ibm.com, cohuck@redhat.com, borntraeger@de.ibm.com, david@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP On 17.02.2018 09:26, Thomas Huth wrote: [...] >> struct QemuIplParameters { >> - uint8_t reserved1[4]; >> + uint8_t boot_menu_flags; >> + uint8_t reserved1[3]; >> + uint32_t boot_menu_timeout; >> uint64_t netboot_start_addr; >> - uint8_t reserved2[16]; >> + uint8_t reserved2[12]; >> } __attribute__ ((packed)); >> typedef struct QemuIplParameters QemuIplParameters; > > I think Victor's original intention was to get netboot_start_addr > aligned in the lowcore memory. Now it's rather aligned in the host > memory. Quite confusing, but I think I'd rather prefer Victor's idea to > keep it aligned in the lowcore (since that's the "architected" part). > > Maybe it's better if we do not declare this as a packed struct at all, > and then instead of doing a memcpy of the whole struct, we set the > fields manually one by one on the host side into the lowcore, and read > the fields manually one by one on the guest side? That's more > cumbersome, but avoids future confusion about the alignments here... > > Thomas > Hm ... I would prefer to keep it all together and perhaps come up with better comments (for the fields). BTW: I think it would make sense to reserve the last 8 bytes 'seriously': in case more global configuration data is needed in the future, we should have the possibility to install a pointer to an extension block in there. Anyway, here's the follup squash-in for a qipl-free IPLB. diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index 3c6a411..fe70008 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -222,7 +222,7 @@ static Property s390_ipl_properties[] = { DEFINE_PROP_END_OF_LIST(), }; -static void s390_ipl_set_boot_menu(IplParameterBlock *iplb) +static void s390_ipl_set_boot_menu(S390IPLState *ipl) { QemuOptsList *plist = qemu_find_opts("boot-opts"); QemuOpts *opts = QTAILQ_FIRST(&plist->head); @@ -231,11 +231,11 @@ static void s390_ipl_set_boot_menu(IplParameterBlock *iplb) const char *tmp; unsigned long splash_time = 0; - switch (iplb->pbt) { + switch (ipl->iplb.pbt) { case S390_IPL_TYPE_CCW: case S390_IPL_TYPE_QEMU_SCSI: - flags = &iplb->qipl.boot_menu_flags; - timeout = &iplb->qipl.boot_menu_timeout; + flags = &ipl->qipl.boot_menu_flags; + timeout = &ipl->qipl.boot_menu_timeout; break; default: error_report("boot menu is not supported for this device type."); @@ -482,7 +482,7 @@ void s390_ipl_prepare_cpu(S390CPU *cpu) } ipl->qipl.netboot_start_addr = cpu_to_be64(ipl->start_addr); } - s390_ipl_set_boot_menu(&ipl->iplb); + s390_ipl_set_boot_menu(ipl); s390_ipl_prepare_qipl(cpu); }