From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id D9ED8740034 for ; Tue, 15 Aug 2023 15:39:43 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=m7hZhdVSvma+udxkRPt2BiIZKpH4+ZzNMr+shvMy3z0=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20140610; t=1692113982; v=1; b=a8WzZjqBCm+1HNzH2gL/0/u3l/W7l5xFymIkmXrTcAQjOu4TJu/3vTc4ovE6tHKORxOfmLSJ WueBr7Ry56E2QRgrLA/2saAPO8BuBC1QwfF/D+o1Cu4q1FmzxTVn+EpVlpxTzidwRxXUsIVIFfH OoGGtnUHO2m+EgOvBQjFJqvE= X-Received: by 127.0.0.2 with SMTP id yeGAYY7687511xIfBo98BLes; Tue, 15 Aug 2023 08:39:42 -0700 X-Received: from mail-ua1-f54.google.com (mail-ua1-f54.google.com [209.85.222.54]) by mx.groups.io with SMTP id smtpd.web10.137400.1692113981931496810 for ; Tue, 15 Aug 2023 08:39:42 -0700 X-Received: by mail-ua1-f54.google.com with SMTP id a1e0cc1a2514c-79a31d66002so1432347241.3 for ; Tue, 15 Aug 2023 08:39:41 -0700 (PDT) X-Gm-Message-State: Dizi3JmqpHxMpmGLpDPXNKrfx7686176AA= X-Google-Smtp-Source: AGHT+IEAD2y+PECXHcSnRySTw8yUe2Q8HSNaWOW60MJN3qgzB1lL/eD6QLz0pgtMN8zSSVsMsTZoFNssaQEuhqGCYQs= X-Received: by 2002:a67:f753:0:b0:443:6457:101 with SMTP id w19-20020a67f753000000b0044364570101mr12538665vso.7.1692113980758; Tue, 15 Aug 2023 08:39:40 -0700 (PDT) MIME-Version: 1.0 References: <22642530-3177-d5d9-426a-d5a68ebfe8c6@loongson.cn> <4EB062B0-6C13-480F-A2CC-95C715A08ECD@apple.com> <0026aa43-c2d6-92bf-77a0-391a608e8b22@loongson.cn> <30CC4A49-0827-4960-A8F5-F44F534051F9@apple.com> In-Reply-To: <30CC4A49-0827-4960-A8F5-F44F534051F9@apple.com> From: "Pedro Falcato" Date: Tue, 15 Aug 2023 16:39:29 +0100 Message-ID: Subject: Re: [edk2-devel] About EDK2 supports Self Modifying Code To: devel@edk2.groups.io, afish@apple.com Cc: lichao@loongson.cn, Ard Biesheuvel , Liming Gao , Bob Feng , Yuwei Chen Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pedro.falcato@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=a8WzZjqB; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io On Tue, Aug 15, 2023 at 4:05=E2=80=AFPM Andrew Fish via groups.io wrote: > > Chao, > > From a quick google it looks like CSR* is used to access banks of registe= rs that relate to things like performance counters and debug infrastructure= and the number of banks of these register sets is likely implementation de= fined. Seems like we could introduce some Fixed At Build PCD values that de= fine the maximum number of elements in a given bank. > > If we are forced to use assembler it might be possible to write some macr= os that used the fixed at build values to only generate functions for banks= that are needed for a given build. Then I think it becomes an exercise in = dead code stripping the assembler. Most compilers generate assembler that c= ontains functions that can be stripped as long as those functions follow ce= rtain rules. > > As a side note it would be good for us to have an FAQ/Wiki entry for the = dead code stripping rules for the various flavors of assembler. I know the = Apple assembler has a unique take on this. FWIW, I'm almost positive there's no DCE in GNU as (or llvm-as as well). Unless you use something ffunction-sections -fdata-sections-like, but then you're relying on the linker + gc-sections to take care of it, just like GCC/clang would. --=20 Pedro -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107768): https://edk2.groups.io/g/devel/message/107768 Mute This Topic: https://groups.io/mt/100751724/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-