From: "Alex Bennée" <alex.bennee@linaro.org>
To: Beata Michalska <beata.michalska@linaro.org>
Cc: Richard Henderson <richard.henderson@linaro.org>,
qemu-devel@nongnu.org, qemu-arm@nongnu.org,
Peter Maydell <peter.maydell@linaro.org>,
pbonzini@redhat.com, quintela@redhat.com,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
eric.auger@redhat.com, shameerali.kolothum.thodi@huawei.com
Subject: Re: [PATCH v2 2/4] Memory: Enable writeback for given memory region
Date: Thu, 07 Nov 2019 16:57:21 +0000 [thread overview]
Message-ID: <87lfsrhbf2.fsf@linaro.org> (raw)
In-Reply-To: <CADSWDztHetgmbUOp4WyRAkR0daAG6kkwhUTcyKWiCTWHQ1XB=w@mail.gmail.com>
Beata Michalska <beata.michalska@linaro.org> writes:
> On Wed, 6 Nov 2019 at 12:20, Richard Henderson
> <richard.henderson@linaro.org> wrote:
>>
>> On 11/6/19 12:40 AM, Beata Michalska wrote:
>> > +void qemu_ram_writeback(RAMBlock *block, ram_addr_t start, ram_addr_t length)
>> > +{
>> > + void *addr = ramblock_ptr(block, start);
>> > +
>> > + /*
>> > + * The requested range might spread up to the very end of the block
>> > + */
>> > + if ((start + length) > block->used_length) {
>> > + qemu_log("%s: sync range outside the block boundaries: "
>> > + "start: " RAM_ADDR_FMT " length: " RAM_ADDR_FMT
>> > + " block length: " RAM_ADDR_FMT " Narrowing down ..." ,
>> > + __func__, start, length, block->used_length);
>> > + length = block->used_length - start;
>> > + }
>>
>> qemu_log_mask w/ GUEST_ERROR? How do we expect the length to overflow?
>
> In theory it shouldn't, at least with current usage.
> I guess the probe_access will make sure of that.
> This was more of a precaution to enable catching potential/future misuses
> aka debugging purpose. I can get rid of that it that's playing too
> safe.
If the internal code might get it wrong and that would be a bug then the
g_assert(), if the values are ultimately from the guest then log with
GUEST_ERROR as Richard suggests.
<snip>
--
Alex Bennée
WARNING: multiple messages have this Message-ID (diff)
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Beata Michalska <beata.michalska@linaro.org>
Cc: Peter Maydell <peter.maydell@linaro.org>,
quintela@redhat.com,
Richard Henderson <richard.henderson@linaro.org>,
qemu-devel@nongnu.org, shameerali.kolothum.thodi@huawei.com,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
eric.auger@redhat.com, qemu-arm@nongnu.org, pbonzini@redhat.com
Subject: Re: [PATCH v2 2/4] Memory: Enable writeback for given memory region
Date: Thu, 07 Nov 2019 16:57:21 +0000 [thread overview]
Message-ID: <87lfsrhbf2.fsf@linaro.org> (raw)
In-Reply-To: <CADSWDztHetgmbUOp4WyRAkR0daAG6kkwhUTcyKWiCTWHQ1XB=w@mail.gmail.com>
Beata Michalska <beata.michalska@linaro.org> writes:
> On Wed, 6 Nov 2019 at 12:20, Richard Henderson
> <richard.henderson@linaro.org> wrote:
>>
>> On 11/6/19 12:40 AM, Beata Michalska wrote:
>> > +void qemu_ram_writeback(RAMBlock *block, ram_addr_t start, ram_addr_t length)
>> > +{
>> > + void *addr = ramblock_ptr(block, start);
>> > +
>> > + /*
>> > + * The requested range might spread up to the very end of the block
>> > + */
>> > + if ((start + length) > block->used_length) {
>> > + qemu_log("%s: sync range outside the block boundaries: "
>> > + "start: " RAM_ADDR_FMT " length: " RAM_ADDR_FMT
>> > + " block length: " RAM_ADDR_FMT " Narrowing down ..." ,
>> > + __func__, start, length, block->used_length);
>> > + length = block->used_length - start;
>> > + }
>>
>> qemu_log_mask w/ GUEST_ERROR? How do we expect the length to overflow?
>
> In theory it shouldn't, at least with current usage.
> I guess the probe_access will make sure of that.
> This was more of a precaution to enable catching potential/future misuses
> aka debugging purpose. I can get rid of that it that's playing too
> safe.
If the internal code might get it wrong and that would be a bug then the
g_assert(), if the values are ultimately from the guest then log with
GUEST_ERROR as Richard suggests.
<snip>
--
Alex Bennée
next prev parent reply other threads:[~2019-11-07 16:57 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-05 23:40 [PATCH v2 0/4] target/arm: Support for Data Cache Clean up to PoP Beata Michalska
2019-11-05 23:40 ` Beata Michalska
2019-11-05 23:40 ` [PATCH v2 1/4] tcg: cputlb: Add probe_read Beata Michalska
2019-11-05 23:40 ` Beata Michalska
2019-11-05 23:40 ` [PATCH v2 2/4] Memory: Enable writeback for given memory region Beata Michalska
2019-11-05 23:40 ` Beata Michalska
2019-11-06 12:19 ` Richard Henderson
2019-11-06 12:19 ` Richard Henderson
2019-11-07 14:41 ` Beata Michalska
2019-11-07 14:41 ` Beata Michalska
2019-11-07 16:57 ` Alex Bennée [this message]
2019-11-07 16:57 ` Alex Bennée
2019-11-07 16:59 ` Peter Maydell
2019-11-07 16:59 ` Peter Maydell
2019-11-05 23:40 ` [PATCH v2 3/4] migration: ram: Switch to ram block writeback Beata Michalska
2019-11-05 23:40 ` Beata Michalska
2019-11-06 14:18 ` Alex Bennée
2019-11-06 14:18 ` Alex Bennée
2019-11-05 23:41 ` [PATCH v2 4/4] target/arm: Add support for DC CVAP & DC CVADP ins Beata Michalska
2019-11-05 23:41 ` Beata Michalska
2019-11-06 12:37 ` Richard Henderson
2019-11-06 12:37 ` Richard Henderson
2023-11-28 11:24 ` Philippe Mathieu-Daudé
2023-11-28 11:34 ` Peter Maydell
2023-11-28 11:44 ` Philippe Mathieu-Daudé
2023-11-28 18:07 ` Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lfsrhbf2.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=beata.michalska@linaro.org \
--cc=dgilbert@redhat.com \
--cc=eric.auger@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=richard.henderson@linaro.org \
--cc=shameerali.kolothum.thodi@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.