qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] q35:Enable TSEG only when G_SMRAME and TSEG_EN both enabled


From: Gerd Hoffmann
Subject: Re: [PATCH] q35:Enable TSEG only when G_SMRAME and TSEG_EN both enabled
Date: Wed, 15 Jun 2022 08:57:27 +0200

On Wed, Jun 15, 2022 at 11:45:01AM +0800, Zhenzhong Duan wrote:
> According to spec:
> "TSEG Enable (T_EN): Enabling of SMRAM memory for Extended SMRAM space
> only. When G_SMRAME = 1 and TSEG_EN = 1, the TSEG is enabled to appear
> in the appropriate physical address space. Note that once D_LCK is set,
> this bit becomes read only."

edk2 agrees and explicitly sets SMRAM_G_SMRAME:

  //
  // TSEG should be closed (see above), but unlocked, initially. Set G_SMRAME
  // (Global SMRAM Enable) too, as both D_LCK and T_EN depend on it.
  //
  PciAndThenOr8 (
    DRAMC_REGISTER_Q35 (MCH_SMRAM),
    (UINT8)((~(UINT32)MCH_SMRAM_D_LCK) & 0xff),
    MCH_SMRAM_G_SMRAME
    );

Good.

> -    if (pd->config[MCH_HOST_BRIDGE_ESMRAMC] & MCH_HOST_BRIDGE_ESMRAMC_T_EN) {
> +    if ((pd->config[MCH_HOST_BRIDGE_ESMRAMC] & MCH_HOST_BRIDGE_ESMRAMC_T_EN) 
> &&
> +        (pd->config[MCH_HOST_BRIDGE_SMRAM] & SMRAM_G_SMRAME)) {

Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>

take care,
  Gerd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]