From: Youling Tang <tangyouling@loongson.cn>
To: Tiezhu Yang <yangtiezhu@loongson.cn>
Cc: Huacai Chen <chenhuacai@kernel.org>,
WANG Xuerui <kernel@xen0n.name>,
Christian Brauner <brauner@kernel.org>,
Andy Lutomirski <luto@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Vincenzo Frascino <vincenzo.frascino@arm.com>,
loongarch@lists.linux.dev, linux-kernel@vger.kernel.org,
loongson-kernel@lists.loongnix.cn
Subject: Re: [PATCH v3] LoongArch: Add support to clone a time namespace
Date: Wed, 31 May 2023 16:34:06 +0800 [thread overview]
Message-ID: <526b7cdc-9d10-d213-4e98-10973483b4cd@loongson.cn> (raw)
In-Reply-To: <1685519761-20425-1-git-send-email-yangtiezhu@loongson.cn>
Hi, Tiezhu
On 05/31/2023 03:56 PM, Tiezhu Yang wrote:
/* snip */
> diff --git a/arch/loongarch/include/asm/vdso/vdso.h b/arch/loongarch/include/asm/vdso/vdso.h
> index 3b55d32..fa6049e 100644
> --- a/arch/loongarch/include/asm/vdso/vdso.h
> +++ b/arch/loongarch/include/asm/vdso/vdso.h
> @@ -16,10 +16,31 @@ struct vdso_pcpu_data {
>
> struct loongarch_vdso_data {
> struct vdso_pcpu_data pdata[NR_CPUS];
> - struct vdso_data data[CS_BASES]; /* Arch-independent data */
> };
>
> -#define VDSO_DATA_SIZE PAGE_ALIGN(sizeof(struct loongarch_vdso_data))
> +/*
> + * The layout of vvar:
> + *
> + * high
> + * +---------------------+--------------------------+
> + * | loongarch vdso data | LOONGARCH_VDSO_DATA_SIZE |
> + * +---------------------+--------------------------+
> + * | timens vdso data | PAGE_SIZE |
> + * +---------------------+--------------------------+
> + * | generic vdso data | PAGE_SIZE |
> + * +---------------------+--------------------------+
> + * low
> + */
> +#define LOONGARCH_VDSO_DATA_SIZE PAGE_ALIGN(sizeof(struct loongarch_vdso_data))
> +#define LOONGARCH_VDSO_DATA_PAGES (LOONGARCH_VDSO_DATA_SIZE >> PAGE_SHIFT)
> +#define VVAR_SIZE (VVAR_LOONGARCH_PAGES_START * PAGE_SIZE + LOONGARCH_VDSO_DATA_SIZE)
> +
> +enum vvar_pages {
> + VVAR_GENERIC_PAGE_OFFSET,
> + VVAR_TIMENS_PAGE_OFFSET,
> + VVAR_LOONGARCH_PAGES_START,
> + VVAR_LOONGARCH_PAGES_END = VVAR_LOONGARCH_PAGES_START + LOONGARCH_VDSO_DATA_PAGES - 1,
> +};
It can also be changed as follows,
enum vvar_pages {
VVAR_GENERIC_PAGE_OFFSET,
VVAR_TIMENS_PAGE_OFFSET,
VVAR_LOONGARCH_PAGES_START,
VVAR_LOONGARCH_PAGES_END = VVAR_LOONGARCH_PAGES_START +
LOONGARCH_VDSO_DATA_PAGES - 1,
VVAR_NR_PAGES,
};
#define VVAR_SIZE (VVAR_NR_PAGES << PAGE_SHIFT)
Which do you think is better?
Youling.
next prev parent reply other threads:[~2023-05-31 8:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-31 7:56 Tiezhu Yang
2023-05-31 8:34 ` Youling Tang [this message]
2023-05-31 10:02 ` Tiezhu Yang
2023-05-31 9:21 ` Thomas Gleixner
2023-05-31 10:04 ` Tiezhu Yang
2023-06-03 2:07 ` Youling Tang
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=526b7cdc-9d10-d213-4e98-10973483b4cd@loongson.cn \
--to=tangyouling@loongson.cn \
--cc=brauner@kernel.org \
--cc=chenhuacai@kernel.org \
--cc=kernel@xen0n.name \
--cc=linux-kernel@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=loongson-kernel@lists.loongnix.cn \
--cc=luto@kernel.org \
--cc=tglx@linutronix.de \
--cc=vincenzo.frascino@arm.com \
--cc=yangtiezhu@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
all inboxes | Powered by JetHome®