Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83052C2D0A8 for ; Sat, 26 Sep 2020 14:58:07 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 256AA208FE for ; Sat, 26 Sep 2020 14:58:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dQ3l6x1p" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 256AA208FE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kMBdQ-0005tW-Hm; Sat, 26 Sep 2020 14:57:12 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kMBdO-0005tR-MP for xen-devel@lists.xenproject.org; Sat, 26 Sep 2020 14:57:10 +0000 X-Inumbo-ID: 86418ffb-14bc-4467-95d2-d5d1bea29fea Received: from mail-lf1-x144.google.com (unknown [2a00:1450:4864:20::144]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 86418ffb-14bc-4467-95d2-d5d1bea29fea; Sat, 26 Sep 2020 14:57:09 +0000 (UTC) Received: by mail-lf1-x144.google.com with SMTP id q8so6092921lfb.6 for ; Sat, 26 Sep 2020 07:57:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=0OkwzjeICf9ftg+qFz7gAAHzvhof0Cb7rYEHWlDNoWk=; b=dQ3l6x1pbyo3zi+jgt3o11lMfklpqtXGuu3wO76iDScHtMqA8ecLUlxa79LFbsC16f QovFodfmFRKNO4ujRyueK25kYE8eBA0BeGT3KBGrpqMW3NP+Ve/XA1Ttjbngl3YHMxyR 8aUSukQbrfR7o6QIEfk50LYNOq/JYhaO0t/foZY813eusTvCwlsbogEyzrsOqlQeZ8Ir Ub7r5I2mSItFntwt7PcFKlH0q5peZ2kONz3w/ksRAxTsrU9xJHDvxtD/kiMrlpXvNpD9 aKq0TbfuYxLdnm30Nx/JZ77w9tKzxe/OXACagOz3oV7FCdyj/RwT5uYQbs4PAZsix1YS dPeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=0OkwzjeICf9ftg+qFz7gAAHzvhof0Cb7rYEHWlDNoWk=; b=s95A3dCWLwGnt/yOCvCg9e/2qhDbs9hLjm0FZIqMO4vk6MOI7yLZQ0Vsbf9ZnxmlYI esNpOqFAviRzEJOcPmSRE/gMHslT/dUVepzmUATTbMR+DzPCIwirRG3w/Gk9p2jmyDDf G+lALT9hmqWoMHU4ICt1yOYalG7vrIsLn/ytYCBPaL1ZAoEzgACaGSfbansCnpHMqp9R RxlbhPiBpwztdFfgtu8SYNEHVb8BKtt8lqhXthzOIa2L/gPEUxpjkfQYvE/xxM+3SIAR GYeTTx5pF/U6wnwrJNy9RlHV2tJ6PwjCA1mZn8PVjSFxvjfvnQgRtlczdvz3HlWbnHHe t67A== X-Gm-Message-State: AOAM5339C+yGKAs099Rbl7J02HhCUPQQ39wbHuMdD9gQEnoW2UWPtVRb 3EC3jir5hDReNcUi1AZAd8j9Ut2gZjSHESai X-Google-Smtp-Source: ABdhPJyUB+7AM9K+nimoRpJjVkDYWT72N2ynP3RBTyQr2Lzj9lykdRj3Hj8ji3DRpJNv3bf5bS1+ug== X-Received: by 2002:a05:6512:3692:: with SMTP id d18mr1201045lfs.62.1601132228158; Sat, 26 Sep 2020 07:57:08 -0700 (PDT) Received: from [192.168.1.6] ([212.22.223.21]) by smtp.gmail.com with ESMTPSA id r13sm1740038lfe.114.2020.09.26.07.57.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Sep 2020 07:57:07 -0700 (PDT) Subject: Re: [PATCH V1 09/16] arm/ioreq: Introduce arch specific bits for IOREQ/DM features To: Julien Grall Cc: xen-devel@lists.xenproject.org, Oleksandr Tyshchenko , Stefano Stabellini , Volodymyr Babchuk , Julien Grall References: <1599769330-17656-1-git-send-email-olekstysh@gmail.com> <1599769330-17656-10-git-send-email-olekstysh@gmail.com> <7fbab25d-18a9-83d6-2596-f0f9d149058c@gmail.com> From: Oleksandr Message-ID: <6e40376c-b6ee-50b6-8870-aa12639f56a6@gmail.com> Date: Sat, 26 Sep 2020 17:57:01 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" On 26.09.20 16:21, Julien Grall wrote: > Hi Oleksandr, Hi Julien. > > On 24/09/2020 19:22, Oleksandr wrote: >> On 24.09.20 20:25, Julien Grall wrote: >>> On 23/09/2020 21:16, Oleksandr wrote: >>>> On 23.09.20 21:03, Julien Grall wrote: >>>>> On 10/09/2020 21:22, Oleksandr Tyshchenko wrote: >>>>>> From: Oleksandr Tyshchenko >>>> Could you please clarify how this patch could be split in smaller one? >>> >>> This patch is going to be reduced a fair bit if you make some of the >>> structure common. The next steps would be to move anything that is >>> not directly related to IOREQ out. >> >> >> Thank you for the clarification. >> Yes, however, I believed everything in this patch is directly related >> to IOREQ... >> >> >>> >>> >>> From a quick look, there are few things that can be moved in >>> separate patches: >>>    - The addition of the ASSERT_UNREACHABLE() >> >> Did you mean the addition of the ASSERT_UNREACHABLE() to >> arch_handle_hvm_io_completion/handle_pio can moved to separate patches? >> Sorry, I don't quite understand, for what benefit? > > Sorry I didn't realize there was multiple ASSERT_UNREACHABLE() in the > code. I was referring to the one in the follow chunk: > > @@ -1955,9 +1959,14 @@ static void do_trap_stage2_abort_guest(struct > cpu_user_regs *regs, >              case IO_HANDLED: >                  advance_pc(regs, hsr); >                  return; > +            case IO_RETRY: > +                /* finish later */ > +                return; >              case IO_UNHANDLED: >                  /* IO unhandled, try another way to handle it. */ >                  break; > +            default: > +                ASSERT_UNREACHABLE(); >              } >          } > > While I understand the reason this was added, to me this doesn't seem > to be directly related to this patch. > > In fact, the switch case will be done on an enum. So without the > default, the compiler will be able to notice if we are adding a new > field. With this new approach, you would only notice at runtime > (assuming the path is exercised). > > So what do we gain? Hmm, now I am in doubt whether we really need to put ASSERT_UNREACHABLE() here. Also we would notice it at the runtime for debug builds only. > > [...] > >>> I think Jan made some suggestion today. Let me know if you require >>> more input. >> >> >> Yes. I am considering this now. I provided my thoughts on that a >> little bit earlier. Could you please clarify there. > > I have replied to it. Thank you. -- Regards, Oleksandr Tyshchenko