Received: by 2002:ac2:52b1:0:0:0:0:0 with SMTP id r17csp3899713lfm; Mon, 27 Apr 2020 02:59:06 -0700 (PDT) X-Google-Smtp-Source: APiQypI+JPS3pXeWwalM3WPo/Jv/GNG0GZuSuQ4kzSGmIwRLhxMSCdb3r2mLJtiLlQJAjkoYSe74 X-Received: by 2002:a37:c4b:: with SMTP id 72mr21290118qkm.2.1587981546669; Mon, 27 Apr 2020 02:59:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587981546; cv=none; d=google.com; s=arc-20160816; b=cPYbpPpt0TXtTNlLVZiBEsCMoG14YiKHa+zl787e6Hn8x0Y4AUit6jwEAiKlasy4it Ykdot9IVoB10hEvdiVnSeYNIq/g6uWVWU2rZUpd9kZ19+NF45x/Jysp3BrTD+1vI4vxn sglFP8JXfYI5ngUVr1lSUx9z9QXUFqkZmk3HOkxGER+L6L6AbMpOn5czgRJJMmSqNZ4p zOCBfP1qn+mgyA6cYN+RkWaQDR2D9p5YPme+ulKUtfzk9vIUa2W9pBJtjVDlRuAZYe/Q zT5bYbH+WOf7JS0BVfZIIQIqvuRS2TCTkAcOC2DxZByDu6jPSDO+Lu3i7uzVi/n4+suS 1IpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=kcWBuPaHBGxHMOrZqvqL266FxHOcDDC/OPS2Jo9wjKw=; b=nbyi8Jt7FbzPmxa5hahAgHnBhnms6dgeian8ULoSkJGSaO/f7ioaqWC8tXgnhNbihO S9KSvc0ZCK2Y6GDrjkW0fqCUz/PwmOm8e7WAxTb7ik8YNH4O9G20jdj1EEmNWvurvzIT wsNUIr7G3QCQZNSolxqVuSmPYZSk4vnPL7HvwDlVMFl93ZxLffGeqlwO2P66zcIQwzuE VUW3VpTxAw4I2EXbQKbNEQaosenusdpbeQiaYGvZOSyzprXUHnlm5XEX3n2UwlPxzCaz CdieZlr1XbjbM2MjM+QweKYpfky5CHpAVfIyIelWXojdJ1SRjupM9EUyFC7pvbu6eJtI ZwkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LMaNoThp; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h1si8476260qvr.170.2020.04.27.02.59.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Apr 2020 02:59:06 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LMaNoThp; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:35692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jT0XZ-0007sB-U0 for alex.bennee@linaro.org; Mon, 27 Apr 2020 05:59:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37632) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jT0XN-0007pr-Mq for qemu-arm@nongnu.org; Mon, 27 Apr 2020 05:58:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jT0XM-0006LD-LS for qemu-arm@nongnu.org; Mon, 27 Apr 2020 05:58:53 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:31665 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jT0XM-00063u-7T for qemu-arm@nongnu.org; Mon, 27 Apr 2020 05:58:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587981529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kcWBuPaHBGxHMOrZqvqL266FxHOcDDC/OPS2Jo9wjKw=; b=LMaNoThpcw5AdLOBfgK8a9mCCXvjZ7B0tlnEXZXFfKSy3TnLp6gjgoaYkS2+NDgNoKXHrF A7Jt7ZpTwqWn9vyZTuLHPq2s+reaYVmrpUcSXMHscc457OaC/Y+dXjragPxz2LtwY6iXs7 4Ng2GNXiZuqDaigckeYn1eLmjbE5q/I= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-318-CQajEjsKN6GYOEPPYp85LA-1; Mon, 27 Apr 2020 05:58:46 -0400 X-MC-Unique: CQajEjsKN6GYOEPPYp85LA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D9D4787134E; Mon, 27 Apr 2020 09:58:43 +0000 (UTC) Received: from [10.36.115.95] (ovpn-115-95.ams2.redhat.com [10.36.115.95]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 050FE5C7CF; Mon, 27 Apr 2020 09:58:31 +0000 (UTC) Subject: Re: [PATCH] hw: add compat machines for 5.1 To: Cornelia Huck References: <20200424090314.544-1-cohuck@redhat.com> <548cd0de-17d3-204d-7df1-4c8fdccad83c@redhat.com> <20200427110609.36ecaac6.cohuck@redhat.com> From: Auger Eric Message-ID: <4166d3fc-58e9-405d-71a1-2270ced75e7d@redhat.com> Date: Mon, 27 Apr 2020 11:58:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20200427110609.36ecaac6.cohuck@redhat.com> Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=205.139.110.61; envelope-from=eric.auger@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/26 23:32:35 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , "Michael S . Tsirkin" , qemu-devel@nongnu.org, Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, David Gibson Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: hLCCTASqcaq+ Hi Connie, On 4/27/20 11:06 AM, Cornelia Huck wrote: > On Mon, 27 Apr 2020 09:43:33 +0200 > Auger Eric wrote: > >> Hi Connie, >> >> On 4/24/20 11:03 AM, Cornelia Huck wrote: >>> Add 5.1 machine types for arm/i440fx/q35/s390x/spapr. >>> >>> Signed-off-by: Cornelia Huck >>> --- >>> >>> Still keeping the default cpu model version on x86 at v1. >>> >>> I'll queue this to my s390-next branch, as I'm planning to send a pull >>> req as soon as 5.0 is out; if someone else wants to queue this, we'll >>> figure it out :) >>> >>> --- >>> hw/arm/virt.c | 9 ++++++++- >>> hw/core/machine.c | 3 +++ >>> hw/i386/pc.c | 3 +++ >>> hw/i386/pc_piix.c | 14 +++++++++++++- >>> hw/i386/pc_q35.c | 13 ++++++++++++- >>> hw/ppc/spapr.c | 15 +++++++++++++-- >>> hw/s390x/s390-virtio-ccw.c | 14 +++++++++++++- >>> include/hw/boards.h | 3 +++ >>> include/hw/i386/pc.h | 3 +++ >>> 9 files changed, 71 insertions(+), 6 deletions(-) >>> >>> diff --git a/hw/arm/virt.c b/hw/arm/virt.c >>> index 7dc96abf72cf..5e84c09402dd 100644 >>> --- a/hw/arm/virt.c >>> +++ b/hw/arm/virt.c >>> @@ -2309,15 +2309,22 @@ static void machvirt_machine_init(void) >>> } >>> type_init(machvirt_machine_init); >>> >>> +static void virt_machine_5_1_options(MachineClass *mc) >>> +{ >>> +} >>> +DEFINE_VIRT_MACHINE_AS_LATEST(5, 1) >>> + >>> static void virt_machine_5_0_options(MachineClass *mc) >>> { >>> static GlobalProperty compat[] = { >>> { TYPE_TPM_TIS_SYSBUS, "ppi", "false" }, >>> }; >>> >>> + virt_machine_5_1_options(mc); >>> + compat_props_add(mc->compat_props, hw_compat_5_0, hw_compat_5_0_len); >>> compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); >> As spotted by patchew we need { TYPE_TPM_TIS_SYSBUS, "ppi", "false" } to >> be applied for all machine types 5_0 onwards as our tpm-tis-device does >> not support PPI. So I guess we need to move compat[] declaration outside >> of virt_machine_5_0_options and call >> "compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));" >> for each virt_machine_5_*_options? Or is a misuse of compats? > > Ah, that was the error (I could not really make sense of it). > > So, if I understand it correctly, ppi needs to be disabled for all virt > machines. ppi property of tpm-tis-sysbus device needs to be disabled for all virt machines whose version >= 5.0. tpm-tis-sysbus device is supported from 5.0 onwards. Looking again at the code, I should rather set the default value of the ppi property to false in tpm_tis_sysbus_properties. Before we shared the same device with x86, hence the compat but now we have a separate one. I guess that should work directly without the pain of that compat :-( Let me check ... Thanks Eric I think the correct way to do this would be to add the > "compat" prop in virt_machine_class_init() (even if it is not strictly > compat, as it always needs to be disabled). It can be removed there and > added to a compat machine should support be added in the future. > > Or does anyone have a better idea? > >