[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d116627c-f21f-1f6b-3c3d-96bea9a29393@loongson.cn>
Date: Wed, 31 May 2023 18:02:05 +0800
From: Tiezhu Yang <yangtiezhu@...ngson.cn>
To: Youling Tang <tangyouling@...ngson.cn>
Cc: Huacai Chen <chenhuacai@...nel.org>,
WANG Xuerui <kernel@...0n.name>,
Christian Brauner <brauner@...nel.org>,
Andy Lutomirski <luto@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Vincenzo Frascino <vincenzo.frascino@....com>,
loongarch@...ts.linux.dev, linux-kernel@...r.kernel.org,
loongson-kernel@...ts.loongnix.cn
Subject: Re: [PATCH v3] LoongArch: Add support to clone a time namespace
On 05/31/2023 04:34 PM, Youling Tang wrote:
> Hi, Tiezhu
>
> On 05/31/2023 03:56 PM, Tiezhu Yang wrote:
...
> 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?
Thanks, it seems more simple to define VVAR_SIZE and works well
as expected. Let us wait for more review comments before respin.
I will send v4 with the following changes based on the current
patch in the next week.
$ git diff
diff --git a/arch/loongarch/include/asm/vdso/vdso.h
b/arch/loongarch/include/asm/vdso/vdso.h
index fa6049ef635e..7e9bceb8c009 100644
--- a/arch/loongarch/include/asm/vdso/vdso.h
+++ b/arch/loongarch/include/asm/vdso/vdso.h
@@ -33,15 +33,17 @@ struct loongarch_vdso_data {
*/
#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,
+ VVAR_NR_PAGES,
};
+#define VVAR_SIZE (VVAR_NR_PAGES << PAGE_SHIFT)
+
static inline unsigned long get_vdso_base(void)
{
unsigned long addr;
Thanks,
Tiezhu
Powered by blists - more mailing lists