From patchwork Thu May 12 16:52:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sergey.fedorov@linaro.org X-Patchwork-Id: 9084371 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9C10B9F1C1 for ; Thu, 12 May 2016 16:52:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0472C2024C for ; Thu, 12 May 2016 16:52:48 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 420342022D for ; Thu, 12 May 2016 16:52:47 +0000 (UTC) Received: from localhost ([::1]:58804 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0tqw-00011V-Ei for patchwork-qemu-devel@patchwork.kernel.org; Thu, 12 May 2016 12:52:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0tqp-00010F-9n for qemu-devel@nongnu.org; Thu, 12 May 2016 12:52:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0tqk-00068r-3x for qemu-devel@nongnu.org; Thu, 12 May 2016 12:52:38 -0400 Received: from mail-lf0-x236.google.com ([2a00:1450:4010:c07::236]:33423) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0tqj-00068h-DM for qemu-devel@nongnu.org; Thu, 12 May 2016 12:52:34 -0400 Received: by mail-lf0-x236.google.com with SMTP id y84so75435731lfc.0 for ; Thu, 12 May 2016 09:52:32 -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; bh=vMx3X+4dqrZwgICu6N1apNlm2q59CW5m8Xtt6PiczsA=; b=kKkeBwhB7eITdTv7QD3/FO9QqOMf2roFLVqiejA+nhOg+d80UrYidWOd299Wn55FK9 oX/8lwFyTqnVk2hMpYkELO9bIKPRqArgZ1na6pLnvQ7lfTyr8VIkTpdh/tFu0OQs2g78 QPA7/SNNzx0pTpj6AEYtj0SWwbma2T9GiOGFs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=vMx3X+4dqrZwgICu6N1apNlm2q59CW5m8Xtt6PiczsA=; b=CpK2djb0ac8piK4njW5/00oUvrDqohxEkpW3Ue36plZTc/SlwRaQt2nK5FgG9OP48C osqwlmX+pX6ugpFt/hYACUla/EC4WiWYwd3CRrTN6mL3gncGKm4FMpTnp8tK756BFjLF cz4TLYICBMJuBikrl9RTjT9qvbfdhr2koYFQubpSfhLxkNM25+bTzQM8x7pG6xjuYWqy UKX/+zHy8NUnoJvT5f13hnxy+dhDkW8QFWsNXc04tIurEe7XfuR1MN6l1nUFtLUfDb// sczO6i5wZL0eMjimCTNNVsYYCqpT6+SVv75ZjbS0EbTFkOVK4cJMEGEmWDBRFoz/RY7W +Wxw== X-Gm-Message-State: AOPr4FXhEURHtTf5AOUeX5+CiHminy9XT2esOpRBS8HRp1BJQCXIh3lPNut7XI84ZOhfQE7u X-Received: by 10.25.41.131 with SMTP id p125mr5014900lfp.32.1463071952053; Thu, 12 May 2016 09:52:32 -0700 (PDT) Received: from sergey-laptop.Dlink (broadband-46-188-121-115.2com.net. [46.188.121.115]) by smtp.gmail.com with ESMTPSA id l10sm2248182lbw.38.2016.05.12.09.52.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 May 2016 09:52:31 -0700 (PDT) From: Sergey Fedorov To: qemu-devel@nongnu.org Date: Thu, 12 May 2016 19:52:17 +0300 Message-Id: <1463071937-26607-1-git-send-email-sergey.fedorov@linaro.org> X-Mailer: git-send-email 1.9.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::236 Subject: [Qemu-devel] [PATCH v2] cpu-exec: Clean up 'interrupt_request' reloading in cpu_handle_interrupt() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sergey Fedorov , Richard Henderson , Peter Crosthwaite , Sergey Fedorov , Paolo Bonzini Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sergey Fedorov Suggested-by: Richard Henderson Signed-off-by: Sergey Fedorov Signed-off-by: Sergey Fedorov Reviewed-by: Richard Henderson --- This patch applies on top of commit: 40ae3669fb55 ("cpu-exec: Remove unused 'x86_cpu' and 'env' from cpu_exec()") from: git://github.com/rth7680/qemu.git tcg-next Changes in v2: * Reload only when target hook called cpu-exec.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cpu-exec.c b/cpu-exec.c index 0ea47e997dfa..14df1aacf42a 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -488,10 +488,11 @@ static inline void cpu_handle_interrupt(CPUState *cpu, if (cc->cpu_exec_interrupt(cpu, interrupt_request)) { *last_tb = NULL; } + /* The target hook may have updated the 'cpu->interrupt_request'; + * reload the 'interrupt_request' value */ + interrupt_request = cpu->interrupt_request; } - /* Don't use the cached interrupt_request value, - do_interrupt may have updated the EXITTB flag. */ - if (cpu->interrupt_request & CPU_INTERRUPT_EXITTB) { + if (interrupt_request & CPU_INTERRUPT_EXITTB) { cpu->interrupt_request &= ~CPU_INTERRUPT_EXITTB; /* ensure that no TB jump will be modified as the program flow was changed */