From: Paul Burton <paulburton@kernel.org>
To: Guoyun Sun <sunguoyun@loongson.cn>
Cc: Ralf Baechle <ralf@linux-mips.org>,
Thomas Gleixner <tglx@linutronix.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Vincenzo Frascino <vincenzo.frascino@arm.com>,
Allison Randal <allison@lohutok.net>,
linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mips/vdso: Support mremap() for vDSO
Date: Tue, 14 Jan 2020 16:08:15 -0800 [thread overview]
Message-ID: <20200115000815.narpydp4unkkuboj@pburton-laptop> (raw)
In-Reply-To: <1578978808-18633-1-git-send-email-sunguoyun@loongson.cn>
Hi Guoyun,
On Tue, Jan 14, 2020 at 01:13:28PM +0800, Guoyun Sun wrote:
> diff --git a/arch/mips/kernel/vdso.c b/arch/mips/kernel/vdso.c
> index bc35f84..eac3982 100644
> --- a/arch/mips/kernel/vdso.c
> +++ b/arch/mips/kernel/vdso.c
> @@ -38,6 +38,28 @@ static struct vm_special_mapping vdso_vvar_mapping = {
> .pages = no_pages,
> };
>
> +int vdso_mremap(const struct vm_special_mapping *sm,
> + struct vm_area_struct *new_vma)
> +{
> + unsigned long new_size = new_vma->vm_end - new_vma->vm_start;
> +
> +#ifdef CONFIG_MIPS32_O32
> + if (vdso_image_o32.size != new_size)
> + return -EINVAL;
> +#endif
> +
> +#ifdef CONFIG_MIPS32_N32
> + if (vdso_image_n32.size != new_size)
> + return -EINVAL;
> +#endif
> +
> + if (vdso_image.size != new_size)
> + return -EINVAL;
> +
> + current->mm->context.vdso = (void __user *)(new_vma->vm_start);
> + return 0;
> +}
> +
Thanks for the patch; this bit doesn't seem right though. It requires
that all the VDSOs be the same size, which seems questionable. I think
we probably need separate mremap callbacks for each VDSO, so that we can
check the appropriate VDSO size.
Thanks,
Paul
prev parent reply other threads:[~2020-01-15 0:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-14 5:13 [PATCH] mips/vdso: Support mremap() for vDSO Guoyun Sun
2020-01-15 0:08 ` Paul Burton [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=20200115000815.narpydp4unkkuboj@pburton-laptop \
--to=paulburton@kernel.org \
--cc=allison@lohutok.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=ralf@linux-mips.org \
--cc=sunguoyun@loongson.cn \
--cc=tglx@linutronix.de \
--cc=vincenzo.frascino@arm.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 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).