qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Laurent Vivier <laurent@vivier.eu>
Cc: peter.maydell@linaro.org, fanwj@mail.ustc.edu.cn, qemu-devel@nongnu.org
Subject: Re: [PATCH] linux-user: fix bug about incorrect base addresss of gdt on i386 and x86_64
Date: Tue, 7 Mar 2023 10:20:34 -0800	[thread overview]
Message-ID: <10a7773d-5665-3c84-f49e-df0cfc6d81a3@linaro.org> (raw)
In-Reply-To: <86533769-fecb-974e-765e-c1210cb36d4f@vivier.eu>

On 3/7/23 06:30, Laurent Vivier wrote:
> Richard,
> 
> do you think it's correct?

It's correct enough, until target/i386 is fixed to not require the GDT/LDT to be 
incorrectly mapped in the (ring 3) user address space.

You may wish to fix a few nits when applying:

>>   }
>> +static void target_cpu_free(void *obj)

Missing line before function.

>> +#if defined(TARGET_I386) || defined(TARGET_X86_64)
>> +    new_env->gdt.base = target_mmap(0, sizeof(uint64_t) * TARGET_GDT_ENTRIES,
>> +                                    PROT_READ|PROT_WRITE,
>> +                                    MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
>> +    memcpy((void*)g2h_untagged(new_env->gdt.base), (void*)g2h_untagged(env->gdt.base), 
>> sizeof(uint64_t) * TARGET_GDT_ENTRIES);

Unnecessary casts, overlong line.


r~


  reply	other threads:[~2023-03-07 18:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-08 15:49 [PATCH] linux-user: fix bug about incorrect base addresss of gdt on i386 and x86_64 fanwj
2023-03-07 14:30 ` Laurent Vivier
2023-03-07 18:20   ` Richard Henderson [this message]
2023-03-07 18:45 ` Laurent Vivier
  -- strict thread matches above, loose matches on Subject: below --
2023-01-03 11:38 fanwenjie
2023-01-15  5:32 ` 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=10a7773d-5665-3c84-f49e-df0cfc6d81a3@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=fanwj@mail.ustc.edu.cn \
    --cc=laurent@vivier.eu \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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).