From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.61]) by mx.groups.io with SMTP id smtpd.web10.9833.1583397153030087895 for ; Thu, 05 Mar 2020 00:32:33 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cDot9v8T; spf=pass (domain: redhat.com, ip: 205.139.110.61, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583397152; h=from:from:reply-to: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=xuBM1ml4eWzxNwDGuZ5PaENPsmLN7gD+VbnYFS7gFvQ=; b=cDot9v8TsxgGamYluEy8EDtJEUSTEjG8Sbs8qgWbSXdN15qYQgAdKg3vgh+ntNLksHmVZ0 mnj5pJ7NUxKjY9SLx5xgQtUL9H6eEhG2zoMurvwKxn+HUSfDUf+EOg8Yi99wtdeC1bY4za pafetUCR4hGicwIiDCny/7rpH3Lmp+M= 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-490-RcCANujoNVqypq7OjfuxtA-1; Thu, 05 Mar 2020 03:32:27 -0500 X-MC-Unique: RcCANujoNVqypq7OjfuxtA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 676C4107ACC4; Thu, 5 Mar 2020 08:32:25 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-216.ams2.redhat.com [10.36.117.216]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E39673891; Thu, 5 Mar 2020 08:32:22 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v2 00/16] OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE From: "Laszlo Ersek" To: edk2-devel-groups-io Cc: Ard Biesheuvel , Eric Dong , Hao A Wu , Igor Mammedov , Jian J Wang , Jiewen Yao , Jordan Justen , Michael Kinney , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Ray Ni , Boris Ostrovsky Reply-To: devel@edk2.groups.io, lersek@redhat.com References: <20200226221156.29589-1-lersek@redhat.com> <58071145-b4a3-57bb-85ec-cc53539f22c2@redhat.com> Message-ID: <193b1113-af0e-e8d6-b6d8-8fde0e326456@redhat.com> Date: Thu, 5 Mar 2020 09:32:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <58071145-b4a3-57bb-85ec-cc53539f22c2@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 03/04/20 13:29, Laszlo Ersek wrote: > On 02/26/20 23:11, Laszlo Ersek wrote: >> Supersedes: <20200223172537.28464-1-lersek@redhat.com> >> Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1512 >> Repo: https://github.com/lersek/edk2.git >> Branch: vcpu_hotplug_smm_bz_1512_v2 >> >> V1 was posted at: >> >> * [edk2-devel] [PATCH 00/16] >> OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE >> >> https://edk2.groups.io/g/devel/message/54734 >> http://mid.mail-archive.com/20200223172537.28464-1-lersek@redhat.com >> >> New in v2: >> >> - Document (in patch#11) and implement (in patch#12) the "combined" >> approach described here: >> >> http://mid.mail-archive.com/111145fc-be3d-2a9a-a126-c14345a8a8a4@redhat.com >> https://edk2.groups.io/g/devel/message/54754 >> >> The idea is basically to make the SMM Monarch wait not just until >> the hot-added CPU hits the normal RAM Post-SMM Pen (which is safe >> wrt. ordering, but can be attacked by the OS), but *also* until the >> hot-added CPU is just about to execute RSM first (which is a bit >> less safe wrt. ordering, but cannot be attacked by the OS). >> >> - Pick up Ard's conditional A-b for the other patches, which have not >> been modified. >> >> - Rebase to master, and retest. > Merged as commit range 61d3b2d4279e..1158fc8e2c7b, via > . I've successfully tested this (now upstream) series with - Windows Server 2012 R2 Standard, and - Windows Server 2016 v1803 guests as well. For that, an ACPI tweak is needed on the QEMU side (on top of Igor's PoC patch). Namely, in the ASL quoted in the v1 blurb that's linked above, Windows's ACPI parser does not like the "SMIR" OperationRegion to be nested in a device, such as \_SB.SMI0. ("Does not like" means that Windows crashes during boot.) Instead, Windows wants the OperationRegion directly under the \_SB scope; like this: > @@ -82,25 +82,10 @@ > } > } > > - Device (SMI0) > + OperationRegion (SMIR, SystemIO, 0xB2, One) > + Field (SMIR, ByteAcc, NoLock, WriteAsZeros) > { > - Name (_HID, "PNP0A06" /* Generic Container Device */) // _HID: Hardware ID > - Name (_UID, "SMI resources") // _UID: Unique ID > - Name (_STA, 0x0B) // _STA: Status > - Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings > - { > - IO (Decode16, > - 0x00B2, // Range Minimum > - 0x00B2, // Range Maximum > - 0x01, // Alignment > - 0x01, // Length > - ) > - }) > - OperationRegion (SMIR, SystemIO, 0xB2, One) > - Field (SMIR, ByteAcc, NoLock, WriteAsZeros) > - { > - SMIC, 8 > - } > + SMIC, 8 > } > } > > @@ -3037,7 +3022,7 @@ > Method (CSCN, 0, Serialized) > { > Acquire (\_SB.PCI0.PRES.CPLK, 0xFFFF) > - \_SB.SMI0.SMIC = 0x04 > + \_SB.SMIC = 0x04 > Local0 = One > While ((Local0 == One)) > { The Linux guest is happy either way. Thanks Laszlo