From patchwork Wed Jun 5 17:22:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 801615 Delivered-To: patch@linaro.org Received: by 2002:adf:cf0e:0:b0:35b:5a80:51b4 with SMTP id o14csp550476wrj; Wed, 5 Jun 2024 10:25:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWvHqTPwxwMnnwG2E05zDWEpxzBxxRpsUB0DDccktgDDJY6tZbJweuDWQ289WlwO1/N2/+l4HZJZZ0ovs5oXhMv X-Google-Smtp-Source: AGHT+IGsjkCx6PB+hToLXTCAZtx/fQjr8Q9+U43r07lAQ7qR8pwlLQySaEHyAbRLXCel6fePwnPG X-Received: by 2002:a05:6214:5787:b0:6af:230d:54c5 with SMTP id 6a1803df08f44-6b02bf1ce1cmr28133306d6.26.1717608329127; Wed, 05 Jun 2024 10:25:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1717608329; cv=none; d=google.com; s=arc-20160816; b=MpcQMpdCrdRvJ7rVomQHklnwKwkBPwAHp5VEouP/vMNlePTkx/VZxOuC+PXaBnNqUI yX3J+FdDb5Sc0kNX9sFxmEfRpT0Hg6kEuneU2S0ZUyrsSJViEp9g8TP3v+2AVCfdhj+Q yONKD+EI2EjbExzfF1gjVxKO12NnNkH6KMpqp3tXKdRwy3WSmdn6ClPuJ2JRQv+4x6Aj uNw8q4T6Y11fdNXPMM5EqPXRoJJbie6y19BVvtWsPz2m+WhU6rjWu0t5IBJghmTVNR/v CmwwUzfYw284xe26udg0Zqsq108Rl0apy1TAeyJ6e0bcr0yfqtd8GfFW8rDyVXGsvLcN bzYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lGzoPsZRmPScWxThSjP+3q3DF2qUkZ0NxX72PayX2e8=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=TI+Mg8AcHRCadkt7LPUqjdsJkjegwFaORhbAfNtKvBP/+bA+pdiCUTHQioa+mmu0eW JISMj6s1vcogzCUMOmV8RKagcqhZdHzMMSfaxIswn5QqvlvUbj4PMawvjTL0ttuX0v8w nrfAcZGwZLzqANWFnVfBtCGYZgPtyM9iXEy0s2TN+B8KBsEaQbs2mw0ZpWtu+KiVMIRS 6no1lYS33jlZ/2BKMHhCSiefXYdG0IUpBZNVeq/c3Q901WfMrROvLVtGnVsylBBHz+Js +jnEGK8JQDNj/I7xdoFrc0pUDkbUx1PJWkkEYrWBRxSMKCDT6lTSGyMnSXnQt4M/00K3 h8iQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oRpW+Wo9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4b41532fsi140606236d6.358.2024.06.05.10.25.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Jun 2024 10:25:29 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oRpW+Wo9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEuMH-0006ET-0k; Wed, 05 Jun 2024 13:23:33 -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 1sEuMF-0006DB-IX for qemu-devel@nongnu.org; Wed, 05 Jun 2024 13:23:31 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEuMD-0003xq-TW for qemu-devel@nongnu.org; Wed, 05 Jun 2024 13:23:31 -0400 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-2c2283707b3so66376a91.0 for ; Wed, 05 Jun 2024 10:23:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717608208; x=1718213008; 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=lGzoPsZRmPScWxThSjP+3q3DF2qUkZ0NxX72PayX2e8=; b=oRpW+Wo9hLQi+ETHYrA8fXx/FtHwknvZhwey0OFpd8s9mcByheYx6BIiXHBexDDrCl 1Gfj3QwZfIq+PoIvUxz0XKoZKLoxJXTpurtufOHYkveZSsfo/Jt0v90SDBXwdxlb21Vd SgHFg/973KcRHo3cWAwqpxOPJjV9gD+3x1cli0TUHuR5tRjsSe7JKxdyPkxcSPB6jdNt oVxF/lTo4s+8c8p6aJbjS5317aInSMQGQSkQBPZAlrkn57DrTP0jjmjb91bPtaL+7z9F YVlmdTH1LpiLYCBh5/ukZBumAFMwj0dxBe0hhvZznnbT3ckGEEqVOMLwQ3VjjWcicanO jQrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717608208; x=1718213008; 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=lGzoPsZRmPScWxThSjP+3q3DF2qUkZ0NxX72PayX2e8=; b=XdE6HENNTN+J8e464ZLfuTrtBClmvskzjnd7xiD5yCNMVQQ5yAGS+4fBDr6HIVIwCs VszY3StedUVoYFO0KWqGf5uVdn3eRCAhHDs9JIuFj8WBWspShuXnkDAlrlog/wThbcXe LUxTKUdnQanNd7VN7qBhP4O0522bEFNxn4y131rJCP05S1U6RXD1s7+3p9+U0dmei5Vb DmkgpivzFY/vgHZvQACqeZiWTuLw+G5FIPAhzmRHpH2SKtXh57pdZ1Ux4kSSM324EF1V 75YPi2rFDSq6ys88TZPn8/JFthdNWMQrDrg7qJqmd0tqTYEGFdFgwUMal+Am7cbcIe4p qtkw== X-Gm-Message-State: AOJu0Yw50avAkBRhlmPzzhRCZJ31RdFmbTNLaLNqxOYciE5RGBDI2KYt U9cMrRwOcrO2QI8DTgA5xDypjzqjBNAYCquOC5sNmQbK7Ynm689Rss6YQG/SOr5fYvwRD11O7oV 4 X-Received: by 2002:a17:90a:a10a:b0:2c1:9cd4:665b with SMTP id 98e67ed59e1d1-2c27db22aa5mr2991865a91.28.1717608208555; Wed, 05 Jun 2024 10:23:28 -0700 (PDT) Received: from stoup.. ([71.212.132.216]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c28066d511sm1720915a91.9.2024.06.05.10.23.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 10:23:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 36/38] target/sparc: Implement MWAIT Date: Wed, 5 Jun 2024 10:22:51 -0700 Message-Id: <20240605172253.356302-37-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240605172253.356302-1-richard.henderson@linaro.org> References: <20240605172253.356302-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/sparc/insns.decode | 1 + target/sparc/translate.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index a7720560f8..fbcb4f7aef 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -124,6 +124,7 @@ CALL 01 i:s30 WRTICK_CMPR 10 10111 110000 ..... . ............. @n_r_ri WRSTICK 10 11000 110000 ..... . ............. @n_r_ri WRSTICK_CMPR 10 11001 110000 ..... . ............. @n_r_ri + WRMWAIT 10 11100 110000 ..... . ............. @n_r_ri ] # Before v8, rs1==0 was WRY, and the rest executed as nop. [ diff --git a/target/sparc/translate.c b/target/sparc/translate.c index b10936a61a..6d0ad38fd5 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -3344,6 +3344,17 @@ static void do_wrpowerdown(DisasContext *dc, TCGv src) TRANS(WRPOWERDOWN, POWERDOWN, do_wr_special, a, supervisor(dc), do_wrpowerdown) +static void do_wrmwait(DisasContext *dc, TCGv src) +{ + /* + * TODO: This is a stub version of mwait, which merely recognizes + * interrupts immediately and does not wait. + */ + dc->base.is_jmp = DISAS_EXIT; +} + +TRANS(WRMWAIT, VIS4, do_wr_special, a, true, do_wrmwait) + static void do_wrpsr(DisasContext *dc, TCGv src) { gen_helper_wrpsr(tcg_env, src);