qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: gaosong <gaosong@loongson.cn>
To: Richard Henderson <richard.henderson@linaro.org>,
	Tianrui Zhao <zhaotianrui@loongson.cn>,
	qemu-devel@nongnu.org
Cc: maobibo@loongson.cn, f4bug@amsat.org, philmd@linaro.org
Subject: Re: [PATCH] hw/loongarch/virt: Fix virt_to_phys_addr function
Date: Tue, 28 Mar 2023 11:20:31 +0800	[thread overview]
Message-ID: <dd1c55f5-d2c2-fd30-2541-b4be8e90d4f4@loongson.cn> (raw)
In-Reply-To: <63c805b9-f006-cdfb-4d07-5dbae84b7039@linaro.org>


在 2023/3/28 上午1:44, Richard Henderson 写道:
> On 3/27/23 04:23, Tianrui Zhao wrote:
>> The virt addr should mask TARGET_PHYS_ADDR_SPACE_BITS to
>> get the phys addr, and this is used by loading kernel elf.
>>
>> Signed-off-by: Tianrui Zhao <zhaotianrui@loongson.cn>
>> ---
>>   hw/loongarch/virt.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c
>> index b702c3f51e..f4bf14c1c8 100644
>> --- a/hw/loongarch/virt.c
>> +++ b/hw/loongarch/virt.c
>> @@ -399,7 +399,7 @@ static struct _loaderparams {
>>     static uint64_t cpu_loongarch_virt_to_phys(void *opaque, uint64_t 
>> addr)
>>   {
>> -    return addr & 0x1fffffffll;
>> +    return addr & MAKE_64BIT_MASK(0, TARGET_PHYS_ADDR_SPACE_BITS);
>>   }
>>     static int64_t load_kernel_info(void)
>
> Looks correct.  Any idea where this 29-bit value originated?
We just considered using  256M low-memory to load the kernel and did not 
consider using the high-memory.

Thanks.
Song Gao
>
> Acked-by: Richard Henderson <richard.henderson@linaro.org>
>
> r~



      reply	other threads:[~2023-03-28  3:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-27 11:23 [PATCH] hw/loongarch/virt: Fix virt_to_phys_addr function Tianrui Zhao
2023-03-27 17:44 ` Richard Henderson
2023-03-28  3:20   ` gaosong [this message]

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=dd1c55f5-d2c2-fd30-2541-b4be8e90d4f4@loongson.cn \
    --to=gaosong@loongson.cn \
    --cc=f4bug@amsat.org \
    --cc=maobibo@loongson.cn \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=zhaotianrui@loongson.cn \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).