From patchwork Fri Jan 18 12:01:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Garzarella X-Patchwork-Id: 10769889 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BE8E81390 for ; Fri, 18 Jan 2019 12:12:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A80D92E6BA for ; Fri, 18 Jan 2019 12:12:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 97E852E738; Fri, 18 Jan 2019 12:12:45 +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=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 288452E6BA for ; Fri, 18 Jan 2019 12:12:45 +0000 (UTC) Received: from localhost ([127.0.0.1]:37374 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkT0u-0007Em-AJ for patchwork-qemu-devel@patchwork.kernel.org; Fri, 18 Jan 2019 07:12:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49791) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkSzI-0005yd-HY for qemu-devel@nongnu.org; Fri, 18 Jan 2019 07:11:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gkSzH-0005MN-Sp for qemu-devel@nongnu.org; Fri, 18 Jan 2019 07:11:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51452) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gkSzH-0005Lb-Mj for qemu-devel@nongnu.org; Fri, 18 Jan 2019 07:11:03 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9A45A9C17B; Fri, 18 Jan 2019 12:01:56 +0000 (UTC) Received: from steredhat.redhat.com (ovpn-117-61.ams2.redhat.com [10.36.117.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id AC014600C2; Fri, 18 Jan 2019 12:01:53 +0000 (UTC) From: Stefano Garzarella To: qemu-devel@nongnu.org Date: Fri, 18 Jan 2019 13:01:39 +0100 Message-Id: <20190118120143.21631-2-sgarzare@redhat.com> In-Reply-To: <20190118120143.21631-1-sgarzare@redhat.com> References: <20190118120143.21631-1-sgarzare@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 18 Jan 2019 12:01:56 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v5 1/5] linuxboot_dma: remove duplicate definitions of FW_CFG 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: , Cc: Eduardo Habkost , Maran Wilson , "Michael S. Tsirkin" , George Kennedy , Stefan Hajnoczi , Paolo Bonzini , Boris Ostrovsky , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP FW_CFG_DMA_CTL_* bits and struct fw_cfg_dma_access are defined in the qemu_fw_cfg.h header file already included in linuxboot_dma.c, so we can remove the definition of BIOS_CFG_DMA_CTL_* and struct FWCfgDmaAccess. Signed-off-by: Stefano Garzarella Reviewed-by: Stefan Hajnoczi Reviewed-by: Liam Merwick --- pc-bios/optionrom/linuxboot_dma.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/pc-bios/optionrom/linuxboot_dma.c b/pc-bios/optionrom/linuxboot_dma.c index d856d41b55..f728dc839f 100644 --- a/pc-bios/optionrom/linuxboot_dma.c +++ b/pc-bios/optionrom/linuxboot_dma.c @@ -58,12 +58,6 @@ asm( " jmp load_kernel\n" ); -/* QEMU_CFG_DMA_CONTROL bits */ -#define BIOS_CFG_DMA_CTL_ERROR 0x01 -#define BIOS_CFG_DMA_CTL_READ 0x02 -#define BIOS_CFG_DMA_CTL_SKIP 0x04 -#define BIOS_CFG_DMA_CTL_SELECT 0x08 - #define BIOS_CFG_DMA_ADDR_HIGH 0x514 #define BIOS_CFG_DMA_ADDR_LOW 0x518 @@ -75,12 +69,6 @@ asm( #define barrier() asm("" : : : "memory") -typedef struct FWCfgDmaAccess { - uint32_t control; - uint32_t length; - uint64_t address; -} __attribute__((packed)) FWCfgDmaAccess; - static inline void outl(uint32_t value, uint16_t port) { asm("outl %0, %w1" : : "a"(value), "Nd"(port)); @@ -153,9 +141,9 @@ static inline uint32_t be32_to_cpu(uint32_t x) static __attribute__((__noinline__)) void bios_cfg_read_entry(void *buf, uint16_t entry, uint32_t len) { - FWCfgDmaAccess access; - uint32_t control = (entry << 16) | BIOS_CFG_DMA_CTL_SELECT - | BIOS_CFG_DMA_CTL_READ; + struct fw_cfg_dma_access access; + uint32_t control = (entry << 16) | FW_CFG_DMA_CTL_SELECT + | FW_CFG_DMA_CTL_READ; access.address = cpu_to_be64((uint64_t)(uint32_t)buf); access.length = cpu_to_be32(len); @@ -165,7 +153,7 @@ void bios_cfg_read_entry(void *buf, uint16_t entry, uint32_t len) outl(cpu_to_be32((uint32_t)&access), BIOS_CFG_DMA_ADDR_LOW); - while (be32_to_cpu(access.control) & ~BIOS_CFG_DMA_CTL_ERROR) { + while (be32_to_cpu(access.control) & ~FW_CFG_DMA_CTL_ERROR) { barrier(); } }