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 4D203CDD1B8 for ; Fri, 27 Sep 2024 14:44:23 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1suCBx-00084P-VI; Fri, 27 Sep 2024 10:43:34 -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 1suCBv-00083t-97 for qemu-devel@nongnu.org; Fri, 27 Sep 2024 10:43:31 -0400 Received: from mail-m16.yeah.net ([1.95.21.17]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1suCBr-0007XX-KO for qemu-devel@nongnu.org; Fri, 27 Sep 2024 10:43:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yeah.net; s=s110527; h=Content-Type:Message-ID:Date:MIME-Version:Subject: From; bh=ALZBECrXNG2fIf74OBY7nYe5G87DilkzbqiOtCZ4azk=; b=XetygEu 2dIi3hBVezJFaLy+m7Es3GoLuEaxikMCyjK+oyJFrDeuS9R6Ka0XYYXLc6DxToFy TuiFB2vNPJbbOtpcwnOQWAUfgKcG8ir7nlaREu0t9BYhgqHPH79At3uX9k5LAlaa eNbF4hFSXTwty78fnlb23n7haiWRxi7T1A58= Received: from [192.168.1.27] (unknown []) by gzsmtp3 (Coremail) with SMTP id M88vCgCXt+Z9xPZmTMs6AQ--.50452S2; Fri, 27 Sep 2024 22:43:10 +0800 (CST) Content-Type: multipart/alternative; boundary="------------tKrdrrMF4xOvByzALLZqtXhK" Message-ID: Date: Fri, 27 Sep 2024 22:43:07 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Re: [PATCH v2 0/2] Drop ignore_memory_transaction_failures for xilink_zynq To: Peter Maydell Cc: qemu-devel@nongnu.org, bin.meng@windriver.com, edgar.iglesias@gmail.com, alistair@alistair23.me References: From: Chao Liu In-Reply-To: X-CM-TRANSID: M88vCgCXt+Z9xPZmTMs6AQ--.50452S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxCF4UKrykGr1ftF4DJrW5ZFb_yoW5Gr4xpr Z5KFyUKrZ7Kryvyw4kXwsFqFZ8ArWF93y3GF48Gw109398uFyrZrW0k39Fvas8Arnaka13 ZrWjqrs8Z3WqvaDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07juCJPUUUUU= X-Originating-IP: [117.173.247.123] X-CM-SenderInfo: pfkd0hxolxq5hhdkh0dhw/1tbiCRhnKGb2kYRoDwABs9 Received-SPF: pass client-ip=1.95.21.17; envelope-from=chao.liu@yeah.net; helo=mail-m16.yeah.net 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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 This is a multi-part message in MIME format. --------------tKrdrrMF4xOvByzALLZqtXhK Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2024/9/27 22:20, Peter Maydell wrote: > On Fri, 27 Sept 2024 at 15:03, Chao Liu wrote: >> On 2024/9/27 20:18, Peter Maydell wrote: >>> On Fri, 27 Sept 2024 at 09:52, Chao Liu wrote: >>> Even if our test set is not sufficiently comprehensive, we can create an >>> unimp_device for the maximum address space allowed by the board. This prevents >>> the guest system from triggering unexpected exceptions when accessing >>> unimplemented devices or regions. >> What would be the benefit of doing that? If we're going to >> say "we'll make accesses to regions without devices not >> generate faults", the simplest way to do that is to >> leave the ignore_memory_transaction_failures flag set >> the way it is. >> Introducing this flag provides a straightforward way to suppress >> memory access exceptions by checking if the flag is enabled after >> a CPU memory access failure; however,its primary purpose is to >> ensure compatibility. >> Since we can designate unimplemented device memory ranges with >> "unimplemented-device," this represents a more standard approach in QEMU >> for managing RAZ/WI behavior. > I don't think that using a 4GB unimplemented-device is > a "more standard" way to do this. We have a standard way for > the board model to say "we don't know whether there might > be existing guest code out there that relies on being able > to make accesses to addresses where there should be a device > but we haven't modeled it". That way is to set the > ignore_memory_transaction_failures flag. > > There are two things we can do: > > (1) We can leave the ignore_memory_transaction_failures > flag set. This is safe (no behaviour change) but not the > right (matching the hardware) behaviour. The main reason > to do this is if we don't feel we have enough access to > a range of guest code to test the other approach. > > (2) We can clear the flag. This is preferable (it matches the > hardware). But the requirement to do this is that > (a) we must make the best effort we can to be sure we've > put unimplemented-device placeholders for specific > devices we don't yet model (by checking e.g. the > hardware documentation for the SoC and board model, > the device tree, etc) > (b) we do the most wide-ranging testing of guest code that > we can. This checks that we didn't miss anything in (a). > > I don't mind which of these we do. What I was asking in my > comments on version one of your patch was for how we were > doing on requirement 2b. > > thanks > -- PMM I understand! I will provide more comprehensive testing methods and results as soon as possible and will get back to you. Best regards, Chao Liu --------------tKrdrrMF4xOvByzALLZqtXhK Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
On 2024/9/27 22:20, Peter Maydell wrote:
On Fri, 27 Sept 2024 at 15:03, Chao Liu <chao.liu@yeah.net> wrote:
On 2024/9/27 20:18, Peter Maydell wrote:
On Fri, 27 Sept 2024 at 09:52, Chao Liu <chao.liu@yeah.net> wrote:
Even if our test set is not sufficiently comprehensive, we can create an
unimp_device for the maximum address space allowed by the board. This prevents
the guest system from triggering unexpected exceptions when accessing
unimplemented devices or regions.
What would be the benefit of doing that? If we're going to
say "we'll make accesses to regions without devices not
generate faults", the simplest way to do that is to
leave the ignore_memory_transaction_failures flag set
the way it is.
Introducing this flag provides a straightforward way to suppress
memory access exceptions by checking if the flag is enabled after
a CPU memory access failure; however,its primary purpose is to
ensure compatibility.
Since we can designate unimplemented device memory ranges with
"unimplemented-device," this represents a more standard approach in QEMU
for managing RAZ/WI behavior.
I don't think that using a 4GB unimplemented-device is
a "more standard" way to do this. We have a standard way for
the board model to say "we don't know whether there might
be existing guest code out there that relies on being able
to make accesses to addresses where there should be a device
but we haven't modeled it". That way is to set the
ignore_memory_transaction_failures flag.

There are two things we can do:

(1) We can leave the ignore_memory_transaction_failures
flag set. This is safe (no behaviour change) but not the
right (matching the hardware) behaviour. The main reason
to do this is if we don't feel we have enough access to
a range of guest code to test the other approach.

(2) We can clear the flag. This is preferable (it matches the
hardware). But the requirement to do this is that
 (a) we must make the best effort we can to be sure we've
     put unimplemented-device placeholders for specific
     devices we don't yet model (by checking e.g. the
     hardware documentation for the SoC and board model,
     the device tree, etc)
 (b) we do the most wide-ranging testing of guest code that
     we can. This checks that we didn't miss anything in (a).

I don't mind which of these we do. What I was asking in my
comments on version one of your patch was for how we were
doing on requirement 2b.

thanks
-- PMM
I understand! I will provide more comprehensive testing methods
and results as soon as possible and will get back to you.

Best regards,
Chao Liu
--------------tKrdrrMF4xOvByzALLZqtXhK--