* [PATCH v4] Libvtv: Add loongarch support.
@ 2022-10-29 6:53 Lulu Cheng
2022-10-31 9:38 ` Lulu Cheng
0 siblings, 1 reply; 2+ messages in thread
From: Lulu Cheng @ 2022-10-29 6:53 UTC (permalink / raw)
To: gcc-patches, cmtice; +Cc: xry111, i, xuchenghua, Lulu Cheng, qijingwen
v1 - > v2:
1. When the macro __loongarch_lp64 is defined, the VTV_PAGE_SIZE is set to 64K.
2. In the vtv_malloc.cc file __vtv_malloc_init function, it does not check
whether VTV_PAGE_SIZE is equal to the system page size, if the macro
__loongarch_lp64 is defined.
v2 -> v3:
Set VTV_PAGE_SIZE to 16KiB for loongarch64.
v3 -> v4:
Modifying the description.
---------------------------------------
The loongarch64 specification permits page sizes of 4KiB, 16KiB and 64KiB,
but only 16KiB pages are supported for now.
Co-Authored-By: qijingwen <qijingwen@loongson.cn>
include/ChangeLog:
* vtv-change-permission.h (defined):
(VTV_PAGE_SIZE): Set VTV_PAGE_SIZE to 16KiB for loongarch64.
libvtv/ChangeLog:
* configure.tgt: Add loongarch support.
---
include/vtv-change-permission.h | 4 ++++
libvtv/configure.tgt | 3 +++
2 files changed, 7 insertions(+)
diff --git a/include/vtv-change-permission.h b/include/vtv-change-permission.h
index 70bdad92bca..e7b9294a081 100644
--- a/include/vtv-change-permission.h
+++ b/include/vtv-change-permission.h
@@ -48,6 +48,10 @@ extern void __VLTChangePermission (int);
#else
#if defined(__sun__) && defined(__svr4__) && defined(__sparc__)
#define VTV_PAGE_SIZE 8192
+#elif defined(__loongarch_lp64)
+/* The page size is configurable by the kernel to be 4, 16 or 64 KiB.
+ For now, only the default page size of 16KiB is supported. */
+#define VTV_PAGE_SIZE 16384
#else
#define VTV_PAGE_SIZE 4096
#endif
diff --git a/libvtv/configure.tgt b/libvtv/configure.tgt
index aa2a3f675b8..6cdd1e97ab1 100644
--- a/libvtv/configure.tgt
+++ b/libvtv/configure.tgt
@@ -50,6 +50,9 @@ case "${target}" in
;;
x86_64-*-darwin[1]* | i?86-*-darwin[1]*)
;;
+ loongarch*-*-linux*)
+ VTV_SUPPORTED=yes
+ ;;
*)
;;
esac
--
2.31.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re:[pushed] [PATCH v4] Libvtv: Add loongarch support.
2022-10-29 6:53 [PATCH v4] Libvtv: Add loongarch support Lulu Cheng
@ 2022-10-31 9:38 ` Lulu Cheng
0 siblings, 0 replies; 2+ messages in thread
From: Lulu Cheng @ 2022-10-31 9:38 UTC (permalink / raw)
To: gcc-patches, cmtice; +Cc: xry111, i, xuchenghua, qijingwen
Pushed to r13-3571.
在 2022/10/29 下午2:53, Lulu Cheng 写道:
> v1 - > v2:
>
> 1. When the macro __loongarch_lp64 is defined, the VTV_PAGE_SIZE is set to 64K.
> 2. In the vtv_malloc.cc file __vtv_malloc_init function, it does not check
> whether VTV_PAGE_SIZE is equal to the system page size, if the macro
> __loongarch_lp64 is defined.
>
> v2 -> v3:
>
> Set VTV_PAGE_SIZE to 16KiB for loongarch64.
>
> v3 -> v4:
>
> Modifying the description.
>
> ---------------------------------------
>
>
> The loongarch64 specification permits page sizes of 4KiB, 16KiB and 64KiB,
> but only 16KiB pages are supported for now.
>
> Co-Authored-By: qijingwen <qijingwen@loongson.cn>
>
> include/ChangeLog:
>
> * vtv-change-permission.h (defined):
> (VTV_PAGE_SIZE): Set VTV_PAGE_SIZE to 16KiB for loongarch64.
>
> libvtv/ChangeLog:
>
> * configure.tgt: Add loongarch support.
> ---
> include/vtv-change-permission.h | 4 ++++
> libvtv/configure.tgt | 3 +++
> 2 files changed, 7 insertions(+)
>
> diff --git a/include/vtv-change-permission.h b/include/vtv-change-permission.h
> index 70bdad92bca..e7b9294a081 100644
> --- a/include/vtv-change-permission.h
> +++ b/include/vtv-change-permission.h
> @@ -48,6 +48,10 @@ extern void __VLTChangePermission (int);
> #else
> #if defined(__sun__) && defined(__svr4__) && defined(__sparc__)
> #define VTV_PAGE_SIZE 8192
> +#elif defined(__loongarch_lp64)
> +/* The page size is configurable by the kernel to be 4, 16 or 64 KiB.
> + For now, only the default page size of 16KiB is supported. */
> +#define VTV_PAGE_SIZE 16384
> #else
> #define VTV_PAGE_SIZE 4096
> #endif
> diff --git a/libvtv/configure.tgt b/libvtv/configure.tgt
> index aa2a3f675b8..6cdd1e97ab1 100644
> --- a/libvtv/configure.tgt
> +++ b/libvtv/configure.tgt
> @@ -50,6 +50,9 @@ case "${target}" in
> ;;
> x86_64-*-darwin[1]* | i?86-*-darwin[1]*)
> ;;
> + loongarch*-*-linux*)
> + VTV_SUPPORTED=yes
> + ;;
> *)
> ;;
> esac
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-10-31 9:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-29 6:53 [PATCH v4] Libvtv: Add loongarch support Lulu Cheng
2022-10-31 9:38 ` Lulu Cheng
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 read-only IMAP folder(s) and NNTP newsgroup(s).