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=-7.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,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 21703C433E0 for ; Thu, 18 Mar 2021 21:15:57 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 99E8964E02 for ; Thu, 18 Mar 2021 21:15:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 99E8964E02 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMzzn-0004Yh-OU for qemu-devel@archiver.kernel.org; Thu, 18 Mar 2021 17:15:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMzyC-0003we-42 for qemu-devel@nongnu.org; Thu, 18 Mar 2021 17:14:16 -0400 Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]:33366) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMzy7-0006lP-3U for qemu-devel@nongnu.org; Thu, 18 Mar 2021 17:14:15 -0400 Received: by mail-oi1-x235.google.com with SMTP id w70so2480896oie.0 for ; Thu, 18 Mar 2021 14:14:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=gVKvW9rSAO0dP3lXSgeqfRbuP0yqwxlRmxb/jqCOt4M=; b=q55OKyMG1rL0820gm9Datyd7qhzduf3lapMX9RSOVKKCNOW4qevj8kBhf07hrmzkMi kySqgM+cJhBADWSCmpzWrbBKrrQxnbkvMFWqP+XnJoIak9fl9VzzwJSz6BxvE2Sdjf2b 4D5nIRrp1IrH8AwAhr7nWLF59M3YlFl2gbOVmFnboUE1lsq75uEWWpOWMumFLH/qcwQn 7JxiRSofCqJjQWHfkXoxaGq75M3O6ZrRiW5Bk98XFj/zJS7HxgEypV9lLuVhdvghKL4f TJ0143GcXDHTXxSmhUadM0Seyeb5GdvNMGs9kO2qQjZUa7dMtz8EmCzMP8DsJmV01x/8 HkLg== 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-language :content-transfer-encoding; bh=gVKvW9rSAO0dP3lXSgeqfRbuP0yqwxlRmxb/jqCOt4M=; b=c9MZHDjs4WlGzOmeG3/544Vz1xcA6wR58UYxMPQPtQDCcTIiWNd6230gQsTdJ2afQd 2REtJQOgNmYQyTIla2e4mXnS8jWuQ1bZQHUiQiFZqClkhv+Du8PkMnybd6sJfyYMCPkq udMk+gXl4UUpp8JiTVtLgItLwkeupT/JQ9NF9EYSpMSW8hPnuggoTXvjQUWIWHlpkTb6 9wQtDAUAKpuAtChqK83/6DOc+YDwBee9JsoazvaDdJLsiO+FA+WQxjzvPwjAi+yEgXoo 4qJbFpP/cxCn6rz/Wb3U6PB94z5kwNldY8uk+BbPAobw7A1BJ+D8T37h4CZwJE4mJ+gl TNeQ== X-Gm-Message-State: AOAM532FthxAD8QyqiXS69JOWDFh8JyF0utFglbNd73O8qQjE3BH2qxn QbFKxR/CGIDvQ46BhpdKv/T9kw== X-Google-Smtp-Source: ABdhPJzXsKIkmXiyrEUfOvLEtfQOwWCw5NLR8Rmz82tDjVsTPoWHwYqA6MYcYoDSBGfZdfxXLiUwJg== X-Received: by 2002:aca:3058:: with SMTP id w85mr4516774oiw.19.1616102049429; Thu, 18 Mar 2021 14:14:09 -0700 (PDT) Received: from [10.10.121.52] (fixed-187-189-51-144.totalplay.net. [187.189.51.144]) by smtp.gmail.com with ESMTPSA id w11sm800129ooc.35.2021.03.18.14.14.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Mar 2021 14:14:08 -0700 (PDT) Subject: Re: [PATCH for-6.0 v2 4/5] hw/core/loader: Add new function rom_ptr_for_as() To: Peter Maydell References: <20210318174823.18066-1-peter.maydell@linaro.org> <20210318174823.18066-5-peter.maydell@linaro.org> <176ca6cf-f917-eb5d-a5ce-d8a98db8fce4@linaro.org> From: Richard Henderson Message-ID: Date: Thu, 18 Mar 2021 15:14:06 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::235; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x235.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, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-arm , QEMU Developers , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 3/18/21 1:02 PM, Peter Maydell wrote: >>> + * Note that we do not check @as against the 'as' member in the >>> + * 'struct Rom' returned by rom_ptr(). The Rom::as is the >>> + * AddressSpace which the rom blob should be written to... ... >> Should you really have this special case? Nowhere is this going to verify that >> @addr is in @as. > > It's the "happens almost all the time" case. Nothing verifies > that @addr is in @as anyway -- see the "Note that" part of the > comment above. The comment explains why we don't examine Rom::as. But we do check @addr vs @as via @as -> @fv -> flatview_translate. r~