[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 06/11] monitor/i386: use debug APIs when accessing guest memo
From: |
Peter Maydell |
Subject: |
Re: [PATCH 06/11] monitor/i386: use debug APIs when accessing guest memory |
Date: |
Tue, 1 Dec 2020 11:54:20 +0000 |
On Mon, 16 Nov 2020 at 19:29, Ashish Kalra <Ashish.Kalra@amd.com> wrote:
>
> From: Brijesh Singh <brijesh.singh@amd.com>
>
> Update the HMP commands to use the debug version of APIs when accessing
> guest memory.
>
> Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
> Signed-off-by: Ashish Kalra <ashish.kalra@amd.com>
> ---
> monitor/misc.c | 4 ++--
> softmmu/cpus.c | 2 +-
> target/i386/monitor.c | 54 ++++++++++++++++++++++++-------------------
> 3 files changed, 33 insertions(+), 27 deletions(-)
>
> diff --git a/monitor/misc.c b/monitor/misc.c
> index 32e6a8c13d..7eba3a6fce 100644
> --- a/monitor/misc.c
> +++ b/monitor/misc.c
> @@ -824,8 +824,8 @@ static void hmp_sum(Monitor *mon, const QDict *qdict)
>
> sum = 0;
> for(addr = start; addr < (start + size); addr++) {
> - uint8_t val = address_space_ldub(&address_space_memory, addr,
> - MEMTXATTRS_UNSPECIFIED, NULL);
> + uint8_t val;
> + cpu_physical_memory_read_debug(addr, &val, 1);
Don't introduce new uses of cpu_* memory read/write functions, please.
They're an old API that has some flaws, like not being able to report
read/write access errors.
If debug accesses are accesses with a MemTxAttrs that says debug=1,
then you should just provide the right MemTxAttrs here.
thanks
-- PMM
- Re: [PATCH 06/11] monitor/i386: use debug APIs when accessing guest memory,
Peter Maydell <=