Received: by 2002:a17:906:d7a2:b0:96f:a786:ac5c with SMTP id pk2csp2442093ejb; Tue, 30 May 2023 14:06:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5GoF+XUnG1y9Z/SoIYFdB6Av1okkBp4SlScJ7GiG56Vhg0tLI8D42C08P94MKtvyJbwJ0K X-Received: by 2002:a05:6214:410f:b0:621:65de:f600 with SMTP id kc15-20020a056214410f00b0062165def600mr4078490qvb.1.1685480782423; Tue, 30 May 2023 14:06:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685480782; cv=none; d=google.com; s=arc-20160816; b=C4bJBgqmEym2vu04WK0A1iSasZSAYstK5JzgNWkleLkAkFmC44ZvoQpeWNLIgAo5Br pLULSdb6YeN4BFJMnSLrlxW5THkLq2gWO+DhiUwPZBeWR0HnKRJVXKofkBtSz89xqic0 dvrPPh5dTyYHj5punXGc7MTcBCPBE9BnE345aplJKdmqAzhKayAiLQySD60UDQJTLsiO doO5RtFhx5+o3VGSWsrBQ1Hb4uKyuW0Ff0QwC0rzfqg8JZ13FU9gxNlISKgrL9XuXGLL CMB6fnIjVO4Md3D7qfC2p8EEl6uiMbpeYv7V7K/63IROXel417FuntcVLJ79KYtKsabx it6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=O7VkMhVGOxiOQ61TnY/jd9GpbjF7vhHIyXxCNbDCSLA=; b=j7hnd/L4AN+UKJSojvB/Dzi+T3llYfeJtJPOpvfuTRTZLhLo/UO2Rb75Vvd8wz/NS/ 4bOaXFiy8/0ucnmEk7K3jgnFpbqIfCMjF9si6lztVAuvySGJt52o1v79TaGd+tb3oPto jdeck3nJ5TbYBUOW9uIFQR7JbVNVIXNYoOuhyBOvHOoRfWowpx7h4aReGg3ptKZjEo1u 8pu/fmdsv90Hlo1UdyojDXk87vX/jAhClCCLQjQ3ckdI/IULuA9Bff3KjMw3fuR/EX9S FiAUpQWlfR/y0HTcZcFAQY75qkcxnTHAQw3Xz9LXVsiRS1NOdM1jWD0oWjUE9DMfX5tM b/Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="aPN3Si/d"; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id iu8-20020ad45cc8000000b00626080fa02dsi6537514qvb.553.2023.05.30.14.06.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 May 2023 14:06:22 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-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=@linaro.org header.s=google header.b="aPN3Si/d"; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q46XJ-0008GZ-Ac; Tue, 30 May 2023 17:05:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q46XI-0008GB-1M for qemu-devel@nongnu.org; Tue, 30 May 2023 17:05:44 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q46XF-0002Lh-VA for qemu-devel@nongnu.org; Tue, 30 May 2023 17:05:43 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3063433fa66so3560729f8f.3 for ; Tue, 30 May 2023 14:05:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685480740; x=1688072740; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=O7VkMhVGOxiOQ61TnY/jd9GpbjF7vhHIyXxCNbDCSLA=; b=aPN3Si/d69SvkZmeFQskm4igjZs4hFcTcjUvgm1RzxYZsBDY87v3M9f3NcpOTMTQ+u 6QWY4g5LT4Hz99YTdwe2ADbwvDfUGsEY2ai/i2Aa7vXpvGztPFRTGVpmwUPhwwRj7jTt X5hEN1ORekpGPVu6H3+Ti0GNYYkKJe002zBhwnAuRJKA3mOLzZYLF+sijBbVpF/xghay dpva20HfuLGH/3CC+gWJFaS+Kf+LyEDFgWK2z4+pHBQ9e9r9Lgdfg/kM7pP9xbSgW59p vEAGrCPVr9JkOImSyhZ1igu3zu05IUb8jdIBphYeXGODf6jfMunEdEDTER90yZCHvT1+ pymQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685480740; x=1688072740; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=O7VkMhVGOxiOQ61TnY/jd9GpbjF7vhHIyXxCNbDCSLA=; b=SVPyaOufa/Y8EkFa2QpXMBng+xIri3lkgj5zTlkx31OZ9Ue59HlMG3rGnpfy/wenir bFHT8TzEG+YPTjHYEyaGc35eAaU8Wrh6i8e/xhT4XhlYzAFy7f9Uzg982yuyT9sBQUZ0 2/VSqFoT4DwIW0B6VYdevAdl8XK69a3U3e7vqtl2mifXL18eXwp1P8fqWNurm2U7YGYR NnNxPSpTHDAM4dwxjP0FV3+7K12Fyetgr4OvV0QYBdeSqwxeMIst/o6FOKT3T/0JEd4/ Z3H+zONrEfFaXDocbaM075yh99KZ+L516fKmzAmttXDhVIPOxa4KJ3X3tZ1wDOiR4JDF Kw2g== X-Gm-Message-State: AC+VfDyFblvfhtVOWhuw1rnyxkiwB2dYjSzyHJUeuM7c9g4BOn8lOaj2 Q8t/iZRg/0RlHbM/kf3y1NyFWw== X-Received: by 2002:adf:e789:0:b0:305:ed26:8576 with SMTP id n9-20020adfe789000000b00305ed268576mr2533019wrm.9.1685480740220; Tue, 30 May 2023 14:05:40 -0700 (PDT) Received: from [192.168.69.115] ([176.176.180.1]) by smtp.gmail.com with ESMTPSA id t7-20020a5d4607000000b0030647449730sm4372519wrq.74.2023.05.30.14.05.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 May 2023 14:05:39 -0700 (PDT) Message-ID: Date: Tue, 30 May 2023 23:05:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH 07/12] hw/ssi: Check for duplicate addresses Content-Language: en-US To: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= , qemu-arm@nongnu.org Cc: qemu-devel@nongnu.org, Peter Maydell , Joel Stanley , Andrew Jeffery , "Edgar E. Iglesias" , Alistair Francis References: <20230508075859.3326566-1-clg@kaod.org> <20230508075859.3326566-8-clg@kaod.org> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= In-Reply-To: <20230508075859.3326566-8-clg@kaod.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 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, NICE_REPLY_A=-0.09, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@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-devel-bounces+alex.bennee=linaro.org@nongnu.org Sender: qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org X-TUID: VmsoUnwRG1mq On 8/5/23 09:58, Cédric Le Goater wrote: > This to avoid address conflicts on the same SSI bus. Adapt machines > using multiple devices on the same bus to avoid breakage. > > Cc: "Edgar E. Iglesias" > Cc: Alistair Francis > Signed-off-by: Cédric Le Goater > --- > hw/arm/stellaris.c | 4 +++- > hw/arm/xilinx_zynq.c | 1 + > hw/arm/xlnx-versal-virt.c | 1 + > hw/arm/xlnx-zcu102.c | 2 ++ > hw/microblaze/petalogix_ml605_mmu.c | 1 + > hw/ssi/ssi.c | 20 ++++++++++++++++++++ > 6 files changed, 28 insertions(+), 1 deletion(-) > diff --git a/hw/ssi/ssi.c b/hw/ssi/ssi.c > index a25e064417..685b7678e0 100644 > --- a/hw/ssi/ssi.c > +++ b/hw/ssi/ssi.c > @@ -42,10 +42,30 @@ DeviceState *ssi_get_cs(SSIBus *bus, int addr) > return NULL; > } > > +static bool ssi_bus_check_address(BusState *b, DeviceState *dev, Error **errp) > +{ > + SSIPeripheral *s = SSI_PERIPHERAL(dev); > + > + if (ssi_get_cs(SSI_BUS(b), s->addr)) { > + error_setg(errp, "addr '0x%x' already in use", s->addr); We could return "... in use by a $MODEL device". DeviceState *d = ssi_get_cs(SSI_BUS(b), s->addr); if (d) { "... in use by a %s device", ..., object_get_typename(OBJECT(d))); } Anyhow, Reviewed-by: Philippe Mathieu-Daudé > + return false; > + } > + > + return true; > +}