From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe34.google.com (mail-vs1-xe34.google.com [IPv6:2607:f8b0:4864:20::e34]) by sourceware.org (Postfix) with ESMTPS id 6A95B3858D37 for ; Mon, 10 Oct 2022 17:49:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6A95B3858D37 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=google.com Received: by mail-vs1-xe34.google.com with SMTP id v68so11061729vsb.1 for ; Mon, 10 Oct 2022 10:49:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=uZJAfxA0dAxUJlS5NRniizBk56OfoR3aIAWP5D/QvQU=; b=NYo6MDOc4vvw3bnwuseRPkEChpnGT63U8E+TrWyA2RftJlpfkLAGufI50ycUSJrEVP /e9jxlEcFg2N+zdSNfCpFlBZVOw5wQaeJA6hO+WTKal+dMNMZAVE2v4fVyPZwZxMXIvo YOiOZ6y+VJZYOF7UFgedn9S1bYraJH+tQGRQVNmD0RwgXyKy8dLf49K+ekvzwK8RCkOU rP40Jc2dQIN0CeRUPFtghN+N4SCV0IKV8J8acjLiG4Lu2Yu9weZAuSZKXp1HreronDyb Vi01HOT+kzFfRSNeNDq16ymEvl1iGpeCePO2yZQPgYj312173UsUXVToiq/cKXUD5ck9 OqhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=uZJAfxA0dAxUJlS5NRniizBk56OfoR3aIAWP5D/QvQU=; b=R2lRyN5Fojuabo37IekOiOVJJJn4zdr+dG0AXcXCUEcUGlZ0Sxk2HlUx0VSVZPIPaa 1DyEIMSEXycJAj36tIF1fGBozXEB2a8hJy7A01VyUxuWcxOpEgknH7ZXxsyu29lMUUBP AHV1c9Iu2WSya1lZB6n13Ipjf03bvvkArA0Y2JlgHJxftXT7ixA0GGtDuJRpBbIKAIIC Ahw3D14OMUNKTNZgzcBcQQFDWuKvWDLQaUARk3/HSg9LKis1eR2CCA7erlyTYMGutoV4 QrbnNrdMyVh/mTGqM5Rz1UfbV11zZJjXIIjRM+Ka9SlfKyt65icg5PF00guef3sjgMEZ qeiQ== X-Gm-Message-State: ACrzQf3L7WHh/endVVX9RNUmbsUkDf1HtOuesIVuf9ii8bipJkNU8VLa CCJLm41YEwIlbJo/aGP8ksNDdnIIOOXcdlOOtC/ImA== X-Google-Smtp-Source: AMsMyM759mqnFPzWvPO7gHC8Wr+WsDBOuFkE+PV49ADgnu/n+lSWtDLi2BcQHtRbOmPDFtDg4nZINeNa6dT2Yvv7bgI= X-Received: by 2002:a67:d20b:0:b0:3a7:2b99:bab8 with SMTP id y11-20020a67d20b000000b003a72b99bab8mr7962884vsi.35.1665424176671; Mon, 10 Oct 2022 10:49:36 -0700 (PDT) MIME-Version: 1.0 References: <20220927074928.804896-1-chenglulu@loongson.cn> In-Reply-To: <20220927074928.804896-1-chenglulu@loongson.cn> From: Caroline Tice Date: Mon, 10 Oct 2022 10:49:25 -0700 Message-ID: Subject: Re: [PATCH v2] LoongArch: Libvtv add loongarch support. To: Lulu Cheng Cc: GCC Patches , mliska@suse.cz, David Malcolm , qijingwen , xuchenghua@loongson.cn, i@xen0n.name Content-Type: multipart/alternative; boundary="00000000000073c9bd05eab1c88a" X-Spam-Status: No, score=-23.7 required=5.0 tests=BAYES_00,DKIMWL_WL_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,ENV_AND_HDR_SPF_MATCH,GIT_PATCH_0,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --00000000000073c9bd05eab1c88a Content-Type: text/plain; charset="UTF-8" On Tue, Sep 27, 2022 at 3:04 AM Lulu Cheng wrote: > > 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. > > All regression tests of libvtv passed. > > === libvtv Summary === > > # of expected passes 176 > > But I haven't tested the performance yet. > > ----------------------------------- > Co-Authored-By: qijingwen > > include/ChangeLog: > > * vtv-change-permission.h (defined): > (VTV_PAGE_SIZE): Under the loongarch64 architecture, > set VTV_PAGE_SIZE to 64K. > > libvtv/ChangeLog: > > * configure.tgt: Add loongarch support. > * vtv_malloc.cc (defined): If macro __loongarch_lp64 is > defined, then don't check whether VTV_PAGE_SIZE is the > same as the system page size. > --- > include/vtv-change-permission.h | 4 ++++ > libvtv/configure.tgt | 3 +++ > libvtv/vtv_malloc.cc | 5 +++++ > 3 files changed, 12 insertions(+) > > diff --git a/include/vtv-change-permission.h > b/include/vtv-change-permission.h > index 70bdad92bca..64e419c29d5 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 > +/* LoongArch architecture 64-bit system supports 4k,16k and 64k > + page size, which is set to the maximum value here. */ > +#elif defined(__loongarch_lp64) > +#define VTV_PAGE_SIZE 65536 > #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 > diff --git a/libvtv/vtv_malloc.cc b/libvtv/vtv_malloc.cc > index 67c5de6d4e9..45804b8d7f8 100644 > --- a/libvtv/vtv_malloc.cc > +++ b/libvtv/vtv_malloc.cc > @@ -212,6 +212,11 @@ __vtv_malloc_init (void) > > #if defined (__CYGWIN__) || defined (__MINGW32__) > if (VTV_PAGE_SIZE != sysconf_SC_PAGE_SIZE()) > +#elif defined (__loongarch_lp64) > + /* I think that under the LoongArch 64-bit system, VTV_PAGE_SIZE is set > + to the maximum value of 64K supported by the system, so there is no > + need to judge here. */ > + if (false) > #else > if (VTV_PAGE_SIZE != sysconf (_SC_PAGE_SIZE)) > Is "if (VTV_PAGE_SIZE != sysconf (_SC_PAGE_SIZE))" going to fail for loongarch? If not, why do you need to insert anything here at all? If so, perhaps you could write something similar to sysconf_SC_PAGE_SIZE for loongarch (as was done for __CYGWIN__ & __MINGW32__)? -- Caroline cmtice@google.com > #endif > -- > 2.31.1 > > --00000000000073c9bd05eab1c88a--