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 X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 C2FEBC433E0 for ; Wed, 20 Jan 2021 19:48:16 +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 66D592343E for ; Wed, 20 Jan 2021 19:48:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 66D592343E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.71726.128685 (Exim 4.92) (envelope-from ) id 1l2JSU-000141-1C; Wed, 20 Jan 2021 19:48:02 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 71726.128685; Wed, 20 Jan 2021 19:48:02 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l2JST-00013u-UU; Wed, 20 Jan 2021 19:48:01 +0000 Received: by outflank-mailman (input) for mailman id 71726; Wed, 20 Jan 2021 19:48:00 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l2JSS-00013p-Pm for xen-devel@lists.xenproject.org; Wed, 20 Jan 2021 19:48:00 +0000 Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 7f2b9aff-3010-415b-b879-93092415cf85; Wed, 20 Jan 2021 19:47:59 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 7D5C32343E; Wed, 20 Jan 2021 19:47:58 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 7f2b9aff-3010-415b-b879-93092415cf85 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611172078; bh=Uylvc275ckLCMUtxiOO1wRpc255HDTMXtSu+n3eBEqE=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=d9fPP0m7nmgaT1yz+k4uyMR1M6DwVvUsUpa6NBKCKfnusrrzvO6s/yeZTn1C2EELp Yxvlcjf7J7JBmj4r322C4NIxUZ5ClzU5wZy0GPZji9VsWywta5F382NbbnTPOy4VZR 67VCziW+h+ATo5UYJYiNgz9/FctOlwSQP6RDs9WhVn0DhIKCXKzVBALRwxfSww+GVd 0aUJQ/beatukiqVkGAkRgvEV2axtAsyqjq2Ue4pQrxe4GDXL4NAbMJvdhNk3vuV3Lo dHhDFXIS5P5lSVv2gPcWG7P8ZdFC5+8N/fIuinc4F9SeF1cU+F4FpQAL+bgVvnEdlw NE6Wld2ULSFGw== Date: Wed, 20 Jan 2021 11:47:57 -0800 (PST) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-T480s To: Julien Grall cc: Stefano Stabellini , Oleksandr , xen-devel@lists.xenproject.org, Julien Grall , Volodymyr Babchuk , Oleksandr Tyshchenko Subject: Re: [PATCH V4 14/24] arm/ioreq: Introduce arch specific bits for IOREQ/DM features In-Reply-To: <9c12c1a7-81e3-20e9-7419-a625f23e4c27@xen.org> Message-ID: References: <1610488352-18494-1-git-send-email-olekstysh@gmail.com> <1610488352-18494-15-git-send-email-olekstysh@gmail.com> <355e613a-3c9d-7978-62cd-a35df057e5cd@xen.org> <06704224-bb57-c55e-a2ee-23032095e8ea@xen.org> <9c12c1a7-81e3-20e9-7419-a625f23e4c27@xen.org> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1388229174-1611172078=:14528" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1388229174-1611172078=:14528 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Wed, 20 Jan 2021, Julien Grall wrote: > Hi Stefano, > > On 20/01/2021 00:50, Stefano Stabellini wrote: > > On Tue, 19 Jan 2021, Oleksandr wrote: > > > diff --git a/xen/arch/arm/ioreq.c b/xen/arch/arm/ioreq.c > > > index 40b9e59..0508bd8 100644 > > > --- a/xen/arch/arm/ioreq.c > > > +++ b/xen/arch/arm/ioreq.c > > > @@ -101,12 +101,10 @@ enum io_state try_fwd_ioserv(struct cpu_user_regs > > > *regs, > > > > > >  bool arch_ioreq_complete_mmio(void) > > >  { > > > -    struct vcpu *v = current; > > >      struct cpu_user_regs *regs = guest_cpu_user_regs(); > > >      const union hsr hsr = { .bits = regs->hsr }; > > > -    paddr_t addr = v->io.req.addr; > > > > > > -    if ( try_handle_mmio(regs, hsr, addr) == IO_HANDLED ) > > > +    if ( handle_ioserv(regs, current) == IO_HANDLED ) > > >      { > > >          advance_pc(regs, hsr); > > >          return true; > > > > Yes, but I think we want to keep the check > > > > vio->req.state == STATE_IORESP_READY > > > > So maybe (uncompiled, untested): > > > > if ( v->io.req.state != STATE_IORESP_READY ) > > return false; > > Is it possible to reach this function with v->io.req.state != > STATE_IORESP_READY? If not, then I would suggest to add an > ASSERT_UNREACHABLE() before the return. If I am reading the state machine right it should *not* be possible to get here with v->io.req.state != STATE_IORESP_READY, so yes, ASSERT_UNREACHABLE() would work. --8323329-1388229174-1611172078=:14528--