From patchwork Thu Mar 13 16:38:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 14015439 Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 683CB1FBEA8 for ; Thu, 13 Mar 2025 16:39:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883956; cv=none; b=nj8odf5QNxgN1CirI1l7/+HVXu0eMIW9KBOVRCOiiik+VFnHw8ATnAlnUqrvW6VKbNxhc0t22jJ9OKBhrbFCatsmsnvt8Y0IZf5c6pt5gJLK6GurcgAOdq9zgY6aa6zHPWkLlRuLEA+L2S/a22qWY+RGsAxpXX76H+scappgVWs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883956; c=relaxed/simple; bh=D7kAKGSn4zAKkiSs1hQlq6vEceALs33too5mFmMr30Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Oy9NIZjXPa4whvzMLpX/0qpRAi63ftY42MkdXf9wq64yXkKgdnERpPaOuXoiLzgmwSe5mQPfuInZxjO+iUeY99CTLAWaJS1nticWmA49IC8CTa1YWgVklq/Ojdkur6pqkU1kiyRRuepak1rPLpZk84nob3jGYsVWHtceRyD5yhA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=os0AdLfp; arc=none smtp.client-ip=209.85.216.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="os0AdLfp" Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-2ff65d88103so2115514a91.2 for ; Thu, 13 Mar 2025 09:39:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741883952; x=1742488752; darn=vger.kernel.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=949DeBQijWmgHqYCdDdupcSTn3rDdND8nLqwkILEwEI=; b=os0AdLfpbmE1IPXGe2iz9R0NgEj4pTBFdZmHErvcvlX81Z0RN33b+piz/BsbE6/auT eqsCNnj3MBT9J+21AO4xLjeqO+wAaP9md9KZe891zmI8qw8AHr32kQihcNA8DKGFvDb3 k3OKULE/aXJPsQ8tWMEwBlwprUj6PLu0UIB0Oi0g+hRiYAYhO3Ugxx5FEMkSbIDCanHy bF39skCvNcusNwpNYy/iwQ8n9yiB0zSbXnzVZMwNmPzgOkaF6/7n9Km5oPiL5tJptz8v 76lffw8j7QWxzhOM7vqRtqER5smOmzUeICY5id5WJEKYhu3HEMsXMgii9oshlZcBMa1r UlCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741883952; x=1742488752; 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=949DeBQijWmgHqYCdDdupcSTn3rDdND8nLqwkILEwEI=; b=Yc1e9uTqtw+B4diZKqAwguvnap/J0A7JE9Vm+3oeMdeGxER+AfOS4X1F4DRuIdw32i nVDKepsTMv2vew//+NfG/tiXvfLUC83B5wyT6obPMdKldhmgpMS3NqSCzpwCfLSq7et7 eQtnLxkhNSFqSOs079MU30LYsaEiHKncPf/9gKM898AQh5jYCL8aRZoy5fbU7oh870L3 kbtwJsL+I0GG5GuWfOoCm7zGe/UjQROqSomNhSG2bSFO4ClywFdC30sMUB3cGIev8vYs uZ1+r1wp5gznxDDVRGpL1lPugHuherc9PFieCgLM6XQQhJs+IxzeKwPckvi+EfYkkJT8 MgdA== X-Forwarded-Encrypted: i=1; AJvYcCVdZ5FMekObl2z/yDhhW5Vl/lOyzjVG5EzBFO1okxJRZHuzzEqU+Z6wQJ/Ck/FvyeNdZBM=@vger.kernel.org X-Gm-Message-State: AOJu0YxXv3/BYC7eKC08u29zVqBA2nwgvmA5ZO0oOGlpPI0w9zzFXiuo gAk3t1JaDBe6L+EMSuvT5FuFKdlAtW/J9zlpR7difZUPGHhiIC29lSVSYyv2ZnM= X-Gm-Gg: ASbGncuK855Quvi6ucwkNUxe4zKWjdOq/IHpZTEBkRrSn1gABQJWR2JX7XRI/ZPNYlG vHrx03GrP6o1XVN7x6TFhIX30bz0ZUx7qn+MXaSgFmktd5Ab58w2wJgCuNHnGBVA90bFo33D71p lWFan+9CpmcNYgmGkit1qHpizYZoksxzqfTIo4NEsWiBgoM5JiReBz7HHvB2NfY+yciE4t6meuB lf+2xkH8Rsn1EQ7IhFQR6zTHT/J9/h9w7zX1IePm3IZXxbeXRxERQHKEfnqpKMxXKn1Dxp7fo3l HdOD2O7yFkba0r9GuuPezTf7XVaiwSMklNtatGI+DXvg X-Google-Smtp-Source: AGHT+IGev37PyaCRPVTSAXm6sa8QmcuQfkCR4AEqF/Tkfr+Zh7Bhff2KfoPULWlCloRr8rbLF7MLgw== X-Received: by 2002:a17:90b:3850:b0:2ff:7b15:813b with SMTP id 98e67ed59e1d1-3014e855f52mr302864a91.17.1741883952691; Thu, 13 Mar 2025 09:39:12 -0700 (PDT) Received: from pc.. ([38.39.164.180]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-30119265938sm4020084a91.39.2025.03.13.09.39.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 09:39:12 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Paul Durrant , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Liu Zhiwei , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Peter Xu , alex.bennee@linaro.org, manos.pitsidianakis@linaro.org, Stefano Stabellini , Paolo Bonzini , qemu-ppc@nongnu.org, Richard Henderson , kvm@vger.kernel.org, David Hildenbrand , Palmer Dabbelt , Weiwei Li , qemu-riscv@nongnu.org, Alistair Francis , Anthony PERARD , Yoshinori Sato , Daniel Henrique Barboza , Nicholas Piggin , Pierrick Bouvier Subject: [PATCH v4 01/17] exec/tswap: target code can use TARGET_BIG_ENDIAN instead of target_words_bigendian() Date: Thu, 13 Mar 2025 09:38:47 -0700 Message-Id: <20250313163903.1738581-2-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> References: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/tswap.h | 11 ++++++----- cpu-target.c | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/exec/tswap.h b/include/exec/tswap.h index ecd4faef015..2683da0adb7 100644 --- a/include/exec/tswap.h +++ b/include/exec/tswap.h @@ -13,13 +13,14 @@ /** * target_words_bigendian: * Returns true if the (default) endianness of the target is big endian, - * false otherwise. Note that in target-specific code, you can use - * TARGET_BIG_ENDIAN directly instead. On the other hand, common - * code should normally never need to know about the endianness of the - * target, so please do *not* use this function unless you know very well - * what you are doing! + * false otherwise. Common code should normally never need to know about the + * endianness of the target, so please do *not* use this function unless you + * know very well what you are doing! */ bool target_words_bigendian(void); +#ifdef COMPILING_PER_TARGET +#define target_words_bigendian() TARGET_BIG_ENDIAN +#endif /* * If we're in target-specific code, we can hard-code the swapping diff --git a/cpu-target.c b/cpu-target.c index cae77374b38..519b0f89005 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -155,6 +155,7 @@ void cpu_abort(CPUState *cpu, const char *fmt, ...) abort(); } +#undef target_words_bigendian bool target_words_bigendian(void) { return TARGET_BIG_ENDIAN; From patchwork Thu Mar 13 16:38:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 14015440 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92D4A267B77 for ; Thu, 13 Mar 2025 16:39:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883956; cv=none; b=hZjIWYAMaEYvNmZN1/vl6acvxUOFiiiAC0mkaE7+o7CNZWC5E0j4lHIS8372weRfrY5cMJJ1GvIJRsYEvBwTNTnQtnO+ihFQdIdv1r5oXghJp1iYs2B2+zpYNs4f4rJ3ugpwQLvi7OWv2jCPGuC3ACmryeGhFsxkgAx7RWAz+hA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883956; c=relaxed/simple; bh=6cdUkgilZ/OtUG5CSqfjwssNSd31+3Bqv7Sh94x+Hkw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=N50JxW6Q7ViCrc8//7a55nIXqfnUgJEAimv33P3nMaZ/YVPv4KateorajsMhKhNGQFH4gT8dFGPWr7R4elc5YVSiCee+rSnnAdt/WpFnl5mkY0FtzWpsH6CCLJ3fOCtkePwi5ah8L7lYdmzvM6rGIImzmy0Jb8G6AS6j2+g18Y8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Imo3RlEv; arc=none smtp.client-ip=209.85.216.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Imo3RlEv" Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-2ff799d99dcso2531903a91.1 for ; Thu, 13 Mar 2025 09:39:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741883954; x=1742488754; darn=vger.kernel.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=fjQjYNlvDIsMbe7+veFF5h4s6vvln32m8yANkT1fS5Y=; b=Imo3RlEvWW2EZsxLK1yCtl4FFB8XugCTJJ8qsUsF/PlQfR6RNjFdWqKmzi5M2ssbFE 67iim9swz1yCc6hYLsYK+v58xhed6zOBSrcDkiA1oK6bLcYqc4dpu0xjA3cjXVKE4T16 FCKI3ZboGyNouZ+Y5p3Id3NnQxnJ2v9ErwKF2tnwVngd9ss0xAIp66YgkX0B/dJus6vT vb/CMVa+4nJ7mzatTBoAOp7dnHruru06NDOntN3C966VrW2nntZJgL0XZek5y3ytunQR CJdAuQhZy0obNXSpd/x/krjQexnpOyMxxpgPEZ6sOFtfrnXtkWo548ZlGHAEALlx7DTg 8Dgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741883954; x=1742488754; 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=fjQjYNlvDIsMbe7+veFF5h4s6vvln32m8yANkT1fS5Y=; b=fbGijQaFNC98uyj0zFW2EfQg6WNejS2b5e6mzI+bJK+Wv5yuH5Em5Bp281ugLolFxT 8poTo0TtWBV8vbJMHDDrg2OTO+pGiHoZ126ESbowpcJFZbM/v2dO3zIwXHFM5APntVhg RMbrg5e8ghs/IQXE8h/LMYJmh1SAzXo2QNCwTtKyQdbzkRAzUBn/yTaBXIwbo+l8WYY1 DIAH5kYGcet81jF3eThqMnQdo9aGQ07mjbLTjf5L2MZLoXMg0NE88Xk4YQSadCB9rpmW rI13pZp+Im7NhXilDtIqUjNKZ7viL79AFSWXNXOLu85u7aPpCoFSybmTKujgMBuM+YyR p5+Q== X-Forwarded-Encrypted: i=1; AJvYcCW2+Owp6Ft3qySSp3/LxF3uEEirPhxGIQRrF82+qkixJdg6FELde1PQLFsVelHT37pgKrA=@vger.kernel.org X-Gm-Message-State: AOJu0YxgfqC/lbFimyqXB3E89GBxDU5F15IgBnRKH6+VERSX81JuDDd5 fheJ8gnMx1jYIIYu5kb4zY1rBpVX29nv55bJVkh9nzJAQZUgGgsCBJOGsd4IaD8= X-Gm-Gg: ASbGncshmLqrVEoetmdIVAsPaljtvT7xrtObu7BZPJfuA8XfVhxmLqz1gG9hsTGjs3L gaqe/YWe+JbOxQftUtpKimuwXu4hMR7yMkBtK3o86khUJ3Dj76x8du/kIBCddrAYRq+yUsB23A6 JaI7LYOFH0U2fnf947BZSbchyO9EeYs99gFi/qmRzXqpYeWLVM+JjSYmE8M4tDV7yNw2IrupJAi gTflz6TMkHwTjwSRJn7u1ifv4xYxwGzyrvLcxYdvU8SrgcnR2WSo3SeSjyDQw3q+meu8dY8+sYr WUHk85oR7H12EldsR+6s17y79U0YwNZNTu81GMPf0wew X-Google-Smtp-Source: AGHT+IGAE0wRrFnOgUSptf/ZCGVy3gy2ROtBxgIz+VJH5KWtqtjx8oj2KP2h7DP6p39QjbuO2M6/IQ== X-Received: by 2002:a17:90b:264c:b0:2fe:6942:3710 with SMTP id 98e67ed59e1d1-3014e821305mr250112a91.3.1741883953849; Thu, 13 Mar 2025 09:39:13 -0700 (PDT) Received: from pc.. ([38.39.164.180]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-30119265938sm4020084a91.39.2025.03.13.09.39.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 09:39:13 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Paul Durrant , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Liu Zhiwei , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Peter Xu , alex.bennee@linaro.org, manos.pitsidianakis@linaro.org, Stefano Stabellini , Paolo Bonzini , qemu-ppc@nongnu.org, Richard Henderson , kvm@vger.kernel.org, David Hildenbrand , Palmer Dabbelt , Weiwei Li , qemu-riscv@nongnu.org, Alistair Francis , Anthony PERARD , Yoshinori Sato , Daniel Henrique Barboza , Nicholas Piggin , Pierrick Bouvier Subject: [PATCH v4 02/17] exec/tswap: implement {ld,st}.*_p as functions instead of macros Date: Thu, 13 Mar 2025 09:38:48 -0700 Message-Id: <20250313163903.1738581-3-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> References: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Defining functions allows to use them from common code, by not depending on TARGET_BIG_ENDIAN. Remove previous macros from exec/cpu-all.h. By moving them out of cpu-all.h, we'll be able to break dependency on cpu.h for memory related functions coming in next commits. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/cpu-all.h | 25 --------------- include/exec/tswap.h | 70 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 25 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 8cd6c00cf89..e56c064d46f 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -38,31 +38,6 @@ #define BSWAP_NEEDED #endif -/* Target-endianness CPU memory access functions. These fit into the - * {ld,st}{type}{sign}{size}{endian}_p naming scheme described in bswap.h. - */ -#if TARGET_BIG_ENDIAN -#define lduw_p(p) lduw_be_p(p) -#define ldsw_p(p) ldsw_be_p(p) -#define ldl_p(p) ldl_be_p(p) -#define ldq_p(p) ldq_be_p(p) -#define stw_p(p, v) stw_be_p(p, v) -#define stl_p(p, v) stl_be_p(p, v) -#define stq_p(p, v) stq_be_p(p, v) -#define ldn_p(p, sz) ldn_be_p(p, sz) -#define stn_p(p, sz, v) stn_be_p(p, sz, v) -#else -#define lduw_p(p) lduw_le_p(p) -#define ldsw_p(p) ldsw_le_p(p) -#define ldl_p(p) ldl_le_p(p) -#define ldq_p(p) ldq_le_p(p) -#define stw_p(p, v) stw_le_p(p, v) -#define stl_p(p, v) stl_le_p(p, v) -#define stq_p(p, v) stq_le_p(p, v) -#define ldn_p(p, sz) ldn_le_p(p, sz) -#define stn_p(p, sz, v) stn_le_p(p, sz, v) -#endif - /* MMU memory access macros */ #if !defined(CONFIG_USER_ONLY) diff --git a/include/exec/tswap.h b/include/exec/tswap.h index 2683da0adb7..84060a49994 100644 --- a/include/exec/tswap.h +++ b/include/exec/tswap.h @@ -80,4 +80,74 @@ static inline void tswap64s(uint64_t *s) } } +/* Return ld{word}_{le,be}_p following target endianness. */ +#define LOAD_IMPL(word, args...) \ +do { \ + if (target_words_bigendian()) { \ + return glue(glue(ld, word), _be_p)(args); \ + } else { \ + return glue(glue(ld, word), _le_p)(args); \ + } \ +} while (0) + +static inline int lduw_p(const void *ptr) +{ + LOAD_IMPL(uw, ptr); +} + +static inline int ldsw_p(const void *ptr) +{ + LOAD_IMPL(sw, ptr); +} + +static inline int ldl_p(const void *ptr) +{ + LOAD_IMPL(l, ptr); +} + +static inline uint64_t ldq_p(const void *ptr) +{ + LOAD_IMPL(q, ptr); +} + +static inline uint64_t ldn_p(const void *ptr, int sz) +{ + LOAD_IMPL(n, ptr, sz); +} + +#undef LOAD_IMPL + +/* Call st{word}_{le,be}_p following target endianness. */ +#define STORE_IMPL(word, args...) \ +do { \ + if (target_words_bigendian()) { \ + glue(glue(st, word), _be_p)(args); \ + } else { \ + glue(glue(st, word), _le_p)(args); \ + } \ +} while (0) + + +static inline void stw_p(void *ptr, uint16_t v) +{ + STORE_IMPL(w, ptr, v); +} + +static inline void stl_p(void *ptr, uint32_t v) +{ + STORE_IMPL(l, ptr, v); +} + +static inline void stq_p(void *ptr, uint64_t v) +{ + STORE_IMPL(q, ptr, v); +} + +static inline void stn_p(void *ptr, int sz, uint64_t v) +{ + STORE_IMPL(n, ptr, sz, v); +} + +#undef STORE_IMPL + #endif /* TSWAP_H */ From patchwork Thu Mar 13 16:38:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 14015441 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB7F313BAF1 for ; Thu, 13 Mar 2025 16:39:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883957; cv=none; b=fRfnxrRyKwBln2E4gRgGzQZ90TghrQAAgCAqVCQMwb1LIG5waGKNZZwkEMpYH5pMl1/Qj9fwpM3CfqvBqk0jT8FFXVxCtu6pPfXMpwc88Tcvg+6tBevgxtRQf9hAI9x2/lMAC9My1dWM0xyFeyPNa7zj1UcF7uQXIPW4AvgZdIU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883957; c=relaxed/simple; bh=oqW9tTQslkYwWgYQ4FVxpgiaLvEuigwHwZLhfUQTCic=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YxM0zXNA3x1oC56cAXKE66pGp7RQEWptj4/S+t2rwuYp/EjFcOGXXMHUpT4n/iEHPS52GBf4LdW/i5Ck5xAtRdhZ1hHU2b6pufo5QsoUro034oxDejNk0gvxjE5HKayB3ohGmVBe/UjM1jfpHYMvqEMELK6E7pP5lhGf/u6UUIQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=wubVLqxm; arc=none smtp.client-ip=209.85.216.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="wubVLqxm" Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-2ff784dc055so2103108a91.1 for ; Thu, 13 Mar 2025 09:39:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741883955; x=1742488755; darn=vger.kernel.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=fcP4MFj0H7Fu3AxOxTbJlPG2KgbdJwiBtz5sSPdKZDU=; b=wubVLqxmw+Ii6tdF0/hGLSOO2Wkz51VOuRLY0K8t6Nb5lc3vJINaKLKbegVMokXG7/ 4h+Zc53kQUslKv/jUGxxsEem93+pVbhDNg42aSrv+NA7z92SspUlX8qsB/5f2g3aPVr0 GWndOdEmr90pPMfGZcvNRXBWESJo/9l/jv/212/HI2qeUH58hctz2Ehanmrvawf32/3e GgcD0WenAwqBS6kMSbTZeJajUFFJnqY8rrPzKz7KZWG+ACsTczPLdmQrKk43InAr/u0+ aHElB/ch2BSaUA7DSCaPkV1J78JmV1RGNRPVZ12rxFWbyojTm9fYQ1aHNkzZYMXoghO4 XTyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741883955; x=1742488755; 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=fcP4MFj0H7Fu3AxOxTbJlPG2KgbdJwiBtz5sSPdKZDU=; b=Q4/CBDHEJosZBSUWcPASqbZ4/f9CBt0rHsggG/fH+D1+TZOjf4J76fXRB+SkF8Q0Tl WbTawbsiquak5B/CYjzvi3CSD0W0wLW9wvRZqMnaFBWEnOYZEe1whFeBvGTSzbGRGxKL nSiDWZDhxGoYx+eb0RUv/ZZrrzbpAzi4nvXUULU+H0y9d8vstESXbasSExAZhsqQ8c5Y vgoMoUX/4/H07jjWBTWWtyEuNKdmEt8LzaLSjylyrM5UEeqFTRhteDilUrP455WPGCRz rPMBIFkjf4E+hhKPa8H2dCnN2Xwsiy0JK66KqZZF3y00czQ1ydM68pypVPhXdxYCIqAL vIXg== X-Forwarded-Encrypted: i=1; AJvYcCV3hp/iIEsgDVpi6vJWrYtAjVi/j7OBlEv5HOgfVsibp+GB405d8l+JjAfMV3M22Um/4RA=@vger.kernel.org X-Gm-Message-State: AOJu0YxHV0rldISTdCYJ/OfwYjX7pGS5v2dbx8hReusaU9zIBjmNyvJC 3bwsiawC9FInAcapdAqx7xSK8yJAFiflYLI7auN0O2TCk9/Z2OXLafnAcZSV3fbhhX0NEy6AJ1z wXT8= X-Gm-Gg: ASbGncu59GTvf5VP8SpD9tmSXtxh6B6TfoFclpflVgdZH4rfDAjw6kTxVkixOlgOIMF kWg9Y7vcrxS/+BIhCKfkzNusGOWz8XWvEufKH0Ray6QEtYKtPSRo1Ww5YiQV4hx/whE+Lu3NzXI 5QYNCC5W0SXIWdhSdOklczulwtCYSQi2Np3jJVBYeEV0h3n0EjKVMHteXPmpD0GH8F8XoO1WYCI dz7vaxi+GPnFQ5BXl12i+QqAJubax0A84VYQdarWZ+VgD7MRrcDTDbN6VPKv/B7arQqO2Ozh27F PRkLDrrpojl2guO2Rl+JAcuG3iGgC6jrM4ucshnUSTHn X-Google-Smtp-Source: AGHT+IHnwSLAPNKXU3gMx+5tsTTteDKv4SHyK4UxOMNd4PXKbxpy7VaCfSFX9w53V0ZmsOD5PjeQ6g== X-Received: by 2002:a17:90b:2f4c:b0:2f9:bcd8:da33 with SMTP id 98e67ed59e1d1-300ff10d6d1mr14553930a91.21.1741883954948; Thu, 13 Mar 2025 09:39:14 -0700 (PDT) Received: from pc.. ([38.39.164.180]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-30119265938sm4020084a91.39.2025.03.13.09.39.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 09:39:14 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Paul Durrant , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Liu Zhiwei , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Peter Xu , alex.bennee@linaro.org, manos.pitsidianakis@linaro.org, Stefano Stabellini , Paolo Bonzini , qemu-ppc@nongnu.org, Richard Henderson , kvm@vger.kernel.org, David Hildenbrand , Palmer Dabbelt , Weiwei Li , qemu-riscv@nongnu.org, Alistair Francis , Anthony PERARD , Yoshinori Sato , Daniel Henrique Barboza , Nicholas Piggin , Pierrick Bouvier Subject: [PATCH v4 03/17] exec/memory_ldst: extract memory_ldst declarations from cpu-all.h Date: Thu, 13 Mar 2025 09:38:49 -0700 Message-Id: <20250313163903.1738581-4-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> References: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 They are now accessible through exec/memory.h instead, and we make sure all variants are available for common or target dependent code. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/cpu-all.h | 12 ------------ include/exec/memory_ldst.h.inc | 4 ---- 2 files changed, 16 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index e56c064d46f..0e8205818a4 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -44,18 +44,6 @@ #include "exec/hwaddr.h" -#define SUFFIX -#define ARG1 as -#define ARG1_DECL AddressSpace *as -#define TARGET_ENDIANNESS -#include "exec/memory_ldst.h.inc" - -#define SUFFIX _cached_slow -#define ARG1 cache -#define ARG1_DECL MemoryRegionCache *cache -#define TARGET_ENDIANNESS -#include "exec/memory_ldst.h.inc" - static inline void stl_phys_notdirty(AddressSpace *as, hwaddr addr, uint32_t val) { address_space_stl_notdirty(as, addr, val, diff --git a/include/exec/memory_ldst.h.inc b/include/exec/memory_ldst.h.inc index 92ad74e9560..7270235c600 100644 --- a/include/exec/memory_ldst.h.inc +++ b/include/exec/memory_ldst.h.inc @@ -19,7 +19,6 @@ * License along with this library; if not, see . */ -#ifdef TARGET_ENDIANNESS uint16_t glue(address_space_lduw, SUFFIX)(ARG1_DECL, hwaddr addr, MemTxAttrs attrs, MemTxResult *result); uint32_t glue(address_space_ldl, SUFFIX)(ARG1_DECL, @@ -34,7 +33,6 @@ void glue(address_space_stl, SUFFIX)(ARG1_DECL, hwaddr addr, uint32_t val, MemTxAttrs attrs, MemTxResult *result); void glue(address_space_stq, SUFFIX)(ARG1_DECL, hwaddr addr, uint64_t val, MemTxAttrs attrs, MemTxResult *result); -#else uint8_t glue(address_space_ldub, SUFFIX)(ARG1_DECL, hwaddr addr, MemTxAttrs attrs, MemTxResult *result); uint16_t glue(address_space_lduw_le, SUFFIX)(ARG1_DECL, @@ -63,9 +61,7 @@ void glue(address_space_stq_le, SUFFIX)(ARG1_DECL, hwaddr addr, uint64_t val, MemTxAttrs attrs, MemTxResult *result); void glue(address_space_stq_be, SUFFIX)(ARG1_DECL, hwaddr addr, uint64_t val, MemTxAttrs attrs, MemTxResult *result); -#endif #undef ARG1_DECL #undef ARG1 #undef SUFFIX -#undef TARGET_ENDIANNESS From patchwork Thu Mar 13 16:38:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 14015443 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE3C2269AF4 for ; Thu, 13 Mar 2025 16:39:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883960; cv=none; b=RJSOATOM1YLTvr62Fz2Gk86AzHcjHMRyEAu1VnMjbCVW6W0PjQbVmQtD7dgxF5E52bkczhFoufbrx+1Lw3NvzFaPQUFt+NegAdMWwaTZTM+D7W5mMcnl9qPqm5iWOiMYZLHSZQCi3LC9gGXEkeME673fbo22//tyUCch0Os61LI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883960; c=relaxed/simple; bh=tsr8Vu0yCbhmYRJ+c2Olh9gVNG1abA5bAWFfRS2LzZg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QQxZfH3sNV/sY5fM7LUtwSb7r7OfgxG1h2P4H7AVy0L7ik8oGCAWT64kKlhzEc1wYwXWWEIaTFJOSWd75wVDvJdqMdpPve1iZP/LT1o7OpxbacBWa4n1Vv2z5x99ajDdFgaiIU8CTXy/iF7z7Y1y7cMKJm2AX27UUiaQkMxr1Ws= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=U2weaT4o; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="U2weaT4o" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-225a28a511eso22552205ad.1 for ; Thu, 13 Mar 2025 09:39:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741883956; x=1742488756; darn=vger.kernel.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=G6OuFeXnonCJBRRaCKlE2hD3nLeAbwsquVgoLJADjfc=; b=U2weaT4o4iDFLUN9w3sJRfwWf9mtSgOCa7OGr4cna3WcXv9dVaVcJ9k8pU0MeH7Spx WXC6nekq373y/pPRT/7a49RD8CRCgKlB0DBy289Lt2shvU0CgCnu5+PB5tFcfqv5blRr D977u6D0PJoh3CrjVgVbV0WqySco6Jnb5vXzrxb4wh3L1lUX3DlaFyf93JxOZrbpGle8 mLLRIVbgJw0Rk5nWS4boqy65rSU8pbYyluhM6Cb8f7W1XeJBehKNe4rsEOfJlSuj79jg ebY4Kn6Fz9rFN6bGUVbd2DxBw5RGDPa6lcNfksqPwvx0T/8Wz+xCFBthSF+ioLYeIaMS 0aZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741883956; x=1742488756; 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=G6OuFeXnonCJBRRaCKlE2hD3nLeAbwsquVgoLJADjfc=; b=P7bAN88FHA7eS0LRnIJcklHrQYRMmfl+M8p+e0gTfQsSDPrpIqKxLmJh35Z85SId0Z re3HYiCe2j5Fp4pbC5utupjWwSLjtk18mhNCWMuLlBbAiVJuhTPaaidYlL62A0TOsEJ8 d5QVgTPDZc2CxterKEYNWPQPswOJ1GbSSSbredea0pRiJKOsSP5FoxyRJ7mubfgkgOw/ hOvD+WhEN5QgnbccNGsPW0fM/zfwfU/NBJgl0PxKaU0cKXfC4USOKv4ZdBtLE8/nCGFa 1D9vfWTxA8o80RD1CYKRGBvHI0XSepjDtWvfl413eqGLe5HVnBlBTJXIg1kEL+MpuHUs +gNQ== X-Forwarded-Encrypted: i=1; AJvYcCX6bbAoytpWoQHa+28LKy5+DbENhj8+kxzFwUC8GLt7nKmLENKsH/sLByYg9rDwUNR0m/s=@vger.kernel.org X-Gm-Message-State: AOJu0Yy8ajM5ZrHwNtyHVvYReD9IBfHLGZ/JCxihM2mlAW/lxa6HxGMg g9mhN12p/ObC3mD4E5ydMo4p/U0lyVCbf0gRpdIwQxVnDoVGeFOp4TnSmXmgvqY= X-Gm-Gg: ASbGncsrdSnPJVfwTnnsSD5U+InklXhPvX6IDJTt1JQngusYas34+7zaAni37HGLmIB jl1LkVbmK5nxUKKeTG/I7CVneVMfM0mGeWmJEW7emBYYa9hjyJn0QnMTMd8pbHw9oquXCPhGyUm N1SaqGEh/24CpS50BZ+C3YbR+czwVI9x6zVaqRxup0DgnISVGHaeK4uBETwd+NSSDMYBDfdXV00 p/x1onHthJPq+22rd13f2smEPvN7+10j64td58b9QJ1F+LgW3+nGeQYKs583ohq4vKgbFowzxE8 IurJmboCRT/JjmX1k96rk1x++tnzebf14IKXdbgriWq6 X-Google-Smtp-Source: AGHT+IFAP0qoR6ylfmeu0A0f1WgQyrtvhvjwp1bL3Fn8cTt6DHZC87LNZvbpID5iZRw0pqfiPur+Vg== X-Received: by 2002:a17:90b:5688:b0:2ee:e113:815d with SMTP id 98e67ed59e1d1-3014e842f8emr264471a91.8.1741883956066; Thu, 13 Mar 2025 09:39:16 -0700 (PDT) Received: from pc.. ([38.39.164.180]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-30119265938sm4020084a91.39.2025.03.13.09.39.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 09:39:15 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Paul Durrant , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Liu Zhiwei , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Peter Xu , alex.bennee@linaro.org, manos.pitsidianakis@linaro.org, Stefano Stabellini , Paolo Bonzini , qemu-ppc@nongnu.org, Richard Henderson , kvm@vger.kernel.org, David Hildenbrand , Palmer Dabbelt , Weiwei Li , qemu-riscv@nongnu.org, Alistair Francis , Anthony PERARD , Yoshinori Sato , Daniel Henrique Barboza , Nicholas Piggin , Pierrick Bouvier Subject: [PATCH v4 04/17] exec/memory_ldst_phys: extract memory_ldst_phys declarations from cpu-all.h Date: Thu, 13 Mar 2025 09:38:50 -0700 Message-Id: <20250313163903.1738581-5-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> References: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 They are now accessible through exec/memory.h instead, and we make sure all variants are available for common or target dependent code. Move stl_phys_notdirty function as well. Cached endianness agnostic version rely on st/ld*_p, which is available through tswap.h. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/cpu-all.h | 29 ----------------------------- include/exec/memory.h | 10 ++++++++++ include/exec/memory_ldst_phys.h.inc | 5 +---- 3 files changed, 11 insertions(+), 33 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 0e8205818a4..902ca1f3c7b 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -38,35 +38,6 @@ #define BSWAP_NEEDED #endif -/* MMU memory access macros */ - -#if !defined(CONFIG_USER_ONLY) - -#include "exec/hwaddr.h" - -static inline void stl_phys_notdirty(AddressSpace *as, hwaddr addr, uint32_t val) -{ - address_space_stl_notdirty(as, addr, val, - MEMTXATTRS_UNSPECIFIED, NULL); -} - -#define SUFFIX -#define ARG1 as -#define ARG1_DECL AddressSpace *as -#define TARGET_ENDIANNESS -#include "exec/memory_ldst_phys.h.inc" - -/* Inline fast path for direct RAM access. */ -#define ENDIANNESS -#include "exec/memory_ldst_cached.h.inc" - -#define SUFFIX _cached -#define ARG1 cache -#define ARG1_DECL MemoryRegionCache *cache -#define TARGET_ENDIANNESS -#include "exec/memory_ldst_phys.h.inc" -#endif - /* page related stuff */ #include "exec/cpu-defs.h" #include "exec/target_page.h" diff --git a/include/exec/memory.h b/include/exec/memory.h index d09af58c971..da21e9150b5 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -21,6 +21,7 @@ #include "exec/memattrs.h" #include "exec/memop.h" #include "exec/ramlist.h" +#include "exec/tswap.h" #include "qemu/bswap.h" #include "qemu/queue.h" #include "qemu/int128.h" @@ -2732,6 +2733,12 @@ MemTxResult address_space_write_rom(AddressSpace *as, hwaddr addr, #define ARG1_DECL AddressSpace *as #include "exec/memory_ldst.h.inc" +static inline void stl_phys_notdirty(AddressSpace *as, hwaddr addr, uint32_t val) +{ + address_space_stl_notdirty(as, addr, val, + MEMTXATTRS_UNSPECIFIED, NULL); +} + #define SUFFIX #define ARG1 as #define ARG1_DECL AddressSpace *as @@ -2798,6 +2805,9 @@ static inline void address_space_stb_cached(MemoryRegionCache *cache, } } +#define ENDIANNESS +#include "exec/memory_ldst_cached.h.inc" + #define ENDIANNESS _le #include "exec/memory_ldst_cached.h.inc" diff --git a/include/exec/memory_ldst_phys.h.inc b/include/exec/memory_ldst_phys.h.inc index ecd678610d1..db67de75251 100644 --- a/include/exec/memory_ldst_phys.h.inc +++ b/include/exec/memory_ldst_phys.h.inc @@ -19,7 +19,6 @@ * License along with this library; if not, see . */ -#ifdef TARGET_ENDIANNESS static inline uint16_t glue(lduw_phys, SUFFIX)(ARG1_DECL, hwaddr addr) { return glue(address_space_lduw, SUFFIX)(ARG1, addr, @@ -55,7 +54,7 @@ static inline void glue(stq_phys, SUFFIX)(ARG1_DECL, hwaddr addr, uint64_t val) glue(address_space_stq, SUFFIX)(ARG1, addr, val, MEMTXATTRS_UNSPECIFIED, NULL); } -#else + static inline uint8_t glue(ldub_phys, SUFFIX)(ARG1_DECL, hwaddr addr) { return glue(address_space_ldub, SUFFIX)(ARG1, addr, @@ -139,9 +138,7 @@ static inline void glue(stq_be_phys, SUFFIX)(ARG1_DECL, hwaddr addr, uint64_t va glue(address_space_stq_be, SUFFIX)(ARG1, addr, val, MEMTXATTRS_UNSPECIFIED, NULL); } -#endif #undef ARG1_DECL #undef ARG1 #undef SUFFIX -#undef TARGET_ENDIANNESS From patchwork Thu Mar 13 16:38:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 14015442 Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 01C16269D17 for ; Thu, 13 Mar 2025 16:39:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883959; cv=none; b=Z/2eZIkeLYE19VYc6vpkrPQM7C66eZBSDWNAVfqOHf35XGnOc3yPM4xHadf6bEokIQ0EAvU0/lu55zNhMcDcaXnSOf4e7F8nQQqbVXBKPskd/zcRPK6tuE4Rx52/FfVpusrJlxxINoF96mYAQHT7olKZ5wg6x6L0Rv80BjRe/ss= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883959; c=relaxed/simple; bh=o5ngxEogoPE4wzfGJK+6GJ+kqB2vK52Q1QHqnpgsaHQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rcj1iL8+nQuso1KR6XZvgvixaD1N/oTq3pZL6xoCP386tYY/iQUCVH85jJF7ZyIllZZ2l9pXpHtc78OOwX78uy/c1XsF0qSOeiLSCpSDeT6Pfp0yZ328xkjVcyKPw5kKvPPBQAJLxJ6kxoToCK1XetSv6tjpfsrhoAMxk36GtYo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=nAmadn+a; arc=none smtp.client-ip=209.85.216.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="nAmadn+a" Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-2fee05829edso2501469a91.3 for ; Thu, 13 Mar 2025 09:39:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741883957; x=1742488757; darn=vger.kernel.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=wT5ohu0Ui7xrH+jgYqMJMpKemGPcZNvy7jzdyuAyzEs=; b=nAmadn+ah1BeUmVKHRFLruTDQoYrU3gBBC7V1w2LWP8wcBv20LLoi1khnTyr62f7Ga 4h4YOwuR/wq64qrQJbWtmOeFkhAPP4I80QePj26Y/t0qr7wDyZhfBtsQEPQzMvgOB5Op X7nItLOqoShoKNvp9MQ0zZSWsVSEqcGKid8dWSVeHugUwIEEBmp9sgfFA/+MgvaRnmAx 87guR4JbXeeGErmxGXPG8xv81kJpSS1J4IzkqvreHR94MiRcby4BFKsjyGWiRPWADG79 T9nJIBDFR4AAxJ1qktsWFj6YBwlkghEsk15/g1DHK83ZwJMZ1lD5OYE+qTAeVvN96YNu GMCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741883957; x=1742488757; 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=wT5ohu0Ui7xrH+jgYqMJMpKemGPcZNvy7jzdyuAyzEs=; b=VPiBaArcca1yFEUHfq/JMapysFbMpQjby6ZJ4ejjfFU4i4lFT4v8Pq32A7Jp4fTsWB 9sJ1OM1oINQzYqO1vaOD0EhKdBNtCoYX+WIVfNTYr7k5kGmc1VOU3xvLvKH+zlz7CGcy OY8KKTasUINqGwfKsg/7WXnJfmMNcl/uUgMxnpb9HaO+w6dxEEmAgUtCnRR73PchIzoI qcFNRwsrBBL9InaLYsPw3HaJciOi59QjTNc5m5w4FPaW1AA820972kGLsoCngKGJnEDb AdBnmnL/uW0DfsUrDjQCfw16hDwGn8k2hrlq8pF6PrpIiIX+6o0K+oXf9/cmqyuC3/0s Vo+w== X-Forwarded-Encrypted: i=1; AJvYcCXwO4ZcBwc/lhcxQqADo8BO81GWCnArXgF9v/K6RtLZDZLtMcE5iyl6fq7vgytlJbR1o3k=@vger.kernel.org X-Gm-Message-State: AOJu0Yzlxzsk39Zo4R+poYYTtty59om99f4EKGcKZPyx35Pn3fDqSgnO tvXWDNBTUOAE7PdqPqubd4kxyo6cAAdAGTYaBY7ohPJ7OzWpokY2bTW4SYwk3sM= X-Gm-Gg: ASbGnctyjINLEcapyPRABMPDTshHeTdAAAnnTftCn61DhkCd+VIgp9SNLfu7iMtSk4O yWL1hxXk4KnC/X7N1IjmSjhSianp9qKC/vTc67GDGJN2WRD1ODJn+6F+NWdEFcDQ/DGKNxB5OHB rO7Peht+fq+BBAlrvh3SlEsAW5ytZsLedW1AYUYm3EKV63qAmDp8a/vCWvv9uK03Wa/joe77kXO j3ohkjsy0qiQ8Nwl3TbxU8o/YzJzAmEA2ZHu94q7IN5J0T05UBILfa3cjGlOje2tTlOt1kpIZVt Vbq09Z+92GaWCAveC9HAuk5yqDWXyzsga9pZpQObp3jO X-Google-Smtp-Source: AGHT+IGT0TQa6IzxQKmV0c+iT9Ap/Go2mov47rFQ/lft0hbXJmOXflaiO0g7vmiNGPWVgJAiRn5xgQ== X-Received: by 2002:a17:90b:2710:b0:2ff:6fc3:79c3 with SMTP id 98e67ed59e1d1-3014e8435admr275040a91.9.1741883957269; Thu, 13 Mar 2025 09:39:17 -0700 (PDT) Received: from pc.. ([38.39.164.180]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-30119265938sm4020084a91.39.2025.03.13.09.39.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 09:39:16 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Paul Durrant , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Liu Zhiwei , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Peter Xu , alex.bennee@linaro.org, manos.pitsidianakis@linaro.org, Stefano Stabellini , Paolo Bonzini , qemu-ppc@nongnu.org, Richard Henderson , kvm@vger.kernel.org, David Hildenbrand , Palmer Dabbelt , Weiwei Li , qemu-riscv@nongnu.org, Alistair Francis , Anthony PERARD , Yoshinori Sato , Daniel Henrique Barboza , Nicholas Piggin , Pierrick Bouvier Subject: [PATCH v4 05/17] exec/memory.h: make devend_memop "target defines" agnostic Date: Thu, 13 Mar 2025 09:38:51 -0700 Message-Id: <20250313163903.1738581-6-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> References: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Will allow to make system/memory.c common later. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/memory.h | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index da21e9150b5..069021ac3ff 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -3138,25 +3138,17 @@ address_space_write_cached(MemoryRegionCache *cache, hwaddr addr, MemTxResult address_space_set(AddressSpace *as, hwaddr addr, uint8_t c, hwaddr len, MemTxAttrs attrs); -#ifdef COMPILING_PER_TARGET /* enum device_endian to MemOp. */ static inline MemOp devend_memop(enum device_endian end) { QEMU_BUILD_BUG_ON(DEVICE_HOST_ENDIAN != DEVICE_LITTLE_ENDIAN && DEVICE_HOST_ENDIAN != DEVICE_BIG_ENDIAN); -#if HOST_BIG_ENDIAN != TARGET_BIG_ENDIAN - /* Swap if non-host endianness or native (target) endianness */ - return (end == DEVICE_HOST_ENDIAN) ? 0 : MO_BSWAP; -#else - const int non_host_endianness = - DEVICE_LITTLE_ENDIAN ^ DEVICE_BIG_ENDIAN ^ DEVICE_HOST_ENDIAN; - - /* In this case, native (target) endianness needs no swap. */ - return (end == non_host_endianness) ? MO_BSWAP : 0; -#endif + bool big_endian = (end == DEVICE_NATIVE_ENDIAN + ? target_words_bigendian() + : end == DEVICE_BIG_ENDIAN); + return big_endian ? MO_BE : MO_LE; } -#endif /* COMPILING_PER_TARGET */ /* * Inhibit technologies that require discarding of pages in RAM blocks, e.g., From patchwork Thu Mar 13 16:38:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 14015444 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1E7ED26A095 for ; Thu, 13 Mar 2025 16:39:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883961; cv=none; b=AQ7rDLlYSmEj809aAMSeZmUE1Es7mb7X8cs/AEzXl0obIseSFNUxw0SSRJTqTvlsiSS54ECrwm22Xsp4iCHwoHOQvbqjE4b4lumTLhNPPMMrSrjToy6YUoIytNW+hsUKK4GVW+fuGaSFhQQEgVpwXDhbe87CeQRJH+c1Z5Bon1U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883961; c=relaxed/simple; bh=7ZCuTPyFqkaspTwPhH/SEirOAPA6rDicmFwNtDxEP7g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XR1dm/QFye7RcVuny1koGF6bU4NJSGE8QU+NbMEC1w0NbMYM0QIreIoDnbWM2Qal9G/FB33nR1/oYzMD6RtHEKdeb6DEZMKJjKvylUfHU7u6P+tKoiy0CSuE9Ppts9Io4yien7dNDmaKQ2ckQ6lola7SAl8xgX8HeEWedw0GRzk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=iUNwF2ke; arc=none smtp.client-ip=209.85.216.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="iUNwF2ke" Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-2ff6ae7667dso2578454a91.0 for ; Thu, 13 Mar 2025 09:39:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741883958; x=1742488758; darn=vger.kernel.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=mZcjdDtX1Z7JVvsuWgguTldfqVr7ZBWkV3i9i17ooa8=; b=iUNwF2keHls6VK1fRn2dZyYKkGiKeSJQvO45MzMdjV2wEVapGOmZ4qcb7Pb0PIEQgV RHHpAW2hJHIkGfrlM3XsvL/uAMCDEEmV/gEG6g7ZsoyXxqJKWjt/U+B+XxfoG2vmJNQa V7/5JbZFHZ0ZrFCqTxhoC2yZvWgUc2TwIZUjHd5Ey7iR3GPRBKCI4YWdrF6E4hLsbUaH J+KO1UaDaJj/b2efzDAQ3rSKjVDk3deqQwD9TUrNv8QlOqSMndSuPMZ2uR12XuvG4dHk 3LCexNX1FMSajaWJ8eI8wL8dZOINk/WyPiAfjlHY+o9/bnxMJvDcgkTIJyU84fhb+hWp usFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741883958; x=1742488758; 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=mZcjdDtX1Z7JVvsuWgguTldfqVr7ZBWkV3i9i17ooa8=; b=EWo+VExrWPS7VwVvPdDeIxiGFyr7HXTo1WZ+wpEBjKIbFiag4HGgKGVNT8dpVU3dUT I8OBGie5gM75gzSLJgxJBzWJ9tDgrE9PijF9bxWwU9z1EgJBQGBFU96vI891dwVCAprx 00Hv7P1uqn7tmwVl5F6UYDFU0CaModvy44rkGQJDTprvqiwtyxRZsbyZaWPGfQvEjcIw lnxm8WDizKmVqcqnQqGkEfLKqB323eN7cnd6+KGb8nV21YR+cEnueo912k2YLrUJoWvV wrgcrxb238/qnkNkEeSAHEgYZ/hrkNVfGFNUad0ClI3OsNS0yuBU7MN5nc7xzOetqK5G F9UQ== X-Forwarded-Encrypted: i=1; AJvYcCUQSYYqKn55Ww/V6tgmR66z4xEeN/6scaB45DiK80x1FtdpgW3HfWJmbGN7l6kqMzUs+2A=@vger.kernel.org X-Gm-Message-State: AOJu0Yw+izlsadojVerw9ajKeEGFTNLtnzVYSlhdS5TpDkOFdcaR1CQW 0290AwEvfrofQhYYqFPkFtTr4jBupyrfIVxVBCSaGn4WHkcZeNwV8zFKRbqXTLk= X-Gm-Gg: ASbGncsbKBFR04oXrjEct+ZUUIUNcE4Jy8yCee0B5qduXwlKDdTbIQ/1or/Llru7sLx kauNOhCPnuKv7BTu9LZDZTrpeWXPXEDMFDpSaIDwOsvubFLb3U6NWSpJ0L+19yRTSdBNFdXoqcz JjzK5R+76U9shstsmEpLxIABSpPZfLB95ZXamtYsuyyIrG+cWr1IJ7HjfRPF25c7YiyjdwQYQxe CYtWiq38+zouSItSnwb7yoz8fOjM4IF3rYj1RtAx6isYuA6vDJ/Eq4NlKzXpxErix1I9o8Co5yV fHHYXyrP8cEffgT78zQsBl0UMXRGpEaviElBw0Mi22Jl X-Google-Smtp-Source: AGHT+IG4zIqLxuyjovKp9g3TAXrCpctV1RL6f3536TGUBfN83HoHfbIXNZa1EoQ+qlG58AlBh7g+Ww== X-Received: by 2002:a17:90b:5403:b0:2ee:fa0c:cebc with SMTP id 98e67ed59e1d1-3014e861c18mr244498a91.20.1741883958391; Thu, 13 Mar 2025 09:39:18 -0700 (PDT) Received: from pc.. ([38.39.164.180]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-30119265938sm4020084a91.39.2025.03.13.09.39.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 09:39:18 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Paul Durrant , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Liu Zhiwei , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Peter Xu , alex.bennee@linaro.org, manos.pitsidianakis@linaro.org, Stefano Stabellini , Paolo Bonzini , qemu-ppc@nongnu.org, Richard Henderson , kvm@vger.kernel.org, David Hildenbrand , Palmer Dabbelt , Weiwei Li , qemu-riscv@nongnu.org, Alistair Francis , Anthony PERARD , Yoshinori Sato , Daniel Henrique Barboza , Nicholas Piggin , Pierrick Bouvier Subject: [PATCH v4 06/17] codebase: prepare to remove cpu.h from exec/exec-all.h Date: Thu, 13 Mar 2025 09:38:52 -0700 Message-Id: <20250313163903.1738581-7-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> References: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/tcg/tcg-op.h | 1 + target/ppc/helper_regs.h | 2 ++ hw/ppc/spapr_nested.c | 1 + hw/sh4/sh7750.c | 1 + page-vary-target.c | 2 +- target/ppc/tcg-excp_helper.c | 1 + target/riscv/bitmanip_helper.c | 2 +- 7 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/tcg/tcg-op.h b/include/tcg/tcg-op.h index a02850583bd..bc46b5570c4 100644 --- a/include/tcg/tcg-op.h +++ b/include/tcg/tcg-op.h @@ -9,6 +9,7 @@ #define TCG_TCG_OP_H #include "tcg/tcg-op-common.h" +#include "exec/target_long.h" #ifndef TARGET_LONG_BITS #error must include QEMU headers diff --git a/target/ppc/helper_regs.h b/target/ppc/helper_regs.h index 8196c1346dc..b928c2c452d 100644 --- a/target/ppc/helper_regs.h +++ b/target/ppc/helper_regs.h @@ -20,6 +20,8 @@ #ifndef HELPER_REGS_H #define HELPER_REGS_H +#include "target/ppc/cpu.h" + void hreg_swap_gpr_tgpr(CPUPPCState *env); void hreg_compute_hflags(CPUPPCState *env); void hreg_update_pmu_hflags(CPUPPCState *env); diff --git a/hw/ppc/spapr_nested.c b/hw/ppc/spapr_nested.c index 201f6292033..a79e398c132 100644 --- a/hw/ppc/spapr_nested.c +++ b/hw/ppc/spapr_nested.c @@ -2,6 +2,7 @@ #include "qemu/cutils.h" #include "exec/exec-all.h" #include "exec/cputlb.h" +#include "exec/target_long.h" #include "helper_regs.h" #include "hw/ppc/ppc.h" #include "hw/ppc/spapr.h" diff --git a/hw/sh4/sh7750.c b/hw/sh4/sh7750.c index 6faf0e3ca8b..41306fb6008 100644 --- a/hw/sh4/sh7750.c +++ b/hw/sh4/sh7750.c @@ -29,6 +29,7 @@ #include "hw/irq.h" #include "hw/sh4/sh.h" #include "system/system.h" +#include "target/sh4/cpu.h" #include "hw/qdev-properties.h" #include "hw/qdev-properties-system.h" #include "sh7750_regs.h" diff --git a/page-vary-target.c b/page-vary-target.c index 3f81144cda8..84ddeb7c26a 100644 --- a/page-vary-target.c +++ b/page-vary-target.c @@ -21,7 +21,7 @@ #include "qemu/osdep.h" #include "exec/page-vary.h" -#include "exec/exec-all.h" +#include "exec/target_page.h" bool set_preferred_target_page_bits(int bits) { diff --git a/target/ppc/tcg-excp_helper.c b/target/ppc/tcg-excp_helper.c index 5a189dc3d70..c422648cfdd 100644 --- a/target/ppc/tcg-excp_helper.c +++ b/target/ppc/tcg-excp_helper.c @@ -19,6 +19,7 @@ #include "qemu/osdep.h" #include "qemu/main-loop.h" #include "qemu/log.h" +#include "target/ppc/cpu.h" #include "exec/cpu_ldst.h" #include "exec/exec-all.h" #include "exec/helper-proto.h" diff --git a/target/riscv/bitmanip_helper.c b/target/riscv/bitmanip_helper.c index b99c4a39a1f..e9c8d7f7780 100644 --- a/target/riscv/bitmanip_helper.c +++ b/target/riscv/bitmanip_helper.c @@ -20,7 +20,7 @@ #include "qemu/osdep.h" #include "qemu/host-utils.h" -#include "exec/exec-all.h" +#include "exec/target_long.h" #include "exec/helper-proto.h" #include "tcg/tcg.h" From patchwork Thu Mar 13 16:38:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 14015445 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 417C026A09A for ; Thu, 13 Mar 2025 16:39:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883961; cv=none; b=ZiCqwvyKb1NzvHfkKfocDr6H2SrasleAB/meaYrPo/uw8ntnKEqX13Ks8eV7azeouuj+EvYPfbrNWkrascrBomLWMFR1RmTpQEJe9G50v2VE9Hq2d8OEQ7RG8pmNBz/KmBNbRbrChxedq3Lf6Xqz0MbhRZfymCCo61G/itGpWUQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883961; c=relaxed/simple; bh=aHcHDSCEQG/Lxg84jg/rjAhvQowTiiMszTRoQh+zwoY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=IhD6zxPqs6TsPnySu0S1BxKJxWA/iwCN7XAGdGJISm10jGF3itROD9JFYvwq6QRHtgl/MpFjf8cbnlYn6CZJeCOzV81pvZSP8/C5C/N7vn8EIHs9XmpTLxHwQplFua2Vt5LHAWVPLEotBJqjRcjw4pOcUdhwg/LPZL4o8hK9i9M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=YEZz/p73; arc=none smtp.client-ip=209.85.216.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="YEZz/p73" Received: by mail-pj1-f43.google.com with SMTP id 98e67ed59e1d1-2ff799d99dcso2532069a91.1 for ; Thu, 13 Mar 2025 09:39:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741883959; x=1742488759; darn=vger.kernel.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=bYYGOsy+zcSjxVOnigwMonGaAhWbZB7W76ZyOX5Jlgc=; b=YEZz/p7337XaTbioiRqmlI2C29iWfqRqL6T4TbiZSHy9bJ9XLmWryjuk2F4OYY+nyQ e+LDQZtqPzdCqzydzGbeW25Vot3m1vxe62p4uZys6GcILnhG6MlH7VyKvQ8YJtWM/mhu EBJ5hT1FMH09FIXCk+hkU1aA/avQT2vs+ljtHgf0iuGIw8hMORo+VvzbG3C4Qa6QE84X iJwDHjwW0i7v3tuThkDvv+we+G/y7DfKX4LK9soIvxKHxvAt8aa/kticfexHoPz9RdXk 9e2ea1i7Jnzll5GTNgTI9dHtchdfhmNDWF/Tx/YUZP5g6zQHljU52abNG5FBaaQEEH6J Vvvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741883959; x=1742488759; 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=bYYGOsy+zcSjxVOnigwMonGaAhWbZB7W76ZyOX5Jlgc=; b=dgqN7jv2SZObsX3hvaODKyBLUk0C/KSmo+C4DpgE6tMTnjQ4QcEahVlMSxLwgdQ8cz pFieeioFLBGHMgJJ0CxTHKIoqz8Xk+BR3xRHM2UcqPaaJyIw4d3JEciWP/ham0C/TsDS GgkWHzy23ErTRhjkA3WdGp+S1IPiN+H89b4m8JgOXq/JPCNzoMH5DtzlzDy65UusPrpZ VmrbTuWqzqocVWS/sEN3xlyl6sFIpPgxjO8pMGiCOww+2aQ1bhwYBTmosP6QrsgulFNu q2g7C91BdWAAaK/mpSnbU3AcKWcB6cNgrqvwxD/g2xHD8o2fFNe4rUZ9AcVG1CfiV5sd VESQ== X-Forwarded-Encrypted: i=1; AJvYcCWIHoKOFN1ttbZu9YReOvIdcJOxXIjGG7mzd2/1MO4AfFc+zbfAfomL+tcwIHzUqOHHd8U=@vger.kernel.org X-Gm-Message-State: AOJu0YyPAseJ0u/lU3RasbBSybcZTYDpjt+79YYz01FVqkE+vXZnw5F8 bYg3lMqtAV2cakux7+KWRKoCjTnLfxsf6B3A1Mmyf5GDNbXI1vogWDht6/26s9c= X-Gm-Gg: ASbGncv5qe4p9A2XEj0bV40DKTYEnZWnkWpk+wYHrg1qrwo0oJxPUstEbaXn8WnBGZq 8EA53UquxnzJ9nvwOsqDrVHKBpZtv+A7hBZDuCps9DEXKtJBkQ90AW/YGPQxGewK2YmofLnnn4+ ITQndgXERMagVc7QxxGfccEACScaodt8/Jdu3BsaRN8lX+TD9a8hP30zDlQnIVNozy9LUamSqoU Yh0I8LvpfW+TbkBG80qd0OXhN+KHpP0Hxz5I5WfyJKPCYohptOlKxDQ3jQezidWMZAtoprtuY03 Mp3lx5f3ysVjFw988ekFmMRcLzXNh1r3Qd7h+kkiJB12 X-Google-Smtp-Source: AGHT+IGIP+en0Aj0eYAe+7XhNeZ6W7zp31secPtMQkoPMAwiLZjQzktFWA/FDeyZICzvqUiJA1imgg== X-Received: by 2002:a17:90b:54c4:b0:2ff:52b8:2767 with SMTP id 98e67ed59e1d1-3014e8619f7mr247106a91.19.1741883959525; Thu, 13 Mar 2025 09:39:19 -0700 (PDT) Received: from pc.. ([38.39.164.180]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-30119265938sm4020084a91.39.2025.03.13.09.39.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 09:39:19 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Paul Durrant , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Liu Zhiwei , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Peter Xu , alex.bennee@linaro.org, manos.pitsidianakis@linaro.org, Stefano Stabellini , Paolo Bonzini , qemu-ppc@nongnu.org, Richard Henderson , kvm@vger.kernel.org, David Hildenbrand , Palmer Dabbelt , Weiwei Li , qemu-riscv@nongnu.org, Alistair Francis , Anthony PERARD , Yoshinori Sato , Daniel Henrique Barboza , Nicholas Piggin , Pierrick Bouvier Subject: [PATCH v4 07/17] exec/exec-all: remove dependency on cpu.h Date: Thu, 13 Mar 2025 09:38:53 -0700 Message-Id: <20250313163903.1738581-8-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> References: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Previous commit changed files relying transitively on it. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/exec-all.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index dd5c40f2233..19b0eda44a7 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -20,7 +20,6 @@ #ifndef EXEC_ALL_H #define EXEC_ALL_H -#include "cpu.h" #if defined(CONFIG_USER_ONLY) #include "exec/cpu_ldst.h" #endif From patchwork Thu Mar 13 16:38:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 14015446 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5CF7126A0AF for ; Thu, 13 Mar 2025 16:39:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883962; cv=none; b=UPhjND3wKENBaNo2ZEM7mAijfl4w+YurlmTKJko02TCpSvcMfx0c2cAULKb//fAAfchsti3xCaQ2mjZPUrYc8FYuTdnycNstf6IfFBy7vozrfmNhRbVcuQdCrmXWz3WSrJrZq5H2qlAw24G/D82IxAlYOp2aC7K7XuDEUvWwwZ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883962; c=relaxed/simple; bh=072rJgb1v8WTOR3ndNWM1YDjHaA2UGkZkEMRddxYphA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gTEF3t9wEBA1Yfy/S2GQ6HPtx7edNAnEJ9JDs+c4/jdoOlzpud2aN1YThFOovAif+GYgRncH9anQaj0E3vh/PBco521qL5WFAJ+39miKznGWxzcdRZY161x1GvczmqacziRDLnRgBMdD+3+eFHesc00gOxb9o2IQ09VlORooZMc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ZIoeOqoO; arc=none smtp.client-ip=209.85.216.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ZIoeOqoO" Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-2ff6e91cff5so2131038a91.2 for ; Thu, 13 Mar 2025 09:39:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741883960; x=1742488760; darn=vger.kernel.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=Rp8GQC6vA5rTxSSazblnkjuLZPjrJAYUOFg9uGM493s=; b=ZIoeOqoOnszgFjIbf5Yv+3z/TDcTE3CpiwSyQ7nTaPWhkuGTxdkLbzuIyKJaBZ8JpA ma2ngqSDJE+HEG7NMad5I/tRrlFCPK7FCAyZhzfw8ExHRpLYC6CC3kgAc3z+OyhDsAoK vxcxh38EffMLGaBoXgvIb0FLckjBWnbONiauSE5oCvuMb3Xeh2uj5nE6DcC/ZrIGNS7q ech0o9u3ne6OKX8gKV9OiVd5zOY7vF5NTnkyjGX421kyNjAT5NVDEnDMDbH94FV3Hxu/ /LKN4lnXRHzLdHrLskLabzDlNe0Om7N0+dTytcFc2bGZrGwWtRxctsIe89s4d0Ckl2RY /J9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741883960; x=1742488760; 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=Rp8GQC6vA5rTxSSazblnkjuLZPjrJAYUOFg9uGM493s=; b=NOtBJ+7K9R2vDsB60FB7BbnmuV3DwycnnVMaVgo0Lk+dwxroBS9f/zlZr0Te+g/nO9 3wDatOmaGZMgYEfhBzOE53wduveVt++d91iAvnzz9ZoVnLDC6N3AtMU4z52Z5qehBPSw ZvxBcNTsunrgfXfTjs3Fp+mBJ2K8CtanzhfyG5FkRbA/KdvR7Wg5nLti2PI1iAaIrb0T KdqD8tEfv81huFbbYDinAPWhZJQGX2M3mlaexO+5qe7v5twjtWsiJm2gjA1Z4j3cDxk6 jjBCva88c+tAFEuoZGEK9WnDPF5mVB8sptF5V97ZA3ZXj/eoAcl2daPH3qas4g4CBjhP acwQ== X-Forwarded-Encrypted: i=1; AJvYcCVl9j2k4HISkAMh/cJpg9DvSEyU2nTAHbvw1nezFJp4Yd4/V9uL2NpIKSozMf2XWeFRnVs=@vger.kernel.org X-Gm-Message-State: AOJu0YwtwE9/soEbBEguQPSh8I6LvRNl1HUBjYh3EdOkbAEIngezncV/ pVxomBsFCXTfmkh44QPKSEqRBQcoPnN7NMsJmw8zf2UEwBlyKekeLaypvVEVpkA= X-Gm-Gg: ASbGnctzVDZTcbvnanxTmLJ3dtEgdMAni7HRHJo/YOdVYUnhX1O9bWlGll45W1jTs1c aXVcdHl/gZHuYNCK0nZW++jadKXJCUp0ZJYxHfnkReUX10gX+Z70l0NHOhOwZrPurFh6FYcNjZ1 l32cuTcdHu6jP06cynMn9fIQjhW6YSV/IZghm1QlzaBYIdNkczTwqiSoGcs8wSP3E/fzA26wF20 /Cbr185k8xC0a3bo2Sy9XmcQ2rpFTd6Q4ac7au3mIC8Oil887024DURfr8BdWqNlGPDngq6/8Z9 kQX5EhMtGCXtYmNAD+Fugrf/bHZM6J/UWTTart2iCjHw X-Google-Smtp-Source: AGHT+IGZzjulkQU+BByDQKOIMhSKMvzNQK3Jb1Ldmjqqry9imNMjEt/+F7i1NK8ViRkyqUoEaWDauw== X-Received: by 2002:a17:90b:4f41:b0:2ee:c2b5:97a0 with SMTP id 98e67ed59e1d1-3014ea23938mr221254a91.25.1741883960596; Thu, 13 Mar 2025 09:39:20 -0700 (PDT) Received: from pc.. ([38.39.164.180]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-30119265938sm4020084a91.39.2025.03.13.09.39.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 09:39:20 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Paul Durrant , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Liu Zhiwei , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Peter Xu , alex.bennee@linaro.org, manos.pitsidianakis@linaro.org, Stefano Stabellini , Paolo Bonzini , qemu-ppc@nongnu.org, Richard Henderson , kvm@vger.kernel.org, David Hildenbrand , Palmer Dabbelt , Weiwei Li , qemu-riscv@nongnu.org, Alistair Francis , Anthony PERARD , Yoshinori Sato , Daniel Henrique Barboza , Nicholas Piggin , Pierrick Bouvier Subject: [PATCH v4 08/17] exec/memory-internal: remove dependency on cpu.h Date: Thu, 13 Mar 2025 09:38:54 -0700 Message-Id: <20250313163903.1738581-9-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> References: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Needed so compilation units including it can be common. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/memory-internal.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h index 100c1237ac2..b729f3b25ad 100644 --- a/include/exec/memory-internal.h +++ b/include/exec/memory-internal.h @@ -20,8 +20,6 @@ #ifndef MEMORY_INTERNAL_H #define MEMORY_INTERNAL_H -#include "cpu.h" - #ifndef CONFIG_USER_ONLY static inline AddressSpaceDispatch *flatview_to_dispatch(FlatView *fv) { From patchwork Thu Mar 13 16:38:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 14015447 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 573E926A0BA for ; Thu, 13 Mar 2025 16:39:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883963; cv=none; b=PA2Rp9LFZCZTiCmaSfoJnn2tlOKpumZF9cRO8d4Ywwgy2miwDjMOVfdb4+xnwMZVt3vLXJROMnbywW8eVTmN7BBTedJsWUv3OS45jz9wxGR5/OgAusRZI9bOmv3QI1I3RwGy3meG9sGstjCoHSxJrVNLNGFdtB2EQ56ghVvVnX4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883963; c=relaxed/simple; bh=rOapAhxsucTXmmvj3a2Zy3fKHxQeQMgYCuWijJzB6sI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=neRWE5EQGaMd6M3xOjhvqWcKb0hghQZzPP+0ZPBemWzhs6nrPHVAimI1Vdiq2kn0Al4ye17f3d3ynL0uajkMDgGpDFLQqfWeya1ZJN1OzfW01bKcwYyMhU1ciBcnv+ZFxFpZ7O/iPcmVyKKll/5HVWDthMx3wFHXWof/Az1M85Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=UMi1g39B; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UMi1g39B" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-22580c9ee0aso23510985ad.2 for ; Thu, 13 Mar 2025 09:39:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741883962; x=1742488762; darn=vger.kernel.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=PfpTTedni4gUGfvRcfnvXw4xTvY7JO0pNjOjXTZ7pI8=; b=UMi1g39BPGahh/khGEsus1BLDD/Sukvv3gZgV/vIlh+WjCYinxPBS5X/x4x2B+PuW8 MjUjL4tnqMMO7Sf3D/uv9RUwpYU+VHQhlNIIpUINvF6J7/VvpshkLE6O9fBeyRJiG9Pt RKdsCn0MZlizzVO9IfsyxYFijnq/NaXIy1W4N8VZqIeNzbMobeHHm7n4V/t1ov9VyFjF xTYicQZgoVUGo4OPmXFwKob3GQ8XJ8vImrzhfNRa575F5wMmIPquTnzdFwBhkri0J0Ko 8s5CXMiP6LSy79nJVNiUAAEyDWFfUOedhfYQ6CcffzWCLSYAv3vDKXWlBq8YIiRgedKM eG0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741883962; x=1742488762; 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=PfpTTedni4gUGfvRcfnvXw4xTvY7JO0pNjOjXTZ7pI8=; b=N2F9n8bDXg24wvS2rzbKqzFowL8I5ZRvQ52HS0I/+AeDbA9N7qIPdEf49mQUskb0DY EudZHdbyUpP9PzQyEOsQrf8xSSjvJQtmKbEU8ijTr1mBRKZFbjgMd+r4eBWYXJQeV/24 8tkN2xHJPesF5gYZyEPluAJjuUZws27uwmJ4Qe2QW/XJNpOPxUfhYJNF8OYlpUFtJ3d9 UQFJs4PdPmVjGpBqop/NFWi/L8npLnbZ29t5/w1fjD//ItpaBIj3pL+GoYhxF3kp/7Ev XJEXJKVL5GpLApx92qQouAa8LwukMdGb552bBseCvmkBSUEwc2cDW9WOz+acl0Au4nSn nCAQ== X-Forwarded-Encrypted: i=1; AJvYcCXsXlbg+F9E2Vct9aD+tnknxXmZOr6vDx6n8MnfH7mPjeQY8fBHLwpgArMciKUzPJln128=@vger.kernel.org X-Gm-Message-State: AOJu0Yyftby5KbG+Ywz2gTLoF5qAjf3XJKasoCoeW6BEbgpGnp3gmLqA 1tbRdYuPKM1j8LB4yj6QHbIWOZtI0y+h5lV3RHP9RD5U15+JB9lYYEqzUGhghvc= X-Gm-Gg: ASbGnctAHojFfol8zLKPsOegmduLk9RMAZhQHP9dIOwzUuEZFHTKMzy9A/Y21t8SGmd twiOCWNPdcN071MniRYJlnAxdTvqyPFHkt1lMU8gtF6VFIHp82vENR2xbcC12AFq00FQCatmMlJ DXWmrlVrnaf+GcCAy4O3ScIqey9QScTPT9l6fQ0yABBPPc6WA3j0wARukZDr6nOnj7FkdqYj+qF m/eK3v6tlRyWXCb07n3eFw7KzvzpCqJ3B1KaWwn8IXkt3B5VB4IdVaw4yF2My0Kh/0EAIuJZSdB CGh4FdGwD5evlmNKdd/MLJJHHjDFbrpC/j1/b0Lx0LbU X-Google-Smtp-Source: AGHT+IGoee0FqI1pRrQ30nb92L6Ez6iWr624Iw9VfJKN6XKShQ8vco+xd3ltWnO1olhH1gK/7mxIvg== X-Received: by 2002:a17:90b:3ccf:b0:2fe:a545:4c84 with SMTP id 98e67ed59e1d1-3014e8bff05mr210801a91.34.1741883961740; Thu, 13 Mar 2025 09:39:21 -0700 (PDT) Received: from pc.. ([38.39.164.180]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-30119265938sm4020084a91.39.2025.03.13.09.39.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 09:39:21 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Paul Durrant , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Liu Zhiwei , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Peter Xu , alex.bennee@linaro.org, manos.pitsidianakis@linaro.org, Stefano Stabellini , Paolo Bonzini , qemu-ppc@nongnu.org, Richard Henderson , kvm@vger.kernel.org, David Hildenbrand , Palmer Dabbelt , Weiwei Li , qemu-riscv@nongnu.org, Alistair Francis , Anthony PERARD , Yoshinori Sato , Daniel Henrique Barboza , Nicholas Piggin , Pierrick Bouvier Subject: [PATCH v4 09/17] exec/ram_addr: remove dependency on cpu.h Date: Thu, 13 Mar 2025 09:38:55 -0700 Message-Id: <20250313163903.1738581-10-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> References: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Needed so compilation units including it can be common. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/ram_addr.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h index e4c28fbec9b..f5d574261a3 100644 --- a/include/exec/ram_addr.h +++ b/include/exec/ram_addr.h @@ -20,13 +20,14 @@ #define RAM_ADDR_H #ifndef CONFIG_USER_ONLY -#include "cpu.h" #include "system/xen.h" #include "system/tcg.h" #include "exec/cputlb.h" #include "exec/ramlist.h" #include "exec/ramblock.h" #include "exec/exec-all.h" +#include "exec/memory.h" +#include "exec/target_page.h" #include "qemu/rcu.h" #include "exec/hwaddr.h" From patchwork Thu Mar 13 16:38:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 14015448 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D73F268FEF for ; Thu, 13 Mar 2025 16:39:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883965; cv=none; b=NhTQdetZjCo69cGFyK9I+cvX+0SsuGN59Yhhmnqz66OLxDSULufJgZAMF3ytthahfeQklc/6hv7VeogivGBGJyCFyd4+rxZpNcmVNIl5+MKdBPpZroorHEoMrwzIH550eKYWdoKe9EpxH30L0vPdiZfR/6xFKiHoHTDsewibvPg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883965; c=relaxed/simple; bh=eZxW1HUQDLqOK64QD3ZvyFTEod5DwQVKTFd8dmVQepY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hYDmRzOcHwnL2RvHx0gz4zQOo/G1QADwjcMcq1Tw/7/WjhMj3kWojDTnzOnZThvZCA/eGarVmZ0JwpUwfkV9F0291hUB2WmNCiGIfFLhjcEwqcAYGN2m0OszD+R7Mr6fziJE3hdYi/BsImggIMZ36bj+DOoAfDOvkJ0yOgAnO5Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=fHXQLzst; arc=none smtp.client-ip=209.85.214.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="fHXQLzst" Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-22548a28d0cso35819365ad.3 for ; Thu, 13 Mar 2025 09:39:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741883963; x=1742488763; darn=vger.kernel.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=BsftdeZcZ0LsVJ43Vlgc1kB7SrUHDvnjwuIeYSteybs=; b=fHXQLzstdzumzZrdn9Dg2HpmiOnS1ME4cP2T/jZn3VOmE2qpPjhfLPT9dOGZyaENCC qdIVjiaKdiBuYnwE011t3K4Eau+vDvILX4G82F9K6o5+GdxuDrQHRvuike76hSvZ7TIN gJbF0WneG1fZu0rpFtiH93xiHzFZ+TvbsBwZLO8qufcDQT5ymTjcKfuCqMg4ScRpNFF5 RqDQjYVmwEGgCDJxEK6hgk09NuPjgEi5ic2SbmErYpVXa3uD1NVn1v3UUQtNqy2J/RE3 24h7qQmf50UB4joXC9FbhUyZPq4jeGBFlJPWFta3sTmoiEoi9RLFP04VVG1fn9epIPka Q2IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741883963; x=1742488763; 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=BsftdeZcZ0LsVJ43Vlgc1kB7SrUHDvnjwuIeYSteybs=; b=NEYZMQz/tr69P1MGaOPxe9zKTvJy6N6A/VKr+dPc1QjaLJoYg+Z52CQfj8H2V4JY4a /HkYVHx5kPnXteEBaIiNXITZTdzJ7ezRMjtS6Cfgw1NsUvMe4rTvd/C9zjGVKyOaNcjC 5F2EDc+6Em88Dd1m5/b7tQKosBUKiiUBilKxCDJ31tBLjVgIPPpIfQPlJT3o1o/mDzR5 tS3I8jgBGkbsQISftNkMbBHqWlNZaN2nMksW+tIyLzIK+JCtIlEoKeANRanLViKXsKAU 4Sp/KVdyfrsHES6GdSiZfncgq3/KaN0R/YKr43SgJmnyHyW8rKQ88EkxZ/LoQA6vJZ+W Tu9g== X-Forwarded-Encrypted: i=1; AJvYcCUI3hf3LWz7SaXPKVX2/mxOhwU3hkt2Kt2MiAm/vEZpeMpawI/OLbLNWsorQT0OZY+JGao=@vger.kernel.org X-Gm-Message-State: AOJu0Yz5i8QXb8OBTO5Pyjji8gBO2cXZpa/UD9UeTmWItasF0IQk+1yd Nta6XES4sqciX6V35MA8bAJwDvMtl59HvPyuAs6I9OsgH6hmiCHOdM45w6TJ6n0= X-Gm-Gg: ASbGncuFBWtESJeSsGYJoxgiklZBP6Q0KQ0yPlDN3qCpS6OT/RAz8rHF6sn0SoFny6b Li8qnZ+9QNpftm8+o7IWc+2F5L3zhBdNqMNXBYBvYim/vKppVxsUEc3AQMuggUrgtM9+I36f2Zm 5abjK9wEtv634qgV0Wia5B4nh2z/eRMgzacQtqO50rlIEgot3n7DYIgPBUqq9ol7gfTz7eoV+nT KZXPbi6d2LLedo9Y48OLXl4RrmmE412XZHoqPjdK2pDHnfotI6nAfBakR3TFuBjVco/NgpC+ecs fnQkYhLhxValISuXqR38A0N22wCgwqGZkv5N11DjXskTEIFZCiWrhGM= X-Google-Smtp-Source: AGHT+IFA5iTR0M+uWE9BgHbKNSK5QhTOV/p9oDq/Jx41glVxwyMkriyoe5Nv+AlfRyMJQR/e/whMeQ== X-Received: by 2002:a17:902:d4c8:b0:224:1074:638e with SMTP id d9443c01a7336-225dd8ec5f6mr2405345ad.52.1741883962943; Thu, 13 Mar 2025 09:39:22 -0700 (PDT) Received: from pc.. ([38.39.164.180]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-30119265938sm4020084a91.39.2025.03.13.09.39.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 09:39:22 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Paul Durrant , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Liu Zhiwei , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Peter Xu , alex.bennee@linaro.org, manos.pitsidianakis@linaro.org, Stefano Stabellini , Paolo Bonzini , qemu-ppc@nongnu.org, Richard Henderson , kvm@vger.kernel.org, David Hildenbrand , Palmer Dabbelt , Weiwei Li , qemu-riscv@nongnu.org, Alistair Francis , Anthony PERARD , Yoshinori Sato , Daniel Henrique Barboza , Nicholas Piggin , Pierrick Bouvier Subject: [PATCH v4 10/17] system/kvm: make kvm_flush_coalesced_mmio_buffer() accessible for common code Date: Thu, 13 Mar 2025 09:38:56 -0700 Message-Id: <20250313163903.1738581-11-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> References: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This function is used by system/physmem.c will be turn into common code in next commit. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/system/kvm.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/system/kvm.h b/include/system/kvm.h index ab17c09a551..21da3b8b052 100644 --- a/include/system/kvm.h +++ b/include/system/kvm.h @@ -210,11 +210,11 @@ bool kvm_arm_supports_user_irq(void); int kvm_on_sigbus_vcpu(CPUState *cpu, int code, void *addr); int kvm_on_sigbus(int code, void *addr); -#ifdef COMPILING_PER_TARGET -#include "cpu.h" - void kvm_flush_coalesced_mmio_buffer(void); +#ifdef COMPILING_PER_TARGET +#include "cpu.h" + /** * kvm_update_guest_debug(): ensure KVM debug structures updated * @cs: the CPUState for this cpu From patchwork Thu Mar 13 16:38:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 14015449 Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B925E26A0EB for ; Thu, 13 Mar 2025 16:39:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883966; cv=none; b=qLut7TuoHsTIQE2riraUJ1HeeWE3lu9cEXDbNA3DAo6bksqsY6/GNSP/GtzXbN2lLhK4twmY3xEAmh3zkMwQvZYkED1rocf3leVjSarlGuUha8iDZ4chN37kF4zq3EX/pgx+D9esGrwms6HBVPEit9WIUBPsYDYTPyX9WjvJA3c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883966; c=relaxed/simple; bh=ym8vi7HBFMN71o/ytWbPTEvymne8dwvUZJtelFdMdmA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hglGvWGSjVuKB3F9VKqrzJ7/YfOfhy8zaLsdkz/41WQVdt85xRIcKr4XRBMjA0eSXfLtCDinE2CbHwG+PHjI65v53b5XJZGKt7ZsnNIsSGZxmKrc4c+9F+Jra9vKx2TessPI3Ep+Njjm3JZ/ZQEIVbYy8Sv6/IrdQYd3QMJjcuA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=eF9zmOlo; arc=none smtp.client-ip=209.85.216.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="eF9zmOlo" Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-2ff615a114bso4342444a91.0 for ; Thu, 13 Mar 2025 09:39:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741883964; x=1742488764; darn=vger.kernel.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=PABH8iZPN9WF+wJr72ZMp6Lm7i1C+9jWBJAvssLik90=; b=eF9zmOlopMCc62QlMcAmMXsAZspwaHJV5fFX7CYM/AqJnGMRWfJmycOaUhaGot4EEi DMT5ZGuZXiaiNjRCwUv6GVwllDBxIkfl4LNDZizCIoaPF4a2htZutmKs7Y5zWI/6yUui As0I9SFeMVrTIPbFGDSKA5TcWdOZkBVE/aLjBacfUgqi9Hk2VnPEd0cXqw+PMknEn0RG H/jbhaUouw/M8eECohusaQ7i8YzpnrPI6dQ+ReGGPqH+51gACunMBnaWpfSc0wTVYANO cYNnI3I73pvDGUmin46g6+5y1JCZMW1epk+m+LAWQsCFytDW6nCmpiRj00zLy5YjMFm9 ZmXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741883964; x=1742488764; 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=PABH8iZPN9WF+wJr72ZMp6Lm7i1C+9jWBJAvssLik90=; b=eW6OkCCH6BNN95kNBo/NMHFdFxdjZ/aaog4pkTId9F9Vo2EEy8+INWO1aBxUxVsq9Q zIObthErxQcBuBLFYu7tCVye11CPQidvuGdAbyhJBgBsP0QBMuYEr+tjqu5ydEihIzxU FcfnvriZqWzQWoMB0HrMcurqdWnr4T7Kf/3GIHPcf8FdSaUElzqSw1GX/T+cFf5ZEfBJ vwFUV1EabLqXaYuwxXDFcngCpqGdid0p3HBfk9T7+9k4qRn6I6R47z8XbK9eNVKCxKRe r5Vs05Ewu2b+Io8PslNe0pRLMXD7yd8SzuUUQNK7XcB7teMZ5nKp3kLsGIcbVPKJ9qb6 9f6g== X-Forwarded-Encrypted: i=1; AJvYcCVahM7eqobGqZpiwnkGTb4uckGaX1lkyMHcEZkeO3MpxaAIl69kT/BumQp8BvXyDcpOA2U=@vger.kernel.org X-Gm-Message-State: AOJu0Ywu9g2SsR5WE50fB9eNtHPlcRCnAavlItX4J3lAbZOeYTpKPucG y9T6zLURmNmgwkYaPQBC+FfxM2QAQhKOU21cYeDq8vvtS1nVadrkVpT5vDtggzQ= X-Gm-Gg: ASbGncv3d87yGvpGNQsYgqsqHnSGM/lMIwBWffeCldb/vu7PnO0EkO0DghMoag7Aqpa Fg+uR9APW7lEHFTXd6bRv9rideGy8sX07fxbA9WQ0Ulx2+Zof2QHBJFKSngNAjFtw2MXEumR0vV YD5FodIBN5Lh0f+lCnxW58KVXFnP2wP8oPFBCd4GrI4vD5zseKbgKzqKjQMiGwKx5o0N0A/qHgH 0cIE7Ix2cf8Rf4yULRRftlTq0YUfGOztNp6vpMBFBrQ0sR+YhyHtcHEtMpPoYKStUq76TK1CJbF +CjIRyvv+y19DMspfnOWIG32t64gJCV+IUJka8mFmZ+tc2GtHj70HkM= X-Google-Smtp-Source: AGHT+IFBCzdx2RE2XSuvFzfGvZFs1Ld7NKM4NGPSUQ/nU1Uh9fZ+kP54v1OAyBR0HlgDCGZ75ow8Ew== X-Received: by 2002:a17:90b:2f0d:b0:2ee:9661:eafb with SMTP id 98e67ed59e1d1-30135ed493amr4421602a91.12.1741883964075; Thu, 13 Mar 2025 09:39:24 -0700 (PDT) Received: from pc.. ([38.39.164.180]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-30119265938sm4020084a91.39.2025.03.13.09.39.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 09:39:23 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Paul Durrant , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Liu Zhiwei , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Peter Xu , alex.bennee@linaro.org, manos.pitsidianakis@linaro.org, Stefano Stabellini , Paolo Bonzini , qemu-ppc@nongnu.org, Richard Henderson , kvm@vger.kernel.org, David Hildenbrand , Palmer Dabbelt , Weiwei Li , qemu-riscv@nongnu.org, Alistair Francis , Anthony PERARD , Yoshinori Sato , Daniel Henrique Barboza , Nicholas Piggin , Pierrick Bouvier Subject: [PATCH v4 11/17] exec/ram_addr: call xen_hvm_modified_memory only if xen is enabled Date: Thu, 13 Mar 2025 09:38:57 -0700 Message-Id: <20250313163903.1738581-12-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> References: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/ram_addr.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h index f5d574261a3..92e8708af76 100644 --- a/include/exec/ram_addr.h +++ b/include/exec/ram_addr.h @@ -339,7 +339,9 @@ static inline void cpu_physical_memory_set_dirty_range(ram_addr_t start, } } - xen_hvm_modified_memory(start, length); + if (xen_enabled()) { + xen_hvm_modified_memory(start, length); + } } #if !defined(_WIN32) @@ -415,7 +417,9 @@ uint64_t cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap, } } - xen_hvm_modified_memory(start, pages << TARGET_PAGE_BITS); + if (xen_enabled()) { + xen_hvm_modified_memory(start, pages << TARGET_PAGE_BITS); + } } else { uint8_t clients = tcg_enabled() ? DIRTY_CLIENTS_ALL : DIRTY_CLIENTS_NOCODE; From patchwork Thu Mar 13 16:38:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 14015450 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1DAF126A0FD for ; Thu, 13 Mar 2025 16:39:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883967; cv=none; b=q8QBOsp1WjMJ/BzBCCMIj6/H4v8Q2D0nVqQXhvYh2q+1Ken+LwR0u7wYHJapKQMRS33PmVLcNp0NdiyZImPgRHvDbczDPRNChxOiNABdlRAplOCGp1tppRRLhqZ/62hWmY9qLNxv7LkQTWbulu5PrH6LmlbgpuDovQuFt9R+M9g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883967; c=relaxed/simple; bh=2BGYv29y1gAuWbOxLdSmdLhzjdPFXu3kgq+kOyRsd60=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SvqXaWRId4G0ADpXjboiUm/Omf73u6qUnl6k8+fPor8HZuSQTM4eX82CAE42T5aBaASCyHlulOh5tyFx+cVjc+8lT2CBF5gdT49txYqx54OCoSRPur9UkWaIUygy4yv/sMzhxHgvhp62tnvs61gV2j7J3PhehHeAVUMjm1/AkNM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ziH/S451; arc=none smtp.client-ip=209.85.214.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ziH/S451" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-225d66a4839so9569535ad.1 for ; Thu, 13 Mar 2025 09:39:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741883965; x=1742488765; darn=vger.kernel.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=YZcwoIie6BtZ5Bqo8BYW0CKBTK95znA0iA8YHmiy7v4=; b=ziH/S4518cyxcO9fuZDeDpIErxYCxfwNT9HBRz3b/S34YdyKfIGkJ1Z3JVHpO/bHC7 myyLwmUHqMO6B0m4D3a/lbmO2ETs1DyfAaDd+sMPrDBO3dlYozfHjNn+eZ4fqOfZjWrw e86xOezwNpG7G5UIFiS/jBgwtYxuWRw8xA9LzMKf+saQNGps77NRZKx47mzu4Ojac60W 8mSqTY3+ur6UgogqmDpabJbOrcdQu5ygx9aMOptM56UEKY4rVScrBp5tvVyNHx7jS6Oz b+Ud+l85C4VrJmZMC0luW5Y0tbO04cF/ROQrEEH7tH3CxjgG59kEhb0xqOW8K3eC5I3E y+Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741883965; x=1742488765; 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=YZcwoIie6BtZ5Bqo8BYW0CKBTK95znA0iA8YHmiy7v4=; b=ji37XLtCaEhtEqLv0EZJhNOvyovfcO1PseHSlpM+bzKG2JFgOwKN/iWe1zA3J5B1bn c/CYYcOnaKcYxUJPg85QT9WrAb4h2/lobaHKWju9AzWXjqmOUTcLzt4aYCk7jXqfVH0j AseyoMwA2F0GKdmzWUtRIcT7MMaXdZzU64Gg63WCIIpNBxQNFwxr/q/smSdut61lD+/b g9CyLz5fciBhO/cI1mDMYu8q1D1bmMPRr8/gxY694vgdZYAalcBKTcDMhyxstAaFJgq8 d4PUjsHYXUW+8k9/n+MeB+nr3p2/o+N6EnKzX1a9N5yqhvzuA37F6N1LGJgp+LFCbzNm e78A== X-Forwarded-Encrypted: i=1; AJvYcCUDki9sG+1D1vJQQgFEu9qciCq7+3k+t1QzCU902mlJhsrwm/+3OX5me/b/CdHfiVkmcZo=@vger.kernel.org X-Gm-Message-State: AOJu0YwcGbtOH+Rngs8HCcSreRFe+D3AAtRQMiKhYyoQmNOZalf9YJ3y y9MnDJcit4/vWELe49aBofTaX4Z06PXwcqhNGHW9eSAWLKpvw35baWLMYjN6BZ8= X-Gm-Gg: ASbGncvFZodHLf0ciEMerW8qfC+oEI0brCrnhk3DDd4k3ylxTiJWaF5KjJN6si/C2UV GvfK/7uqsNNG63dJF34fhMgeGAo6YflebQenrTQOCzrZLKz3zBOKxbhHBn8XIFn5FdZUvBxQ+Tp 9YVbix6oQ+377oJM2YG3LKa/vy03lUImFNOAPv38qTtXK9IbgLj2hMvh81UpiOz7g43pCBgpuMR 1OWb3lkVqJBLipcThKGdyuWjTmeVOPegWlWfELvXifiluJTWPu+oThfJqLLTPlQQbZudMa6knrA Zet1O99f3KBpi2DZKXXA69Xz+vaAU16P+/UsovhVOuNq X-Google-Smtp-Source: AGHT+IFiKP7Cv0cYdqEMV+MhGWK6VMcS4hFI6ysthSkCfjorg7zJkJOo9IS+PhkZP2SVMZhjn6kprA== X-Received: by 2002:a17:90b:3502:b0:2fa:21d3:4332 with SMTP id 98e67ed59e1d1-30135f4d091mr4406058a91.12.1741883965232; Thu, 13 Mar 2025 09:39:25 -0700 (PDT) Received: from pc.. ([38.39.164.180]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-30119265938sm4020084a91.39.2025.03.13.09.39.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 09:39:24 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Paul Durrant , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Liu Zhiwei , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Peter Xu , alex.bennee@linaro.org, manos.pitsidianakis@linaro.org, Stefano Stabellini , Paolo Bonzini , qemu-ppc@nongnu.org, Richard Henderson , kvm@vger.kernel.org, David Hildenbrand , Palmer Dabbelt , Weiwei Li , qemu-riscv@nongnu.org, Alistair Francis , Anthony PERARD , Yoshinori Sato , Daniel Henrique Barboza , Nicholas Piggin , Pierrick Bouvier Subject: [PATCH v4 12/17] hw/xen: add stubs for various functions Date: Thu, 13 Mar 2025 09:38:58 -0700 Message-Id: <20250313163903.1738581-13-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> References: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Those functions are used by system/physmem.c, and are called only if xen is enabled (which happens only if CONFIG_XEN is not set). So we can crash in case those are called. Acked-by: Richard Henderson Signed-off-by: Pierrick Bouvier Acked-by: Anthony PERARD --- hw/xen/xen_stubs.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++ hw/xen/meson.build | 3 +++ 2 files changed, 59 insertions(+) create mode 100644 hw/xen/xen_stubs.c diff --git a/hw/xen/xen_stubs.c b/hw/xen/xen_stubs.c new file mode 100644 index 00000000000..19cee84bbb4 --- /dev/null +++ b/hw/xen/xen_stubs.c @@ -0,0 +1,56 @@ +/* + * Various stubs for xen functions + * + * Those functions are used only if xen_enabled(). This file is linked only if + * CONFIG_XEN is not set, so they should never be called. + * + * Copyright (c) 2025 Linaro, Ltd. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "system/xen.h" +#include "system/xen-mapcache.h" + +void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length) +{ + g_assert_not_reached(); +} + +void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, + struct MemoryRegion *mr, Error **errp) +{ + g_assert_not_reached(); +} + +bool xen_mr_is_memory(MemoryRegion *mr) +{ + g_assert_not_reached(); +} + +void xen_invalidate_map_cache_entry(uint8_t *buffer) +{ + g_assert_not_reached(); +} + +void xen_invalidate_map_cache(void) +{ + g_assert_not_reached(); +} + +ram_addr_t xen_ram_addr_from_mapcache(void *ptr) +{ + g_assert_not_reached(); +} + +uint8_t *xen_map_cache(MemoryRegion *mr, + hwaddr phys_addr, + hwaddr size, + ram_addr_t ram_addr_offset, + uint8_t lock, + bool dma, + bool is_write) +{ + g_assert_not_reached(); +} diff --git a/hw/xen/meson.build b/hw/xen/meson.build index 4a486e36738..a1850e76988 100644 --- a/hw/xen/meson.build +++ b/hw/xen/meson.build @@ -9,6 +9,9 @@ system_ss.add(when: ['CONFIG_XEN_BUS'], if_true: files( system_ss.add(when: ['CONFIG_XEN', xen], if_true: files( 'xen-operations.c', +), +if_false: files( + 'xen_stubs.c', )) xen_specific_ss = ss.source_set() From patchwork Thu Mar 13 16:38:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 14015451 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 46E4126A1AC for ; Thu, 13 Mar 2025 16:39:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883968; cv=none; b=sPBqQyFLn+od3Jf5dyyFBBFilTduBLXk9BWFRYon94PdDNYaUOXSVxQpopXXc+KUJFzN2Yk+Onez8FZFFSCz8ICRnBtjk0sOKynThRD7SvIisV0RNJUxG2JTur0JQCaJwwVyQdRh7Bf3NFCKUJn7CKBx50V0IQfgW00UYaJtOI0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883968; c=relaxed/simple; bh=CzPhR8gRelKLEDtp1LKolN6jwIOO5jPAQq57RMOd2W8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DDf3d8iOTOIFQtHOdGiAVVYk6KlhwF6ayEO9YaZazWXFrhGlf5285M8WfznAE9CUKn1W1j+ynXK71+UqiEA3vajjnENuKUhh8JP/2gkAGDoeuo0w0vfe+wkEYRZx7UEOy+DR2MLGnjE/+f8cmVi4+3J4soyQ2plS9uA0QwHX49g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=LaTpj7Ox; arc=none smtp.client-ip=209.85.216.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="LaTpj7Ox" Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-2f9b9c0088fso2395626a91.0 for ; Thu, 13 Mar 2025 09:39:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741883966; x=1742488766; darn=vger.kernel.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=cOa15ppvF5kxsldjPkSIJYe5T0c824L9GaUvR3via0Q=; b=LaTpj7OxyfQsV0ZrnXKamGtKSvbN0XZ+UcHcwTtTFv6kRCN3gWffXwrfCwKsjZLrvK 12TryOQ3DorU0RY4v5SMR5ScndhcCRn6MiDqJdnhZb5p5iSMRQ1hTmueqAsZjBdZfm9d WhdE9cMM2QroC6E4AAprhOxSz0Qw7ysiR89AMJ/+HpCr95ZWTZI6BMNP9ewRJG6DZGTC RIwtFvYNvaFO0HT3SQJrYBj2ww/eljZNiw+Urm41f5hrlc/1WV3PjrJVvUdIZdo3lGan CteZ6BJAadIZMNPbsEtAYFpy04DutqnB6ye24uLWiHnrzQx+w1Zblbe3t0y8feevaLqc gXyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741883966; x=1742488766; 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=cOa15ppvF5kxsldjPkSIJYe5T0c824L9GaUvR3via0Q=; b=KUtbHvQAo/utFwWu15jIFZpTi2X9KrzkDLK9XeUbAhpFETe25seKupk2ZN4y0kEiQq TjZAMFb/qlgfbs193v+TDeg9nBRybVp+bnPWx7m8iF27lUCEuwMkZSLHfzUPipoGm69F /xk+0lAgHM89s1dUyZQRKnPKFSqmsxz6czedyN/Y4Zo1FuzlVYjjWwTSxKXs8jLMKELI J6qiP9KtuKvrjLGz/x0iLy92WTzYU+MDyDv5p+Jfqy5kItKfACuQsqSJNBLSTph5kbP1 aEjiZsaAJgt/vH7JVSJeUaUAN+PruNe8Q8X0RbZhHP9KhYgudaaGP241X7HglaFv/o4U 4ttQ== X-Forwarded-Encrypted: i=1; AJvYcCVFOjv8YHtXpDJCJUYsJNj7D+tW8MRNmgPCMkgoPZAqtmk7HYGkqKCj8Nn2PoRcRT8v6ls=@vger.kernel.org X-Gm-Message-State: AOJu0YwMfxpZbJjaU+Q8DY23v9Ersd9bCalufgGrTsLNeUsEYar7mf4W oGnVyA9OW1dlEhvMN2EKkveBXc6GMYD948m5gZexAggTYOCypeOigAccZF5fqak= X-Gm-Gg: ASbGncu0tGBQG7yfpdrw7SYixPywI4dhU8wioPnca+3q7r4n8BX6U80C9ZQ9macPyas iAmhWGGN7DefLCRfYf3eM53CRgeUhKQLGDYTQVeFRgnuae2/CaqYbYGe9JFh6ccUr7LON1+YwOW 7DzACZx5VAyHAkTMabtnSgVmigusP65r0yw/HvksCPr/+QUfcfMDXgifkJfQ9r7IANk5/DxQemO mO51MrqWWW1WFVgumEyvPyV4tWFOxAQnZceBBAPoUnJ4zWBVLyeyMtBPZ0Pm3oQE7gsVnAjYwKe ZKDGxFrrhtubH1TxBVCYsSl456rDsq57F3515/AS2loX X-Google-Smtp-Source: AGHT+IF4AzvOcFWztZZ2bxlYvUCRcZgJhJkixRgg9I+5NbaWKKn606UlzAb4zSHX4i3sVnz0TZr9yg== X-Received: by 2002:a17:90b:574c:b0:2fa:30e9:2051 with SMTP id 98e67ed59e1d1-30135eab105mr4295980a91.5.1741883966469; Thu, 13 Mar 2025 09:39:26 -0700 (PDT) Received: from pc.. ([38.39.164.180]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-30119265938sm4020084a91.39.2025.03.13.09.39.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 09:39:26 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Paul Durrant , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Liu Zhiwei , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Peter Xu , alex.bennee@linaro.org, manos.pitsidianakis@linaro.org, Stefano Stabellini , Paolo Bonzini , qemu-ppc@nongnu.org, Richard Henderson , kvm@vger.kernel.org, David Hildenbrand , Palmer Dabbelt , Weiwei Li , qemu-riscv@nongnu.org, Alistair Francis , Anthony PERARD , Yoshinori Sato , Daniel Henrique Barboza , Nicholas Piggin , Pierrick Bouvier Subject: [PATCH v4 13/17] system/physmem: compilation unit is now common to all targets Date: Thu, 13 Mar 2025 09:38:59 -0700 Message-Id: <20250313163903.1738581-14-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> References: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- system/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/meson.build b/system/meson.build index eec07a94513..bd82ef132e7 100644 --- a/system/meson.build +++ b/system/meson.build @@ -3,7 +3,6 @@ specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: [files( 'ioport.c', 'globals-target.c', 'memory.c', - 'physmem.c', )]) system_ss.add(files( @@ -16,6 +15,7 @@ system_ss.add(files( 'dma-helpers.c', 'globals.c', 'memory_mapping.c', + 'physmem.c', 'qdev-monitor.c', 'qtest.c', 'rtc.c', From patchwork Thu Mar 13 16:39:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 14015452 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0842426A1B3 for ; Thu, 13 Mar 2025 16:39:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883969; cv=none; b=pyjKnQKEEDW1E/nK4aQh7GT6Yti9rqTMUScc4sSAKs9mbeOkhe0ZcULuRFwu5VcEeaUlHwXwFBTiEHBIfzUwtcJs5BpN0KVhpyFrq8/4kwBQoVqRyYA2A33UUCSJYZcgVnDk6YVrbppoOtLsS7L27MzW9XBO4i9VvHCffsAZw3k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883969; c=relaxed/simple; bh=HWCRrm0GaxX14ykibana2jy+mNovavf3Va2YjCViNUU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kHq7OH6GLdJS4+K+HFeGciw6OjqaZJs6/EkkPR9JdQKVR4FgkhP62weY0ODsKxcMWAXD7xrBMJbZsG7Kk6EaZudnW9jKPnhkasfzsc9jkec3MOixBAM+i7bNwdcidSS/xhuDqsVAmh24V5974w1H6DEq7cE75fX5Fp2wM/BlwIw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=zQ/Yyb9a; arc=none smtp.client-ip=209.85.214.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="zQ/Yyb9a" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-2239aa5da08so24790815ad.3 for ; Thu, 13 Mar 2025 09:39:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741883967; x=1742488767; darn=vger.kernel.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=0vI16NHb2tKWbIxjnq/SoVUTdY/Lep770BkCc47k0Rc=; b=zQ/Yyb9aYXW5/nPezVUSZj9zCsu9NVgJpn3xUvjGNJ9ETS6tpW4hgpfgWtGjn0Ild/ JcSIVgNmNYIzsDhl+wBlEiHYzR0yn8tg5DZ6/fMGRhpya1HCMrzctH0Bx41nkD6x5XFL UitAlxi4A9opiMuEtNmvc8JNFGQsXMulbaHx4Gmho1RRZqquytizYeX323SmhvUw6oNV iWIbL72hoIWaReWFj3kkJhUkb2d301ieavyw9/cMnv9j1LS+QJlJ1RmqfLZ6Nj4hv87d 60AdvNbVQNHFco03LQ3FqzCfA6pa1JVt2LqZM+PyECcgZ/LDsQOM9TfFsZDYQp7JAmo4 ZDYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741883967; x=1742488767; 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=0vI16NHb2tKWbIxjnq/SoVUTdY/Lep770BkCc47k0Rc=; b=J7EHIDzkNLDdwukmwhjAfqCADSJqGKJpfvQIicyF964x79cUKWiI8+H791tv51X+Zk t5C41NdLNn4E6qnJBGZkIf9mkXtWLUM9FLM9b6FDB7Xn9CO5E+ns+ErvxiWdRKdF7ltw Sy6aDz+EqmJjd/zxfGrXgOuTAg6nv2Htj4ZhBXvj6FPQ8q80cuOAzaLd+0+D5u8QzFxo MRiljvzoIbhhWi8NmQXfxS837ONl9xdWcxLY1dErU1xoNvFQ+X5l7L6X+dEeDAUrz63e TpVLMdUuyMknwWMIqNney923kabtIJlFR+TF/+4SfdO3i5hGnC3pNQ9YM/L0FeURmMkG oDSA== X-Forwarded-Encrypted: i=1; AJvYcCUltv/LSQnS0FZJafJy1Gaz5b73qEm2fj6KxFm50doVmfzW97HtjK+cIBrcRVYPu3U4zKY=@vger.kernel.org X-Gm-Message-State: AOJu0YxvoCuFTDCiNY0kw2Nao6FIscYJ/pjubHnj0ZRKXOKl1XCS22tF gRCvBIMigUiDSeB+4SuB9VbljCr69Vwyvye2aBOm2ALHNrK7jGS+Lft9ROtk56A= X-Gm-Gg: ASbGncurF7LsZBEE2TjeUsqdSvTdng0aTg3dFliNp7c5dRpAKGvDsZC2+TkiRNJ5uFV GacW1KifcQwF4aWANoYYKIZCPm++mB8dMuPnhPtj3D43/DMDkbruBgRTg9RtVqXQSF45cZV6+ln D7wlMaRWK+OhfglDeLUri3wefyuQr/SInYbQsT2DGrrdRXGA6lu2T2mS54FXB7lrpPVz29Em2ea /keNUY25ORwxiXTnLIO2OjxDUvHTLsdhqcO13ANI7Pm/7LM0kOQBZklPjTKcbOz+unYqJq0U1sy THY2RPfznLkqwsUturq0OP5ZJVyw7JsEIpmllw9fPhn+TWo/y0jptdA= X-Google-Smtp-Source: AGHT+IFcq5bUjsmA5zzk8huR+izs7UMfjfhsI/1Y2larg5eumFEccAwXse4tJs4zAbzQaGCcQS+wlQ== X-Received: by 2002:a17:902:cecd:b0:220:e924:99dd with SMTP id d9443c01a7336-225dd8b9922mr2731115ad.34.1741883967572; Thu, 13 Mar 2025 09:39:27 -0700 (PDT) Received: from pc.. ([38.39.164.180]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-30119265938sm4020084a91.39.2025.03.13.09.39.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 09:39:27 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Paul Durrant , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Liu Zhiwei , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Peter Xu , alex.bennee@linaro.org, manos.pitsidianakis@linaro.org, Stefano Stabellini , Paolo Bonzini , qemu-ppc@nongnu.org, Richard Henderson , kvm@vger.kernel.org, David Hildenbrand , Palmer Dabbelt , Weiwei Li , qemu-riscv@nongnu.org, Alistair Francis , Anthony PERARD , Yoshinori Sato , Daniel Henrique Barboza , Nicholas Piggin , Pierrick Bouvier Subject: [PATCH v4 14/17] include/exec/memory: extract devend_big_endian from devend_memop Date: Thu, 13 Mar 2025 09:39:00 -0700 Message-Id: <20250313163903.1738581-15-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> References: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 we'll use it in system/memory.c. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/memory.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 069021ac3ff..70177304a92 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -3138,16 +3138,22 @@ address_space_write_cached(MemoryRegionCache *cache, hwaddr addr, MemTxResult address_space_set(AddressSpace *as, hwaddr addr, uint8_t c, hwaddr len, MemTxAttrs attrs); -/* enum device_endian to MemOp. */ -static inline MemOp devend_memop(enum device_endian end) +/* returns true if end is big endian. */ +static inline bool devend_big_endian(enum device_endian end) { QEMU_BUILD_BUG_ON(DEVICE_HOST_ENDIAN != DEVICE_LITTLE_ENDIAN && DEVICE_HOST_ENDIAN != DEVICE_BIG_ENDIAN); - bool big_endian = (end == DEVICE_NATIVE_ENDIAN - ? target_words_bigendian() - : end == DEVICE_BIG_ENDIAN); - return big_endian ? MO_BE : MO_LE; + if (end == DEVICE_NATIVE_ENDIAN) { + return target_words_bigendian(); + } + return end == DEVICE_BIG_ENDIAN; +} + +/* enum device_endian to MemOp. */ +static inline MemOp devend_memop(enum device_endian end) +{ + return devend_big_endian(end) ? MO_BE : MO_LE; } /* From patchwork Thu Mar 13 16:39:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 14015453 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91C3F269B1C for ; Thu, 13 Mar 2025 16:39:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883971; cv=none; b=j3TdnTKdwMvxUMecfmE/yntUitxYAHPyWY/JwzJqnhjZRgieXgroSE2e8J6R5tvt+XxL/IROQbqFI08Hbc4TfIwznN1Yw40vGBZRNvFIAfW4VL9kebIEneFWFZ9K+DmjBoVZQl3kQs7aVZsGnrfd3adrJbOoC6Bca+ywdBM8vC4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883971; c=relaxed/simple; bh=HPmrxLDFV5sbXdh9+wymWgtr8znrI9mCJnuvPobQYz8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=F4MuaGktkrH+ihcawNJQ1SAMkmIZSITLEQPYvKFTlXDqw6f3OQVRv+aECeDy1Q3a8vL4/HM/10mcWU4GMwemCYp9AUOgGtLMDmwvfN7xDbdxm7IZRz1N18T1ADiP3+e/VfX48onytnGuOWZBKFdvT/ialdjbGhPc+7U+Z5r9J5M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=sVbroHHT; arc=none smtp.client-ip=209.85.216.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="sVbroHHT" Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-2ff6a98c638so2662423a91.0 for ; Thu, 13 Mar 2025 09:39:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741883969; x=1742488769; darn=vger.kernel.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=/B5foK4Qy0OvFQVWNYpVAAsAF+tVTKpBxl4Jl8CdPFE=; b=sVbroHHTI+j9lW5nfMAqmzftbnwspS/fXKplWosDlhtUrITPmedZ5Xkv+oKp4QkCpX OeN1Nk5bCJz/VEqgUfMToHpIszrjqmH/rsK2yDo11tGVDkfm7FmK4qJTZDyZZHbv3bWy Pj0oHy4xyWsEiw7yW0OUMEFfh4MMdl4C2pRJTr8S4LmknA84SWitIa1q7Z45EyYZYHR0 /2H89iQtmx1DqWba7umlBNJCEoO6WrfZUO73LaxJ3m3TfsE0iGGJf4K7MpviX8AuGkUU /Zcn0VH2ayXddSVicfx7VVZXVVQhETGPwFCQECyUE8RzWpFDxyINk3kWU3KaUd0vDc/6 a6mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741883969; x=1742488769; 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=/B5foK4Qy0OvFQVWNYpVAAsAF+tVTKpBxl4Jl8CdPFE=; b=nY91xtvC8Yy4fTp4zoe02T/TxRhduEgyQi2iD1Ong8C/ZxU2DzK2lit07hmQrpGvJ4 I67RW/pit7ET29piV468uuuiv4VHeuDct1bF8128X+sK6mtllDYMunhwU+bhxr/e3b2I BRC+nzgjdatvQfNZuF+Vusb5jJOKeYi/trx2/WM6JS4YccZuBC0KGqI4cMOtYnnvqxtb w0XGGTSv3LhdW2lc931Matf0cC5BRkt8lajG69we5+PM+w/607KHv0x4o7zy7xHrX8F2 sNB4xoGFqUDANErXMkcOr07iJui9TDC9eRErC/WZsuMrXUDuGyfm9K3xAICcaRnhiR+f n8lg== X-Forwarded-Encrypted: i=1; AJvYcCWZyrjuhus2ZkoUU8Mj+ZoGCYRY9P3LiO/c934X4nkDAA71SWfJIYgal9YwyeBrunp4Cbk=@vger.kernel.org X-Gm-Message-State: AOJu0Yy/5cqItwOWvIY7Tomp7Gyu0rT7vCg8jObmY/MKYUQ/72mv6o5u 8DXhpcHe+JeHeLSv/2RbUqz3+5Sw9Gi1vpDnc+I/BB03/2roQJDvcBfYC8GvMRM= X-Gm-Gg: ASbGncuY9ILIj3pUz2QWW5gD0cc7+VoCJeVoHi1M77Ago9CnZwrk3Aazl/x2zRptCa6 YpVueFV+PvS3wFbQ9tCTCI4GDMrArWl+JV07BZPIL1QVr+f/uccpTa/Cyt4FGqA4bsSnQu/qi9H SrrXnpS6MDYGIlX9rDOty5q9TtinGBhKpeJUFvjTjUmEIDgLdPT3i1k2Ya/pkmAA5QUafyRL1Zv acWtWno4+ZYe4MF2v2GV8UGj50tjI0I2szU073BD9MFDR9W9iJ49THD0OjmTru0ZqPmGwCYb1jG +cPSBfel79GY9snBT/fOEDVjmOb4UJYrAk28XOcJoicr X-Google-Smtp-Source: AGHT+IE6Us2O77TYYfj/J/RmRU6RhpFIbMCr45wvgkThs0nxBWSPhVRimj63yvMeVhIF4wJ+N9MdKw== X-Received: by 2002:a17:90b:3bc6:b0:2ff:58b8:5c46 with SMTP id 98e67ed59e1d1-3014e82fd9amr271511a91.8.1741883968719; Thu, 13 Mar 2025 09:39:28 -0700 (PDT) Received: from pc.. ([38.39.164.180]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-30119265938sm4020084a91.39.2025.03.13.09.39.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 09:39:28 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Paul Durrant , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Liu Zhiwei , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Peter Xu , alex.bennee@linaro.org, manos.pitsidianakis@linaro.org, Stefano Stabellini , Paolo Bonzini , qemu-ppc@nongnu.org, Richard Henderson , kvm@vger.kernel.org, David Hildenbrand , Palmer Dabbelt , Weiwei Li , qemu-riscv@nongnu.org, Alistair Francis , Anthony PERARD , Yoshinori Sato , Daniel Henrique Barboza , Nicholas Piggin , Pierrick Bouvier Subject: [PATCH v4 15/17] include/exec/memory: move devend functions to memory-internal.h Date: Thu, 13 Mar 2025 09:39:01 -0700 Message-Id: <20250313163903.1738581-16-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> References: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Only system/physmem.c and system/memory.c use those functions, so we can move then to internal header. Signed-off-by: Pierrick Bouvier --- include/exec/memory-internal.h | 19 +++++++++++++++++++ include/exec/memory.h | 18 ------------------ 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h index b729f3b25ad..c75178a3d6b 100644 --- a/include/exec/memory-internal.h +++ b/include/exec/memory-internal.h @@ -43,5 +43,24 @@ void address_space_dispatch_free(AddressSpaceDispatch *d); void mtree_print_dispatch(struct AddressSpaceDispatch *d, MemoryRegion *root); + +/* returns true if end is big endian. */ +static inline bool devend_big_endian(enum device_endian end) +{ + QEMU_BUILD_BUG_ON(DEVICE_HOST_ENDIAN != DEVICE_LITTLE_ENDIAN && + DEVICE_HOST_ENDIAN != DEVICE_BIG_ENDIAN); + + if (end == DEVICE_NATIVE_ENDIAN) { + return target_words_bigendian(); + } + return end == DEVICE_BIG_ENDIAN; +} + +/* enum device_endian to MemOp. */ +static inline MemOp devend_memop(enum device_endian end) +{ + return devend_big_endian(end) ? MO_BE : MO_LE; +} + #endif #endif diff --git a/include/exec/memory.h b/include/exec/memory.h index 70177304a92..a3bb0542bf6 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -3138,24 +3138,6 @@ address_space_write_cached(MemoryRegionCache *cache, hwaddr addr, MemTxResult address_space_set(AddressSpace *as, hwaddr addr, uint8_t c, hwaddr len, MemTxAttrs attrs); -/* returns true if end is big endian. */ -static inline bool devend_big_endian(enum device_endian end) -{ - QEMU_BUILD_BUG_ON(DEVICE_HOST_ENDIAN != DEVICE_LITTLE_ENDIAN && - DEVICE_HOST_ENDIAN != DEVICE_BIG_ENDIAN); - - if (end == DEVICE_NATIVE_ENDIAN) { - return target_words_bigendian(); - } - return end == DEVICE_BIG_ENDIAN; -} - -/* enum device_endian to MemOp. */ -static inline MemOp devend_memop(enum device_endian end) -{ - return devend_big_endian(end) ? MO_BE : MO_LE; -} - /* * Inhibit technologies that require discarding of pages in RAM blocks, e.g., * to manage the actual amount of memory consumed by the VM (then, the memory From patchwork Thu Mar 13 16:39:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 14015454 Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6C6D1269CEC for ; Thu, 13 Mar 2025 16:39:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883972; cv=none; b=NzTzUX21YCN45Briu7w9F0jCny0R4RyNgMZavhUQXUFruL9p6dnvvy1G55OaG6rjedTn4P0OvAfwVWF18CJ/mYq6kK3gkBczJ7/92Tnv19Qf6zjYv2I4u9ZUOi+mWRhVsaLPQMn5Tcio5ZbxEcL5LfBjOXBLSMkAhBRysSpor8s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883972; c=relaxed/simple; bh=IelyUoYuqLIAw6DPSyagCvFpNJxQiv+t0JYUBox7DYg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BdOR5BPIEb2UuKaoDpSu5biyo5Dc91TQIP11aOWfqRKfWoRODlSxAowvk8AU5XtcxI4TIsxoV7zkuG68RC+dLhLyr/IVWna0Rj1dh5ldrtLZds/sEcgQgAbHyDF+9wZTfZpZyUn6oV+HsPPNkjk0TBpWCME8HoCjeCFTpyN3nZU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ZQgN7qkB; arc=none smtp.client-ip=209.85.216.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ZQgN7qkB" Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-2fa8ada6662so2710517a91.1 for ; Thu, 13 Mar 2025 09:39:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741883970; x=1742488770; darn=vger.kernel.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=EBRugwqnxw4q7Phz2P050i5IjB6Zbf1WGwdoEilqtkY=; b=ZQgN7qkBNveXhew6OqeHTJFnVzPFK7LSestl0RvM+WaNhZQlna67G4Z4LcwdVg029Y c2JMBGsmWJM6rsCGTzVUC9z/1kXjx7mBHytIVzasBwNN2VBLNe9SWHnwlb3vsTLYz9h6 ARoKhjNzQk8jgaoGHNcAMsdHovQeHAsAM1m42ybTkv5nvK9jFJXN2Fvaf7AwEiEFjzSO cVzxhvIJ8vNCzndvL06+C6QPxebGGHhMRJkAHM+UV+CVaabDMlgfC3u3OxTKALgDl9sS soMx1A/25+SCayeMdWPEVOj/H7IuPfWE5c8lkLbYkTaFqdOzcN1xVZA+LCagc+QLY3Py FEew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741883970; x=1742488770; 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=EBRugwqnxw4q7Phz2P050i5IjB6Zbf1WGwdoEilqtkY=; b=ZhmtVDHc892CcvBLdcxGzUzNf1/Kpv5kvt26XPjcFN8Ocw89BCOnM0/neADCl/WwZv bctvHBhs4R98QSwRuMnJkjqygJdY83wwwN8bZg/AOvUS22T/KK1sXVHRLFTy5LQwA97q VXCmyvl8Qq8OY9CJfOhuIRaqNbIgNz66wvUNXU++M/QcwihhqYtUx9ZVHcaLmWN4A6v6 Pqo3a/bFoJr9FlkWZ8NX3zBsl4G8PkMD1DSzyrhx82Nna3K9FaYYFn7xPHCikgLT96g0 qEOmHgIlmAwmszPzHw2XXhi9T7JdtjCXRCW11yRxVDDTWpD0TDNVZ6Me5Xw3F7FMXLDv cj2g== X-Forwarded-Encrypted: i=1; AJvYcCU5o+1ry0sNxGK4U2BMRlB+shMy2gqiHuLIWMDKsgA7SPcfCt++Q2+zsT9Z17MxzdpqRPI=@vger.kernel.org X-Gm-Message-State: AOJu0Yxgg9ldARVmx9nKr6M5SNXkoKj8PZ2KxKM3ktXJIK0orQB5IdFi iDFKj+UjOguTOBMm2WzkfFRLwiKv5RVChtJwByJa+xEUlBayXL89BR6HberVAjg= X-Gm-Gg: ASbGnctZDijRlkhKV3m8elgPxxqo+ML5jkzu6fw1B2lCFULlw4uZLBTDpLCbuNA3vgE rwaRFaumHsZuEY92f0uIeSYlGpSsG8HZN5265rEv7d3SDUK31cUUVl7MO7302mtZnReVMX/BQcP h1x8Z1xIwzxwLFhFrlfGpbHyuXST+9v0zPSKKHilfofsqd1dF6M0L4VNXDLr3NdmjCxfJqB51uY HsaIyBiQH3qg3YbHuPyOCWBaOCX/BbfwmICKJBNCyMgSfV3KFi6LdhRjoa817c4CZv/OVbMv1zO FO+khPPNd6ntDAafUPHIbFZ8gE/1jDqCkcLUijvEi7Y5 X-Google-Smtp-Source: AGHT+IHRyNfs/2JPL1rq+dZtoKg0Gk6ovyIhkaylwgSPQTAI/HYpqKgruBLvp53+c1fVanolW+jjbw== X-Received: by 2002:a17:90b:51d1:b0:2fe:a614:5cf7 with SMTP id 98e67ed59e1d1-3014e815c62mr251908a91.3.1741883969872; Thu, 13 Mar 2025 09:39:29 -0700 (PDT) Received: from pc.. ([38.39.164.180]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-30119265938sm4020084a91.39.2025.03.13.09.39.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 09:39:29 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Paul Durrant , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Liu Zhiwei , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Peter Xu , alex.bennee@linaro.org, manos.pitsidianakis@linaro.org, Stefano Stabellini , Paolo Bonzini , qemu-ppc@nongnu.org, Richard Henderson , kvm@vger.kernel.org, David Hildenbrand , Palmer Dabbelt , Weiwei Li , qemu-riscv@nongnu.org, Alistair Francis , Anthony PERARD , Yoshinori Sato , Daniel Henrique Barboza , Nicholas Piggin , Pierrick Bouvier Subject: [PATCH v4 16/17] system/memory: make compilation unit common Date: Thu, 13 Mar 2025 09:39:02 -0700 Message-Id: <20250313163903.1738581-17-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> References: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- system/memory.c | 17 +++++------------ system/meson.build | 2 +- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/system/memory.c b/system/memory.c index 4c829793a0a..eddd21a6cdb 100644 --- a/system/memory.c +++ b/system/memory.c @@ -353,15 +353,6 @@ static void flatview_simplify(FlatView *view) } } -static bool memory_region_big_endian(MemoryRegion *mr) -{ -#if TARGET_BIG_ENDIAN - return mr->ops->endianness != DEVICE_LITTLE_ENDIAN; -#else - return mr->ops->endianness == DEVICE_BIG_ENDIAN; -#endif -} - static void adjust_endianness(MemoryRegion *mr, uint64_t *data, MemOp op) { if ((op & MO_BSWAP) != devend_memop(mr->ops->endianness)) { @@ -563,7 +554,7 @@ static MemTxResult access_with_adjusted_size(hwaddr addr, /* FIXME: support unaligned access? */ access_size = MAX(MIN(size, access_size_max), access_size_min); access_mask = MAKE_64BIT_MASK(0, access_size * 8); - if (memory_region_big_endian(mr)) { + if (devend_big_endian(mr->ops->endianness)) { for (i = 0; i < size; i += access_size) { r |= access_fn(mr, addr + i, value, access_size, (size - access_size - i) * 8, access_mask, attrs); @@ -2584,7 +2575,8 @@ void memory_region_add_eventfd(MemoryRegion *mr, unsigned i; if (size) { - adjust_endianness(mr, &mrfd.data, size_memop(size) | MO_TE); + MemOp mop = (target_words_bigendian() ? MO_BE : MO_LE) | size_memop(size); + adjust_endianness(mr, &mrfd.data, mop); } memory_region_transaction_begin(); for (i = 0; i < mr->ioeventfd_nb; ++i) { @@ -2619,7 +2611,8 @@ void memory_region_del_eventfd(MemoryRegion *mr, unsigned i; if (size) { - adjust_endianness(mr, &mrfd.data, size_memop(size) | MO_TE); + MemOp mop = (target_words_bigendian() ? MO_BE : MO_LE) | size_memop(size); + adjust_endianness(mr, &mrfd.data, mop); } memory_region_transaction_begin(); for (i = 0; i < mr->ioeventfd_nb; ++i) { diff --git a/system/meson.build b/system/meson.build index bd82ef132e7..4f44b78df31 100644 --- a/system/meson.build +++ b/system/meson.build @@ -2,7 +2,6 @@ specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: [files( 'arch_init.c', 'ioport.c', 'globals-target.c', - 'memory.c', )]) system_ss.add(files( @@ -15,6 +14,7 @@ system_ss.add(files( 'dma-helpers.c', 'globals.c', 'memory_mapping.c', + 'memory.c', 'physmem.c', 'qdev-monitor.c', 'qtest.c', From patchwork Thu Mar 13 16:39:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 14015455 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80C3626AA84 for ; Thu, 13 Mar 2025 16:39:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883973; cv=none; b=H3Aa4wozQBHe6eQ8Am4GVgsiPWi1SoI0Ysw9x7Dp4gTlflpEa89dGLMdJ3EMXCy4zuPWfoHfH/UEy8ROV00rMgn62xcXh16+c0J6HTmBjU0HezM1hXbRFE5yqfshRc5Ixpfom8e61gqdjxfVWYJba8rPsDwXO+Fq/7yq0sx9Zu8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741883973; c=relaxed/simple; bh=8cc5k/dBJ8A5yXdLs7/Et5ghEBM8BXgwEWxHnVDm94A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nlIb8//Vb+9WALXfeGDgxe/FOJ8LFqQm/e/4tW+PxbfOK8ghFMcmTyi8Mu4pqJE27t/XJmQr2cITnGmwR9+E5MspW1YOEtmytcNvlWaOUVhpZc2cSOkynvy6bsNn/gvcbs48xwkNIeqpYEqNiGRIh+j1RzfuOFEb4do3pmqSHJI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=FoMxmgg0; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="FoMxmgg0" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-223fd89d036so26176715ad.1 for ; Thu, 13 Mar 2025 09:39:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741883971; x=1742488771; darn=vger.kernel.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=pdsNHldr91xnqdGHk1DTLXuYnmkD/cCe/HKmA2EoKL4=; b=FoMxmgg0Y61b0vfXL6BoCPEi7Pm0K8qEhuiJVod8DztrLMUVt7GfqE+F0Rq0gvvmwo ZyQXaPICzHCzqIA+rJdrT1ZSaY7qOMYksrAnE2hpVV8kbQtULbbfmKzYaxAtBmy1TLkh uMyAY3PeSwtJO+fXSeYnUVQxebGoSD4aBkP0O8HSD05mHMQex2iPc6M45DWIEWzZ6WXK nLovmM/JiODOw2wXbM7MqPUcIDE6zYOrBWsQPyIY91vzjJJL5BTGk3wh9Hbm92jWyECc +8GGTYP4SRgI8smZwQQ9nvT4Xg2QgWgpPHo2cQBrvCL/OW9F7G2VYItMe5GETdnz/tmU YDRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741883971; x=1742488771; 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=pdsNHldr91xnqdGHk1DTLXuYnmkD/cCe/HKmA2EoKL4=; b=ppjwQBQqraXdbTNKW/5FAp3b1yJUH1rpHJZ4NlCatWYOyitzoXTPM2jGpDD+GkU86r VAGd3NnEKd/o8m7ebiFKy7qh1yXEXkf+aOTmqH8eCR7tAlVyoJhg7i8WpiOOIwhksiqY r7NyPMuIjsEHjQr9MnA3kjk7n1+pyMLETsWqhtUkcbzP5/XeBiesSIEdPxwM2caQX0xh B3srgqaeG/ilNxaHT1QVosTqoUpKgOjib/4nMJ+7a4F1nJKWjzPGzAz/BEUI2DUTUpiW rxfIY3aMxBispWPMW+SExLuz6lV6AAJU6Kb9ZCZ+VjTVOCt/o/cgkxEJzT8KMHUGtBTW Anlg== X-Forwarded-Encrypted: i=1; AJvYcCW+aWabrt0Pb9em1YR0gXhiW7cVthPt8sYFXq5hWypgi3yfC1TulJx0TddLpm8xsIqOBoc=@vger.kernel.org X-Gm-Message-State: AOJu0YyNK1TBbZ3IPo0AH7Sx4KcKSmYP5nhFrh/h56mPxJ5urs2S44vy u5Y6i9+QqO00YbnrDNHm7YS7d0RZ352UsiXUhB1mF7Wli8iKetgvy4j6VwxAzIU= X-Gm-Gg: ASbGncvhUu/X0Q7yOS8U3s5fyP1l72TWtS4MVBMwGS0DefyaEnKE+ATvRCT+Y0+S0Mb aUqsdwvbE2ykSFWv1yNFF5o/zqS2hq0B/M1XJd1Es/kyJyCQpFVz1O19uYYP/iTK98u+TWwk/hb uOXGkw+VKcguz7AgOpNQsVm5rR8NWOKgg+5NFcUlCaw52i695HR8zthqcKKV1DY5Kye3q/VvNCU oSpa6LeL9uRobdFz6JNKoYL7LFWLFcwYf3jW896bveUAm7jlrCkPjarfP7obmbacf0jlPFLhMWv 828wywkIZBaX284f22yC5HQwQwlGT41ScEhg02N0+ES6 X-Google-Smtp-Source: AGHT+IGwkoEmUkadWWuwDPp5K+cQQMib7Zg2jJHfpZBwTIoZ4S09vzdl8DeRv7aJJJyLYJnLE9fiwQ== X-Received: by 2002:a17:90a:d604:b0:2f9:cf97:56ac with SMTP id 98e67ed59e1d1-3014e735345mr385635a91.0.1741883970945; Thu, 13 Mar 2025 09:39:30 -0700 (PDT) Received: from pc.. ([38.39.164.180]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-30119265938sm4020084a91.39.2025.03.13.09.39.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 09:39:30 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Paul Durrant , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , Liu Zhiwei , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Peter Xu , alex.bennee@linaro.org, manos.pitsidianakis@linaro.org, Stefano Stabellini , Paolo Bonzini , qemu-ppc@nongnu.org, Richard Henderson , kvm@vger.kernel.org, David Hildenbrand , Palmer Dabbelt , Weiwei Li , qemu-riscv@nongnu.org, Alistair Francis , Anthony PERARD , Yoshinori Sato , Daniel Henrique Barboza , Nicholas Piggin , Pierrick Bouvier Subject: [PATCH v4 17/17] system/ioport: make compilation unit common Date: Thu, 13 Mar 2025 09:39:03 -0700 Message-Id: <20250313163903.1738581-18-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> References: <20250313163903.1738581-1-pierrick.bouvier@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- system/ioport.c | 1 - system/meson.build | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/system/ioport.c b/system/ioport.c index 55c2a752396..89daae9d602 100644 --- a/system/ioport.c +++ b/system/ioport.c @@ -26,7 +26,6 @@ */ #include "qemu/osdep.h" -#include "cpu.h" #include "exec/ioport.h" #include "exec/memory.h" #include "exec/address-spaces.h" diff --git a/system/meson.build b/system/meson.build index 4f44b78df31..063301c3ad0 100644 --- a/system/meson.build +++ b/system/meson.build @@ -1,6 +1,5 @@ specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: [files( 'arch_init.c', - 'ioport.c', 'globals-target.c', )]) @@ -13,6 +12,7 @@ system_ss.add(files( 'dirtylimit.c', 'dma-helpers.c', 'globals.c', + 'ioport.c', 'memory_mapping.c', 'memory.c', 'physmem.c',