From patchwork Thu Oct 3 23:42:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 832441 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp529294wra; Thu, 3 Oct 2024 16:44:41 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXbJbIUQVneRzQc3m3ILpgS1pDccPnBNfsA7Ie7W27tdi9FOF6dLXnF1Pu94nqvSfGZGv1qAQ==@linaro.org X-Google-Smtp-Source: AGHT+IEun5SHc3bcIFC89H4DhiqUSTcYfzkMAgUhrIFkuuVaWH8QypWNWubKqtTwhn4DfTF5oR3q X-Received: by 2002:a05:6214:3d8b:b0:6cb:8344:fabb with SMTP id 6a1803df08f44-6cb9a32ec17mr17761326d6.1.1727999081289; Thu, 03 Oct 2024 16:44:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727999081; cv=none; d=google.com; s=arc-20240605; b=dfZ9nlhIN1+175Vo2Vo5pYcpvrLZMSi6Fe2lFDGiCzC4yqO+xQ4+Tkbr5R3b2PKswJ fLTHvTTFausWOJCsEHRNti41PluqWmOKmZAmyktUDsdlU0iXHPqoj0vGTAHt7Z3UoaZq h3sOkqC2F5cRm1OwchCu2Oh1nWzMLw2Z6zoNskpRo0XDGbUdYB/9eI18AgZTf1D/NaHC iaTAPOghOAgT/Eld9pqMrbZKLRVKIM3dkExlXTEWdo4zDSvbtGy2bty7v8vfJgvqybfO z/tP8ZqDeWVOJQgafcBaYkdju79I3IqHdpVLp91CBQ8Ow503i+6Vz4nFjcW2ktHPGWX4 U9FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Dm59hqKIZ3uzww+6ZScIPbWn9/eLWxkBAfjg6zYFCG8=; fh=nW81HitAWvlF9bIdfU4jFbnEE30qf0mnop6z+LPTekQ=; b=Y5TURVSA8kbhqPLqbMpjl5JU72hqx41Be2BQmQwdj+hfcJVh5Wsn/48u0iXZZ3jNf0 1PXNDBP9fvzocY+Wf3DP31k/ghijyvJUw8DgNqH7cIyEc+obNh3JoMNpVOwvOVQL/cUN UjDf/pSAMtdbVP3hLG2p1+ZGiwkHI5Q5ZOaWAZcnxdaumGKrHztUAmSdU+naNHXBOOqB m2x9aQgvggaCBWLW/FJIGg5RY4RsW6Vmd1N7LWyR3N1FZ0dxi8HtR0daA8qCgYkIbXZk VJ0QiSp3+u8ZwSgsMzY+VOpaJwnjx01PvwJKsKlI0iICmtT1h+3xn6dHbqAzmlQn7sUZ oD8Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S+J5E5yR; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6cb9382e6e2si24735186d6.359.2024.10.03.16.44.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Oct 2024 16:44:41 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S+J5E5yR; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1swVUC-0000h3-A7; Thu, 03 Oct 2024 19:43:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1swVTx-00089M-FG for qemu-devel@nongnu.org; Thu, 03 Oct 2024 19:43:43 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swVTv-00041m-72 for qemu-devel@nongnu.org; Thu, 03 Oct 2024 19:43:41 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-42cb1e623d1so15019635e9.0 for ; Thu, 03 Oct 2024 16:43:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727999017; x=1728603817; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Dm59hqKIZ3uzww+6ZScIPbWn9/eLWxkBAfjg6zYFCG8=; b=S+J5E5yRZoIaqLAUjiDxVj5kMIPOp7qQ/qzaQGFXgAsuyp0W/8OH3NZFi+7aKdYepq FCH0x/7UcwKRDLKIxSw22HUaKhZ1kafyHb02RKOmvr0yoJI/y1jUxT3OWIwBBZ5we+kV lMxRfyqgQo/+Cv7vM3iAvLBftKvFH07m1lKOwG5ffcqfRheaMD4chwA8GDUw3KDS1mnH xwkP0dMYy5pB88We/o1IKNJ9UGrXaSV5xbtkEpbzQ+YoK+h6ZzCFID0hw2/tm/orwacy eiWZT4LS61Fmtx8znCnzdsk9gMQ4s+HvxzfkoIa16Y4n1KVkgbILs//zgVNtXLyQmX2W ITdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727999017; x=1728603817; 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=Dm59hqKIZ3uzww+6ZScIPbWn9/eLWxkBAfjg6zYFCG8=; b=l/FzdmRU7kfDATcdTODZrF8MXqBW3FY0TUM5txQoNv3Q6sfMFwmxHI20smBMk5GocV S9Eyiot0Er84O/gHlQyba6blcs5JQb0N514YOEkI5Pmt9k3QztV0ig2g6u62X8PkmXM/ QQH3diFqy5A7t9Vq1RxKbP2mQ/kwzxjpGoksN4jdYaBWd1wBvW8KjE+hQDDDEY2WZEeg o32jcUPiKEER4D1eVjpq97nM15mbneqvE+wS7y/aMO7LOttFhBNxK2KSgwd89mMjuGDL FGD4Ou4vc0oqgH4JIxvJTRdfoPWRmFONwjRMsvEKgASmhcQFHC/KzUAv3rQqmlZY14KM tnZg== X-Gm-Message-State: AOJu0Yzx04WFC9JVsoM4w5LTIjlAuQvIYEVyi36SfxRL41J4yXj/uMBn DOrIfCqp/gkYYOEjcr7De+hPImz1LblVtbIQxmvVmFDq8P4zZC5eo9mE5yo2Lm9hAYjfQRKO+1Y 2LsY= X-Received: by 2002:a05:600c:3541:b0:42c:e0da:f155 with SMTP id 5b1f17b1804b1-42f85aa6f3bmr4490165e9.11.1727999017259; Thu, 03 Oct 2024 16:43:37 -0700 (PDT) Received: from localhost.localdomain (45.red-88-29-191.dynamicip.rima-tde.net. [88.29.191.45]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d081f7464sm2170287f8f.12.2024.10.03.16.43.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Oct 2024 16:43:35 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Michael Rolnik , Halil Pasic , Christian Borntraeger , Mark Cave-Ayland , Frederic Konrad , Artyom Tarasenko , Matthew Rosato , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , David Hildenbrand , Peter Xu , Ilya Leoshkevich , Song Gao , Thomas Huth , Marcel Apfelbaum , Eduardo Habkost , qemu-s390x@nongnu.org, Laurent Vivier , Eric Farman , =?utf-8?q?Cl=C3=A9ment_Chigot?= , Paolo Bonzini , "Michael S. Tsirkin" , Thomas Huth , Bastian Koppelmann , Richard Henderson , Pierrick Bouvier Subject: [PATCH 10/16] target/s390x: Use explicit big-endian LD/ST API Date: Fri, 4 Oct 2024 01:42:05 +0200 Message-ID: <20241003234211.53644-11-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241003234211.53644-1-philmd@linaro.org> References: <20241003234211.53644-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The S390 architecture uses big endianness. Directly use the big-endian LD/ST API. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- target/s390x/gdbstub.c | 4 ++-- target/s390x/ioinst.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/target/s390x/gdbstub.c b/target/s390x/gdbstub.c index a9f4eb92adf..f346208f79d 100644 --- a/target/s390x/gdbstub.c +++ b/target/s390x/gdbstub.c @@ -88,7 +88,7 @@ static int cpu_write_ac_reg(CPUState *cs, uint8_t *mem_buf, int n) switch (n) { case S390_A0_REGNUM ... S390_A15_REGNUM: - env->aregs[n] = ldl_p(mem_buf); + env->aregs[n] = ldl_be_p(mem_buf); cpu_synchronize_post_init(env_cpu(env)); return 4; default: @@ -123,7 +123,7 @@ static int cpu_write_fp_reg(CPUState *cs, uint8_t *mem_buf, int n) switch (n) { case S390_FPC_REGNUM: - env->fpc = ldl_p(mem_buf); + env->fpc = ldl_be_p(mem_buf); return 4; case S390_F0_REGNUM ... S390_F15_REGNUM: *get_freg(env, n - S390_F0_REGNUM) = ldtul_p(mem_buf); diff --git a/target/s390x/ioinst.c b/target/s390x/ioinst.c index bbe45a497a8..a944f16c254 100644 --- a/target/s390x/ioinst.c +++ b/target/s390x/ioinst.c @@ -603,7 +603,7 @@ static int chsc_sei_nt2_have_event(void) #define CHSC_SEI_NT2 (1ULL << 61) static void ioinst_handle_chsc_sei(ChscReq *req, ChscResp *res) { - uint64_t selection_mask = ldq_p(&req->param1); + uint64_t selection_mask = ldq_be_p(&req->param1); uint8_t *res_flags = (uint8_t *)res->data; int have_event = 0; int have_more = 0;