Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DB475C5DF97 for ; Wed, 26 Aug 2026 18:53:40 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wzIkY-0000jY-Un; Wed, 26 Aug 2026 14:53:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wzIkX-0000iH-OT for qemu-riscv@nongnu.org; Wed, 26 Aug 2026 14:53:25 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wzIkT-0004ng-Iw for qemu-riscv@nongnu.org; Wed, 26 Aug 2026 14:53:25 -0400 Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67QGuocQ1310598 for ; Wed, 26 Aug 2026 18:53:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= Q+GuKNhmSV5MwT9xgzo64fFKH6ElJEq/Qt5ZuoMbN38=; b=OCL2F8NDN2Ng3hbc CBFVJ6bGdb3mnx16Gpot+D9Ll6izeHMBMHvhz+LjHqisqb3MfPv6L/NUc3e8yCH6 1DbSZLHHbL8LxSNS+p4nHFV1+RaMJfEAriNS8A6sszWCFCMzcYm4Wd2oi30BFUSK 62zNzzeOzFOVCZ91lNOASzaBcS453IAl6HIGyyfYcsEYA41HXXdfKxG8q1fcYFLG Rexb+SnjAyJnmwQQHKLt3/sjFE4g+roM36/RkB74b92yvZZuU1PQ/pt9vU7wfxgy Dk0MuGZd/HEq25xX2NRz1w9xEbE5uRA7MgrVPWOXHMJ3xHLMaf/jxgDWazEknLpl HvPoTw== Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ga03a9j1r-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 26 Aug 2026 18:53:20 +0000 (GMT) Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-cb48f41343aso144876a12.1 for ; Wed, 26 Aug 2026 11:53:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1787770399; x=1788375199; darn=nongnu.org; h=content-transfer-encoding:content-type:in-reply-to:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to:content-type; bh=Q+GuKNhmSV5MwT9xgzo64fFKH6ElJEq/Qt5ZuoMbN38=; b=KpQYhXqRuffWKUWRh1EE7DpQ7sNESLgQD2z3nVTlxMZigRE58bEub+K6sJONyMgd5w FLDo2w+P6/xmZ0wtMr5zYTptn/DPl3LykQ/rj5y9WJ+PZ3JwnHFP9E/KL7djyO5kx5tG 3QKS6HhBbowtqY1LbEGXqhRipukXWRsr3n0/+1shE6agiSqnxYjs/x12A7Yb9NnPLWZ1 yTPW45vr1YPR3MStdks8XNBWp4IumEjlJZ14mONn29WDueB4yQpJkxQn2i1zdwoPyYnQ 2Sov9xnyAws4mUAF0YrkOIX1uOh+7IglKS9qeIcAOZAhnVWcQxDeJVsKiTk73Z6wmBhp JLEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787770399; x=1788375199; h=content-transfer-encoding:content-type:in-reply-to:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Q+GuKNhmSV5MwT9xgzo64fFKH6ElJEq/Qt5ZuoMbN38=; b=hJzgb+3/Ibl1prO2Ofen0dkwKwObwlKAy7DZOk7gGr4Gb9DSaVUYO4ebndFlZEQqEM jcyN0oQ+iYty34qlyfhsdpFbGNXSVI+gsBwPlTfVySnTs0/sVa52JtZowz+KD3mu0tYj t789I/kNz6GoiP8utwwpYtdkq2AwKBrZvLu8BiRNy/JBVMWW8CM+rDVoVGWBUxucRiwQ Ws5l7GOc8JFiSVvgimDP2jcJTt+sWyW3J3MP1Ojdg0G0K4fUMdctZgLxSvXAbYTlHPoi y6ssAFgWt27aeihxLMXHQ65T4pqsrmvlVKuPgh4PTApdNsBoHa822AInNZQT1XaPPyeI A8rA== X-Forwarded-Encrypted: i=1; AHgh+RryAiF+AMqKrwXmbPSwn+Cvj3PChpJBgODNOVYoawO9eysFHbjHZ8bwp+RMS2vrMU0P3OODxliQmPJM@nongnu.org X-Gm-Message-State: AFuF++lQxkKo0d9Prx0a67HQx3SIVygCaCcsIrOzCz0hYwmqIarJFaOH GmtE4lVauKw/Xu1kN63/B2UZgS5LHv5NxksMuLGAqDH9IwL4xmF8J6yfYBTRdXlRE/P/u8GqcYq NAgjRY8H3Qnps1Nh4Og73avXJfmxJGbdA40EYfAagG8+DSs4jokMtgU0I1w== X-Gm-Gg: AR+sD12wbmtmXl1KwhKdafweMt5BedMgvAAioMPrbBeNK7sJUbpvnJxh+16h2BqKdsF 6kQENhqFWzgkl2wSreiTLYgXX9Wh8Sy095cfKwD7a5OHaDicRLoKmBXAgP9kPFSP3jJl7W94FQe y7C5BQKjzabRpANG6R/p+q5l2G1gVyJqzaRlkVj2INAcfNKxW356w8g6xkwpfaWNyCgVLw3IIFq F1fjqVJMSYFuVbLKE/pgei7BT76jaur5U90qnbyeSRZitOhEJaLulEbinxf/+/8IaHKRdRaCMJu mWzfQ+4IkcVL0TSadZamZJchYA2EIMQQLURoOlQ50G/Iu2kreuQGjKIbVu4xxDEvoWdfyI9zb9M NY9St3gRUe1TVTg/qmCYwKsP8v1IHgyoPQulvukYhb6rFHMSnbexMqWemfx3Bjyg8SwMk X-Received: by 2002:a17:90a:e7cb:b0:38e:9ca8:e99 with SMTP id 98e67ed59e1d1-3969bb7ae09mr1106229a91.5.1787770398849; Wed, 26 Aug 2026 11:53:18 -0700 (PDT) X-Received: by 2002:a17:90a:e7cb:b0:38e:9ca8:e99 with SMTP id 98e67ed59e1d1-3969bb7ae09mr1106165a91.5.1787770398278; Wed, 26 Aug 2026 11:53:18 -0700 (PDT) Received: from [192.168.1.199] (216-71-219-44.dyn.novuscom.net. [216.71.219.44]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3283d8d208csm10526105eec.23.2026.08.26.11.53.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Aug 2026 11:53:17 -0700 (PDT) Message-ID: <6c38922a-c733-4444-89ba-cfaf9397a1ea@oss.qualcomm.com> Date: Wed, 26 Aug 2026 11:53:14 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 00/12] single-binary: link ARM and RISC-V into qemu-system From: Pierrick Bouvier To: =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?= , Yonggang Luo Cc: qemu-devel@nongnu.org, Xianglai Li , Alistair Francis , Chinmay Rath , Sunil V L , qemu-riscv@nongnu.org, Alexander Bulekov , Zhao Liu , Eric Farman , Laurent Vivier , Peter Maydell , Chao Liu , Liu Zhiwei , Palmer Dabbelt , Song Gao <17746591750@163.com>, Harsh Prateek Bora , Glenn Miles , Daniel Henrique Barboza , qemu-s390x@nongnu.org, Jiaxun Yang , =?UTF-8?Q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?Q?Alex_Benn=C3=A9e?= , David Hildenbrand , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Igor Mammedov , Aleksandar Rikalo , Nicholas Piggin , Cornelia Huck , Richard Henderson , Ilya Leoshkevich , Fabiano Rosas , Aurelien Jarno , Paolo Bonzini , Ani Sinha , Bibo Mao , =?UTF-8?Q?Marc-Andr=C3=A9_Lureau?= , Matthew Rosato , Weiwei Li , Darren Kenny References: <20260823150731.896-1-luoyonggang@gmail.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: R2iIxTiaf-1Wn-Kk_MNgehC_CqpSngHO X-Authority-Analysis: v=2.4 cv=VdLH+lp9 c=1 sm=1 tr=0 ts=6a8f3620 cx=c_pps a=Oh5Dbbf/trHjhBongsHeRQ==:117 a=iLqgmErQAxjCjdq5jj1Aqg==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=vnREMb7VAAAA:8 a=_OsohoArVhiiuAOQVD4A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=_Vgx9l1VpLgwpw_dHYaR:22 X-Proofpoint-ORIG-GUID: R2iIxTiaf-1Wn-Kk_MNgehC_CqpSngHO X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODI2MDE1OCBTYWx0ZWRfX7lRRAYX3bjSG qebN9Yhp8pIBStEnaiJ+HgiIAZV1PEdzF0UyooG+QW+3rwJcMObGYCk9Y26OV0esxzKa1ezZspM JCDNqWoxG/SG9faM4+7nYT769LbBtx+aGOxYQ3UAlf+0DMdSNAk6haa8cQzaDnP6nw4vAurpE1x hexqLIRZgEt7jA+9BhF638iuALudGOQioqi/Z570sPmhrYyTkHfquQtjKJD5oa/mWeS1BEKJtOp IXVjS1bjWsg2nn+SY/hznrPxlIFHdbrhaqqhuCftv6Ha7fz7J001K8lkp99yWrDKLDw6ss909Fz nOmUKkewoRtNSVJMXLMEQ6cj9K9EXRsu9jgkPv4s1rgLzDpxei6CBcQkr4sMkVgV2nDu6nddBXp 2W/Jnz8o5zUYlCETJyL0JstCKMGj6OhJ0dDgk2FZHg7QuFgn2Y7TNRSxydv7wGAfBCTvTqdZ5Wt OfHxZQr0J0Jg0BOhwxg== X-Proofpoint-Spam-Info: AW1haW4tMjYwODI2MDE1OCBTYWx0ZWRfXx4G42avP0jw4 vVhu1Uoe/BmBATv+18iQM+/iGYjeOsuucjrsc1wQa+3njAf1kJH0pnHlrA7c0+jc6cIgdAAajeG UyqALpvYlRnwobpDzXK3mAKQJwjh3gs= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-26_05,2026-08-26_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 suspectscore=0 malwarescore=0 spamscore=0 phishscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608260158 Received-SPF: pass client-ip=205.220.180.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-riscv@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-riscv-bounces+qemu-riscv=archiver.kernel.org@nongnu.org Sender: qemu-riscv-bounces+qemu-riscv=archiver.kernel.org@nongnu.org On 8/26/2026 11:35 AM, Pierrick Bouvier wrote: > On 8/26/2026 5:32 AM, Daniel P. Berrangé wrote: >> On Sun, Aug 23, 2026 at 11:07:18PM +0800, Yonggang Luo wrote: >> >> snip, >> >> ..to comment just on the end result for now.. >> >>> The last patch builds qemu-system (and qemu-systemw on Windows) from >>> aarch64 common/system objects plus RISC-V arch objects, and installs >>> qemu-system-{arm,aarch64,riscv32,riscv64} as symlinks so argv[0] still >>> selects TargetInfo. >>> >>> Examples: >>> >>> qemu-system -target aarch64 -M virt ... >>> qemu-system-riscv64 -M virt ... >>> >>> A basename that matches no registered token falls through to the unique >>> default. A combined binary with no suffix requires -target when more >>> than one default TargetInfo is registered. >> >> In testing and comparing the new qemu-system-riscv64 symlink >> to qemu-system vs the current standalone qemu-system-riscv64 >> binary there are some significant user visible changes. >> >> The simplest is 'qom-list-types' went from reporting approx >> 770 classes, to reporting approx 1530 classes. IOW, the >> qemu-system-riscv64 binary is now reporting supporting for >> all the classes that were unique to arm. >> >> The '-device help' output similarly shows a great many more >> devices >> >> TL;DR introspecting qemu-system-riscv64 is no longer accurate >> wrt riscv64 capabilities. >> >> This is not suprising, since we register all TypeInfo meaning >> we get all QOM classes present. Some of Pierricks patches try >> to filter places which iterate over classes, but this does not >> have full coverage. >> > > I would add that if you would focus on reviewing and helping for this > filter problem instead of reinventing the wheel for command line, it > would be solved by now. > >> >> I think this is probably also what leads to the increased RAM >> usage in qemu-system-riscv64. Starting >> >> qemu-system-riscv64 -nodefaults -display none -M none >> >> shows an increase in RAM usage from 17.3 to 20.7 MB which >> is about 15% increase. NB this is dirty, private RAM per >> process. The shared RAM pages also increase but that's not >> a concern since they're common to all QEMU processes. >> >> qemu-system-aarch64 shows a much smaller RAM increase, since >> it only grew from 1430 classes to 1530 classes. >> >> We have many more target though, so if we assume the end >> point where every single target is unified, the the union >> of all classes for all targets comes to approx 3600. >> >> My guesstimate is that would mean a memory increase for >> qemu-system-riscv64 from 17.3 to 39.9 MB, which is a >> 72% increase. >> >> In absolute terms this is still modest, but for deployments >> with large VM counts and small RAM sizes, that gets to be >> significant. >> > > How surprising (:eye-roll:) it is that adding more code and more classes > would result in a higher memory usage, or bigger binary size for > qemu-system. > > More seriously. If someone is concerned about it, the simple solution is > to restrict list of targets and/or Kconfig to include less. > >> >> None of this means single binary is a bad idea. >> >> >> My main takeaway is that we're creating uneccessary work >> for ourselves by trying to make 'qemu-sytem' identical >> in behaviour to qemu-system-$TARGET. >> >> The complex filtering patches / QOM interfaces that I >> found uncomfortable in Pierrick's base series are largely >> around the filtering needed to simulate qemu-system-$TARGET, >> and they're still incomplete. I don't have high confidence >> in our ability to avoid regressions if we go route this >> route. >> >> >> IMHO we should make a clean break with the past. Leave >> the existing qemu-system-$TARGET binaries being built >> from the same pieces they are today, such that there >> is better confidence that we are not making behavioural >> changes to them. >> > > Funny enough, it reminded me word for word of a blog post from a > Microsoft employee where he explained that powershell existed only > because young developers were scared to modify original cmd shell. > > Regression issues are solved with testing and good design, not by > inventing new things. > >> >> qemu-system should be built alongside qemu-system-$TARGET >> and offer new semantics where it is documented as exposing >> everything from all targets whenever introspected and does >> not apply target type or target Kconfig filtering to inputs/ >> outputs. >> >> We still get the benefit of only building most .o files >> once, so keeping qemu-system-$TARGET is only a small >> overhead in the final step of linking everything together. >> >> >> qemu-system will still have the increased memory overhead >> but that's fine as qemu-system-$TARGET will be unaffected. >> We can tackle the memory overhead of qemu-system at our >> leisure through use of loadable modules, and thus not have >> that as a task to think about today. >> >> >> With the clean break with the past, we also have the >> ability to tackle various long standing design mistakes >> present in qemu-system-$TARGET instead of carrying them >> over into the new binary. >> >> Specifically >> >> * -nodefaults should become the default >> >> * All CLI args should be processed in order from >> the command line, so we eliminate the nonsense >> where we process some -object, then -chardev, >> then more -object through hand crafted deps >> >> * No default machine type >> >> * Drop all legacy syntax so we only have a single >> QAPI based way of configuring. >> eg drop -hda, -hdb, -cdrom, -drive, etc >> only keeping -blockdev >> eg drop -mon, -monitor, -qmp, etc only >> keeping -object >> >> We don't have to do all that straightaway. If we declare >> qemu-system "experimental" initially we can iterate on >> that intentionally breaking compat in releases, without >> any impact on qemu-system-$TARGET. >> >> Avoiding the back compat task will give us more flexibility >> with the follow on work when people come to create new >> machine types with heterogenous CPU targets. >> > > Seems like the Genius.Artist. in the bottle just need to escape, and you > can send us a nice series doing all this. Meanwhile, I'll try to find a > carpet, a monkey, a princess and a suit to be the next Aladdin. > I was wondering why my brain connected with this, but watching "A whole new world" video clip and lyrics made it obvious. https://www.youtube.com/watch?v=EXTLJmYsaUQ&list=RDEXTLJmYsaUQ&start_radio=1 Now, we definitely need an AI generated version for heterogeneous emulation :) >> >> With regards, >> Daniel > > Regards, > Pierrick