From patchwork Tue Sep 13 14:50:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 9329397 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C4BB76048F for ; Tue, 13 Sep 2016 16:05:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B5C2F290C9 for ; Tue, 13 Sep 2016 16:05:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA3C629217; Tue, 13 Sep 2016 16:05:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CC97A290C9 for ; Tue, 13 Sep 2016 16:05:21 +0000 (UTC) Received: from localhost ([::1]:49855 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjqD2-0006KA-LM for patchwork-qemu-devel@patchwork.kernel.org; Tue, 13 Sep 2016 12:05:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55403) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjpYd-0005Lt-Sg for qemu-devel@nongnu.org; Tue, 13 Sep 2016 11:23:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjpYY-00044K-Ry for qemu-devel@nongnu.org; Tue, 13 Sep 2016 11:23:35 -0400 Received: from mail-by2nam03on0068.outbound.protection.outlook.com ([104.47.42.68]:42400 helo=NAM03-BY2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjpYY-00042R-Hw for qemu-devel@nongnu.org; Tue, 13 Sep 2016 11:23:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=5xKFlihEPsWV1AcNUimgTqvQEz1wUa+juDUUknU1bGU=; b=XLCO0WrcrrsAMGx8yJtjifQLlx3RCQ2+4f220aB+r20nEeB57dEECRdgQC6ERZShUIO7jYck/zIPvr+1VHL/6RzV/PePepwgYKvj740aDMj+w8C1pqzSURg+Ihkx+oEVn+p4dxaogbeRNkJzz3NRjXFjJhwKOlCGvG71zSzImBQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from [127.0.1.1] (165.204.77.1) by SN1PR12MB0670.namprd12.prod.outlook.com (10.163.208.28) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.609.9; Tue, 13 Sep 2016 14:50:10 +0000 From: Brijesh Singh To: , , , , , , , , Date: Tue, 13 Sep 2016 10:50:06 -0400 Message-ID: <147377820679.11859.11888810000954712438.stgit@brijesh-build-machine> In-Reply-To: <147377800565.11859.4411044563640180545.stgit@brijesh-build-machine> References: <147377800565.11859.4411044563640180545.stgit@brijesh-build-machine> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN1PR15CA0009.namprd15.prod.outlook.com (10.163.200.19) To SN1PR12MB0670.namprd12.prod.outlook.com (10.163.208.28) X-MS-Office365-Filtering-Correlation-Id: df2ee602-7dd4-45d8-96e9-08d3dbe5431c X-Microsoft-Exchange-Diagnostics: 1; SN1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cx7WfsjVg6Wn2K57PK8ms=; 20:jAe4gokGPv85xqG/XPqrEMtGsMegWAH4PjnzfwZ8jVVyouE/bsCW16Aq8R9nNOpPfGwTqYIhWyZkSuUTPTjtU+IuOK/AC73cqj/WBaq1A6T7Aj4R323P5fZ/es/G0RbdDgTpk6moGHSmQpuJN4dHqiWjLphgN6OjlG02VV4vF/Mg+pBwBKK6NxW3fByGCFjvWg5tgLYuNpkOOpjRD2ddkx9tLtlFfboKGh934dMFPprCeJnJ0h4RpgRymA5h9N/esk6maAinMMFGzTW5XaeJPxhjQYOWPv0jHTSxvwjklXBz95/zlAmwfB6NSshHs+kCfgFkonQifU2mYjHLlTBLoEZZOSMkzmwvF+OgVHsIv3bw/3wcNkibV02pBp9+2ZsiHz5+KAUrRq32t1mrSJwd53wqDri/8ZXGNagw/vzP0j2kHDIKwNGeek0BpY7P4si3CsV3T4vASFl9UWoFsfCTvtjGsOCIeGrAwc+yu17g7ogK8q9oCaK9JdBKeYyyCBRA X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:SN1PR12MB0670; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0670; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0670; 4:rfDb9mw5Ix1T5dOR7980Kfcui/GTMiC1clG+VgKD19CEqtXAHV9cNtXe0UmL503Etxj5+I5ityFfdczD44DtrV8xJ7cq1E40cWDrLv0CqO9zjoHzpnbfzsFH1r8Ow6s2Q5ZgGElOrjec0zkjkLIcR8ZVA/0wrc49xy/Wq4QwMfxnV2r2Li0t2d5+Bojre7inXw520FdhOFhoHeuNEG731HcNQQpTXQVfybjy+3+vUAxFbch5wb7FuyVAdGnDg6GyppIABltdhD37+fJU1Fy4Wkoq+/9aAk7Ps8xsSjAkvtEzQH4tCLzPuHOVglir8wd6uyFRRE6xhX5/bMSXdjfYiSllnRZEg9K6NHqrz9nqczayGEpi42whHjM9I3azLngC0ZMDCosi4XEMykyJC+XzNcpIYTNjaYDblw8NebilOLLqbSHBePaFJyILFf53QMA2 X-Forefront-PRVS: 0064B3273C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6049001)(6009001)(7916002)(189002)(199003)(103116003)(86362001)(7846002)(106356001)(81166006)(105586002)(2906002)(2201001)(3846002)(9686002)(81156014)(8676002)(4001350100001)(42186005)(97736004)(6116002)(305945005)(5001770100001)(23676002)(107886002)(229853001)(33646002)(76176999)(77096005)(54356999)(7736002)(50986999)(189998001)(66066001)(33716001)(2950100001)(83506001)(68736007)(47776003)(586003)(19580395003)(230700001)(50466002)(92566002)(5660300001)(19580405001)(101416001)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0670; H:[127.0.1.1]; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtTTjFQUjEyTUIwNjcwOzIzOlA1RHZwY0hvQUMwSmY2OVk0RTJoWk5WUi9S?= =?utf-8?B?R0FFODlXSWVSR01ONkNEOFIwQ3dSVU14VWpobnRxcEhqMFI3YlJVK1NzNlRx?= =?utf-8?B?T0lMTzFqZ1AzZDRibE1HMkVmZ1VlamlVZDZLczFOWVNJbTFUTEtRMXR3MStw?= =?utf-8?B?MU44S29kUDBZTXZKNlB5MVZTQ085Q3g2VWdlcFlpbVcxanJVWTlrdVVsY2I5?= =?utf-8?B?RmhTWnhHNFJhOS9BRXUxRGxlTXpVVVA4dTRYS0QyNEE1Wm95RmNjcFlpN25W?= =?utf-8?B?SlBOMmVTVjBQNjZVbW9ENzNHRjM3QTlSekYxSGlvYjZ6YUM2OEI0cWNoZmRY?= =?utf-8?B?VDJrK3o2RWJhM0hsTnlKcVgxSE81VmFLbUY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zRvgeFX95TtYRL+0PaoooTFVWUPEldrj9k=; 7:GG9RcTVje1u6N+zPCHEtQrE79Oq+UmC6SnTA/wQwTORrK/lK+TnIeUbJJDDChP/n8/oBNjE+XoO6hJUeZa25j6mSHg98RsDpuOGBvbwfLiLemIIBXa/h6r7uW4aXxGRH6PAbRS0uF4nd+Vfy9zZ/RT/pMP5s2S2QDCTE3bJQa7W3Ddl8HnrykLECMA3pwcb//wm7EV1NcOOtqsXzETI6GVNHVfq3w8ZHVsRr/50T0y9qhGaTCQCx1XtB6MH0ZdGw SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0670; 20:RuCs4E/P5txj3jpN/5tXx43L0cCeC7teXCj4IpzJim6QskutkgtNebwcaYITApQtzlIeMSaN6ZmclO1kX0Y1SxHjRxd/hSLKw1axGmPbK/xFocp10bE3pcaXNwfWOZCFTEhtV4CnvnMd9eo+KoFxnlzYfFkLb0bilsz999AJ7XFxx9g+HgJCrRSaNWgfM4eSCc0t9OwiRvDK1cEq1Y3B53yKXFhWp6xm/G1WEyq/jS16syUIYnzzbs2BQenK/rJV X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2016 14:50:10.7421 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0670 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.42.68 X-Mailman-Approved-At: Tue, 13 Sep 2016 11:45:47 -0400 Subject: [Qemu-devel] [RFC PATCH v1 20/22] fw_cfg: sev: disable dma in real mode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP In SEV-enabled guest dma should be performed on shared pages. Since the SeaBIOS executes in non PAE mode and does not have access to C-bit to create a shared page hence disable the dma operation when reading from fw_cfg interface. Signed-off-by: Brijesh Singh --- hw/nvram/fw_cfg.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 6a68e59..aca99e9 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -24,6 +24,7 @@ #include "qemu/osdep.h" #include "hw/hw.h" #include "sysemu/sysemu.h" +#include "sysemu/kvm.h" #include "sysemu/dma.h" #include "hw/boards.h" #include "hw/isa/isa.h" @@ -1009,6 +1010,11 @@ static void fw_cfg_io_realize(DeviceState *dev, Error **errp) FWCfgIoState *s = FW_CFG_IO(dev); SysBusDevice *sbd = SYS_BUS_DEVICE(dev); + /* disable dma on fw_cfg when SEV is enabled */ + if (kvm_sev_enabled()) { + qdev_prop_set_bit(dev, "dma_enabled", false); + } + /* when using port i/o, the 8-bit data register ALWAYS overlaps * with half of the 16-bit control register. Hence, the total size * of the i/o region used is FW_CFG_CTL_SIZE */