From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=17.151.62.68; helo=nwk-aaemail-lapp03.apple.com; envelope-from=afish@apple.com; receiver=edk2-devel@lists.01.org Received: from nwk-aaemail-lapp03.apple.com (nwk-aaemail-lapp03.apple.com [17.151.62.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D4631202E5308 for ; Tue, 19 Feb 2019 11:51:21 -0800 (PST) Received: from pps.filterd (nwk-aaemail-lapp03.apple.com [127.0.0.1]) by nwk-aaemail-lapp03.apple.com (8.16.0.27/8.16.0.27) with SMTP id x1JJg1Xt014992; Tue, 19 Feb 2019 11:51:18 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=mime-version : content-transfer-encoding : content-type : sender : subject : from : in-reply-to : date : cc : message-id : references : to; s=20180706; bh=LrJaEDBVIxukr5V5A8W0zmtLgDPg0bfBJ3SB1BIEm3c=; b=stsQ8oo+Tmf3eB1cBxgoEc0d0ZWruY7x2odHs3tVeFoySuMZ2GwXkc37THfIDL7NmNV5 mR0+x67ej1NLVzBuZmttgqSyby/XrzjqM4NnAXMpTjcM56kL4jRpiZ276N70cqk7/Bcw Ng8Kjpd8DXBNf2BTihh9P94A82YriNx2KRdzpwR/mtUz1PAO1DozZmcvM2Et/kbVYjbn kZSHQN0BpP65yeVkN7e7JimdiMa7FgKmgTXPkERCN3PA8Zvpqsd0Z0TPaGq7LGK+K/zh UEhts6/Bsj8JuOencNYCCJA95YRbRkFsyWcI75ftzhDuIcC6j6NpHOoldOprQSR0roOZ 0g== Received: from mr2-mtap-s01.rno.apple.com (mr2-mtap-s01.rno.apple.com [17.179.226.133]) by nwk-aaemail-lapp03.apple.com with ESMTP id 2qpfxbtx2e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Tue, 19 Feb 2019 11:51:18 -0800 MIME-version: 1.0 Received: from ma1-mmpp-sz09.apple.com (ma1-mmpp-sz09.apple.com [17.171.128.183]) by mr2-mtap-s01.rno.apple.com (Oracle Communications Messaging Server 8.0.2.3.20181024 64bit (built Oct 24 2018)) with ESMTPS id <0PN600CO8V5H8NA0@mr2-mtap-s01.rno.apple.com>; Tue, 19 Feb 2019 11:51:18 -0800 (PST) Received: from process_viserion-daemon.ma1-mmpp-sz09.apple.com by ma1-mmpp-sz09.apple.com (Oracle Communications Messaging Server 8.0.2.3.20181024 64bit (built Oct 24 2018)) id <0PN600700U5N1500@ma1-mmpp-sz09.apple.com>; Tue, 19 Feb 2019 11:51:17 -0800 (PST) X-Va-A: X-Va-T-CD: 13715775cfe6ed78bc954dbcb503dbb2 X-Va-E-CD: 64c50ac82610ffce90b03f711fb0bf21 X-Va-R-CD: b74a66ffe0100bc0506b9b1accd4a294 X-Va-CD: 0 X-Va-ID: 2081c3ab-d6dd-4d6f-bc28-cb417466a8c4 X-V-A: X-V-T-CD: 13715775cfe6ed78bc954dbcb503dbb2 X-V-E-CD: 64c50ac82610ffce90b03f711fb0bf21 X-V-R-CD: b74a66ffe0100bc0506b9b1accd4a294 X-V-CD: 0 X-V-ID: a44bc99d-2872-413a-8ff8-780c37478533 Received: from process_milters-daemon.ma1-mmpp-sz09.apple.com by ma1-mmpp-sz09.apple.com (Oracle Communications Messaging Server 8.0.2.3.20181024 64bit (built Oct 24 2018)) id <0PN600D00UTO3500@ma1-mmpp-sz09.apple.com>; Tue, 19 Feb 2019 11:51:17 -0800 (PST) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-02-19_13:,, signatures=0 Received: from [17.234.138.57] (unknown [17.234.138.57]) by ma1-mmpp-sz09.apple.com (Oracle Communications Messaging Server 8.0.2.3.20181024 64bit (built Oct 24 2018)) with ESMTPSA id <0PN60064QV5E4P40@ma1-mmpp-sz09.apple.com>; Tue, 19 Feb 2019 11:51:17 -0800 (PST) Sender: afish@apple.com From: Andrew Fish In-reply-to: Date: Tue, 19 Feb 2019 11:51:13 -0800 Cc: Jordan Justen , edk2-devel@lists.01.org, Anthony Perard , Peter Fang Message-id: <8426BEC3-E35D-45D2-9632-4C33817D4B36@apple.com> References: <20190218101015.23399-1-jordan.l.justen@intel.com> To: Laszlo Ersek X-Mailer: Apple Mail (2.3445.6.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-02-19_13:, , signatures=0 Subject: Re: [PATCH] OvmfPkg/Sec: Clear the Cache Disable flag in the CR0 register 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: Tue, 19 Feb 2019 19:51:22 -0000 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII > On Feb 18, 2019, at 5:23 AM, Laszlo Ersek wrote: > > generic comment (applies to all NASM usage I guess): > > On 02/18/19 11:10, Jordan Justen wrote: > >> + mov eax, cr0 >> + and eax, ~(1 << 30) >> + mov cr0, eax > >> + mov rax, cr0 >> + and eax, ~(1 << 30) >> + mov cr0, rax > > I've read up on the << and ~ operators in the NASM documentation, and I > think the above build-time calculations of the masks are well-defined > and correct. > > - bit shifts are always unsigned > - given bit position 30, ~(1 << 30) will be a value with 32 bits > - bit-neg simply flips bits (one's complement) > > On the other hand, I find these NASM specifics counter-intuitive. The > expression ~(1 << 30) looks like valid C, but in C, it means a quite > different thing. > > I think calculating the mask with "strict dword" somehow (not exactly > sure how) would make this more readable; or else the BTR instruction would. > > Opinions? (Again, pertaining to all NASM usage in edk2.) > Lazlo, I guess comments, or #defines, are other options? Thanks, Andrew Fish > Thanks > Laszlo > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel