From nobody Mon Feb 9 22:04:11 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1549306052509779.8451373180573; Mon, 4 Feb 2019 10:47:32 -0800 (PST) Received: from localhost ([127.0.0.1]:47414 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqjHC-0005JA-TA for importer@patchew.org; Mon, 04 Feb 2019 13:47:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59251) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqj6r-00051y-0e for qemu-devel@nongnu.org; Mon, 04 Feb 2019 13:36:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gqj6p-0003TB-On for qemu-devel@nongnu.org; Mon, 04 Feb 2019 13:36:44 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:34976) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gqj6n-0003QU-PW for qemu-devel@nongnu.org; Mon, 04 Feb 2019 13:36:43 -0500 Received: by mail-wm1-x336.google.com with SMTP id t200so1041427wmt.0 for ; Mon, 04 Feb 2019 10:36:39 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s132sm8836236wmf.28.2019.02.04.10.36.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Feb 2019 10:36:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=0yrVirtf2XYWtid3rKgKyPY4/E20xtlKXHv18PjOeFM=; b=CsHdQAXBaaPCuRVFOvIsjXUcJUTA3cCLBit/aS9mpBDnrOzViNyxU/FJCV/4JObLA6 sh6YEJOujXQCriL2gyuGjm+k+W4zOtOUvOFG2ingsl7wbUG+gSg/XxA338N1g9ZANNHo W3/42ivALerj1ATxk2e7RHeRCTbJtv+e7UY2PzDCgHkBOWq1bJLBcZE00e+shmdjiZru AmN0fPQ83Syb9dTyRJD6iBHir9ev5YhnYXVEc6hZH9XcQ0XQ0xDL5RVrrKbgjxVUJuA/ DLbeLrFbkwx/pJwBvT7Gm+Ul+9LSOw6fCCOSZtE7ytFRV31S/gLie3737L3kMNOqqz/V 63jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=0yrVirtf2XYWtid3rKgKyPY4/E20xtlKXHv18PjOeFM=; b=XyY/WRbYoQfF5SblbYrTCXuzV859TMhlN0W9fC9xkGgINTaBAsRUk1+blRyfk5Mcu2 8L95/850YVqY3WFbbXHBYE70de02RzfyH9SQM3dCNiWE/YkZ5OdXGIaTQ22XyRPvy5Nc BfSg1WzDaMcFCnvE4/Qs32GXSznu4Uk/nBmCz9DH5P31UucFIW0NQ86vPGdRugAPeEi9 dZVwFGWKAJ8CnfTAnW7yVQfTQ04/c4TGMDR+tH1yWTRy4mq0x0jaTowTZb3Ppg6hk8I1 CBYOLt8o+dNHIIYV4CXnntya6iHyO1wzAsZTU2bCrclrwEEkDJ6wi7wGkf8/763pIufl ksRw== X-Gm-Message-State: AHQUAua0bjvPbWQxxn5FjOVUywwDgTMC8P/uOMPhbMhd66DqVL3/omQS qzOhzhjozQgHHUujFbkK9jizIp5u X-Google-Smtp-Source: AHgI3IbCsUiYS2xOhfUHqJtq7bzvWSI9dBkv/e1XISWtMXoWU+btHUbEr0JviICStw82A8P/3mTEYQ== X-Received: by 2002:a1c:650a:: with SMTP id z10mr566789wmb.148.1549305398035; Mon, 04 Feb 2019 10:36:38 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 4 Feb 2019 19:35:19 +0100 Message-Id: <1549305379-51117-18-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1549305379-51117-1-git-send-email-pbonzini@redhat.com> References: <1549305379-51117-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::336 Subject: [Qemu-devel] [PULL 17/77] 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: Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Stefano Garzarella 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 Based-on: <1547554687-12687-1-git-send-email-liam.merwick@oracle.com> Signed-off-by: Paolo Bonzini --- 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/linuxboo= t_dma.c index d856d41..f728dc8 100644 --- a/pc-bios/optionrom/linuxboot_dma.c +++ b/pc-bios/optionrom/linuxboot_dma.c @@ -58,12 +58,6 @@ asm( " jmp load_kernel\n" ); =20 -/* 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 =20 @@ -75,12 +69,6 @@ asm( =20 #define barrier() asm("" : : : "memory") =20 -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 =3D (entry << 16) | BIOS_CFG_DMA_CTL_SELECT - | BIOS_CFG_DMA_CTL_READ; + struct fw_cfg_dma_access access; + uint32_t control =3D (entry << 16) | FW_CFG_DMA_CTL_SELECT + | FW_CFG_DMA_CTL_READ; =20 access.address =3D cpu_to_be64((uint64_t)(uint32_t)buf); access.length =3D cpu_to_be32(len); @@ -165,7 +153,7 @@ void bios_cfg_read_entry(void *buf, uint16_t entry, uin= t32_t len) =20 outl(cpu_to_be32((uint32_t)&access), BIOS_CFG_DMA_ADDR_LOW); =20 - while (be32_to_cpu(access.control) & ~BIOS_CFG_DMA_CTL_ERROR) { + while (be32_to_cpu(access.control) & ~FW_CFG_DMA_CTL_ERROR) { barrier(); } } --=20 1.8.3.1