From patchwork Thu Sep 16 15:29:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 512944 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp1327552jao; Thu, 16 Sep 2021 08:37:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNlziXXndAyB4XSdQuFX2BTjRN6IUOjtfNH08cxnB9uqKKTTqD7LvwmTduy7IVLwa+V0YH X-Received: by 2002:ac8:5941:: with SMTP id 1mr5535404qtz.1.1631806631939; Thu, 16 Sep 2021 08:37:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631806631; cv=none; d=google.com; s=arc-20160816; b=O4LaRRSReS8akSXEWW3P4EA/lKJn5/7mP9gsvfXVILzYLVEx9IUhgdeIcbVfovEBEh 75bEdEEQ3D3T/HKobAokrQmH8Rhhg3+lTr34PeNe4ICj1GKNMxwVErYKcoWqrb4JV5Ni KGVeD24jbINhINL3j6YCodiPx8lnH8RpXy5NWf/BTbv73GsNzUz7KS6NtA8pnuoDp1Pz 9qRsjkudYMm+PT+WoYUZ839/7dgHEfY8HYSYpP8TAaUC2OhCEZipkGpr2l0RIBv0XRI9 pFFrHZc8rP4cq0Syg7Oiy7Zr9DIL8nDkd4B2TmbL+jSevGygLvhiiUkUSY+Fe/OhmSIh pMlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=/b65paiPCJASFJfCtunYkpNY6XJIYqckezX/cCSvcrY=; b=OQ9JNE1b4hHAz0OFf38hj+bUtlHz4LCzDt2+nBu19MZop6lJFcoSPXBmwPHJf48Xhw NKfwcLpVJMBWHlZw5BKHb6Gx4vPHJr9iBhc8eJpCOyINtY7wllSer8SBjNcxgdmzBz/3 NSI2l90ZED6ldDqoVhpV3rsnZY8rrPPe2F6+g8BekCCrigo2SmFZYeyJstwNDL+zKA3w dRL4Gvd6XlorVSD9IyoGWoJyXqwaQXse3saYXvJSBVw9RmKsAZPPbVTw1bwcpm9XwM25 2tXKcGc7XHVdmewfEfvWPgMjfFtdDge+H5rNjFaF+GCjTuJfur+6nTbDt3JjUlnEkFFP JZ8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eQCOAoqW; 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 128si1834986qkd.264.2021.09.16.08.37.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 Sep 2021 08:37:11 -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=eQCOAoqW; 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]:45656 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQtRn-0000wU-F1 for patch@linaro.org; Thu, 16 Sep 2021 11:37:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQtLP-0001Dv-4R for qemu-devel@nongnu.org; Thu, 16 Sep 2021 11:30:35 -0400 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]:40875) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mQtLK-0002Ml-IA for qemu-devel@nongnu.org; Thu, 16 Sep 2021 11:30:32 -0400 Received: by mail-pj1-x1034.google.com with SMTP id n13-20020a17090a4e0d00b0017946980d8dso7791040pjh.5 for ; Thu, 16 Sep 2021 08:30:29 -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=/b65paiPCJASFJfCtunYkpNY6XJIYqckezX/cCSvcrY=; b=eQCOAoqWDMQN3xZsEWy9jOI8Eeir3e/tkrzegQWiRoWuEXfMhCO6K681BVoFe/di58 7ejKDnxDGWZeAfY5DVW0K6Y3rtFiv0MxMNvl2+SR5ZCiTDp0vlcaNRUvSPiIsbj6osps uLmbArvdm+H7lmFVZJiGEN4Wz+2zNEX6TVres+uBlj9oMCwB7u2fzLWp69P4J6O+QSST Y8mAJtljl9D0Pe2aUWAcKqbK3difRqarnFLGGX4QSnKlVTYCfpUfY8vXa+zVlk2SybsJ 6SmZ2pL+nJelKpnYnV20IR9raE/wvADCjaFFNuQq7QLerDkPKdwU1TEH/SLmfSzLBaV2 DA5A== 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=/b65paiPCJASFJfCtunYkpNY6XJIYqckezX/cCSvcrY=; b=ChOKYG/8IFwMF/oyrGhTcBiEaOUtVu3S3L4MV+q15au9VdjVJHtAmlBQCHMp2sdKL8 WAnDp34WQSvyf5wKR8VlQCRN0Ta5RHe1e/goyj0qAIADIy9z5bw+1lj6RfUUed9yc4bm 8XEJqRzFPETYbg5adzXhWFEHhGnsBy5iOph9/gfG1myorSBXXcuOs5A2iRuI4WJ4D/TY MCtjcN6hxN9zmqb15Hq4CrAVcY4uZBspMfWN+9InmOB2LYRIWC4BacsWTbPukrCyr3nk TcKCclOLFu5aknCeaoH3x4sM8j8lIF1nISXwygqtQYcFuRCBOghSc93hhoyUPOmEwpsg Dqgw== X-Gm-Message-State: AOAM531xXOyFv0ieBJcfWu32VZdyJ6GrIJMnYTPHoA7d0OYJSi8ug6sj xY1GCbAO1R2y9G/BfwWKnPNILL01pbQZTQ== X-Received: by 2002:a17:90a:bb09:: with SMTP id u9mr6707819pjr.165.1631806228395; Thu, 16 Sep 2021 08:30:28 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id b7sm3779447pgs.64.2021.09.16.08.30.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Sep 2021 08:30:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 03/35] hw/core: Restrict cpu_has_work() to sysemu Date: Thu, 16 Sep 2021 08:29:53 -0700 Message-Id: <20210916153025.1944763-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210916153025.1944763-1-richard.henderson@linaro.org> References: <20210916153025.1944763-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1034.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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé cpu_has_work() is only called from system emulation code. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20210912172731.789788-3-f4bug@amsat.org> Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) -- 2.25.1 diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index bc864564ce..2bd563e221 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -538,6 +538,22 @@ enum CPUDumpFlags { void cpu_dump_state(CPUState *cpu, FILE *f, int flags); #ifndef CONFIG_USER_ONLY +/** + * cpu_has_work: + * @cpu: The vCPU to check. + * + * Checks whether the CPU has work to do. + * + * Returns: %true if the CPU has work, %false otherwise. + */ +static inline bool cpu_has_work(CPUState *cpu) +{ + CPUClass *cc = CPU_GET_CLASS(cpu); + + g_assert(cc->has_work); + return cc->has_work(cpu); +} + /** * cpu_get_phys_page_attrs_debug: * @cpu: The CPU to obtain the physical page address for. @@ -636,22 +652,6 @@ CPUState *cpu_create(const char *typename); */ const char *parse_cpu_option(const char *cpu_option); -/** - * cpu_has_work: - * @cpu: The vCPU to check. - * - * Checks whether the CPU has work to do. - * - * Returns: %true if the CPU has work, %false otherwise. - */ -static inline bool cpu_has_work(CPUState *cpu) -{ - CPUClass *cc = CPU_GET_CLASS(cpu); - - g_assert(cc->has_work); - return cc->has_work(cpu); -} - /** * qemu_cpu_is_self: * @cpu: The vCPU to check against.