From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id 49FBE3858418 for ; Fri, 5 Aug 2022 02:51:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 49FBE3858418 Received: from [192.168.0.105] (unknown [183.200.25.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 4D018668D4; Thu, 4 Aug 2022 22:51:42 -0400 (EDT) Message-ID: Subject: Re: =?gb2312?Q?=BB=D8=B8=B4=A3=BA=5BPATCH?= v5] LoongArch: add movable attribute From: Xi Ruoyao To: Lulu Cheng , "gcc-patches@gcc.gnu.org" Cc: Chenghua Xu , Youling Tang , Huacai Chen , Jinyang He , Wang Xuerui Date: Fri, 05 Aug 2022 10:51:36 +0800 In-Reply-To: References: <9b6b0e68cfb7e87ae961ef8a7bb7987f534da19c.camel@xry111.site> <6cafbcdf79f77b73b9329f3e3a2f24ec85eda94d.camel@xry111.site> <-2muj1c-68saz6jhkcyw3jo1xp-1mgcvnkbqi2wjp6tue-qsso54-emxgu3-k85590-kpgox7-w67u6h3cai1l-5bi887dsgzsu-g4d7i7-wl316qxrucx4kv4on7-mnna36-iremg8-nwc5ot-9041t2-hu8nsl.1659495047941@email.android.com> <90d2f698eaa2ef88712e9aef453b1deff197b533.camel@xry111.site> <44a2cb6f-b8b2-babb-bfcc-3dd17d8fce42@loongson.cn> <60bac545a09ee202d41421a596ac64a4cb83d89c.camel@xry111.site> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.3 MIME-Version: 1.0 X-Spam-Status: No, score=4.6 required=5.0 tests=BAYES_00, BODY_8BITS, CHARSET_FARAWAY_HEADER, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FROM_SUSPICIOUS_NTLD, LIKELY_SPAM_FROM, PDS_OTHER_BAD_TLD, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: **** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Aug 2022 02:51:46 -0000 On Fri, 2022-08-05 at 10:38 +0800, Lulu Cheng wrote: > > > I'm working on the implementation of specifing attributes of variable= s for other architectures. > > > If the address is obtained through the GOT table and 4 instructions, = there is not much difference in performance. > > In this case I still prefer a GOT table entry because for 4-instruction > > absolute addressing sequence we'll need to implement 4 new relocation > > types in the kernel module loader. > If it is accessed through the GOT table, dynamic relocation is required w= hen the module is loaded. Dynamic relocation is required when the module is loaded anyway. The .ko modules are actually relocatable ELF objects (produced by ld -r) and the module loader has to perform some work of a normal linker. > And accessing the got table may have a cache miss. /* snip */ > So my idea is "model(normal)","model (large)" etc. Then should we have an option to disable GOT globally? Maybe for kernel we'll just "-mno-got -mcmodel=3Dlarge" (or "extreme"? The kernel image is loaded at 0x9000000000000000 and the modules are above 0xffff000000000000 so we need to handle 64-bit offset). --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University