From patchwork Mon Jul 10 09:49:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 701006 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp5079154wrs; Mon, 10 Jul 2023 02:50:52 -0700 (PDT) X-Google-Smtp-Source: APBJJlE+D4OlKw/IWYupLtqrGi/ThOxPBo+9G9cE83sDJDxZObDDR7UP4T9ulb9l2j4SUY8BQQJW X-Received: by 2002:a05:620a:2450:b0:767:4cb2:3145 with SMTP id h16-20020a05620a245000b007674cb23145mr17825908qkn.41.1688982652305; Mon, 10 Jul 2023 02:50:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688982652; cv=none; d=google.com; s=arc-20160816; b=wfVUSZ/p7f5LKb3iY1kilU02weUZjBhFCRc36i33rLuKAIBG6WYE2FDpISqpQoZ0ou t9SHKRldREHkz59vs/FV/6leRthnO0WX4oY0gZOL79BQq8DmlVIaAd7tCjNhz+Dwv39v ZBkZBXRfj42uOZFYohqKUs0WBIVPNfVuO6dlhrWFJ4kJVRfAd+SkLbMNEF5PoPgmKe9w peWCrkD7pN1o+9Ot0KQfUfa17md9NeqJmd+u9uyyG/DYjkkAfo9w8MjU3cjKe6HDD4eD LCXwagXH6lsol0Ev+q8Ikf9YyvullPtlGJQmmodvf1mlgoIogmqIXupTU7XcRxXj6nwi rraw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ufBOjc9SeZsogN9rwEOZ+B47n6rE09TymenxbvkIAQo=; fh=FilpW137HyWOg2zjOJR+HkXqOM9xEmodh7UtIP57FfE=; b=glGKRG319MuliTV0kGAED4fnsX9cvLrRD+LGc4Q6v5Kf3oROrLuVNvhyYIpXNERkNz j4nbYwoPQo16b69MrgsWXDY9kaCH/JlngG5DChOUahsz6O2ipXssu5Ry0Yt6CEuXTaWp duGBtuB24OPrvGRJKfAlTPQb2VuGo6Y5Mv5N2L2e5dG+6Uke9+IhtfJVeAWi40SHZHLP ypikpuddS8pEI/2UHJr0vv0mGxPd0IWTB0T9Se51I3T1s6Nb0HxlYFR5IVihNahPWUpt 9JgNxHsPSaynXnXSsdd7jVfRDAu+VkuigfHNDZ5Yz5tM7Sj51U+WNEuNGYKNUVaw9vWk VjHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=if41VYgY; 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=pass (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 v17-20020a05620a123100b0076719f3f70dsi5406110qkj.165.2023.07.10.02.50.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Jul 2023 02:50:52 -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=pass header.i=@linaro.org header.s=google header.b=if41VYgY; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qInXJ-00023P-Tb; Mon, 10 Jul 2023 05:50:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qInXB-00022D-SY for qemu-devel@nongnu.org; Mon, 10 Jul 2023 05:50:22 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qInXA-0003pF-6l for qemu-devel@nongnu.org; Mon, 10 Jul 2023 05:50:21 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-31441dfbf97so4898556f8f.1 for ; Mon, 10 Jul 2023 02:50:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688982618; x=1691574618; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ufBOjc9SeZsogN9rwEOZ+B47n6rE09TymenxbvkIAQo=; b=if41VYgY9HRpi/UF+rX9jd2ntN8W88hbcyzYqEqrd0BgWJhl+aCqQLaEyGJbERWNBn PWnZU5cT8MKWutksHQ/gtGFPJGfTKVs6IquodXklRBm8aXAGAjJP7ZCcqp4bXtrEJ7fK pqn0qaLbZYtxECfZl3PH9ktSvbmSUIi+vABPyoiq8nWlcNg1B5VcjzREiufcLfnlT3F0 CyPOX+XNXIGuUfsb9E2dh9dnYLYCpA3mlQU6E7S9G9ZeVd/TQHQvSSeeEmpb4XJ3o5eV 1aZKbNsGho/wFxdnipUhkftjRrMl87xwPnP60ytPIPFjbQYZY8fqsW/DAYtVO76Q3Snu pasw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688982618; x=1691574618; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ufBOjc9SeZsogN9rwEOZ+B47n6rE09TymenxbvkIAQo=; b=epEKhhpmt6y+P/1q5aATV/rsi6I2LpNlL0HmQ46DhhX4ZQnYuLcuIiOpCRRsQt/Jsb ZZw3AtkNPLqh66MdUrnfWAXoGeslO+I7KLSqY0gbWfRNBBMbptFzuZswCLrjIXDV7zaz JDDACAFxttQd1fIplsvoQ9mlR/XNYWFxVSP0EhLXCbECNAp0pTZw+kUeyFxs2ApPobnp uLk7rPokbnRnMeCM5tmanMNvsn087DhJYUZuxL/lXfQBwGEnAYsMrN9DDyLSjRWVjioM kbtcuW/BJ7KUPBWb2crNCU0gH2XPHt3JrI/Un5s0pH0tKWbTkVYzw+1WHO2FgN9dMsnO RZ7Q== X-Gm-Message-State: ABy/qLaPBbRkqRChTJ3YSjud3F8qENrs6b3huU4OYYZkzkZyEp+SzOqH 0an5ywuzCP90QA2K+k39Vy2RuEPcOJcwh7rypqWjqw== X-Received: by 2002:a5d:49cb:0:b0:313:ef24:6feb with SMTP id t11-20020a5d49cb000000b00313ef246febmr12334865wrs.3.1688982618115; Mon, 10 Jul 2023 02:50:18 -0700 (PDT) Received: from localhost.localdomain (70.red-88-28-30.dynamicip.rima-tde.net. [88.28.30.70]) by smtp.gmail.com with ESMTPSA id k6-20020a05600c0b4600b003fc00892c13sm8617369wmr.35.2023.07.10.02.50.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 10 Jul 2023 02:50:17 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Richard Henderson , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 1/6] hw/virtio: Propagate page_mask to vhost_vdpa_listener_skipped_section() Date: Mon, 10 Jul 2023 11:49:26 +0200 Message-Id: <20230710094931.84402-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230710094931.84402-1-philmd@linaro.org> References: <20230710094931.84402-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org In order to make vhost-vdpa.c a target-agnostic source unit, we need to remove the TARGET_PAGE_SIZE / TARGET_PAGE_MASK / TARGET_PAGE_ALIGN uses. TARGET_PAGE_SIZE will be replaced by the runtime qemu_target_page_size(). The other ones will be deduced from TARGET_PAGE_SIZE. Since the 3 macros are used in 3 related functions (sharing the same call tree), we'll refactor them to only depend on TARGET_PAGE_MASK. Having the following call tree: vhost_vdpa_listener_region_del() -> vhost_vdpa_listener_skipped_section() -> vhost_vdpa_section_end() The first step is to propagate TARGET_PAGE_MASK to vhost_vdpa_listener_skipped_section(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/virtio/vhost-vdpa.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 3c575a9a6e..87653bf841 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -42,7 +42,8 @@ static Int128 vhost_vdpa_section_end(const MemoryRegionSection *section) static bool vhost_vdpa_listener_skipped_section(MemoryRegionSection *section, uint64_t iova_min, - uint64_t iova_max) + uint64_t iova_max, + int page_mask) { Int128 llend; @@ -313,7 +314,7 @@ static void vhost_vdpa_listener_region_add(MemoryListener *listener, int ret; if (vhost_vdpa_listener_skipped_section(section, v->iova_range.first, - v->iova_range.last)) { + v->iova_range.last, TARGET_PAGE_MASK)) { return; } if (memory_region_is_iommu(section->mr)) { @@ -396,7 +397,7 @@ static void vhost_vdpa_listener_region_del(MemoryListener *listener, int ret; if (vhost_vdpa_listener_skipped_section(section, v->iova_range.first, - v->iova_range.last)) { + v->iova_range.last, TARGET_PAGE_MASK)) { return; } if (memory_region_is_iommu(section->mr)) { From patchwork Mon Jul 10 09:49:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 701007 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp5079191wrs; Mon, 10 Jul 2023 02:50:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlEWXG5IXIN6CwGfa1R9qLUqufR2RuXB0vJT2cWorwBd2icc81JCIHrHvJez2zCsGoLUvkY6 X-Received: by 2002:a05:620a:904b:b0:767:8083:dd46 with SMTP id rl11-20020a05620a904b00b007678083dd46mr10558394qkn.61.1688982658445; Mon, 10 Jul 2023 02:50:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688982658; cv=none; d=google.com; s=arc-20160816; b=PyKEekpgurkgPYHIrE26AUOmWW8GHh3NiECU3xWelf2dvllUgAkQAELNTnVInvZriE YXzjZgfN+ayeGLFSFjvvs78zhZy4CKcfviI6zh1hUrPCvgYR0cq3yt2EM81f8Y3vMjeZ xPw/3eP6rSFUFZaGkGIkddCImxecS0F7Tre5wM+TSXfYcSvkqXpaQEBMUXiGf53JY0gt 40Y3DNpkkdQXBFY0H3ugsqiN3Nu/B+KNUiFYSSEcxmF115wZRVOcPkGy91imKxB4JJdD SLeIi0rdSx5K5n5c/6vHUYqKm2R4BRYi9PlCnl6QFDwynlACbKAfrT5matG+M9YfpWgL enxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kP8qzfTD4vvJGBfBeZEZ5IO8iCCDKAKq4Fv9p6to8AE=; fh=FilpW137HyWOg2zjOJR+HkXqOM9xEmodh7UtIP57FfE=; b=ESKTNlq/Vi0lCGPRsGXvIRy5uaehlOuWSUGhRS6l4logaABg6DSkhswaME0q8IjMMh /KUsoIzJ7TJ1L8aoeh2g81ZvueY7ctResCNPRcWA5wZ+ZNdmqe61JHkOiUITvIf3KLA8 YlXUjl5odbuKbvARrfZ5Eg402FFRRySlviOtfWReB7zUZmAO9o8x8PXlMCm3VvY3+OD0 LXGmY25MicESsbWyX4tOH7ycm8pvygrJCTw/T3Q84pFkrb9ZSeQKGBhQ6MfhJZcLS6/6 doSdp8D/01tn9W+Vbry+cfgavHRTl5fUIIIVoU23ZyTJCcIOogKNwkohW+Te8omvnn9l 9bJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="HK/Z3WrL"; 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=pass (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 k9-20020a05620a142900b00763b0d91135si5362965qkj.272.2023.07.10.02.50.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Jul 2023 02:50:58 -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=pass header.i=@linaro.org header.s=google header.b="HK/Z3WrL"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qInXY-0002Ju-V6; Mon, 10 Jul 2023 05:50:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qInXV-0002F0-8I for qemu-devel@nongnu.org; Mon, 10 Jul 2023 05:50:41 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qInXT-0003yw-Ib for qemu-devel@nongnu.org; Mon, 10 Jul 2023 05:50:41 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3143798f542so4617760f8f.2 for ; Mon, 10 Jul 2023 02:50:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688982637; x=1691574637; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kP8qzfTD4vvJGBfBeZEZ5IO8iCCDKAKq4Fv9p6to8AE=; b=HK/Z3WrLTFw4bZuyhsk899uskPGomjEDJ0qbyz8GfAwhxYOJANDU3RCPlelD3/DU2V fQFmeqk0oN7RnM9NVhk942NyDKb9PMrTSfNQrFSnHlceRF+YmEPtrMAHLRcqfhVnEge1 ZpnzzGm2sKbCYbdDBOJcPRaR5u8CxwqCT+DYYMsCZ57SHv01zPoJoOTOuesCHE1ol2b1 FaE+x7ADnw1MNQO2rB2bDMBgX6OW5jDgV69B/9UOCrqYeOCgAmT/L1B7MryGgm4js6bB x9NGCRkR9xRMvW+gW0aAhUPV/HOm91LS9C1Mi0TqEwXtwShF2WGd+IEnhQP1pmJvnSwu 6VTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688982637; x=1691574637; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kP8qzfTD4vvJGBfBeZEZ5IO8iCCDKAKq4Fv9p6to8AE=; b=McFhaW30SRd07Qmnh6q+fHWSt4sj1M8colCw5jfMUbyfnqH+FGV7OOvsbdJiuhxGzJ tge+nT4dABjWlkHwVR+IBiuRZpMsZpRN9dArBRlDunMi1NPoUYSdgFRx0FTyPXrv7qiQ aFw9rmAyCajTmCSkcfkLEktH+wpmlrZ4XNd5rvPXyhK120mnbpZu3Z1670BXqfW76Fe8 iUXKpCK5+ELhrfK64H0Nd/o9QpeZQ8J3xtJzuXcoP2TS+liLyeXohhOX0mPeL1gvNdzF wi8I9wQ8z1O+5Km8oqMknriDrfWHzEXAIkdu07fd2aUzvjV7uKeFLxPXW8nX/NiVpy8n 4v+A== X-Gm-Message-State: ABy/qLZ0rW1zQN+5O0Wg4vnl0PQb4ifs0lZD010bsIbjZHwd7wxB3uj7 W2cs8/Oll2dtWf7IxNKxgjGkvj05HkutlQQulHql6Q== X-Received: by 2002:adf:e649:0:b0:314:3ac8:c277 with SMTP id b9-20020adfe649000000b003143ac8c277mr11209848wrn.9.1688982637321; Mon, 10 Jul 2023 02:50:37 -0700 (PDT) Received: from localhost.localdomain (70.red-88-28-30.dynamicip.rima-tde.net. [88.28.30.70]) by smtp.gmail.com with ESMTPSA id d5-20020adfe885000000b003143ba62cf4sm11258044wrm.86.2023.07.10.02.50.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 10 Jul 2023 02:50:37 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Richard Henderson , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 2/6] hw/virtio: Propagate page_mask to vhost_vdpa_section_end() Date: Mon, 10 Jul 2023 11:49:27 +0200 Message-Id: <20230710094931.84402-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230710094931.84402-1-philmd@linaro.org> References: <20230710094931.84402-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Propagate TARGET_PAGE_MASK (see the previous commit for rationale). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/virtio/vhost-vdpa.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 87653bf841..3040bd8ee8 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -31,11 +31,12 @@ * Return one past the end of the end of section. Be careful with uint64_t * conversions! */ -static Int128 vhost_vdpa_section_end(const MemoryRegionSection *section) +static Int128 vhost_vdpa_section_end(const MemoryRegionSection *section, + int page_mask) { Int128 llend = int128_make64(section->offset_within_address_space); llend = int128_add(llend, section->size); - llend = int128_and(llend, int128_exts64(TARGET_PAGE_MASK)); + llend = int128_and(llend, int128_exts64(page_mask)); return llend; } @@ -69,7 +70,7 @@ static bool vhost_vdpa_listener_skipped_section(MemoryRegionSection *section, */ if (!memory_region_is_iommu(section->mr)) { - llend = vhost_vdpa_section_end(section); + llend = vhost_vdpa_section_end(section, page_mask); if (int128_gt(llend, int128_make64(iova_max))) { error_report("RAM section out of device range (max=0x%" PRIx64 ", end addr=0x%" PRIx64 ")", @@ -329,7 +330,7 @@ static void vhost_vdpa_listener_region_add(MemoryListener *listener, } iova = TARGET_PAGE_ALIGN(section->offset_within_address_space); - llend = vhost_vdpa_section_end(section); + llend = vhost_vdpa_section_end(section, TARGET_PAGE_MASK); if (int128_ge(int128_make64(iova), llend)) { return; } @@ -411,7 +412,7 @@ static void vhost_vdpa_listener_region_del(MemoryListener *listener, } iova = TARGET_PAGE_ALIGN(section->offset_within_address_space); - llend = vhost_vdpa_section_end(section); + llend = vhost_vdpa_section_end(section, TARGET_PAGE_MASK); trace_vhost_vdpa_listener_region_del(v, iova, int128_get64(int128_sub(llend, int128_one()))); From patchwork Mon Jul 10 09:49:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 701008 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp5079299wrs; Mon, 10 Jul 2023 02:51:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlHbBpG0DY36K6DZVxux9sLSlxmKGQym+QSWxIzKEbhWfGd+2X9KV4h/6t9YtsRQVg02Tf1A X-Received: by 2002:a0c:dc84:0:b0:623:6b1a:c5f1 with SMTP id n4-20020a0cdc84000000b006236b1ac5f1mr11633746qvk.4.1688982672502; Mon, 10 Jul 2023 02:51:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688982672; cv=none; d=google.com; s=arc-20160816; b=jFWnJb1+p9otKaV/r0YYkrk7Z7puFyVawxmOlUCEBE5icsCg6rJ+2btnkhnZIfQHNV kLQEyxX3RjFls7NymweDXDJ4OA8X6BaF3Tzxo7XVliD0aIJRjT/o56MhOLQTKdytwe0i yLNzAApNW2acHF8rMuMs9edaHdJQ/MhnL3pmv//R/Jk4GPv7k3iAlz7VBQ7SCI5sRZW5 QAn3x0v9SbfZsBqA9JAOE7EZUuBYoPFVSuPpF9Dnt2mWv39U8sYTwA2AH3wK15bpdPMJ VyK7SfBApylIhp3gmJd6d0n5p/mX3Wbz/yzaFYAqYx0MWoIaN6c8rfZzkqajo+59tvrS k3/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=opfO9q/dSVfV5cAvnirB68cIre+ympAxvZtAmrt5FgM=; fh=FilpW137HyWOg2zjOJR+HkXqOM9xEmodh7UtIP57FfE=; b=UJistlVVNOz8ytlcz9TrXTImN7E2vDZyIb6V+6AJaxPYThpFVV3XjZMNS25t/PFoPn rmeJahxjPwKjIsy/2W9DQSR4BUIS3Jei+t+ly5n1J5nO4uHaHjt5Rvo5MnR/0TzibEgj PGl5PWoc3A88lc3H2zIZa4yae1iybPf+PY1XPw7jRAfAayI8YsNL/812vnaGxtG1iil+ a7DluDLghPua84DDkvhCvoP0+F/7EKEE+pzwvbjKaNhw6eyi8mOnhfKnCl3Rb/NXa+SD T1LvVPBf465vFt6IQH/5IozBfkVWlIZES7BQjPpYDNxPEgdxLrLU8YYu7nGkOc9piHYM TPiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FoGO98yW; 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=pass (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 l12-20020a0ce50c000000b0063660b51442si5426119qvm.355.2023.07.10.02.51.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Jul 2023 02:51:12 -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=pass header.i=@linaro.org header.s=google header.b=FoGO98yW; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qInXw-0004I9-Hn; Mon, 10 Jul 2023 05:51:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qInXu-0004BD-RD for qemu-devel@nongnu.org; Mon, 10 Jul 2023 05:51:06 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qInXt-00043L-BI for qemu-devel@nongnu.org; Mon, 10 Jul 2023 05:51:06 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3fbd33a57b6so55139015e9.2 for ; Mon, 10 Jul 2023 02:51:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688982664; x=1691574664; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=opfO9q/dSVfV5cAvnirB68cIre+ympAxvZtAmrt5FgM=; b=FoGO98yWBxpOqMAqpVEt/T49YC7q5XckNGh60YZcPopoEP1Ht7bMsJjwOkXb/6m/2L b5mV07/xWIC4tNm7Ssg35suGEJ5NKRFkc3pEUn7fyPuYCZVt1fF+rLthkNFXYWhaEvim 6/7dxETS6rAhdvDWdAHz8prBKGUdRyrP9v45kCMMxmkvgEvNouvvLEHNxMGzqZFws6w/ 45G/BRPxJ/kjTc5QOguyuw5zydk9mVVTn/ga22HNiqYAlWE/NfUUKhNg+UN9rSodMinG mHleVeT/yGBH6n9Zd4beEibW6dwxW9IR1KchTh8FxJjbvGzcbLjibt9Fc9YW+TIdeMvW 8hig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688982664; x=1691574664; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=opfO9q/dSVfV5cAvnirB68cIre+ympAxvZtAmrt5FgM=; b=fAgSowfeUG3h5iNigwsVWbQavqgfrdcjjduL+2C5WFtgFlzZqf5gt5BzvVT11dFl2M 8ujesQC9Ydy+lFvKE4TG6B34gE8dJJ8MrURRmuhQ07+nfF6DqtDJZXfm/DvWb/6T0/qv vo31xW/Pa0h5BjtTak/Iy+qZ8Y9awtKJyhg2LWBHsQyeQgdBb1m1ZNvSNAV6TrPlEod7 U2+e3T8Jvc464c8b9i5x9Wg1Wk6bFbEXq39qBT+1nI5bEdp1TyBff+rhic5Z1u4HcOls 6mv2JHfwn2TI6tJHcZvwxoowW+HAfAJVjO4H3cHiR6mba2qlU3ZSz4aa8kp0rWkeOFlQ +nbw== X-Gm-Message-State: ABy/qLZnHFb0d+YhH6KTGnWjOM49xQBulAk+noNLCtHJIOjRoe/T9fwz 2jRe37i9fh0qZ6U+XSqx/+GZSnGdkRBbtpYRoGb0MQ== X-Received: by 2002:a05:600c:2105:b0:3fc:3e1:7105 with SMTP id u5-20020a05600c210500b003fc03e17105mr8628759wml.24.1688982663754; Mon, 10 Jul 2023 02:51:03 -0700 (PDT) Received: from localhost.localdomain (70.red-88-28-30.dynamicip.rima-tde.net. [88.28.30.70]) by smtp.gmail.com with ESMTPSA id q5-20020a1ce905000000b003fbc9d178a8sm9919839wmc.4.2023.07.10.02.50.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 10 Jul 2023 02:51:03 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Richard Henderson , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 3/6] hw/virtio/vhost-vdpa: Inline TARGET_PAGE_ALIGN() macro Date: Mon, 10 Jul 2023 11:49:28 +0200 Message-Id: <20230710094931.84402-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230710094931.84402-1-philmd@linaro.org> References: <20230710094931.84402-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Use TARGET_PAGE_SIZE to calculate TARGET_PAGE_ALIGN (see the rationale in previous commits). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/virtio/vhost-vdpa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 3040bd8ee8..a3dd7c712a 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -329,7 +329,7 @@ static void vhost_vdpa_listener_region_add(MemoryListener *listener, return; } - iova = TARGET_PAGE_ALIGN(section->offset_within_address_space); + iova = ROUND_UP(section->offset_within_address_space, TARGET_PAGE_SIZE); llend = vhost_vdpa_section_end(section, TARGET_PAGE_MASK); if (int128_ge(int128_make64(iova), llend)) { return; @@ -411,7 +411,7 @@ static void vhost_vdpa_listener_region_del(MemoryListener *listener, return; } - iova = TARGET_PAGE_ALIGN(section->offset_within_address_space); + iova = ROUND_UP(section->offset_within_address_space, TARGET_PAGE_SIZE); llend = vhost_vdpa_section_end(section, TARGET_PAGE_MASK); trace_vhost_vdpa_listener_region_del(v, iova, From patchwork Mon Jul 10 09:49:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 701009 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp5079526wrs; Mon, 10 Jul 2023 02:51:48 -0700 (PDT) X-Google-Smtp-Source: APBJJlGV5n/nNWM6uXNGxeH9wAcsvyHbf+XcXWkoow+Cr5kqaCT7rEW7zAM/mbzK6VaRdjOvtKMk X-Received: by 2002:a05:620a:4114:b0:767:55ed:8d22 with SMTP id j20-20020a05620a411400b0076755ed8d22mr14081571qko.25.1688982707800; Mon, 10 Jul 2023 02:51:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688982707; cv=none; d=google.com; s=arc-20160816; b=NgWtYdXHWlUeB8mG4Owp03i9FNRNxL12LLA9X6jujwYrNkUVPOKACW1da4C9ruKlHJ dQUHsKsHcMhA8DncVru/8/jwmDqxkGzbBd5sVDNMq8O6V2tLLl6c8sV4574UFNv5lRXW kELHY+wOX6SPQeoM3KZwEDm321sRb+MXG4XIjRlhpg8DoStwDSQswXv8qM72K2N1i6bo 7qa7BMB/mpXamCL95qoO3cBRKoAvIV18zHYfacxbAxD7EzNxHkuFlScQXpFCHBnL9Dbo UiHzNRtPaNCXNbw0bxhjeWIu5C9j+xfhSuXtnfFmXep5ZKsmVu3co1nlsNonjI/jMW7D 3/TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Te/381aYxXjbGwK91Z8xo75ztwPRV+rlNTVP8J6hqh8=; fh=FilpW137HyWOg2zjOJR+HkXqOM9xEmodh7UtIP57FfE=; b=dkCAbtp+CsQW6i6q19dwAB2SUVwhGtvoUZ8i/e9iVBT+5xYe1uFbtGLDUxoaDK9imH 3nvyIMrL+1QQV65U6NJlq8RZ7fg9jfl0JG0NFhO6+UojnnxQebswl2uZkRNdqQN002i2 0MjevxaC8FlfEqSQogtcT7jdmrecqCkdwVQ7PPvUOXKHg7s1ojJedYSOJdnf3oI1Z+6H D8vyY2vp7F05UL/vPVhPYvueviDCyZwrwug/7dOIEeG3+t9N7a2nuWjKaTYRbWJ2Tnf9 j9uB/8mxkwKuNod7nkVy9L3RiIHhomJdxFr3IiDHN2gzFdjC7jNB9WlTEu4KO69ZyCuQ Ykzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ajHaLvTj; 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=pass (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 bi15-20020a05620a318f00b00767cc0e1ddcsi1603556qkb.274.2023.07.10.02.51.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Jul 2023 02:51:47 -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=pass header.i=@linaro.org header.s=google header.b=ajHaLvTj; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qInYE-00052r-9x; Mon, 10 Jul 2023 05:51:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qInYC-0004x8-6L for qemu-devel@nongnu.org; Mon, 10 Jul 2023 05:51:24 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qInYA-0004Dz-GX for qemu-devel@nongnu.org; Mon, 10 Jul 2023 05:51:23 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-3fbc12181b6so47709515e9.2 for ; Mon, 10 Jul 2023 02:51:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688982680; x=1691574680; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Te/381aYxXjbGwK91Z8xo75ztwPRV+rlNTVP8J6hqh8=; b=ajHaLvTjqb30kWmcJVPp8PfoJ+pgpSNcMU93ZXOfZVoG6hzI3aFCq/ffboNB6b93Gt oDvADTqmt3lZfhgVyxJtypq0+/186kopeuYYa1Gv6aeUpu/ULSGXCno2ODOyxaksO96P DslLgj5YZ2snWYzsjIlXg4TYun5yNDyPC3+cbVRW72lbBAS0LYD4SlQgIUogI7izs6Q+ mkU9D1iTJGPJcLKc88hHH0eeNkKFFfHGlHUhH2X6phVz03ltrBOGNokcidOUpgBd0dMG qgyRYhtVlb/KMPN03T85mnwqPM5o35+diS9219DGQXp+7liBCmgDPACoF6RP8/njaVF6 ZLWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688982680; x=1691574680; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Te/381aYxXjbGwK91Z8xo75ztwPRV+rlNTVP8J6hqh8=; b=DNYxvk1nesSw0AG1onHMiQ+Yf1UkpBtVicnjxkqNuB9YxOlnbrzvjbmJLYCjN8nkRs B40NQO2w/j2GLx8gqk+9QgPHc1mNVT0ZaV+HCyDwnpx/hgaRXAqQsjx3xeygc8OB0PXS PycNoPHAReVNOWzIKKVS7F40zpsCAOb9akzTQRqqPi5IbaZgfaCPC8c9JHsysnvV3ofq hMh5aHpUuuHoBHe7NRMhxYeIjGnQOkEkJwCzOc0IhoQWUZCE+naRUUkpAQGSBq19pAzm NMxIwI+yt0AINz++ZLwajAWRDekIj5xGknuROU/yTA2cTnVRtvsoahTqmlYH7Ij1uOEk 9gvA== X-Gm-Message-State: ABy/qLbj+aKF+ScwvwNzxvmu/2hXJBioL0YLH9xGCIMyic93kcI8Wl7a O5NwbepA02comgSxYxCu4PAs26fZPJabjl1V/R0z1w== X-Received: by 2002:a7b:cc84:0:b0:3fc:a5:2c3a with SMTP id p4-20020a7bcc84000000b003fc00a52c3amr7729653wma.41.1688982680527; Mon, 10 Jul 2023 02:51:20 -0700 (PDT) Received: from localhost.localdomain (70.red-88-28-30.dynamicip.rima-tde.net. [88.28.30.70]) by smtp.gmail.com with ESMTPSA id c13-20020a05600c0acd00b003fa96fe2bebsm9830608wmr.41.2023.07.10.02.51.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 10 Jul 2023 02:51:20 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Richard Henderson , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 4/6] hw/virtio/vhost-vdpa: Use target-agnostic qemu_target_page_mask() Date: Mon, 10 Jul 2023 11:49:29 +0200 Message-Id: <20230710094931.84402-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230710094931.84402-1-philmd@linaro.org> References: <20230710094931.84402-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Similarly to commit e414ed2c47 ("virtio-iommu: Use target-agnostic qemu_target_page_mask"), Replace the target-specific TARGET_PAGE_SIZE and TARGET_PAGE_MASK definitions by a call to the runtime qemu_target_page_size() helper which is target agnostic. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/virtio/vhost-vdpa.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index a3dd7c712a..2717edf51d 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -14,6 +14,7 @@ #include #include #include +#include "exec/target_page.h" #include "hw/virtio/vhost.h" #include "hw/virtio/vhost-backend.h" #include "hw/virtio/virtio-net.h" @@ -23,7 +24,6 @@ #include "migration/blocker.h" #include "qemu/cutils.h" #include "qemu/main-loop.h" -#include "cpu.h" #include "trace.h" #include "qapi/error.h" @@ -313,9 +313,11 @@ static void vhost_vdpa_listener_region_add(MemoryListener *listener, Int128 llend, llsize; void *vaddr; int ret; + int page_size = qemu_target_page_size(); + int page_mask = -page_size; if (vhost_vdpa_listener_skipped_section(section, v->iova_range.first, - v->iova_range.last, TARGET_PAGE_MASK)) { + v->iova_range.last, page_mask)) { return; } if (memory_region_is_iommu(section->mr)) { @@ -323,14 +325,14 @@ static void vhost_vdpa_listener_region_add(MemoryListener *listener, return; } - if (unlikely((section->offset_within_address_space & ~TARGET_PAGE_MASK) != - (section->offset_within_region & ~TARGET_PAGE_MASK))) { + if (unlikely((section->offset_within_address_space & ~page_mask) != + (section->offset_within_region & ~page_mask))) { error_report("%s received unaligned region", __func__); return; } - iova = ROUND_UP(section->offset_within_address_space, TARGET_PAGE_SIZE); - llend = vhost_vdpa_section_end(section, TARGET_PAGE_MASK); + iova = ROUND_UP(section->offset_within_address_space, page_size); + llend = vhost_vdpa_section_end(section, page_mask); if (int128_ge(int128_make64(iova), llend)) { return; } @@ -396,23 +398,25 @@ static void vhost_vdpa_listener_region_del(MemoryListener *listener, hwaddr iova; Int128 llend, llsize; int ret; + int page_size = qemu_target_page_size(); + int page_mask = -page_size; if (vhost_vdpa_listener_skipped_section(section, v->iova_range.first, - v->iova_range.last, TARGET_PAGE_MASK)) { + v->iova_range.last, page_mask)) { return; } if (memory_region_is_iommu(section->mr)) { vhost_vdpa_iommu_region_del(listener, section); } - if (unlikely((section->offset_within_address_space & ~TARGET_PAGE_MASK) != - (section->offset_within_region & ~TARGET_PAGE_MASK))) { + if (unlikely((section->offset_within_address_space & ~page_mask) != + (section->offset_within_region & ~page_mask))) { error_report("%s received unaligned region", __func__); return; } - iova = ROUND_UP(section->offset_within_address_space, TARGET_PAGE_SIZE); - llend = vhost_vdpa_section_end(section, TARGET_PAGE_MASK); + iova = ROUND_UP(section->offset_within_address_space, page_size); + llend = vhost_vdpa_section_end(section, page_mask); trace_vhost_vdpa_listener_region_del(v, iova, int128_get64(int128_sub(llend, int128_one()))); From patchwork Mon Jul 10 10:04:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 701010 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp5084785wrs; Mon, 10 Jul 2023 03:05:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlHoGHS7Sd6A/GuCa7pI8DgLZVBfEymfcPSvoHE6KGiZpTUC8oaX2wcryYdDhlASQmEYpJUW X-Received: by 2002:a05:622a:588:b0:3f5:39a7:1b9e with SMTP id c8-20020a05622a058800b003f539a71b9emr14910180qtb.56.1688983529322; Mon, 10 Jul 2023 03:05:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688983529; cv=none; d=google.com; s=arc-20160816; b=s6MRAZSue28klwHl0jMmBJ2IZgT/T252ClQ1WkJs42a/IZ3Oz+A0QOiIkf2RQRX2l4 dkIqsmVW1qSrbsSz2BKeRAPdYQCf/FNv2jXC+jzXpFC2JP+BhVweJ68eyopLQYjhcaCN CLcw80pelI5S/oZ2fHpIKQuZJ35I8g+md8rFWm8b760r9z9sOf34MeRLcwAAVsRP3Jp3 gQhsi99P1dNuKcGuhKNX8nAURSDdFbMtJQnY4lUoN0btB6DU/HChizcxuooWfSApcFOK U2bHwBBjgSfpunTd1YSlR5ygChd0LeLrZXSXyKRno6Ew/hI/tWq62f/KAkX1XXCGQ0JK L22A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6LMOPfhO5ibhIM8wguQENwLu/kd+mXHQhja7vg27N5M=; fh=HsV0QDNO5uDHVX1M7Yuho9xYoBykL2LI01VoFxuogog=; b=bnP5hno6TzDnFDB5ZUBiMyrXMCDekVf6N0/tz+5R/a8Ito5TysrhMP33fupSqBb/6E D33qh6zYa2PfsvZJPBUM1MtuMw596QAJ40+/UQGfAcV2kAU27dg1gzf17OyuqyXqMy/J ggk72tyfi5J1dGW8ER+3UaVYCkr5IaOkTTVm5W2vuV7nBw/3O6UlORCoER/MRSOe6cmp vVR8QWWgcINtqcQN1sM3mDMLwAcFEw6zPlbTDF5fOwTgU8O0C8S/CoQSq3xaIECnUosY 8s8JegU83eXMS1fHbf9Hmo4Aunb35JvVRfek+43HDK0/l6m0v473CB6LUmZQvCFFQt6D RAEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BZFyNP0Q; 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=pass (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 u15-20020ac858cf000000b00403ac17cf02si1075808qta.74.2023.07.10.03.05.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Jul 2023 03:05:29 -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=pass header.i=@linaro.org header.s=google header.b=BZFyNP0Q; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qInlE-0001Rd-0n; Mon, 10 Jul 2023 06:04:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qInlB-0001RM-Ec for qemu-devel@nongnu.org; Mon, 10 Jul 2023 06:04:49 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qInl8-0001tu-0i for qemu-devel@nongnu.org; Mon, 10 Jul 2023 06:04:47 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-3fbc77e76abso44947315e9.1 for ; Mon, 10 Jul 2023 03:04:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688983484; x=1691575484; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6LMOPfhO5ibhIM8wguQENwLu/kd+mXHQhja7vg27N5M=; b=BZFyNP0Qvl6j3gQGtMAYdILycCI3bmo3AqAhaVykrziftbX12Idqe5U72qpomxvm0o 8hoObCvqVkSDfcrb7nstleDEKPmhMe7xC67+i8zjWtj/1J8tAJRHLz2n4JtnLl0Rl1/f 1u+F1OUbmaY9vsUT6rpkl6zTDPmRRBv9uai8EtFc8blOsN8wGkrl3Oc/EZAs+6ugaESi yXXGczvK1UtrbE3R+nTSFHz3BE8W1/OSFguqWkaZCUXZuHI4DJlkJS0n7QNI6dJMvX1G iONVSo06r4UBHGL5i4u8QwiIorva/aExBbrVYtyqv0g5l5K3jUpofbivtWiH8DO40w+0 9nBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688983484; x=1691575484; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6LMOPfhO5ibhIM8wguQENwLu/kd+mXHQhja7vg27N5M=; b=gTEKX0zsPyw8fFIKxd2eZ7dSxLWjSP+8mz5wxt6FJiYyUjIv17+CvzlQM+lq/8piMs Dbm2QSI3FleRyB8FibjHyzYLTDtJiUqnp2hVGVCIqeNm22PAdq/9GbCJSz3HGtmodUDQ BCAW84p2XAYrHJUNM7U/fu5DLTEWliG+/t9ZF7eePj8Mot1kobAwmYSMJ/MqK6olP8S/ edfnuv+5t0AlfyQKsrRuc6Obr/fgF5dDWDyehiWxil1KgSF5ecVnOhNkHj43UyvDK82t HHdBysZ07Tc7pnB5yl9xluxxRlE1ONVH9MDtfq5sne5mtw0V+znbZ05xS4x0rCcPkJsJ +bxA== X-Gm-Message-State: ABy/qLaiz0LHjP6k7kkdZeCqww7cILfW05pfbJcLch0TpsqRg/52t2Tl KS/TGfK8WSxr51b1XWRSZ/2KEg== X-Received: by 2002:a05:6000:144:b0:313:ee3e:50c5 with SMTP id r4-20020a056000014400b00313ee3e50c5mr10395648wrx.20.1688983483964; Mon, 10 Jul 2023 03:04:43 -0700 (PDT) Received: from localhost.localdomain (70.red-88-28-30.dynamicip.rima-tde.net. [88.28.30.70]) by smtp.gmail.com with ESMTPSA id u12-20020adfdd4c000000b0030ab5ebefa8sm11222109wrm.46.2023.07.10.03.04.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 10 Jul 2023 03:04:43 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Cc: Thomas Huth , "Michael S . Tsirkin" , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v3 5/6] hw/virtio: Build vhost-vdpa.o once Date: Mon, 10 Jul 2023 12:04:32 +0200 Message-Id: <20230710100432.84819-1-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230710094931.84402-1-philmd@linaro.org> References: <20230710094931.84402-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The previous commit removed the dependencies on the target-specific TARGET_PAGE_FOO macros. We can now move vhost-vdpa.c to the 'softmmu_virtio_ss' source set to build it once for all our targets. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/virtio/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/virtio/meson.build b/hw/virtio/meson.build index f32b22f61b..900864c1be 100644 --- a/hw/virtio/meson.build +++ b/hw/virtio/meson.build @@ -18,7 +18,8 @@ if have_vhost specific_virtio_ss.add(files('vhost-user.c')) endif if have_vhost_vdpa - specific_virtio_ss.add(files('vhost-vdpa.c', 'vhost-shadow-virtqueue.c')) + softmmu_virtio_ss.add(files('vhost-vdpa.c')) + specific_virtio_ss.add(files('vhost-shadow-virtqueue.c')) endif else softmmu_virtio_ss.add(files('vhost-stub.c')) From patchwork Mon Jul 10 10:05:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 701011 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp5084965wrs; Mon, 10 Jul 2023 03:05:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlFyzH3Y3tBCkxkn66rbI0xiWWEy2AtdfjC3Ai4bI4GEw3ZMvAQwoSjrjuDZcrupXPgGs0H7 X-Received: by 2002:a05:620a:2903:b0:767:261d:1ef6 with SMTP id m3-20020a05620a290300b00767261d1ef6mr13850285qkp.59.1688983553510; Mon, 10 Jul 2023 03:05:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688983553; cv=none; d=google.com; s=arc-20160816; b=sK4plmEmGJAcqSdsdfMfmZAMbPP3tmJ96rOwqxo5Cjt2YovyTMZBurBXxXqBJKV1sE /3/Zd7Qx8lMORONx3CUmiSvmdUMIQqlgeAfkvUwoVKAbjcMdZF9aN/gLBbysnkHvuEL7 8zuLHmjrlIqt3snr69uLkJVyFzSbGPVKrsUJA3bopwAcFxHO9mSVx3E66Ol8DtEQ8J9M m9EeO2WUiAtAD1IvbW1JXiwpvN13gy2hEKln3kyDAeMCiiRW/VdrHiqs82/lK2ZWYQCS GUEtJQsSnNDC2VHpW/+p4c/cYFBREpMc8O9c1+W//ieJaH/r6F2zNFJgsO4XRN23+s6B +4FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iwQW/gq4UyCSctLiWA3Tu8H5hFtvtJMWJauTX+1QKic=; fh=HsV0QDNO5uDHVX1M7Yuho9xYoBykL2LI01VoFxuogog=; b=E3XACnzvOPzPrSxSi4Vz6YxxUjg49v+c74YLHG8gNgT/N4qliVWl0WqGZa9GnYV8jZ gOVALzO1dEx62f+VOOlEPNPHQPjm6wc2mFRkOPjDt+TUAJEHvcMUpQU1kh2xgvnbR4F0 z8KkP9MSIacRejXKk5Zo/A11D2alI9Dlj9jcFgMxD6/6fI625kVWeIcM4wxdoaZvlVAZ lIeG62KYRUMAqHJ4D1LX8PE1YqzaUhLVK6+6wjPrN023H1T7D9s6Z4ujdHwAxdzGXDzi qdNrKTl3KeN8TZYH/KFrLqbw0DnXRD3q4lzU61stl/d2UQWU4hnHmVa3k9asmiqT4pA4 hudA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nIEtX0DT; 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=pass (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 az39-20020a05620a172700b00767d94f38f8si326677qkb.475.2023.07.10.03.05.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Jul 2023 03:05:53 -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=pass header.i=@linaro.org header.s=google header.b=nIEtX0DT; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qInln-0001WM-EE; Mon, 10 Jul 2023 06:05:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qInlm-0001WA-6U for qemu-devel@nongnu.org; Mon, 10 Jul 2023 06:05:26 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qInlg-0001yd-RT for qemu-devel@nongnu.org; Mon, 10 Jul 2023 06:05:23 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-314172bac25so4089510f8f.3 for ; Mon, 10 Jul 2023 03:05:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688983518; x=1691575518; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iwQW/gq4UyCSctLiWA3Tu8H5hFtvtJMWJauTX+1QKic=; b=nIEtX0DT4DxlLF/T9WiXr0t/fiCC83PfonPEivviNBajMMSFQYtHORSX5DOEYyx1lM r9RtwSW5X+mBm1eJg6Ue4phP8Cre9I53ihOumVerO7Ic2PudqGHR3iQ5caXDEKnScOqf Z5NK4shvFNzSuVHFRjy/mcY4c5Ahs6skhQWliRkn1AWlqKD3NWsQ8yB/A/MyFI9C0CQt USYOsIV8QKLIfo+rRBlBilTBBPNLbwrSZvHMYg+hVCAZE/x+2d1Atsfqijp2gAVnxTsH wV88mzAPtB9irh3APc2jzEmGBHoO4heFKihjw+FG19Q5nKOdWZdZ89YQqRyw5RWJSMJ2 wOwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688983518; x=1691575518; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iwQW/gq4UyCSctLiWA3Tu8H5hFtvtJMWJauTX+1QKic=; b=leoegoYW5DvNDyZrkbVSE2o/ZfW7SmJnr48YFdfQFYKwDym1tB6l3AddhhocyVxKQa SxTGyoUVQ/bvfUmkZy9nlBJB480DpV+Y30gNZ3LtFgPNB4XWDYAnqUcBQaRFwBzdSe5y qKU14W5SLh0QtXq4MWGC67Mwa3uik3ygALuZeNTMaKSdo912hY0/O2hK3guFfM4Kv+se HR/MngvzTTE9xU2HM9KtT+0eOKr4OSSnDuXtJiuR+OiviZntfSDYoC67LHKIbCrIBoTf /LzGGhzvKrhq1xLqE6r6O3Bvo4g/gznqUgR/gBGhAheIPU99JYNQP2UtF9lLt2TiCEbR J8Qg== X-Gm-Message-State: ABy/qLa7Opjici4unT9Vjy/1541inQYaPDCE3vII672kuh5r3TOZZvk3 qw/02SyQKqNoRuwVwVJeLG9bHQ== X-Received: by 2002:a5d:6501:0:b0:313:e456:e64a with SMTP id x1-20020a5d6501000000b00313e456e64amr10155707wru.21.1688983518162; Mon, 10 Jul 2023 03:05:18 -0700 (PDT) Received: from localhost.localdomain (70.red-88-28-30.dynamicip.rima-tde.net. [88.28.30.70]) by smtp.gmail.com with ESMTPSA id f17-20020adfe911000000b0031416362e23sm11295659wrm.3.2023.07.10.03.05.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 10 Jul 2023 03:05:17 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Cc: Thomas Huth , "Michael S . Tsirkin" , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v3 6/6] hw/virtio/meson: Rename softmmu_virtio_ss[] -> system_virtio_ss[] Date: Mon, 10 Jul 2023 12:05:10 +0200 Message-Id: <20230710100510.84862-1-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230710094931.84402-1-philmd@linaro.org> References: <20230710094931.84402-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Similarly to commit de6cd7599b ("meson: Replace softmmu_ss -> system_ss"), rename the virtio source set common to all system emulation as 'system_virtio_ss[]'. This is clearer because softmmu can be used for user emulation. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/virtio/meson.build | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/hw/virtio/meson.build b/hw/virtio/meson.build index 900864c1be..7a36eabb39 100644 --- a/hw/virtio/meson.build +++ b/hw/virtio/meson.build @@ -1,28 +1,28 @@ -softmmu_virtio_ss = ss.source_set() -softmmu_virtio_ss.add(files('virtio-bus.c')) -softmmu_virtio_ss.add(when: 'CONFIG_VIRTIO_PCI', if_true: files('virtio-pci.c')) -softmmu_virtio_ss.add(when: 'CONFIG_VIRTIO_MMIO', if_true: files('virtio-mmio.c')) -softmmu_virtio_ss.add(when: 'CONFIG_VIRTIO_CRYPTO', if_true: files('virtio-crypto.c')) -softmmu_virtio_ss.add(when: 'CONFIG_VHOST_VSOCK_COMMON', if_true: files('vhost-vsock-common.c')) -softmmu_virtio_ss.add(when: 'CONFIG_VIRTIO_IOMMU', if_true: files('virtio-iommu.c')) -softmmu_virtio_ss.add(when: 'CONFIG_VHOST_VDPA_DEV', if_true: files('vdpa-dev.c')) +system_virtio_ss = ss.source_set() +system_virtio_ss.add(files('virtio-bus.c')) +system_virtio_ss.add(when: 'CONFIG_VIRTIO_PCI', if_true: files('virtio-pci.c')) +system_virtio_ss.add(when: 'CONFIG_VIRTIO_MMIO', if_true: files('virtio-mmio.c')) +system_virtio_ss.add(when: 'CONFIG_VIRTIO_CRYPTO', if_true: files('virtio-crypto.c')) +system_virtio_ss.add(when: 'CONFIG_VHOST_VSOCK_COMMON', if_true: files('vhost-vsock-common.c')) +system_virtio_ss.add(when: 'CONFIG_VIRTIO_IOMMU', if_true: files('virtio-iommu.c')) +system_virtio_ss.add(when: 'CONFIG_VHOST_VDPA_DEV', if_true: files('vdpa-dev.c')) specific_virtio_ss = ss.source_set() specific_virtio_ss.add(files('virtio.c')) specific_virtio_ss.add(files('virtio-config-io.c', 'virtio-qmp.c')) if have_vhost - softmmu_virtio_ss.add(files('vhost.c')) + system_virtio_ss.add(files('vhost.c')) specific_virtio_ss.add(files('vhost-backend.c', 'vhost-iova-tree.c')) if have_vhost_user specific_virtio_ss.add(files('vhost-user.c')) endif if have_vhost_vdpa - softmmu_virtio_ss.add(files('vhost-vdpa.c')) + system_virtio_ss.add(files('vhost-vdpa.c')) specific_virtio_ss.add(files('vhost-shadow-virtqueue.c')) endif else - softmmu_virtio_ss.add(files('vhost-stub.c')) + system_virtio_ss.add(files('vhost-stub.c')) endif specific_virtio_ss.add(when: 'CONFIG_VIRTIO_BALLOON', if_true: files('virtio-balloon.c')) @@ -65,7 +65,7 @@ virtio_pci_ss.add(when: 'CONFIG_VHOST_VDPA_DEV', if_true: files('vdpa-dev-pci.c' specific_virtio_ss.add_all(when: 'CONFIG_VIRTIO_PCI', if_true: virtio_pci_ss) -system_ss.add_all(when: 'CONFIG_VIRTIO', if_true: softmmu_virtio_ss) +system_ss.add_all(when: 'CONFIG_VIRTIO', if_true: system_virtio_ss) system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('vhost-stub.c')) system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('virtio-stub.c')) system_ss.add(when: 'CONFIG_ALL', if_true: files('vhost-stub.c'))