From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 205EEC433B4 for ; Mon, 19 Apr 2021 21:05:17 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B4115611C9 for ; Mon, 19 Apr 2021 21:05:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B4115611C9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:45620 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYb51-00014i-NU for qemu-devel@archiver.kernel.org; Mon, 19 Apr 2021 17:05:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60258) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYaIR-00085m-Te for qemu-devel@nongnu.org; Mon, 19 Apr 2021 16:15:04 -0400 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]:34646) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lYaIP-0007Ss-9F for qemu-devel@nongnu.org; Mon, 19 Apr 2021 16:15:03 -0400 Received: by mail-qk1-x734.google.com with SMTP id y136so5069927qkb.1 for ; Mon, 19 Apr 2021 13:15:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=3zPzpWstg1yBFekk7QUlkfTV1TseMXZKeyOzNPi0vhc=; b=JjuxR5Pr4rVpAW83iViJBbuYuw/sIoYn/Fij0Jg4hKc7KQ/OikQlFFgM6VtxmwveGy WcWN5SdZ/kt1YpWgW50zAursmT/GfXQoFdJ+YIbocirDQrZKJViUw/tklB/zDcbokVY7 nZHidIRQrj2F7jg6DJ/DcA0PiKG/DIqFoSxflp24aTWJ7R2WSxEvk1Pfs5XcDq5LPmMa 6PwMEaMg6qyLwpqW4CqOF6W1lshctNiODjc1PJRM+6SBJ5VNZfxJU2Ie8ycEQdMSye2O cnf1fX8NfGPB5HSTXKZUHoM2G816oCRjmoqaFXU8k0FY62BcRdZ5tn1Zbsfy39Oc9+7g df8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=3zPzpWstg1yBFekk7QUlkfTV1TseMXZKeyOzNPi0vhc=; b=INOXejFNxRI69Af1DJGcP20xGNfrwYRNa5RDNyRLw4eitpLefFaDzhKbqf9Hp7cIwC HrpAO8WvwvzPGbsJfvpEm2Ucc5r38v5K1iF5aR5ArIsg0wG8TwV2VgkCF1FbLeNt+mwn t0TwX+z0aAh1rGyD2RC+hQDi61P3Sxz2IBmwckJC5kO77f0kKAP2F1REZYP1+2SBQ92B SbRBAE76zZ9/40UV6sVl1tS6a6QRNV83VDFsRETi1VOqccoNT6H5KNX4V1OH6Nt04n33 F9lGetDG+zjwa2CLouQUBBTONyVC5fvopQ3IGRqXNnzhbZskOjvopdlnQMqeC14SoejZ EkNA== X-Gm-Message-State: AOAM533lTn49Cul5ohDyD1b6L/V7fZ91w/jKF5ljbTwxoBdvMfyCZdnk WLp59o8q6UlLAYPp69P0ElprTQ== X-Google-Smtp-Source: ABdhPJyZsbout7s/3+LbhzA31gJ0Fy6qvXYGWAHc3u1reIvio4s/2E5uMXtHdBkscNOWgbnDdS+LOw== X-Received: by 2002:a05:620a:1202:: with SMTP id u2mr12427601qkj.248.1618863299973; Mon, 19 Apr 2021 13:14:59 -0700 (PDT) Received: from ?IPv6:2607:fb90:80c7:aba4:3594:91a:8889:c77a? ([2607:fb90:80c7:aba4:3594:91a:8889:c77a]) by smtp.gmail.com with ESMTPSA id b11sm9825892qtt.5.2021.04.19.13.14.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Apr 2021 13:14:59 -0700 (PDT) Subject: Re: [PATCH v3 24/30] target/mips: Move helper_cache() to tcg/sysemu/special_helper.c To: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , qemu-devel@nongnu.org References: <20210419191823.1555482-1-f4bug@amsat.org> <20210419191823.1555482-25-f4bug@amsat.org> From: Richard Henderson Message-ID: Date: Mon, 19 Apr 2021 13:14:55 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210419191823.1555482-25-f4bug@amsat.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::734; envelope-from=richard.henderson@linaro.org; helo=mail-qk1-x734.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, NICE_REPLY_A=-0.001, 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: Aleksandar Rikalo , Huacai Chen , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 4/19/21 12:18 PM, Philippe Mathieu-Daudé wrote: > +#define STUB_HELPER(NAME, ...) \ > + static inline void gen_helper_##NAME(__VA_ARGS__) \ > + { qemu_build_not_reached(); } Does this really work when optimization is on? I suspect you need additional cleanups before you can use qemu_build_not_reached(). In particular: (1) check_cp0_enabled must return a boolean, so that the caller can avoid emitting dead code after the exception is emitted. (2) check_cp0_enabled must be adjusted to Know that cp0 access is always forbidden in user-only mode. Otherwise, I can't see how the compiler can prove that the call to gen_cache_operation, and thus gen_helper_cache, is unreachable. In the meantime, you can use g_assert_not_reached() in STUB_HELPER. With that changed, Reviewed-by: Richard Henderson r~