From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe30.google.com (mail-vs1-xe30.google.com [IPv6:2607:f8b0:4864:20::e30]) by sourceware.org (Postfix) with ESMTPS id A45F43858436 for ; Wed, 12 Oct 2022 04:06:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A45F43858436 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-xe30.google.com with SMTP id p7so13001641vsr.7 for ; Tue, 11 Oct 2022 21:06:04 -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=KD/Psl7H5KbnYZGNKbdODV/+vQBFlfXiHju+HfEc/1E=; b=Rno7wtQwFdpFXIfTOIHGeyXyfjLUccaWtfefzkkUfGuzr84we3VxOR6bBFASLjJIF3 OYzpFt+7HQMO5+vfFtKHif/9uCb8cTa/pGDCVxhDYe5CAOB8KU1d7lwCOA3KBTH+8WAI YM4xaWHXFuO0eqco2GIl3sI6+9q01UnbVhMJP24ZJhEB42Fv5aenRCxZHLzseOKyciBc WKwNf3oEmtec2suFmBPbTcKeeB7Cgq6le1EzQqhlSuN3eM9Stn0F5C/+9xjpxRZH3ONa Dj4x6BIohxyFQgVe3b5j91w3vabpfE5H/LgUupQimn+pSltZZICIi73uyc16BR8fQnnZ ST9Q== 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=KD/Psl7H5KbnYZGNKbdODV/+vQBFlfXiHju+HfEc/1E=; b=BvMN8Jnc8t4V0BtM/+dtQNKJusluPjf6sGcr1Y7ZrUzp1cJsCERF61D1qK8d7WEWpg /5Hd/sxa/mpE7Zk4VSXB5tsw+dqSGQRlScm02VxVmQ0eaPq2kZcBXBaxv2r61+q8O1tF mOd/Qt4wQt0oqBmWgf5oc0PxOj6xoCeOjxzdzgwzeWIkGmup2JJgS80oZ4Q+StxTyk5Z c+in3GmrSMQAv/gahXswk8xhSlWIefQKdnY3CtK7WcMOooMIcDheUrqmSbt4k9EKiLTl ifeAFj47MW/RdB9c3I68r5+ljZv2goZ91LoEeoiVExkzqGnwOOo11W6yXDCy2VqGWGBs uwtQ== X-Gm-Message-State: ACrzQf1eWf6D8Sq65TnrpukJlfuoSJEsAndQY2jR+rI+RupM2csY6OYX kMjZASDuLh9gWgjzr4Xuf/XeVZmHFYn1fOlzgDeHWg== X-Google-Smtp-Source: AMsMyM4yLm5iL5e5sPO5e9JycwtdofFcn9tkbQ0utzgFCO5FeEeUxvU5ySTEBCwefd5MWQS8KYbq8+JYJ+vzND6IZv8= X-Received: by 2002:a05:6102:284a:b0:3a7:ce5:ca83 with SMTP id az10-20020a056102284a00b003a70ce5ca83mr12569939vsb.38.1665547563984; Tue, 11 Oct 2022 21:06:03 -0700 (PDT) MIME-Version: 1.0 References: <20220927074928.804896-1-chenglulu@loongson.cn> <7a6d077c-7a3b-1660-ba20-a24804e10b30@loongson.cn> In-Reply-To: <7a6d077c-7a3b-1660-ba20-a24804e10b30@loongson.cn> From: Caroline Tice Date: Tue, 11 Oct 2022 21:05:52 -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="000000000000e8b4c705eace82b6" X-Spam-Status: No, score=-17.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,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: --000000000000e8b4c705eace82b6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Oct 11, 2022 at 7:52 PM Lulu Cheng wrote: > > =E5=9C=A8 2022/10/12 =E4=B8=8A=E5=8D=884:57, Caroline Tice =E5=86=99=E9= =81=93: > > I think that if VTV_PAGE_SIZE is not set to the actual size being used by > the system, it could result in some unexpected failures. I believe the > right thing to do in this case, since the size may vary, is to get the > actual size being used by the system and use that in the definition of > VTV_PAGE_SIZE. So in include/vtv-permission.h you would have something > like: > > +#elif defined(__loongarch_lp64) > +#define VTV_PAGE_SIZE sysconf(_SC_PAGE_SIZE) > > Then you would have the accurate, correct size for the current system, and > there would be no need to update the > check in vtv_malloc.cc at all. > > > /* Page-aligned symbol to mark beginning of .vtable_map_vars section. > */ > char _vtable_map_vars_start [] > __attribute__ ((__visibility__ ("protected"), used, > aligned(VTV_PAGE_SIZE), > section(".vtable_map_vars"))) > =3D { }; > > The above code is in the libgcc/vtv_start.c file. Alignment (aligned > (alignment) ) must be an > integer constant power of 2. So setting VTV_PAGE_SIZE as a variable is not > advisable. > > > As xiruoyao notes, the default value for the LoongArch Linux kernel > configuration is 16KB. > > So let's set VTV_PAGE_SIZE to 16KB first and I will indicate in the > submission information > > that only 16KB pages are supported. > > > OK, that would work if you want to go that way. --000000000000e8b4c705eace82b6--