From patchwork Tue Jul 5 10:59:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 587445 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:1ec:0:0:0:0 with SMTP id 12csp1658854map; Tue, 5 Jul 2022 04:22:32 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vt1uHuHY3JJEzTpZggoJVZ2r8uBpcAmucGxtT2t8cBJtDiiDd3gulOTmtRuQMYriK2N+o7 X-Received: by 2002:a81:34a:0:b0:31c:849b:a9a with SMTP id 71-20020a81034a000000b0031c849b0a9amr17831330ywd.422.1657020152288; Tue, 05 Jul 2022 04:22:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657020152; cv=none; d=google.com; s=arc-20160816; b=bqe3ZGK/YVmFp1rLzDMl+iFJ/gY2fCQ+eeVPmPQ3u9pXI4zWFMM9lAIMCYxoE7tXYD m5nguzH38E6JenOjC6wwrfMI8b6pZXObIoi5RpgA6py6kwEsjJ+mHoT/XZmkzmX55ueV KX1Ltwbm1AsLZxaduhY5uCU3nWBvoQCLl586gY1ZhFXEGZB5KRPY3a8UOcCp7HIJiyb6 RwfpkZixKBpJVGC/l31WnYmZRxg7Rxa+y/Lxras4JsmjEAWP8PbOGjezcCHOEs1i1Mr/ avIXYSzTXmIbl7HrzM1yMYaNX4vNSmFxZ2RSRs12jkPJ4SdqHx5sqhGXqdLtL5gA6mRW 7BHA== 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=z9HYnLroahrDAazMWts4PSFEzXJdvqtXFJupFoU2vN8=; b=jf6OO7UJVMRxFAFGcpg1/woe9mOKCdhba+0tUepoTmSNjFki5uuGKM07ALFL2AGHMo quPuTrfKKsYgW6kj980EyvdWFFxe0tYNxMzKMMRvcW6Nub0EJVFB7L3LA2ZmG8pZXGi7 KCLx0CrwB7CZAZCJmSkZ9VCezzyTJkGSD7TRIpCXY5bnpI/SNVvjsoVEr5tAwgcxrpmB hsgWwwqff8U6YUhxw14gfrIyD7N3EDKuF9MtYAoM7EoUXVwTcdblecaeymxlhtISqquE 6ilZ2FgNl/5iTLJB9WKCrf+NgEZxgn6wr5AYcUF5/Qo2QwRJc63zZczg8TYW8HI7rjfK LRXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dmooeY8o; 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 141-20020a811993000000b0031ca5d3e9ddsi6397261ywz.366.2022.07.05.04.22.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Jul 2022 04:22:32 -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=dmooeY8o; 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]:39330 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o8gdT-00043z-Pe for patch@linaro.org; Tue, 05 Jul 2022 07:22:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40306) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8gI6-0006wB-TR for qemu-devel@nongnu.org; Tue, 05 Jul 2022 07:00:26 -0400 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]:39682) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o8gHq-0000gQ-Uf for qemu-devel@nongnu.org; Tue, 05 Jul 2022 07:00:16 -0400 Received: by mail-pg1-x533.google.com with SMTP id q82so3900570pgq.6 for ; Tue, 05 Jul 2022 04:00:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=z9HYnLroahrDAazMWts4PSFEzXJdvqtXFJupFoU2vN8=; b=dmooeY8oKJC/tJFBYkHpFo2ZVveFReLyXeuP5A2o5EkB7uwFfta93HEVsZzB3GN+5k bCA4IAJWKuSntcy4eqi1x+PHNtXhkpvQSSNO+a8mD3lfJFLW0Hk0m7f0w2TjY7a+xb4J BKkagPj9MbXxfNeCCV1z90k7/m7B36yrRTj7fbBRReIQAj0JtJepnhXksnwyozFw4FsP +AvPxGhCSDaOmGkxfzk1vqsziiuKxbEIMgnGNIUftqeoqHL82D/GnWXcluA8mD67radq r0QhEm0Po3ri4KBXp5rGmAxJikxzR/rgKaKc1CQdVQTekMWZPY7f30GA7NG3g2QZK7Pn YiIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=z9HYnLroahrDAazMWts4PSFEzXJdvqtXFJupFoU2vN8=; b=NBpDRYNQ3srUD1NcE8tsenzbYo5r2ON8jyzfElLDDd68AirNauaj/xhTBz9hVa/Clw trxScUrEe7S/JYNHDwnwQiEn5SL+ONNvoEyQPm8DJ+BP0y1Dk+aAdBiES+29ZAYgmtWE 9aHjOwoTPTZ/0tPLPblgZWAOYlHEwsi++PZ1AVk+12X34nvU0WzlnX7MPOpRt21xptYr luMU6n0ah+os0xuav2EDfYsXUfWBhp+EovO/bQ3NIeRBMNHJPZJOD15/2VcaNC1uSwp7 iZQedLJ0hdZui60yaritG/GlbYywOLRotkA0OoCs9U358WPJA0Jeflh0K3h2bgtzXZTj tyRg== X-Gm-Message-State: AJIora9z6sYm8ev7VO8EpjLUqJ0GNLEjPi7TuECCzfEMozxrEfuM2/bt UXNX3XkQvmuxitcMPA1HU+qo6+Xn0fQyMbqw X-Received: by 2002:a62:542:0:b0:525:a313:fe28 with SMTP id 63-20020a620542000000b00525a313fe28mr41719723pff.73.1657018809463; Tue, 05 Jul 2022 04:00:09 -0700 (PDT) Received: from stoup.. ([122.255.60.245]) by smtp.gmail.com with ESMTPSA id d18-20020a170903231200b0016bf7981d0bsm508454plh.86.2022.07.05.04.00.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jul 2022 04:00:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Song Gao Subject: [PULL 2/6] target/loongarch: Clean up tlb when cpu reset Date: Tue, 5 Jul 2022 16:29:53 +0530 Message-Id: <20220705105957.1144514-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220705105957.1144514-1-richard.henderson@linaro.org> References: <20220705105957.1144514-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::533; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x533.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" From: Song Gao We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- target/loongarch/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index d2d4667a34..e21715592a 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -479,6 +479,7 @@ static void loongarch_cpu_reset(DeviceState *dev) #ifndef CONFIG_USER_ONLY env->pc = 0x1c000000; + memset(env->tlb, 0, sizeof(env->tlb)); #endif restore_fp_status(env);