From patchwork Thu Mar 6 06:41:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 870815 Delivered-To: patch@linaro.org Received: by 2002:a5d:64c8:0:b0:38f:210b:807b with SMTP id f8csp159880wri; Wed, 5 Mar 2025 22:42:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV9nKQRNgND9oy6+IpWvW3nrwvdZlCH9wCJWo92JeS/yaCkArdi0ASGgLnmE1slpnWfAtSl9A==@linaro.org X-Google-Smtp-Source: AGHT+IE+nNNhwr9ixHCs40p23bItZfkcfIj2PgCWc/ShwviEbYoWWR3QSbjUaKeWeodQQnuKbuZT X-Received: by 2002:a05:620a:84c7:b0:7c0:a28e:4964 with SMTP id af79cd13be357-7c3d8e4653amr823242085a.14.1741243350294; Wed, 05 Mar 2025 22:42:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741243350; cv=none; d=google.com; s=arc-20240605; b=HUAG1sc92H4EzkyKPQd/+luZd4ZbygLXsoPmVmmIoRduRNsQNQnn2V2tzOdkEx9NzB qi/dNMw/gf9pvNihguZeF38PRQG6RWe7Mdq2uRwNpQGZIjUneo2PWghqu/Z1lgvtenU0 EnX7rfmXY66yMPLl7cQXJ5Fejc4TKrqGL+Pui4r7w4iQwZJmSlWLtP+A0H3yk3SMtR8W 7Ife2IF1HRvIhSDd9BtmnsIP8e3XT+UaiXsmgzo6I6D+RP9e4A3yjTEiBPm97Vv6q4LH 4CzqfrDfAi8glEz6mU7DLWsoteq6Ig6+9J+WMxlg9Jo3vRufvQgnx0dwGp6RT4uw1tOR N2pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=GuCnrkSUR2vP9owV0mamaIN+gV2Z3JtFzZ89seSCxZQ=; fh=6YXYrvfwRj++zpzjev+6RgQQ1z/X8e8BywVVLkXqzXI=; b=I6jplM00rparQjdvY/ubvpZE6z282iu7ns+tUouv3Eh309La2tD1KQYE7KG7qzpY+o ggFoAp1yLq/WmuIQN8gkk6NuIlaPYWQTFfz2aokwkISI/IPUkA/xLju/6RwVvITkZp2c 5KkQ4hE+NKrqoPmbpPipGKdQ2tm4s512HoSPX61z1uZyEhoYFUXQYE63TMMkR+LzSptq +zFKT+hZ4WDh7Nwe1hSvLH/frYqHy4ShFDn3j0i9Tho0TjG5jpa0tePJKOEXjooIOPG7 ibJUSCv4RktPWFj7L6rWYWCanjPXCOGScKONz80hc/Pth6IMHxqXwhIqiwuxN9sAPGYm TDzQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lTAaet5w; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7c3e55114b8si67717485a.429.2025.03.05.22.42.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Mar 2025 22:42:30 -0800 (PST) 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=lTAaet5w; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tq4vb-00026b-0q; Thu, 06 Mar 2025 01:41:55 -0500 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 1tq4vH-0001zP-MC for qemu-devel@nongnu.org; Thu, 06 Mar 2025 01:41:36 -0500 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tq4vE-0006Ft-6X for qemu-devel@nongnu.org; Thu, 06 Mar 2025 01:41:34 -0500 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-2239f8646f6so4113425ad.2 for ; Wed, 05 Mar 2025 22:41:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741243291; x=1741848091; darn=nongnu.org; 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=GuCnrkSUR2vP9owV0mamaIN+gV2Z3JtFzZ89seSCxZQ=; b=lTAaet5w11kpsa0a+RfuLrqWOKFoWuZvWIPt/Uuzu3GJ26QFdK32qdQl+IzNqX6CKH DI/ChGTA6Cnbiz8q4u+WK337O+nRHfZqsE/pOmfNML8pnGum9HufhhPZ4R3U+mBmcz6/ 39GqK5fT6b6ynT1A9uSEbMDr4PtPf3ZdjN/L9Wa9HNaCk0uTfDv2rphN1WZsLNVH9AI4 y+65lHrFslef3ayCGUp5dJsX772eFeKOAtDRcmPBhWjAcA0FN1fuu5s3cJHN7hqFmOKr dJtvgFnyrg5GBgX37MOFSnp3oFdKNFVvNQyDsGfvrwdfqYObEFsfzZ8E0kFlqnClFITY PkUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741243291; x=1741848091; 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=GuCnrkSUR2vP9owV0mamaIN+gV2Z3JtFzZ89seSCxZQ=; b=CUxmI/VX132CpIgmmpw8TCA0bh+jLeYFWBGjJG2GcQjJvm8jNIVXAIW9QteJhObdov wXVyaKVHd3/ZpZQk64/6sqbD5FanIbIKZX4M0AYGHcclKJCJIjxqAh4ir9ZVAki4YwLN +4kP8N0BC7XQfW0yFN8u1qRSYWyXpRUbJyZV7x4swti39MxmZL8lPzwDQzbk3kVvVakw A10GRAbuuiiUUkB5ntOIObhfcc6ncPkiVgIxycCS6Wxuw4LEVeqiqFSQMccCrFNx/yFf GK88e2Ra5MSKdW1ueDvZT86NXbXT/4xKkKEMDhzM5msWlv/LOHA9ClchY7TI2THt8UYF tL6A== X-Gm-Message-State: AOJu0YwLYpUdon3XlaovXknWcCdvyWfS/JruBgCr9l05wWM0NIUdoHt2 nmBcR4grmdZ8lTQu0vX4V4HibFHlYJsy9AhWk6PSFFU24U7DVc3ym6E6OswQqbmG5kS70l4mxwm s X-Gm-Gg: ASbGncsKg3KYd2E/1MkqWAzRU9cauLy1t8bYhPLWydaZRE+WvhW4V6Ijb2D3Thvu1y1 0wp0aMuOu953Qr96LUqSg+bPNDU4t3EQosepEtDZHBSVr/3hqTUNqrmmnTWO9TPmHWYKkUf4cyB TI9Bd8RqMGIMcK1w9GiZUY5RyO79ZjFJWgW29+xZiRyN4m65pJu5G7kprtHBEbAK5KFod7iIFbT 8II+YlxUsgThE0gNDKwIX1pysOtpqv7Bdfh2x6it6/93zBcHlj09DMxW3wBucaN1SZp1Wr73msR JLmnkCHmnijpCgyNAb2PQS4QyYGSQ/ZYcD0Yp4YJ1YRp X-Received: by 2002:a17:902:f606:b0:223:f9a4:3f99 with SMTP id d9443c01a7336-223f9a457a2mr79524075ad.29.1741243290828; Wed, 05 Mar 2025 22:41:30 -0800 (PST) Received: from pc.. ([38.39.164.180]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22410a91cffsm4769355ad.174.2025.03.05.22.41.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Mar 2025 22:41:30 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, philmd@linaro.org, Paolo Bonzini , pierrick.bouvier@linaro.org, manos.pitsidianakis@linaro.org, "Maciej S. Szmigiero" , richard.henderson@linaro.org, Marcelo Tosatti , alex.bennee@linaro.org Subject: [PATCH 5/7] hw/hyperv/syndbg: common compilation unit Date: Wed, 5 Mar 2025 22:41:16 -0800 Message-Id: <20250306064118.3879213-6-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250306064118.3879213-1-pierrick.bouvier@linaro.org> References: <20250306064118.3879213-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x62e.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 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 Replace TARGET_PAGE.* by runtime calls Signed-off-by: Pierrick Bouvier --- hw/hyperv/syndbg.c | 7 ++++--- hw/hyperv/meson.build | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/hyperv/syndbg.c b/hw/hyperv/syndbg.c index d3e39170772..f9382202ed3 100644 --- a/hw/hyperv/syndbg.c +++ b/hw/hyperv/syndbg.c @@ -14,7 +14,7 @@ #include "migration/vmstate.h" #include "hw/qdev-properties.h" #include "hw/loader.h" -#include "cpu.h" +#include "exec/target_page.h" #include "hw/hyperv/hyperv.h" #include "hw/hyperv/vmbus-bridge.h" #include "hw/hyperv/hyperv-proto.h" @@ -188,7 +188,8 @@ static uint16_t handle_recv_msg(HvSynDbg *syndbg, uint64_t outgpa, uint64_t timeout, uint32_t *retrieved_count) { uint16_t ret; - uint8_t data_buf[TARGET_PAGE_SIZE - UDP_PKT_HEADER_SIZE]; + const size_t buf_size = qemu_target_page_size() - UDP_PKT_HEADER_SIZE; + uint8_t *data_buf = g_alloca(buf_size); hwaddr out_len; void *out_data; ssize_t recv_byte_count; @@ -201,7 +202,7 @@ static uint16_t handle_recv_msg(HvSynDbg *syndbg, uint64_t outgpa, recv_byte_count = 0; } else { recv_byte_count = recv(syndbg->socket, data_buf, - MIN(sizeof(data_buf), count), MSG_WAITALL); + MIN(buf_size, count), MSG_WAITALL); if (recv_byte_count == -1) { return HV_STATUS_INVALID_PARAMETER; } diff --git a/hw/hyperv/meson.build b/hw/hyperv/meson.build index c855fdcf04c..a9f2045a9af 100644 --- a/hw/hyperv/meson.build +++ b/hw/hyperv/meson.build @@ -1,6 +1,6 @@ specific_ss.add(when: 'CONFIG_HYPERV', if_true: files('hyperv.c')) specific_ss.add(when: 'CONFIG_HYPERV_TESTDEV', if_true: files('hyperv_testdev.c')) system_ss.add(when: 'CONFIG_VMBUS', if_true: files('vmbus.c')) -specific_ss.add(when: 'CONFIG_SYNDBG', if_true: files('syndbg.c')) +system_ss.add(when: 'CONFIG_SYNDBG', if_true: files('syndbg.c')) specific_ss.add(when: 'CONFIG_HV_BALLOON', if_true: files('hv-balloon.c', 'hv-balloon-page_range_tree.c', 'hv-balloon-our_range_memslots.c')) system_ss.add(when: 'CONFIG_HV_BALLOON', if_false: files('hv-balloon-stub.c'))