From mboxrd@z Thu Jan 1 00:00:00 1970 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 lists.gnu.org (lists.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 DECE6C77B7A for ; Tue, 13 Jun 2023 08:08:36 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q8z48-0001yX-P3; Tue, 13 Jun 2023 04:07:48 -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 1q8z47-0001y7-6W; Tue, 13 Jun 2023 04:07:47 -0400 Received: from mail-vk1-xa33.google.com ([2607:f8b0:4864:20::a33]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q8z45-0005dV-LF; Tue, 13 Jun 2023 04:07:46 -0400 Received: by mail-vk1-xa33.google.com with SMTP id 71dfb90a1353d-4652fcb2ac1so2136421e0c.1; Tue, 13 Jun 2023 01:07:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686643664; x=1689235664; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ciFMPtsm0MR17JnUHMUbyGZPGjmipZFXian0Z+D/0jo=; b=hNOOP/LCJhmYPKA9Hift8B3pLhII1zd8ZWkz5u4WDmGOi5IEVc1k8rbx0IvI0f9dsM GhpkaKprHQ18STeetSYmeUaV4/m6rFsK7NzO9WauPNWpT6ql1EOyy8OzQWV9oNTSiSc0 CguVNg38+GtJJm+9R22u4VqqscIH24mT1fMufJifiiucsP55s4UYr4O+ng+Exwv1gked YTm0D+lN5QODEzGeyGIDK1ekd0o1ZsHYtHZMmHKDUGJ1VzKu1VypsI4bRZy3/CRZRGbr 2ux+NW1Dg5g6f7M5rIyS7U0euAErpLjipClvS6983HNRMhTjFrTS9Y9+VlMi8FfgGiaS fxDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686643664; x=1689235664; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ciFMPtsm0MR17JnUHMUbyGZPGjmipZFXian0Z+D/0jo=; b=hSdQdocoZf1DADz4xDGvtrbPuI3RwpW4R9tr3wr26lq1jrCjN/GTXifGrypbMdcrbw XtLLtBS4uOYnNEeO9Ep1SsqCzBbbavRX7ZTz9OWDXkO/Xe6lGEwNRhmpVYbANqmLrf70 THMlePTIw2jSbKeTa4X8paiWQNCBr4oT2JO7/MTIgGYu/lJaxEEmeUIiqbbjmMk+AQX7 X2gCtopApsf5ndsyOtBsYlVH8kTGH0U5TuRUwrEqiKpZh170PCMpVY1Q2y3bqcasc4YA wpAFMXjShbM/TAM7ZAlV8cxiXVSoMVmIQTT5VsCsPpbwtF5Tl7L/BPSlC3RTn0gmyJsN jOIA== X-Gm-Message-State: AC+VfDxOzsNQgBbt2J34jGTTcmkVDDpMxbO3YBSiYykL84ZxX8tVc3gv oV9MRMac5GuMCEINzcuA2c5eEqFx4nJq7OIbVOQ= X-Google-Smtp-Source: ACHHUZ7j+wwlsiCHn2x7sPwNZaZ2c8O8jcyAmeBc0BEgequ525TuaJIoVHnGzgTxYw9ow7xcwJik8Pi38JFGGkwdQUc= X-Received: by 2002:a1f:d405:0:b0:464:cd5c:b37e with SMTP id l5-20020a1fd405000000b00464cd5cb37emr6279948vkg.0.1686643664187; Tue, 13 Jun 2023 01:07:44 -0700 (PDT) MIME-Version: 1.0 References: <20230609185119.691152-1-mark.cave-ayland@ilande.co.uk> <20230609185119.691152-6-mark.cave-ayland@ilande.co.uk> <76F6648A-47D8-4975-8344-93BE5DD6A071@gmail.com> In-Reply-To: From: Bernhard Beschow Date: Tue, 13 Jun 2023 10:07:30 +0200 Message-ID: Subject: Re: [PATCH 5/5] cmd646: move device-specific BMDMA registers to separate memory region To: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= Cc: Mark Cave-Ayland , jsnow@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org Content-Type: multipart/alternative; boundary="00000000000077776805fdfe5454" Received-SPF: pass client-ip=2607:f8b0:4864:20::a33; envelope-from=shentey@gmail.com; helo=mail-vk1-xa33.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, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org --00000000000077776805fdfe5454 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jun 13, 2023 at 12:39=E2=80=AFAM Philippe Mathieu-Daud=C3=A9 wrote: > On 12/6/23 21:28, Bernhard Beschow wrote: > > > > > > Am 9. Juni 2023 18:51:19 UTC schrieb Mark Cave-Ayland < > mark.cave-ayland@ilande.co.uk>: > >> The aim here is to eliminate any device-specific registers from the > main BMDMA > >> bar memory region so it can potentially be moved into the shared PCI > IDE device. > >> > >> For each BMDMA bus create a new cmd646-bmdma-specific memory region > representing > >> the device-specific BMDMA registers and then map them using aliases > onto the > >> existing BMDMAState memory region. > >> > >> Signed-off-by: Mark Cave-Ayland > >> --- > >> hw/ide/cmd646.c | 111 +++++++++++++++++++++++++++++++--------- > >> include/hw/ide/cmd646.h | 4 ++ > >> 2 files changed, 90 insertions(+), 25 deletions(-) > > > >> struct CMD646IDEState { > >> PCIIDEState parent_obj; > >> + > >> + MemoryRegion bmdma_mem[2]; > >> + MemoryRegion bmdma_mem_alias[2][2]; > > > > The added complexity of a two-dimensional alias array seems like a toug= h > call for me. I'm not totally against it but I'm reluctant. > > Alternative: > > struct { > MemoryRegion mem; > MemoryRegion mem_alias[2]; > If `mem_alias` became an anonymous struct as well we could avoid fiddling with two indices in a matrix, lowering the complexity. Best regards, Bernhard > } bmdma[2]; > > >> }; > >> > >> #endif > > > > --00000000000077776805fdfe5454 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Tue, Jun 13, 2023 at 12:39=E2=80= =AFAM Philippe Mathieu-Daud=C3=A9 <= philmd@linaro.org> wrote:
On 12/6/23 21:28, Bernhard Beschow wrote:
>
>
> Am 9. Juni 2023 18:51:19 UTC schrieb Mark Cave-Ayland <mark.cave-ayland@ila= nde.co.uk>:
>> The aim here is to eliminate any device-specific registers from th= e main BMDMA
>> bar memory region so it can potentially be moved into the shared P= CI IDE device.
>>
>> For each BMDMA bus create a new cmd646-bmdma-specific memory regio= n representing
>> the device-specific BMDMA registers and then map them using aliase= s onto the
>> existing BMDMAState memory region.
>>
>> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk><= br> >> ---
>> hw/ide/cmd646.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 111 +++++++++++= ++++++++++++++++++++---------
>> include/hw/ide/cmd646.h |=C2=A0 =C2=A04 ++
>> 2 files changed, 90 insertions(+), 25 deletions(-)


>> struct CMD646IDEState {
>>=C2=A0 =C2=A0 =C2=A0 PCIIDEState parent_obj;
>> +
>> +=C2=A0 =C2=A0 MemoryRegion bmdma_mem[2];
>> +=C2=A0 =C2=A0 MemoryRegion bmdma_mem_alias[2][2];
>
> The added complexity of a two-dimensional alias array seems like a tou= gh call for me. I'm not totally against it but I'm reluctant.

Alternative:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0MemoryRegion mem;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0MemoryRegion mem_alias[2];<= br>

If `mem_alias` became an anonymous stru= ct as well we could avoid fiddling with two indices in a matrix, lowering t= he complexity.

Best regards,
Bernhard
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} bmdma[2];

>> };
>>
>> #endif
>

--00000000000077776805fdfe5454--