From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (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 2FFE2223522A1 for ; Mon, 5 Mar 2018 05:54:29 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AC8C0DF38C; Mon, 5 Mar 2018 14:00:41 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-64.rdu2.redhat.com [10.10.120.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4EFACAFD62; Mon, 5 Mar 2018 14:00:40 +0000 (UTC) To: Brijesh Singh , edk2-devel-01 Cc: Ard Biesheuvel , Jordan Justen References: <20180302000408.14201-1-lersek@redhat.com> <2d6e37a5-fdfa-330d-d7ef-51e0350afdad@amd.com> <6be3c2e4-0269-7743-d14d-4cf1f2935342@redhat.com> <45c6adcc-57a1-c7c4-3474-b33b7323ea17@amd.com> From: Laszlo Ersek Message-ID: Date: Mon, 5 Mar 2018 15:00:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <45c6adcc-57a1-c7c4-3474-b33b7323ea17@amd.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 05 Mar 2018 14:00:41 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 05 Mar 2018 14:00:41 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' Subject: Re: [PATCH 00/20] OvmfPkg: SEV: decrypt the initial SMRAM save state map for SMBASE relocation X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2018 13:54:30 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit On 03/02/18 14:17, Brijesh Singh wrote: > On 3/2/18 5:53 AM, Laszlo Ersek wrote: >> Do you have (maybe updated) instructions for setting up the SEV host? >> What are the latest bits that are expected to work together? > For host kernel: > - use recent kvm/master > - make sure following kernel config is enabled >   CONFIG_KVM_AMD_SEV >   CONFIG_CRYPTO_DEV_SP_PSP >   CONFIG_AMD_MEM_ENCRYPT >   CONFIG_AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT > > For guest kernel: >  - you can use host kernel or anything >=4.15 >     make sure you have following config enabled in kernel: >       CONFIG_AMD_MEM_ENCRYPT > > For qemu: > - v10 patches from this branch > https://github.com/codomania/qemu/tree/v10 QEMU exits with the following error for me: 2018-03-05T13:40:12.478835Z qemu-system-x86_64: sev_ram_block_added: failed to register region (0x7f3df3e00000+0x200000000) 2018-03-05T13:40:12.489183Z qemu-system-x86_64: sev_ram_block_added: failed to register region (0x7f3ffaa00000+0x37c000) 2018-03-05T13:40:12.497580Z qemu-system-x86_64: sev_ram_block_added: failed to register region (0x7f3ffa800000+0x20000) 2018-03-05T13:40:12.504485Z qemu-system-x86_64: sev_launch_update_data: LAUNCH_UPDATE ret=-12 fw_error=0 '' 2018-03-05T13:40:12.504493Z qemu-system-x86_64: failed to encrypt pflash rom Here's my full QEMU command line (started by libvirt) -- this command line does not restrict pflash access to guest code that runs in SMM, and correspondingly, the OVMF build lacks SMM_REQUIRE: /opt/qemu-installed/bin/qemu-system-x86_64 \ -name guest=from-brijesh,debug-threads=on \ -S \ -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-4-from-brijesh/master-key.aes \ -machine pc-q35-2.10,accel=kvm,usb=off,smm=on,dump-guest-core=off \ -cpu host \ -drive file=/home/virt-images/OVMF_CODE.4m.fd,if=pflash,format=raw,unit=0,readonly=on \ -drive file=/var/lib/libvirt/qemu/nvram/from-brijesh_VARS.fd,if=pflash,format=raw,unit=1 \ -m 8192 \ -realtime mlock=off \ -smp 1,sockets=1,cores=1,threads=1 \ -uuid e2373f13-f481-4008-88d0-d61fa9da16fe \ -no-user-config \ -nodefaults \ -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain-4-from-brijesh/monitor.sock,server,nowait \ -mon chardev=charmonitor,id=monitor,mode=control \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ -device pcie-root-port,port=0x10,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,addr=0x2 \ -device pcie-root-port,port=0x11,chassis=2,id=pci.2,bus=pcie.0,addr=0x2.0x1 \ -device pcie-root-port,port=0x12,chassis=3,id=pci.3,bus=pcie.0,addr=0x2.0x2 \ -device pcie-root-port,port=0x13,chassis=4,id=pci.4,bus=pcie.0,addr=0x2.0x3 \ -device nec-usb-xhci,id=usb,bus=pci.1,addr=0x0 \ -device virtio-scsi-pci,iommu_platform=on,ats=on,id=scsi0,bus=pci.3,addr=0x0 \ -drive file=/var/lib/libvirt/images/rhel-7-server.qcow2,format=qcow2,if=none,id=drive-scsi0-0-0-0,cache=writeback,discard=unmap,werror=enospc \ -device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1 \ -netdev tap,fd=26,id=hostnet0,vhost=on,vhostfd=28 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:65:f7:fb,bus=pci.4,addr=0x0,rombar=0 \ -chardev pty,id=charserial0 \ -device isa-serial,chardev=charserial0,id=serial0 \ -device usb-tablet,id=input2,bus=usb.0,port=1 \ -spice port=5900,addr=127.0.0.1,disable-ticketing,seamless-migration=on \ -device cirrus-vga,id=video0,bus=pcie.0,addr=0x1 \ -device virtio-balloon-pci,id=balloon0,bus=pci.2,addr=0x0 \ -global isa-debugcon.iobase=0x402 \ -debugcon file:/tmp/from-brijesh.log \ -fw_cfg name=opt/ovmf/PcdResizeXterm,string=y \ -s \ -object sev-guest,id=sev0,policy=0x0,cbitpos=47,reduced-phys-bits=5 \ -machine memory-encryption=sev0 \ -msg timestamp=on Thanks, Laszlo