From patchwork Tue Sep 3 16:08:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 172854 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp94942ily; Tue, 3 Sep 2019 09:40:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/80ZeZ4bki7XHDtLqljm+4mHdEZLxr7oSR1qpL9AfJl4VDlYfZEBU3tczp5a9Uof2VUiJ X-Received: by 2002:a05:620a:1269:: with SMTP id b9mr27910360qkl.86.1567528819311; Tue, 03 Sep 2019 09:40:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567528819; cv=none; d=google.com; s=arc-20160816; b=JSwFdPFsRjpFuo06YOGXZyF312hu2v2MKE33Ggz8J+DKEdjC0BQ4GUfu1bScPjz4Fg 7DBA+JmB5yFdmXxyyHbCcYWrHexpmR1//KIDgmR1PkxMVun8CItqV/2bzNuzxEWv2Su0 Uo+Yqg6QQmfwWPxa1SVcgLPUpyfgBDVBuXPglBIVZ5RuFy50KK+5k5GNE9FSwQeT9CBT NvOYkq3pVYdx161rqLVINOdS2lrehnb0H+fRVKG8JD3WhoWgHnSLDbFL4n6CN2uJa9Ny q7uPwH4YLAa0y2AZ+H1YwQONDxOQVqIdrzUiaNv01NgaTlsyzhQcYSBJJMMGvxSEEmBt KREg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=IUucvckgBKMbyf9pJkZMtE+2aTYnMo7TXpA6BtThwRg=; b=w2cxhBiYGjBvEcR32os6qYgXyicyHU1Y8tXXaSR2kQhhsu68YMvIxWchB/sSfjn9OX RnafS7zvmrSl4TTes+V9wK4frLRS3QAUy9uK6nIGd4T3Car79n3wYU/JBUnP5ctvvDZo t15/QHgUGCk2Xwdb45DOutERZguM7jEQxDe92RL2m7K7lKcBnm9gc9r5ORrlmxfSaPcm Ix94iAc/KFpb399C/j/eJBbg3kON4lKkAxPbjQ0bp/udCM/+9wcu/OOWNvrzE/NbB+B4 sXGlnGLCoEA+EC9slq3SOMgEEsM7D+v4BSBInQpFcESwohbA3Rksy1IWteroPyiZrwNY T8pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=wQimXJm+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 13si9102447qtt.174.2019.09.03.09.40.19 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Sep 2019 09:40:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=wQimXJm+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5Bqs-0000pw-KI for patch@linaro.org; Tue, 03 Sep 2019 12:40:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37098) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5BMm-000107-LJ for qemu-devel@nongnu.org; Tue, 03 Sep 2019 12:09:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i5BMk-0003fe-LB for qemu-devel@nongnu.org; Tue, 03 Sep 2019 12:09:12 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:44927) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i5BMk-0003eb-FU for qemu-devel@nongnu.org; Tue, 03 Sep 2019 12:09:10 -0400 Received: by mail-pg1-x543.google.com with SMTP id i18so9386937pgl.11 for ; Tue, 03 Sep 2019 09:09:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IUucvckgBKMbyf9pJkZMtE+2aTYnMo7TXpA6BtThwRg=; b=wQimXJm+NV1QEGqk24MjKUH5S6jbhOLcLSkMtn7F6olyxzfjZTSQUZmMgb/HqOu4dR OHHrEXz9BJf0fdinYZuzipPEVP6HN6Q29VB2akyjxyn7nJfBJuDYUDVJBbkyl/dZy9O7 ed1OAUyg5COtl/6+E1qjdawBzTI9Z19ywGU1RpBbkrlqqM/KPOcQ1cd25O7k9iLBkbA+ cE+SMYmGtUzrj+nsj0Q1wr9hUrIT8nTMusB8ckeIguhs4b6G77dkB2YmiqhJGk45pDUP FvnQAfUN7tD6QtxyGOV4iF13gM/foWI1uN/09baIX1xzsuJ/un4WoZIeC/MEL4uczIRq x5HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IUucvckgBKMbyf9pJkZMtE+2aTYnMo7TXpA6BtThwRg=; b=GixH0yHYjdQUkvjgu3XJVaVXFRrRdfhSjuHM7DGrfBP4+KqbSSb/N3VDse488/wOb6 7hD+2C5kFaoGHAfCEhm6U8KmRM/pwhwAs+MGGyx/mcqtakKSlK+QHfk0WxkDL6hL24YK fShjhwVWGzJyx29tdBv9oZ/hVc5eypJx8QwaGy2clQCeu0R7o8j1TTHUZ+g/IndXVNdu jTC5TofuB7Xn5AY/bnBQJJhvWf/0XBuIpT2zaHXq6jdUgKn5LWP2jVsv5XfOs08whIY3 vLz1QB8jK6nhxk8D5v+kKb4UCCdCyViaVPPs07dn2PBgCw1nWaYjJnwmQABNtwClRfWw kl/g== X-Gm-Message-State: APjAAAW3/07cF/wZoORSOKD8hFehAoG0zUTXOiUAtJsmruLNMaY2Ibst Ye5G6GgqnfF1d7qzDzajn7QE1YedBIc= X-Received: by 2002:a63:3805:: with SMTP id f5mr30721138pga.272.1567526948336; Tue, 03 Sep 2019 09:09:08 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id 127sm28089711pfy.56.2019.09.03.09.09.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2019 09:09:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 3 Sep 2019 09:08:28 -0700 Message-Id: <20190903160858.5296-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190903160858.5296-1-richard.henderson@linaro.org> References: <20190903160858.5296-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::543 Subject: [Qemu-devel] [PATCH 06/36] hw/virtio: Access MemoryRegion with MemOp X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Tony Nguyen Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Tony Nguyen The memory_region_dispatch_{read|write} operand "unsigned size" is being converted into a "MemOp op". Convert interfaces by using no-op size_memop. After all interfaces are converted, size_memop will be implemented and the memory_region_dispatch_{read|write} operand "unsigned size" will be converted into a "MemOp op". As size_memop is a no-op, this patch does not change any behaviour. Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson Reviewed-by: Cornelia Huck Message-Id: Signed-off-by: Richard Henderson --- hw/virtio/virtio-pci.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 8babd92e59..82c5e87a44 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -17,6 +17,7 @@ #include "qemu/osdep.h" +#include "exec/memop.h" #include "standard-headers/linux/virtio_pci.h" #include "hw/virtio/virtio.h" #include "migration/qemu-file-types.h" @@ -552,7 +553,8 @@ void virtio_address_space_write(VirtIOPCIProxy *proxy, hwaddr addr, /* As length is under guest control, handle illegal values. */ return; } - memory_region_dispatch_write(mr, addr, val, len, MEMTXATTRS_UNSPECIFIED); + memory_region_dispatch_write(mr, addr, val, size_memop(len), + MEMTXATTRS_UNSPECIFIED); } static void @@ -575,7 +577,8 @@ virtio_address_space_read(VirtIOPCIProxy *proxy, hwaddr addr, /* Make sure caller aligned buf properly */ assert(!(((uintptr_t)buf) & (len - 1))); - memory_region_dispatch_read(mr, addr, &val, len, MEMTXATTRS_UNSPECIFIED); + memory_region_dispatch_read(mr, addr, &val, size_memop(len), + MEMTXATTRS_UNSPECIFIED); switch (len) { case 1: pci_set_byte(buf, val);