From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::d44; helo=mail-io1-xd44.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2C2D8211A2077 for ; Wed, 2 Jan 2019 08:55:03 -0800 (PST) Received: by mail-io1-xd44.google.com with SMTP id g8so13623905iok.4 for ; Wed, 02 Jan 2019 08:55:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Hvs6FpPy+JW1xFEKXloolLnmxTUYr0gxhzDRQoHp7Lw=; b=MgLKZL55nrDYWQdZprX8O4UpMcVpQDQnt1GNb7eq7hmRyOMaIYD1tjY7Qo4N7/l04O cyUDMKrdf9LSWwdnlN5PCq+RvzCiiBGdPjqGr4mo1YxE00pvaJ3VnQELcnlgHDDGP+oB WdSjfB0G+drG0VOB+aVj7/AF3a4o9tE5tMPa4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Hvs6FpPy+JW1xFEKXloolLnmxTUYr0gxhzDRQoHp7Lw=; b=CUyLzXZMu1xsZR2OC4GVrp2WaXdgAobW/2huQrT8Ckpk0F6U27CFk816T3qk0NFeoI dj0z7OyfnG0Gv7ro77gFMafqJBb3u9bjyl/cSuLFP8PR+9+LiflMNQo24OrEY0/KFmvL 1Ys5yBjnY8Dslura2TgB6Sg/2hSnpEH9S6ugweJUKMG8d3M0W8JxSscWu5hm8mCxgf7z UVZjBKRDFHO9hHIfD9fQv2icCXXZ19QySWCM3U4WdNhf9F8vu9jqpzXpDF9XkwEQkyuV 7cRPayoLYkUrqdo0ZX2hWQ7ECSg+CfJmevP7YZFThKQhNBqrZ5O+V29I/22iF0G2Lblf xYYA== X-Gm-Message-State: AJcUukdiHeiV/feuU98Cx/gfMOmR5H1qQDIbu/2KYZqYAtWjzfrkkYwH EDCRjZVydho43jurOpHjgv6n0yNCUU4ev8HRTxZSYw== X-Google-Smtp-Source: ALg8bN793Pb5jLD7lY9ygI0laGR06gXrUL2QijxIkvCfwSFhWOa6K/frqMGbRKKggXjy3ZSJ88OZ3rgtOw419djTZiY= X-Received: by 2002:a6b:5d01:: with SMTP id r1mr29698787iob.170.1546448103010; Wed, 02 Jan 2019 08:55:03 -0800 (PST) MIME-Version: 1.0 References: <1544789607-11316-1-git-send-email-jagadeesh.ujja@arm.com> <1544789607-11316-11-git-send-email-jagadeesh.ujja@arm.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14E3A021C@SHSMSX104.ccr.corp.intel.com> In-Reply-To: From: Ard Biesheuvel Date: Wed, 2 Jan 2019 17:54:51 +0100 Message-ID: To: "Gao, Liming" Cc: Jagadeesh Ujja , "edk2-devel@lists.01.org" , "Zhang, Chao B" Subject: Re: [PATCH 10/13] MdeModulePkg/VarCheckLib: allow MM_STANDALONE drivers to use this library X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2019 16:55:04 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2 Jan 2019 at 15:23, Ard Biesheuvel wro= te: > > On Wed, 2 Jan 2019 at 14:23, Gao, Liming wrote: > > > > Ard: > > Why need to change module type? The non-base type library can support= more than one module types, such as MdeModulePkg\Library\PeiDxeDebugLibRep= ortStatusCode\PeiDxeDebugLibReportStatusCode.inf. Only if this library has = constructor and needs to support cross module type, it must be set to BASE.= For other case, its module type can be kept as-is. I clarify this rule in = https://lists.01.org/pipermail/edk2-devel/2018-December/033523.html. > > > > Currently, standalone MM on AArch64 requires strict alignment, and we > only build SEC, PEI_CORE, PEIM and BASE modules with strict alignment. > > In general, I think it makes sense to default to BASE type for all > libraries unless there is a need to using something else, i.e, when > the library has a constructor that needs to ImageHandle and/or > SystemTable arguments. Actually, regardless of whether BASE is more appropriate in general, I think there is no reason to keep the strict alignment checking in standalone MM, since the MM core will be invoked with MMU and caches enabled, and so there is no reason to disallow unaligned accesses (this is different from SEC and PEI modules on ARM, since they may execute in place with the caches and MMU off, in which case unaligned accesses are never permitted) I will raise this internally. In the mean time, please disregard this aspect of my feedback. Simply adding MM_STANDALONE to the list of permitted module types should be sufficient.