From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web09.7079.1615894845944562548 for ; Tue, 16 Mar 2021 04:40:46 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Et+1rrne; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615894845; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=z2hgkhTcqRffZWYZ9pB9dVFeXjXI6ppT8PvxDbW/aq0=; b=Et+1rrneYcf6ggYuoc9pkfgtFxa/NB7W9qxMImShlMHSzQYzlSC8txbakUAkvNNourw9zd 0cKGUn8qsnQtUCQcKlVA2UeP3AsWfe4ZL4rh6epu2qORiEHjpQlWr9ARCmIEmzh272ucS0 GN3q62kOUNcdgIwH6t8bd2NIBmHbYpw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-273-N6-BCFGhPeqCKOROPTkhYA-1; Tue, 16 Mar 2021 07:40:41 -0400 X-MC-Unique: N6-BCFGhPeqCKOROPTkhYA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5CE911966320; Tue, 16 Mar 2021 11:40:39 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-138.ams2.redhat.com [10.36.114.138]) by smtp.corp.redhat.com (Postfix) with ESMTP id BDD5F10023B5; Tue, 16 Mar 2021 11:40:37 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v9 10/10] OvmfPkg/SmmControl2Dxe: negotiate CPU hot-unplug To: devel@edk2.groups.io, ankur.a.arora@oracle.com Cc: imammedo@redhat.com, boris.ostrovsky@oracle.com, Jordan Justen , Ard Biesheuvel , Aaron Young References: <20210312062656.2477515-1-ankur.a.arora@oracle.com> <20210312062656.2477515-11-ankur.a.arora@oracle.com> From: "Laszlo Ersek" Message-ID: Date: Tue, 16 Mar 2021 12:40:36 +0100 MIME-Version: 1.0 In-Reply-To: <20210312062656.2477515-11-ankur.a.arora@oracle.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 03/12/21 07:26, Ankur Arora wrote: > Advertise OVMF support for CPU hot-unplug and negotiate it > if QEMU requests the feature. > > Cc: Laszlo Ersek > Cc: Jordan Justen > Cc: Ard Biesheuvel > Cc: Igor Mammedov > Cc: Boris Ostrovsky > Cc: Aaron Young > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3132 > Signed-off-by: Ankur Arora > --- > > Notes: > Addresses the following comments from v8: > > (1) Remove inconsistent comment style (and stray newline) around the newly > added ICH9_LPC_SMI_F_CPU_HOT_UNPLUG. > (2) Remove spurious empty line. > > OvmfPkg/SmmControl2Dxe/SmiFeatures.c | 18 ++++++++++++++++-- > 1 file changed, 16 insertions(+), 2 deletions(-) > > diff --git a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c b/OvmfPkg/SmmControl2Dxe/SmiFeatures.c > index c9d875543205..3e2e61e4dbd0 100644 > --- a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c > +++ b/OvmfPkg/SmmControl2Dxe/SmiFeatures.c > @@ -28,7 +28,12 @@ > // "etc/smi/supported-features" and "etc/smi/requested-features" fw_cfg files. > // > #define ICH9_LPC_SMI_F_CPU_HOTPLUG BIT1 > - > +// > +// The following bit value stands for "enable CPU hot-unplug, and inject an SMI > +// with control value ICH9_APM_CNT_CPU_HOTPLUG upon hot-unplug", in the > +// "etc/smi/supported-features" and "etc/smi/requested-features" fw_cfg files. > +// > +#define ICH9_LPC_SMI_F_CPU_HOT_UNPLUG BIT2 Per my v8 comment, this hunk is not supposed to change the amount of vertical whitespace, in either direction. v8 added an empty line that wasn't called for, and this version removes one, which is also unjustified. But I'll fix that up when I merge this series (= soon). Reviewed-by: Laszlo Ersek Thanks! Laszlo > // > // Provides a scratch buffer (allocated in EfiReservedMemoryType type memory) > // for the S3 boot script fragment to write to and read from. > @@ -112,7 +117,8 @@ NegotiateSmiFeatures ( > QemuFwCfgReadBytes (sizeof mSmiFeatures, &mSmiFeatures); > > // > - // We want broadcast SMI, SMI on CPU hotplug, and nothing else. > + // We want broadcast SMI, SMI on CPU hotplug, SMI on CPU hot-unplug > + // and nothing else. > // > RequestedFeaturesMask = ICH9_LPC_SMI_F_BROADCAST; > if (!MemEncryptSevIsEnabled ()) { > @@ -120,6 +126,7 @@ NegotiateSmiFeatures ( > // For now, we only support hotplug with SEV disabled. > // > RequestedFeaturesMask |= ICH9_LPC_SMI_F_CPU_HOTPLUG; > + RequestedFeaturesMask |= ICH9_LPC_SMI_F_CPU_HOT_UNPLUG; > } > mSmiFeatures &= RequestedFeaturesMask; > QemuFwCfgSelectItem (mRequestedFeaturesItem); > @@ -166,6 +173,13 @@ NegotiateSmiFeatures ( > __FUNCTION__)); > } > > + if ((mSmiFeatures & ICH9_LPC_SMI_F_CPU_HOT_UNPLUG) == 0) { > + DEBUG ((DEBUG_INFO, "%a: CPU hot-unplug not negotiated\n", __FUNCTION__)); > + } else { > + DEBUG ((DEBUG_INFO, "%a: CPU hot-unplug with SMI negotiated\n", > + __FUNCTION__)); > + } > + > // > // Negotiation successful (although we may not have gotten the optimal > // feature set). >