[{"id":3673359,"web_url":"http://patchwork.ozlabs.org/comment/3673359/","msgid":"<1c6d7e6f-eb16-4820-a4c2-35767c8db919@linaro.org>","list_archive_url":null,"date":"2026-04-04T01:01:33","subject":"Re: [RFC PATCH 3/4] alpha: Replace helper_set_alarm with Typhoon\n Cchip MMIO register","submitter":{"id":72104,"url":"http://patchwork.ozlabs.org/api/people/72104/","name":"Richard Henderson","email":"richard.henderson@linaro.org"},"content":"On 4/2/26 03:04, Yodel Eldar wrote:\n> From: Yodel Eldar <yodel.eldar@yodel.dev>\n> \n> This commit creates a QEMU-specific (non-standard) MMIO register\n> in Typhoon's Cchip to replace helper_set_alarm() and to move\n> the QEMUTimer pointer, alarm_timer, out of the Alpha CPU and into\n> the chipset code.\n> \n> Currently, PALcode writes to the QEMU-specific, synthetic\n> Processor Register (index 251) and triggers the invocation of\n> helper_set_alarm() as a side effect in QEMU, thereby setting\n> the timer alarm expiration value.\n> \n> This works, because the AlphaCPU contains the QEMUTimer and\n> CPUAlphaState stores the alarm expiration value; however, the timer\n> alarm callback resides in and is specific to the Typhoon chipset,\n> thus the CPU and the chipset are entangled.\n> \n> By designating the currently unused offset (0x7c0) of Cchip as the\n> location of the timer alarm expiration, we can disentangle and\n> better encapsulate both.\n> \n> Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org>\n> Signed-off-by: Yodel Eldar <yodel.eldar@yodel.dev>\n> ---\n> \n> Notes:\n>      The patch to the palcode-clipper binary that follows this\n>      one is necessary for this patch to work; I've left the\n>      diff to the source in the notes of it for reproduction.\n>      \n>      Philippe:\n>      Thanks, again, for the suggestion of decoupling the CPU from\n>      the Typhoon using IRQ lines. In my response, I guessed that\n>      getting the CPU index would be trickier than moving the timer\n>      into TyphoonState; perhaps you'll find it amusing (as I do)\n>      that it appears I had that backwards (due to the PALcode\n>      peculiarity)!\n>      \n>      The remaining CPU interrupts will be refactored in v2 of that\n>      series.\n\nI'm not keen on this.  I would much rather keep the synthetic processor register than add \na synthetic CChip mmio.\n\nIn any case, this is also doing more than one thing at a time. For instance, Connecting \nthe irq on typhoon to the irq on the cpu does not depend on anything else.\n\n\nr~","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=N3Gb3k4y;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fnckZ13FGz1yCs\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 04 Apr 2026 12:02:14 +1100 (AEDT)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1w8pOS-0002lh-SP; Fri, 03 Apr 2026 21:01:44 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>)\n id 1w8pOR-0002lS-FK\n for qemu-devel@nongnu.org; Fri, 03 Apr 2026 21:01:43 -0400","from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>)\n id 1w8pOP-0004TL-63\n for qemu-devel@nongnu.org; Fri, 03 Apr 2026 21:01:42 -0400","by mail-pj1-x102a.google.com with SMTP id\n 98e67ed59e1d1-35c238f1063so1418991a91.1\n for <qemu-devel@nongnu.org>; Fri, 03 Apr 2026 18:01:40 -0700 (PDT)","from [192.168.1.105] (124-150-69-109.tpgi.com.au. [124.150.69.109])\n by smtp.gmail.com with ESMTPSA id\n d9443c01a7336-2b27472ddd0sm71177605ad.4.2026.04.03.18.01.37\n (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n Fri, 03 Apr 2026 18:01:38 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1775264500; x=1775869300; darn=nongnu.org;\n h=content-transfer-encoding:in-reply-to:content-language:from\n :references:cc:to:subject:user-agent:mime-version:date:message-id\n :from:to:cc:subject:date:message-id:reply-to;\n bh=wgf9366UHbIBzJJ6UfeLJRUiuBgwR1WTaaZGYTx+aXQ=;\n b=N3Gb3k4yTLc14BBfKAaF2igA/QGsyPTPjrN4j3Zd/nXB8tM1FVWuBX2i+G3vYgOhi/\n 98/BDboRDV5fuLordFADu5IwJvZ97QsS4v9Cpe/KyHP3xS9Gj7bjQNCnC/y1+Wf3SlUF\n 2X204CxiEvjyuhy6mrYMlYjqdGQPV90mf8AytoDxA+JLV3nfBRiR6raGw5tfURj/ISUs\n PeYDwhdj340d6qbntAhfTu52YVtb6UGSIhZE85p0H3xD0X++tUydL4WK+CElbckmF4IZ\n fJGOHVHlkBl/U9cm7VWzJ4tZSszxhHGl17lW7Hp74Ma20ddmY3b13vLHyQ6uNhhtwibm\n gdHw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775264500; x=1775869300;\n h=content-transfer-encoding:in-reply-to:content-language:from\n :references:cc:to:subject:user-agent:mime-version:date:message-id\n :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id\n :reply-to;\n bh=wgf9366UHbIBzJJ6UfeLJRUiuBgwR1WTaaZGYTx+aXQ=;\n b=M4mn5RS8qki3uoLphSyZhUm4yYPoYK8nqeMf2CE7MN2knX8MllOC+8M55GA4m+Qxjh\n v7CPEqiNzyC6KXJUbC86u7HNn8jg3NGE/zxs8GRGPczqGprtOEFW5e8wZySad+JLzaAh\n R8wz/ZXt/Nxnu62Mv+yc1gdMq/Wvu0pQ9MBBt4dRBrUcrHwcTn+mgWgh02PFX9UA3jga\n N6Ab6CtPBnd9DnOPXdMLnhkwlkcmkIfKNGaZ+Y+KN2Zs2V4muQkpzoI89R0y23I21zAu\n iSs3JPsDnf4VrmE7ikTGOXpX0OI1EZP0m/f1GRFjn2Pm2flDw7Yka1ZW+Eq1dD5QvHUk\n HDQQ==","X-Forwarded-Encrypted":"i=1;\n AJvYcCWc2p3s40NgwHa1Wjv73cVGaIYZeQcSy80sfv9JqIqxl49o3aGket/3VWyhp3SLcxfrbrZ4II8l/jIF@nongnu.org","X-Gm-Message-State":"AOJu0YznmpTi+ZWtJ9NOqwmCx/u+vzBgNcemz6PkPR+MjofZJ4/a+caM\n zl9He/gb1g/9w3SbqLueWXzj8H4SztXpookCFGgl2qiooo5QhOzBfeQafCVG081hNmzPhop9v9/\n JhmpH32w=","X-Gm-Gg":"AeBDieuSodUEsTP6eyNMv0p9mCtOE37DxfL/iCf4BR2GAXPRfqjxkhOypnnTmlxrAtv\n CSnmjQ9a9RvIJbR8XYP246FS/qXEUn1Uv90dqEZtXUCm4R/jgyXttGrw+vcFdy0gVc6Mk5hnZ5V\n j7QhG4E1TU17OPUjQimbbySZlvbT4h77DbYfVZh6hQWNEL54P1B7bTCv1MzvhiTgKlKVv0oUKtg\n TCkMB7ve+MxiF7A8O3Mpr2UBfcUk1x5VXWoULLjbix9lOGdRpyO1jo2tLWlcLUumbpxUaBtl936\n ov7roz8s7F7tsa8X1O+RFHtJW7GygAEeg97FeGJZWLgzIK0y86yvz/aJbvXsevdjyNKASkbCVmM\n xuY5Z3rUmZIv9HxajP6Qt48CSyLbaLGx94a1nb1K2OK5/CpMxUXGw1mDXnUhJyYq2b1hGhnPovY\n VQJG0wS6ksYsiECTvMYf5T4wwF0WjNjs//6A2mk3Vc2L2RD/NF/4tAMK5p4GFjjhZypJs=","X-Received":"by 2002:a17:902:c950:b0:2b0:afbe:4e1a with SMTP id\n d9443c01a7336-2b2818fd42dmr51094465ad.41.1775264499476;\n Fri, 03 Apr 2026 18:01:39 -0700 (PDT)","Message-ID":"<1c6d7e6f-eb16-4820-a4c2-35767c8db919@linaro.org>","Date":"Sat, 4 Apr 2026 11:01:33 +1000","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [RFC PATCH 3/4] alpha: Replace helper_set_alarm with Typhoon\n Cchip MMIO register","To":"Yodel Eldar <yodel.eldar@yodel.dev>, qemu-devel@nongnu.org","Cc":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>","References":"<20260401170454.32045-1-yodel.eldar@yodel.dev>\n <20260401170454.32045-4-yodel.eldar@yodel.dev>","From":"Richard Henderson <richard.henderson@linaro.org>","Content-Language":"en-US","In-Reply-To":"<20260401170454.32045-4-yodel.eldar@yodel.dev>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","Received-SPF":"pass client-ip=2607:f8b0:4864:20::102a;\n envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102a.google.com","X-Spam_score_int":"-20","X-Spam_score":"-2.1","X-Spam_bar":"--","X-Spam_report":"(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"}},{"id":3673513,"web_url":"http://patchwork.ozlabs.org/comment/3673513/","msgid":"<0f822f37-de4a-44d3-81dc-61f9caee0403@yodel.dev>","list_archive_url":null,"date":"2026-04-04T23:32:34","subject":"Re: [RFC PATCH 3/4] alpha: Replace helper_set_alarm with Typhoon\n Cchip MMIO register","submitter":{"id":92094,"url":"http://patchwork.ozlabs.org/api/people/92094/","name":"Yodel Eldar","email":"yodel.eldar@yodel.dev"},"content":"On 03/04/2026 20:01, Richard Henderson wrote:\n> On 4/2/26 03:04, Yodel Eldar wrote:\n>> From: Yodel Eldar <yodel.eldar@yodel.dev>\n>>\n>> This commit creates a QEMU-specific (non-standard) MMIO register\n>> in Typhoon's Cchip to replace helper_set_alarm() and to move\n>> the QEMUTimer pointer, alarm_timer, out of the Alpha CPU and into\n>> the chipset code.\n>>\n>> Currently, PALcode writes to the QEMU-specific, synthetic\n>> Processor Register (index 251) and triggers the invocation of\n>> helper_set_alarm() as a side effect in QEMU, thereby setting\n>> the timer alarm expiration value.\n>>\n>> This works, because the AlphaCPU contains the QEMUTimer and\n>> CPUAlphaState stores the alarm expiration value; however, the timer\n>> alarm callback resides in and is specific to the Typhoon chipset,\n>> thus the CPU and the chipset are entangled.\n>>\n>> By designating the currently unused offset (0x7c0) of Cchip as the\n>> location of the timer alarm expiration, we can disentangle and\n>> better encapsulate both.\n>>\n>> Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org>\n>> Signed-off-by: Yodel Eldar <yodel.eldar@yodel.dev>\n>> ---\n>>\n>> Notes:\n>>      The patch to the palcode-clipper binary that follows this\n>>      one is necessary for this patch to work; I've left the\n>>      diff to the source in the notes of it for reproduction.\n>>      Philippe:\n>>      Thanks, again, for the suggestion of decoupling the CPU from\n>>      the Typhoon using IRQ lines. In my response, I guessed that\n>>      getting the CPU index would be trickier than moving the timer\n>>      into TyphoonState; perhaps you'll find it amusing (as I do)\n>>      that it appears I had that backwards (due to the PALcode\n>>      peculiarity)!\n>>      The remaining CPU interrupts will be refactored in v2 of that\n>>      series.\n> \n> I'm not keen on this.  I would much rather keep the synthetic processor \n> register than add a synthetic CChip mmio.\n> \n\nNo problem... Are we okay with exposing a typhoon timer helper\nand TyphoonState to target/alpha/sys_helper.c via the inclusion\nof hw/alpha/alpha_sys.h?\n\nIf so, we can add an opaque pointer parameter to helper_set_alarm\ncarrying the TyphoonState and invoke the typhoon timer helper;\ne.g.:\n\n/* Inside target/alpha/sys_helper.c */\n#include \"hw/alpha/alpha_sys.h\"\n\nvoid helper_set_alarm(CPUAlphaState *env, uint64_t expire, void *opaque)\n{\n     CPUState *cs = env_cpu(env);\n     TyphoonState *s = TYPHOON_PCI_HOST_BRIDGE(opaque);\n     int cpu_index = cs->cpu_index & 3;\n\n     if (expire) {\n         env->alarm_expire = expire;\n         typhoon_timer_mod(s, cpu_index, expire);\n     } else {\n         typhoon_timer_del(s, cpu_index);\n     }\n\n}\n\nWe'd have to keep alarm_expire in CPUAlphaState, because\npalcode-clipper would still expect it, but alarm timers would\nbe moved into the typhoon as an array indexed by cpu_index.\n\nWDYT?\n\n> In any case, this is also doing more than one thing at a time. For \n> instance, Connecting the irq on typhoon to the irq on the cpu does not \n> depend on anything else.\n> \n\nThanks for the example; I'll split it next time.\n\nThanks again,\nYodel\n\n> \n> r~\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=yodel.dev header.i=@yodel.dev header.a=rsa-sha256\n header.s=rsa2048 header.b=i1RFT8qd;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fpBjm51CKz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 05 Apr 2026 09:33:32 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1w9ATw-0005ke-BA; Sat, 04 Apr 2026 19:32:48 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1)\n (envelope-from <bounce+0e9322.97607e-qemu-devel=nongnu.org@yodel.dev>)\n id 1w9ATv-0005kW-0C\n for qemu-devel@nongnu.org; Sat, 04 Apr 2026 19:32:47 -0400","from v512.v5f06b487.use4.send.mailgun.net ([143.55.232.12])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1)\n (envelope-from <bounce+0e9322.97607e-qemu-devel=nongnu.org@yodel.dev>)\n id 1w9ATt-0006Es-5M\n for qemu-devel@nongnu.org; Sat, 04 Apr 2026 19:32:46 -0400","from mail.yodel.dev (mail.yodel.dev [35.209.39.246]) by\n 3e36628bed354508f55fe2c38d478cff2044cf0a55f8acc5e152bbfd8f8dafea with SMTP id\n 69d19f93f2f7fa4308868d1b; Sat, 04 Apr 2026 23:32:35 GMT"],"X-Mailgun-Sid":"WyI4ZDFlNiIsInFlbXUtZGV2ZWxAbm9uZ251Lm9yZyIsIjk3NjA3ZSJd","X-Mailgun-Sending-Ip":"143.55.232.12","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=yodel.dev;\n s=rsa2048; t=1775345554;\n bh=Uwg9PvySCOemqSHr19GMagVaGrk0TQyaiUytsw6K7CI=;\n h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:\n X-Mailgun-Dkim:From:In-Reply-To:Content-Type:\n Content-Transfer-Encoding:From:Reply-to:Subject:Date:Message-id:To:\n Cc:Mime-version:Content-type:Content-transfer-encoding:In-reply-to:\n References;\n b=i1RFT8qdsGceJXZvSCBe+dckM/i8pZm9JOU5MU8wwU6EDDFi7Jcuhofk6OYOm8rWg\n zgvaxR5B6UcRW7xSxt8sylM6B23UoylaX0jtiHPf93suhBlJQFdZqws3UvtM1LQNa8\n TsjZ80Fh5mWMMcXGVRyW0F3CkBk42MO8hLljCE/k+LMmx/WG5DwhNs1exi+8b/03d2\n InJTPz1yiYkuEFF3F230h1tNt2aPxQjwg+I2/ozwAhTpnL1GDSalO73BD/py/TQyOO\n bvmMmbfNzgU6anY8+H5xJZyLD5Evnr8oEpq5UI72GmTL6lqqkF30cu7aQuQhpysgTR\n nk/cvCylDUz8Q==","Message-ID":"<0f822f37-de4a-44d3-81dc-61f9caee0403@yodel.dev>","Date":"Sat, 4 Apr 2026 18:32:34 -0500","MIME-Version":"1.0","Subject":"Re: [RFC PATCH 3/4] alpha: Replace helper_set_alarm with Typhoon\n Cchip MMIO register","To":"Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org","Cc":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>","References":"<20260401170454.32045-1-yodel.eldar@yodel.dev>\n <20260401170454.32045-4-yodel.eldar@yodel.dev>\n <1c6d7e6f-eb16-4820-a4c2-35767c8db919@linaro.org>","Content-Language":"en-US","X-Mailgun-Dkim":["no","no"],"From":"Yodel Eldar <yodel.eldar@yodel.dev>","Autocrypt":"addr=yodel.eldar@yodel.dev; keydata=\n xjMEZxqXdhYJKwYBBAHaRw8BAQdAkletQdG3CLyANZyuf2t7Z9PK4b6HiT+DdSPUB2mHzmPN\n I1lvZGVsIEVsZGFyIDx5b2RlbC5lbGRhckB5b2RlbC5kZXY+wpkEExYKAEECGwMFCQOcG00F\n CwkIBwIGFQoJCAsCBBYCAwECHgECF4AWIQTTzRjNQG27imap+N+V7k+3NmVNrAUCaNWASwIZ\n AQAKCRCV7k+3NmVNrNnSAPoDjQXa6v7ZzdQSaLdRfAQy/5SsUucv+zp3WAP4pXdgJQEAzMMC\n Ctx4l6b13Fs2hZdRXEnF/4BZ9t1K68nwzZOV3QnOOARnGpd2EgorBgEEAZdVAQUBAQdAKPIy\n 3W/DKFsm1e+31zoqmOY0pqz8vjIM846wM6lEY2QDAQgHwn4EGBYIACYCGwwWIQTTzRjNQG27\n imap+N+V7k+3NmVNrAUCaNWG7QUJA5wi9wAKCRCV7k+3NmVNrPusAQCQDQwETy7VT6UhHPho\n TkrQnsNqQfFU3tXqCTiViToktQD7B/U2/to97hQIJCWbK6yd3T+KPZJPMcHMg2XRyedUvgA=","In-Reply-To":"<1c6d7e6f-eb16-4820-a4c2-35767c8db919@linaro.org>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","Received-SPF":"pass client-ip=143.55.232.12;\n envelope-from=bounce+0e9322.97607e-qemu-devel=nongnu.org@yodel.dev;\n helo=v512.v5f06b487.use4.send.mailgun.net","X-Spam_score_int":"-20","X-Spam_score":"-2.1","X-Spam_bar":"--","X-Spam_report":"(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n HELO_STATIC_HOST=-0.001, RCVD_IN_MSPIKE_H2=0.001,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,\n SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"}},{"id":3673611,"web_url":"http://patchwork.ozlabs.org/comment/3673611/","msgid":"<b23cc492-6a78-456c-a97e-b935b9277b34@linaro.org>","list_archive_url":null,"date":"2026-04-05T22:59:24","subject":"Re: [RFC PATCH 3/4] alpha: Replace helper_set_alarm with Typhoon\n Cchip MMIO register","submitter":{"id":72104,"url":"http://patchwork.ozlabs.org/api/people/72104/","name":"Richard Henderson","email":"richard.henderson@linaro.org"},"content":"On 4/5/26 09:32, Yodel Eldar wrote:\n> On 03/04/2026 20:01, Richard Henderson wrote:\n>> On 4/2/26 03:04, Yodel Eldar wrote:\n>>> From: Yodel Eldar <yodel.eldar@yodel.dev>\n>>>\n>>> This commit creates a QEMU-specific (non-standard) MMIO register\n>>> in Typhoon's Cchip to replace helper_set_alarm() and to move\n>>> the QEMUTimer pointer, alarm_timer, out of the Alpha CPU and into\n>>> the chipset code.\n>>>\n>>> Currently, PALcode writes to the QEMU-specific, synthetic\n>>> Processor Register (index 251) and triggers the invocation of\n>>> helper_set_alarm() as a side effect in QEMU, thereby setting\n>>> the timer alarm expiration value.\n>>>\n>>> This works, because the AlphaCPU contains the QEMUTimer and\n>>> CPUAlphaState stores the alarm expiration value; however, the timer\n>>> alarm callback resides in and is specific to the Typhoon chipset,\n>>> thus the CPU and the chipset are entangled.\n>>>\n>>> By designating the currently unused offset (0x7c0) of Cchip as the\n>>> location of the timer alarm expiration, we can disentangle and\n>>> better encapsulate both.\n>>>\n>>> Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org>\n>>> Signed-off-by: Yodel Eldar <yodel.eldar@yodel.dev>\n>>> ---\n>>>\n>>> Notes:\n>>>      The patch to the palcode-clipper binary that follows this\n>>>      one is necessary for this patch to work; I've left the\n>>>      diff to the source in the notes of it for reproduction.\n>>>      Philippe:\n>>>      Thanks, again, for the suggestion of decoupling the CPU from\n>>>      the Typhoon using IRQ lines. In my response, I guessed that\n>>>      getting the CPU index would be trickier than moving the timer\n>>>      into TyphoonState; perhaps you'll find it amusing (as I do)\n>>>      that it appears I had that backwards (due to the PALcode\n>>>      peculiarity)!\n>>>      The remaining CPU interrupts will be refactored in v2 of that\n>>>      series.\n>>\n>> I'm not keen on this.  I would much rather keep the synthetic processor register than \n>> add a synthetic CChip mmio.\n>>\n> \n> No problem... Are we okay with exposing a typhoon timer helper\n> and TyphoonState to target/alpha/sys_helper.c via the inclusion\n> of hw/alpha/alpha_sys.h?\n> \n> If so, we can add an opaque pointer parameter to helper_set_alarm\n> carrying the TyphoonState and invoke the typhoon timer helper;\n> e.g.:\n> \n> /* Inside target/alpha/sys_helper.c */\n> #include \"hw/alpha/alpha_sys.h\"\n> \n> void helper_set_alarm(CPUAlphaState *env, uint64_t expire, void *opaque)\n> {\n>      CPUState *cs = env_cpu(env);\n>      TyphoonState *s = TYPHOON_PCI_HOST_BRIDGE(opaque);\n>      int cpu_index = cs->cpu_index & 3;\n> \n>      if (expire) {\n>          env->alarm_expire = expire;\n>          typhoon_timer_mod(s, cpu_index, expire);\n>      } else {\n>          typhoon_timer_del(s, cpu_index);\n>      }\n> \n> }\n> \n> We'd have to keep alarm_expire in CPUAlphaState, because\n> palcode-clipper would still expect it, but alarm timers would\n> be moved into the typhoon as an array indexed by cpu_index.\n> \n> WDYT?\n\nI don't understand why you want to move the QEMUTimer.  What do we gain by preventing the \ncpu from accessing the QEMUTimer?\n\n\nr~","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=X0PAjsYH;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fpnx408WZz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 06 Apr 2026 09:00:22 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1w9WRO-0002Ai-CR; Sun, 05 Apr 2026 18:59:39 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>)\n id 1w9WRM-0002AY-Hc\n for qemu-devel@nongnu.org; Sun, 05 Apr 2026 18:59:36 -0400","from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>)\n id 1w9WRK-0007zt-Nr\n for qemu-devel@nongnu.org; Sun, 05 Apr 2026 18:59:36 -0400","by mail-pg1-x533.google.com with SMTP id\n 41be03b00d2f7-c76cce85bd9so1098233a12.1\n for <qemu-devel@nongnu.org>; Sun, 05 Apr 2026 15:59:32 -0700 (PDT)","from [192.168.1.105] (124-150-69-109.tpgi.com.au. [124.150.69.109])\n by smtp.gmail.com with ESMTPSA id\n d2e1a72fcca58-82cf9c6ad8asm12345723b3a.40.2026.04.05.15.59.28\n (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n Sun, 05 Apr 2026 15:59:30 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1775429971; x=1776034771; darn=nongnu.org;\n h=content-transfer-encoding:in-reply-to:content-language:from\n :references:cc:to:subject:user-agent:mime-version:date:message-id\n :from:to:cc:subject:date:message-id:reply-to;\n bh=CEjO6cA0xH1DV8M9V2QCUTnh13QATmp0HWimZlUlaBU=;\n b=X0PAjsYHBiTlJDgU0APo1kJqTZGJjOoH1nkIItmiuZ4u7OpF/nM/Ibmd13hjk/WSgc\n ad7ZdxsF+MPxwmePBh3LXwhk8ax5cxL1sGVGtiQFV/OXvhbx92UtOVaSX9xAZjiX55SP\n DqEsTnjuJ6+aHtsDRr6zlaecitDrrUgoz9YODK4eW815cpjsWtdoW+CmV8gpvAWnNBQm\n EZsAiSIRiWovxGNOVMqeqnh0zo7M2YmaDBRIFlGgrq3EPd3gICQV4qPyNIMhUkuZjcfP\n FzqMODtgRH47IgizmON7dg/m7bG3eNeX5wXuvu7ngPsMlccoBxsN46Hwn+ZyWKOXU9zz\n M2Xw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775429971; x=1776034771;\n h=content-transfer-encoding:in-reply-to:content-language:from\n :references:cc:to:subject:user-agent:mime-version:date:message-id\n :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id\n :reply-to;\n bh=CEjO6cA0xH1DV8M9V2QCUTnh13QATmp0HWimZlUlaBU=;\n b=ZYznXfDnD5GNOJJ0+XoE29Hy78vbxSZoILPZF4ZxlMJi0zverTVVd8+GIEe8XcPxFC\n 1apYd9D2iKAd1ZTtZVCE2JHsZ5W8ZzuKLeD1yXbmGvEixg9IueB//FqXfLhamwLZ5Bqt\n q7A0ZvpEfY0A65c4zTH+ME7FMjMG9hViU6+yxrDo96JEoFKe/ANgdphne/dWlV9K4s4Z\n eLFCPydhSwegkKP8pmRiBu0dxsAl+fYZNAXFjpbNBteTpgnJKKlrsIMJ6iROESibWPGw\n sHLc9oDeGJmrB12X0owpUItlmbOLCIPUt6SUgW2aTZeympb4IbKGb0K3F/2ROeyK1bOE\n zagg==","X-Forwarded-Encrypted":"i=1;\n AJvYcCWituWCbuDFMZ+eLTeiajavUZ5kDUGjVYFMBsZLjauO/abRk2Vs6se5k1FMKfW51l3ElCZR1G6t+Se2@nongnu.org","X-Gm-Message-State":"AOJu0YyWi8kUafl8IPpKRuYzresdR5+YTINp/0+Icf2WpkiZnoQkptvV\n xd8JfWZoj/81sgHARLZwNssZqflnk5UfY1ZLunLoC68fpnD4ay10PhorsjfXC5G4SL3fB41LUpr\n jgUrR","X-Gm-Gg":"AeBDievqx6svdP6tSelJfaNMLA4OCvUZZ/wiUFJHECBBVRMTXWcFaRJ+MZBBGppA6sk\n SzszryOD4K3lFRXq+hKsA/r9JQ77eLl/Y6wBb+8mNTWkKNjxApIvjlyCfPG88bWt067rqWF5IZw\n oEs9sVyvwNKLXsgpUoIwyYMAweW2Ah9vpDEXmLukXIK68VFnkFhB1bBvZJcNPRULPuzu5c3mgyH\n bEORLdw1AxxWe+yWzBVivaX0DBIDOOrgIrhxMgB4Ehx9rROhvBxO1n++V5akGTWqNcLLgjMJ/2A\n E8cDsNwTjdnlO21TnDtxo36mNVP+6yLUpWOgTs2dALFcZUFpeuZnXDEFGgKqtpe030HQWrV8eZt\n sjdgIf2MmI8cY+rE7FApKz6EkVESTCl9YFmXqib/dKU7x1qngbO3Vp4nlKLfy16NS2SahX3diO9\n 1lW+5MAeVcGSBcdJRKY6hl4NaXCvND4FYjRiDZoLhKsXUCTdq3IgigxaSqeUc7sgEX8XilR6XEZ\n cBKWQ==","X-Received":"by 2002:a05:6a00:414b:b0:82c:d8c3:6983 with SMTP id\n d2e1a72fcca58-82d0dbcfdd5mr10297216b3a.51.1775429971213;\n Sun, 05 Apr 2026 15:59:31 -0700 (PDT)","Message-ID":"<b23cc492-6a78-456c-a97e-b935b9277b34@linaro.org>","Date":"Mon, 6 Apr 2026 08:59:24 +1000","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [RFC PATCH 3/4] alpha: Replace helper_set_alarm with Typhoon\n Cchip MMIO register","To":"Yodel Eldar <yodel.eldar@yodel.dev>, qemu-devel@nongnu.org","Cc":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>","References":"<20260401170454.32045-1-yodel.eldar@yodel.dev>\n <20260401170454.32045-4-yodel.eldar@yodel.dev>\n <1c6d7e6f-eb16-4820-a4c2-35767c8db919@linaro.org>\n <0f822f37-de4a-44d3-81dc-61f9caee0403@yodel.dev>","From":"Richard Henderson <richard.henderson@linaro.org>","Content-Language":"en-US","In-Reply-To":"<0f822f37-de4a-44d3-81dc-61f9caee0403@yodel.dev>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","Received-SPF":"pass client-ip=2607:f8b0:4864:20::533;\n envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x533.google.com","X-Spam_score_int":"-20","X-Spam_score":"-2.1","X-Spam_bar":"--","X-Spam_report":"(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"}},{"id":3673615,"web_url":"http://patchwork.ozlabs.org/comment/3673615/","msgid":"<cb70f613-9c41-42e8-9ffb-e57e3db7248f@yodel.dev>","list_archive_url":null,"date":"2026-04-05T23:19:30","subject":"Re: [RFC PATCH 3/4] alpha: Replace helper_set_alarm with Typhoon\n Cchip MMIO register","submitter":{"id":92094,"url":"http://patchwork.ozlabs.org/api/people/92094/","name":"Yodel Eldar","email":"yodel.eldar@yodel.dev"},"content":"On 04/04/2026 18:32, Yodel Eldar wrote:\n> On 03/04/2026 20:01, Richard Henderson wrote:\n>> On 4/2/26 03:04, Yodel Eldar wrote:\n>>> From: Yodel Eldar <yodel.eldar@yodel.dev>\n>>>\n>>> This commit creates a QEMU-specific (non-standard) MMIO register\n>>> in Typhoon's Cchip to replace helper_set_alarm() and to move\n>>> the QEMUTimer pointer, alarm_timer, out of the Alpha CPU and into\n>>> the chipset code.\n>>>\n>>> Currently, PALcode writes to the QEMU-specific, synthetic\n>>> Processor Register (index 251) and triggers the invocation of\n>>> helper_set_alarm() as a side effect in QEMU, thereby setting\n>>> the timer alarm expiration value.\n>>>\n>>> This works, because the AlphaCPU contains the QEMUTimer and\n>>> CPUAlphaState stores the alarm expiration value; however, the timer\n>>> alarm callback resides in and is specific to the Typhoon chipset,\n>>> thus the CPU and the chipset are entangled.\n>>>\n>>> By designating the currently unused offset (0x7c0) of Cchip as the\n>>> location of the timer alarm expiration, we can disentangle and\n>>> better encapsulate both.\n>>>\n>>> Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org>\n>>> Signed-off-by: Yodel Eldar <yodel.eldar@yodel.dev>\n>>> ---\n>>>\n>>> Notes:\n>>>      The patch to the palcode-clipper binary that follows this\n>>>      one is necessary for this patch to work; I've left the\n>>>      diff to the source in the notes of it for reproduction.\n>>>      Philippe:\n>>>      Thanks, again, for the suggestion of decoupling the CPU from\n>>>      the Typhoon using IRQ lines. In my response, I guessed that\n>>>      getting the CPU index would be trickier than moving the timer\n>>>      into TyphoonState; perhaps you'll find it amusing (as I do)\n>>>      that it appears I had that backwards (due to the PALcode\n>>>      peculiarity)!\n>>>      The remaining CPU interrupts will be refactored in v2 of that\n>>>      series.\n>>\n>> I'm not keen on this.  I would much rather keep the synthetic \n>> processor register than add a synthetic CChip mmio.\n>>\n> \n> No problem... Are we okay with exposing a typhoon timer helper\n> and TyphoonState to target/alpha/sys_helper.c via the inclusion\n> of hw/alpha/alpha_sys.h?\n> \n> If so, we can add an opaque pointer parameter to helper_set_alarm\n> carrying the TyphoonState and invoke the typhoon timer helper;\n> e.g.:\n> \n> /* Inside target/alpha/sys_helper.c */\n> #include \"hw/alpha/alpha_sys.h\"\n> \n> void helper_set_alarm(CPUAlphaState *env, uint64_t expire, void *opaque)\n> {\n>      CPUState *cs = env_cpu(env);\n>      TyphoonState *s = TYPHOON_PCI_HOST_BRIDGE(opaque);\n>      int cpu_index = cs->cpu_index & 3;\n> \n>      if (expire) {\n>          env->alarm_expire = expire;\n>          typhoon_timer_mod(s, cpu_index, expire);\n>      } else {\n>          typhoon_timer_del(s, cpu_index);\n>      }\n> \n> }\n> \n\nHmm, on second thought, I'm not sure this is doable\nwithout setting a link property between CPU and\nTyphoon, and if we're relegated to that than\nadding the link property in Typhoon's instance_init\n(as in in Patch 8 of \"QOMify Clipper and Typhoon\" [1])\nto use them in Typhoon's realize to create the timers\nis preferable over using them in TCG helper/translate.\n\nThe MMIO approach may be the only way to achieve\nencapsulation here, but it adds complexity and is\nprobably not as performant than using a process\nregister, so I understand the pushback against it.\n\nLet's set aside the MMIO patch; I'll integrate the\nMemTxAttrs patch (to eliminate current_cpu from the\nMISC register read) into the larger QOMify series and\nreplace all occurrences of cpu_{,reset_}interrupt with\nIRQ lines, but leave the alarm timers in the CPU. Since\nthe callback for the timer alarm belongs to Typhoon,\nthe Cchip will for the time being continue to have a\nreference to the CPUs (though, I'll continue to think\nabout gentler ways of eliminating them).\n\nPhilippe: I hope two out of three nexuses will be\nenough for now?\n\nRichard: Thanks for taking the time to check this out\nand for the feedback; I'll incorporate it into v2.\n\n[1] <20260310-qomify-alpha-v1-8-4375b00a85ff@yodel.dev>\n\nThanks,\nYodel\n\n> We'd have to keep alarm_expire in CPUAlphaState, because\n> palcode-clipper would still expect it, but alarm timers would\n> be moved into the typhoon as an array indexed by cpu_index.\n> \n> WDYT?\n> \n>> In any case, this is also doing more than one thing at a time. For \n>> instance, Connecting the irq on typhoon to the irq on the cpu does not \n>> depend on anything else.\n>>\n> \n> Thanks for the example; I'll split it next time.\n> \n> Thanks again,\n> Yodel\n> \n>>\n>> r~\n>>\n> \n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=yodel.dev header.i=@yodel.dev header.a=rsa-sha256\n header.s=rsa2048 header.b=skvrIIGl;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fppN73Nrtz1xy1\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 06 Apr 2026 09:20:23 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1w9Wkr-0001If-FX; Sun, 05 Apr 2026 19:19:45 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1)\n (envelope-from <bounce+0e9322.97607e-qemu-devel=nongnu.org@yodel.dev>)\n id 1w9Wkl-0001H4-Lh\n for qemu-devel@nongnu.org; Sun, 05 Apr 2026 19:19:39 -0400","from v512.v5f06b487.use4.send.mailgun.net ([143.55.232.12])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1)\n (envelope-from <bounce+0e9322.97607e-qemu-devel=nongnu.org@yodel.dev>)\n id 1w9Wkj-0002NW-OP\n for qemu-devel@nongnu.org; Sun, 05 Apr 2026 19:19:39 -0400","from mail.yodel.dev (mail.yodel.dev [35.209.39.246]) by\n 8513f12a2fc15fc111f0faa1e590f55254e6a5dbcdc728bb1c83c627af625053 with SMTP id\n 69d2ee0518e714e81b8f8382; Sun, 05 Apr 2026 23:19:33 GMT"],"X-Mailgun-Sid":"WyI4ZDFlNiIsInFlbXUtZGV2ZWxAbm9uZ251Lm9yZyIsIjk3NjA3ZSJd","X-Mailgun-Sending-Ip":"143.55.232.12","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=yodel.dev;\n s=rsa2048; t=1775431172;\n bh=cUGn+kyME30ZrpKCOLY8TUd5U6ZOP/Ccs+FUUQSZ8+0=;\n h=Message-ID:Date:MIME-Version:Subject:X-Mailgun-Dkim:From:To:Cc:\n References:In-Reply-To:Content-Type:Content-Transfer-Encoding:From:\n Reply-to:Subject:Date:Message-id:To:Cc:Mime-version:Content-type:\n Content-transfer-encoding:In-reply-to:References;\n b=skvrIIGl2BjyyGVAcfrvkaY5Jow7CS5BIA/iPmqCJ20iES3+2EJVOTN4nn/kGs7nv\n DecuZ+p9aJ6Q8vhBrdeZdLMZMf22/ji/D1VjOFWAKxXNiWTXxWu7XCaJciu5F8Qzjo\n GLAiKh9RPna2vdzuQ+YkWxhu1ol2IyErAuxiuIe4KQVUiif6NyZVLRrQklh4gRH9Ok\n rrOJfHFhJCEQKNXBHNjMhtxNIShQnDwoT+bjeYpliGSArWj47jgiO3TfWHQXlw87NP\n UAQCrYcifdLltbgTETyLuUiNu9kcr/f+Rzo/QXQcCjzusO4POZ0A5O/p9Qsp0NU6Dq\n q/xGdTvZfhmTA==","Message-ID":"<cb70f613-9c41-42e8-9ffb-e57e3db7248f@yodel.dev>","Date":"Sun, 5 Apr 2026 18:19:30 -0500","MIME-Version":"1.0","Subject":"Re: [RFC PATCH 3/4] alpha: Replace helper_set_alarm with Typhoon\n Cchip MMIO register","X-Mailgun-Dkim":["no","no"],"From":"Yodel Eldar <yodel.eldar@yodel.dev>","To":"Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org","Cc":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>","References":"<20260401170454.32045-1-yodel.eldar@yodel.dev>\n <20260401170454.32045-4-yodel.eldar@yodel.dev>\n <1c6d7e6f-eb16-4820-a4c2-35767c8db919@linaro.org>\n <0f822f37-de4a-44d3-81dc-61f9caee0403@yodel.dev>","Content-Language":"en-US","Autocrypt":"addr=yodel.eldar@yodel.dev; keydata=\n xjMEZxqXdhYJKwYBBAHaRw8BAQdAkletQdG3CLyANZyuf2t7Z9PK4b6HiT+DdSPUB2mHzmPN\n I1lvZGVsIEVsZGFyIDx5b2RlbC5lbGRhckB5b2RlbC5kZXY+wpkEExYKAEECGwMFCQOcG00F\n CwkIBwIGFQoJCAsCBBYCAwECHgECF4AWIQTTzRjNQG27imap+N+V7k+3NmVNrAUCaNWASwIZ\n AQAKCRCV7k+3NmVNrNnSAPoDjQXa6v7ZzdQSaLdRfAQy/5SsUucv+zp3WAP4pXdgJQEAzMMC\n Ctx4l6b13Fs2hZdRXEnF/4BZ9t1K68nwzZOV3QnOOARnGpd2EgorBgEEAZdVAQUBAQdAKPIy\n 3W/DKFsm1e+31zoqmOY0pqz8vjIM846wM6lEY2QDAQgHwn4EGBYIACYCGwwWIQTTzRjNQG27\n imap+N+V7k+3NmVNrAUCaNWG7QUJA5wi9wAKCRCV7k+3NmVNrPusAQCQDQwETy7VT6UhHPho\n TkrQnsNqQfFU3tXqCTiViToktQD7B/U2/to97hQIJCWbK6yd3T+KPZJPMcHMg2XRyedUvgA=","In-Reply-To":"<0f822f37-de4a-44d3-81dc-61f9caee0403@yodel.dev>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","Received-SPF":"pass client-ip=143.55.232.12;\n envelope-from=bounce+0e9322.97607e-qemu-devel=nongnu.org@yodel.dev;\n helo=v512.v5f06b487.use4.send.mailgun.net","X-Spam_score_int":"-20","X-Spam_score":"-2.1","X-Spam_bar":"--","X-Spam_report":"(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n HELO_STATIC_HOST=-0.001, RCVD_IN_MSPIKE_H2=0.001,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,\n SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"}},{"id":3673626,"web_url":"http://patchwork.ozlabs.org/comment/3673626/","msgid":"<a6a7039c-c197-4e9b-a2aa-6ae9079c8d0b@yodel.dev>","list_archive_url":null,"date":"2026-04-05T23:30:20","subject":"Re: [RFC PATCH 3/4] alpha: Replace helper_set_alarm with Typhoon\n Cchip MMIO register","submitter":{"id":92094,"url":"http://patchwork.ozlabs.org/api/people/92094/","name":"Yodel Eldar","email":"yodel.eldar@yodel.dev"},"content":"Hi, Richard!\n\nOn 05/04/2026 17:59, Richard Henderson wrote:\n> On 4/5/26 09:32, Yodel Eldar wrote:\n>> On 03/04/2026 20:01, Richard Henderson wrote:\n>>> On 4/2/26 03:04, Yodel Eldar wrote:\n>>>> From: Yodel Eldar <yodel.eldar@yodel.dev>\n>>>>\n>>>> This commit creates a QEMU-specific (non-standard) MMIO register\n>>>> in Typhoon's Cchip to replace helper_set_alarm() and to move\n>>>> the QEMUTimer pointer, alarm_timer, out of the Alpha CPU and into\n>>>> the chipset code.\n>>>>\n>>>> Currently, PALcode writes to the QEMU-specific, synthetic\n>>>> Processor Register (index 251) and triggers the invocation of\n>>>> helper_set_alarm() as a side effect in QEMU, thereby setting\n>>>> the timer alarm expiration value.\n>>>>\n>>>> This works, because the AlphaCPU contains the QEMUTimer and\n>>>> CPUAlphaState stores the alarm expiration value; however, the timer\n>>>> alarm callback resides in and is specific to the Typhoon chipset,\n>>>> thus the CPU and the chipset are entangled.\n>>>>\n>>>> By designating the currently unused offset (0x7c0) of Cchip as the\n>>>> location of the timer alarm expiration, we can disentangle and\n>>>> better encapsulate both.\n>>>>\n>>>> Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org>\n>>>> Signed-off-by: Yodel Eldar <yodel.eldar@yodel.dev>\n>>>> ---\n>>>>\n>>>> Notes:\n>>>>      The patch to the palcode-clipper binary that follows this\n>>>>      one is necessary for this patch to work; I've left the\n>>>>      diff to the source in the notes of it for reproduction.\n>>>>      Philippe:\n>>>>      Thanks, again, for the suggestion of decoupling the CPU from\n>>>>      the Typhoon using IRQ lines. In my response, I guessed that\n>>>>      getting the CPU index would be trickier than moving the timer\n>>>>      into TyphoonState; perhaps you'll find it amusing (as I do)\n>>>>      that it appears I had that backwards (due to the PALcode\n>>>>      peculiarity)!\n>>>>      The remaining CPU interrupts will be refactored in v2 of that\n>>>>      series.\n>>>\n>>> I'm not keen on this.  I would much rather keep the synthetic \n>>> processor register than add a synthetic CChip mmio.\n>>>\n>>\n>> No problem... Are we okay with exposing a typhoon timer helper\n>> and TyphoonState to target/alpha/sys_helper.c via the inclusion\n>> of hw/alpha/alpha_sys.h?\n>>\n>> If so, we can add an opaque pointer parameter to helper_set_alarm\n>> carrying the TyphoonState and invoke the typhoon timer helper;\n>> e.g.:\n>>\n>> /* Inside target/alpha/sys_helper.c */\n>> #include \"hw/alpha/alpha_sys.h\"\n>>\n>> void helper_set_alarm(CPUAlphaState *env, uint64_t expire, void *opaque)\n>> {\n>>      CPUState *cs = env_cpu(env);\n>>      TyphoonState *s = TYPHOON_PCI_HOST_BRIDGE(opaque);\n>>      int cpu_index = cs->cpu_index & 3;\n>>\n>>      if (expire) {\n>>          env->alarm_expire = expire;\n>>          typhoon_timer_mod(s, cpu_index, expire);\n>>      } else {\n>>          typhoon_timer_del(s, cpu_index);\n>>      }\n>>\n>> }\n>>\n>> We'd have to keep alarm_expire in CPUAlphaState, because\n>> palcode-clipper would still expect it, but alarm timers would\n>> be moved into the typhoon as an array indexed by cpu_index.\n>>\n>> WDYT?\n> \n> I don't understand why you want to move the QEMUTimer.  What do we gain \n> by preventing the cpu from accessing the QEMUTimer?\n> \n\nFor architectural accuracy and separation of concerns,\nI wanted to eliminate the references to the CPUs in\nTyphoon's Cchip, but as I mentioned in the email I just\nsent before I saw your reply, I understand the MMIO\napproach is probably too heavy-handed.\n\nI'll drop the MMIO patch and am setting aside alternative\napproaches to focus on the rest of the QOMify series.\n\nThanks a lot for your comments and time.\n\nYodel\n\n> \n> r~\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=yodel.dev header.i=@yodel.dev header.a=rsa-sha256\n header.s=rsa2048 header.b=X3LtXfBt;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fppc03nvPz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 06 Apr 2026 09:30:40 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1w9WvC-00012H-Ok; Sun, 05 Apr 2026 19:30:26 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1)\n (envelope-from <bounce+0e9322.97607e-qemu-devel=nongnu.org@yodel.dev>)\n id 1w9WvB-00011W-Be\n for qemu-devel@nongnu.org; Sun, 05 Apr 2026 19:30:25 -0400","from v512.v5f06b487.use4.send.mailgun.net ([143.55.232.12])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1)\n (envelope-from <bounce+0e9322.97607e-qemu-devel=nongnu.org@yodel.dev>)\n id 1w9Wv9-0004H4-6f\n for qemu-devel@nongnu.org; Sun, 05 Apr 2026 19:30:25 -0400","from mail.yodel.dev (mail.yodel.dev [35.209.39.246]) by\n 91436959f6d3dcd0cb484754364cde98aa8bd2a527ac59d3f05a32f48ddbc29f with SMTP id\n 69d2f08d29f95355fc836d2f; Sun, 05 Apr 2026 23:30:21 GMT"],"X-Mailgun-Sid":"WyI4ZDFlNiIsInFlbXUtZGV2ZWxAbm9uZ251Lm9yZyIsIjk3NjA3ZSJd","X-Mailgun-Sending-Ip":"143.55.232.12","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=yodel.dev;\n s=rsa2048; t=1775431820;\n bh=fQu2ruKow94+K7lAvisUebn8Vb7YQhAB+5r/AhrFPEo=;\n h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:\n X-Mailgun-Dkim:From:In-Reply-To:Content-Type:\n Content-Transfer-Encoding:From:Reply-to:Subject:Date:Message-id:To:\n Cc:Mime-version:Content-type:Content-transfer-encoding:In-reply-to:\n References;\n b=X3LtXfBt4CUkHx+8kc+XDV/OACaFDNb9gPZed8v19apZatOmWH+MK24VYW/ug5UhD\n WB2XniPSrQ79+XEe0uD39OSMeFld62CmQDcNG1CgO7rF5qOi6KHf3GJ4Lvljy16NbQ\n 7W+mz5e6T2CWHcSSe1az42AccZVIK/2ba6mjURYBLMKL4IAb/AfxGjqJLCdAUx/S8N\n 7mouo7Z4h1mpHceXDcNZdXOmxu92ZmGt0S1xziANIA+bYqBUj8s6gptAoL0Ct+vFaF\n 6+DJaZ3xXwcc26OrkYzXymxvtBLhcyYHAHAs4DIYHWyqmwd9oyEOii+Y/tEGllVHVo\n bw/Yuftkn3x7Q==","Message-ID":"<a6a7039c-c197-4e9b-a2aa-6ae9079c8d0b@yodel.dev>","Date":"Sun, 5 Apr 2026 18:30:20 -0500","MIME-Version":"1.0","Subject":"Re: [RFC PATCH 3/4] alpha: Replace helper_set_alarm with Typhoon\n Cchip MMIO register","To":"Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org","Cc":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>","References":"<20260401170454.32045-1-yodel.eldar@yodel.dev>\n <20260401170454.32045-4-yodel.eldar@yodel.dev>\n <1c6d7e6f-eb16-4820-a4c2-35767c8db919@linaro.org>\n <0f822f37-de4a-44d3-81dc-61f9caee0403@yodel.dev>\n <b23cc492-6a78-456c-a97e-b935b9277b34@linaro.org>","Content-Language":"en-US","X-Mailgun-Dkim":["no","no"],"From":"Yodel Eldar <yodel.eldar@yodel.dev>","Autocrypt":"addr=yodel.eldar@yodel.dev; keydata=\n xjMEZxqXdhYJKwYBBAHaRw8BAQdAkletQdG3CLyANZyuf2t7Z9PK4b6HiT+DdSPUB2mHzmPN\n I1lvZGVsIEVsZGFyIDx5b2RlbC5lbGRhckB5b2RlbC5kZXY+wpkEExYKAEECGwMFCQOcG00F\n CwkIBwIGFQoJCAsCBBYCAwECHgECF4AWIQTTzRjNQG27imap+N+V7k+3NmVNrAUCaNWASwIZ\n AQAKCRCV7k+3NmVNrNnSAPoDjQXa6v7ZzdQSaLdRfAQy/5SsUucv+zp3WAP4pXdgJQEAzMMC\n Ctx4l6b13Fs2hZdRXEnF/4BZ9t1K68nwzZOV3QnOOARnGpd2EgorBgEEAZdVAQUBAQdAKPIy\n 3W/DKFsm1e+31zoqmOY0pqz8vjIM846wM6lEY2QDAQgHwn4EGBYIACYCGwwWIQTTzRjNQG27\n imap+N+V7k+3NmVNrAUCaNWG7QUJA5wi9wAKCRCV7k+3NmVNrPusAQCQDQwETy7VT6UhHPho\n TkrQnsNqQfFU3tXqCTiViToktQD7B/U2/to97hQIJCWbK6yd3T+KPZJPMcHMg2XRyedUvgA=","In-Reply-To":"<b23cc492-6a78-456c-a97e-b935b9277b34@linaro.org>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","Received-SPF":"pass client-ip=143.55.232.12;\n envelope-from=bounce+0e9322.97607e-qemu-devel=nongnu.org@yodel.dev;\n helo=v512.v5f06b487.use4.send.mailgun.net","X-Spam_score_int":"-20","X-Spam_score":"-2.1","X-Spam_bar":"--","X-Spam_report":"(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n HELO_STATIC_HOST=-0.001, RCVD_IN_MSPIKE_H2=0.001,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,\n SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"}}]