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=-14.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 5DC9AC433EF for ; Mon, 13 Sep 2021 14:22:32 +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 0763660C51 for ; Mon, 13 Sep 2021 14:22:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0763660C51 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:54136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mPmqs-0007S1-M9 for qemu-devel@archiver.kernel.org; Mon, 13 Sep 2021 10:22:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPmBF-0006it-NA for qemu-devel@nongnu.org; Mon, 13 Sep 2021 09:39:29 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]:44996) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mPmBD-0001rX-K9 for qemu-devel@nongnu.org; Mon, 13 Sep 2021 09:39:29 -0400 Received: by mail-pf1-x42e.google.com with SMTP id v123so8845697pfb.11 for ; Mon, 13 Sep 2021 06:39:27 -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=oBGlz/XZ0g2AF1bkdUcJt8PrhgnflsQV7r4zoJ62DjU=; b=yh+ChAK/xrRnDjFYFlhYJYCMkWF5W+aP40hWjz4YyILltCFEa5PMeDYEAgiGF+ist6 Hcad8QLq3iOt9/pg0hpUeH96/UUqqhIK4s1Iu2sHlNV7EMD7tc9YDM65IYltbw+/j+x1 1R467BMwGBwRPx2zxzxR8iDCJU1GvrXjypcv3bkKmyU99Bi8gFfZCIxaikOMd8koxR25 JPwaVRo1rLcNB4krGkZ8XsI289yheY69pTy9hmwXm1D9CNeWon4UZ6LbCXDqN5ReF+lG j+ghtuNSBF3W5J71MOB3naYJjcxQAy8wysKR+GZ2h4l5PynqeHCfntkk8/RqZJpoE4qD 4X1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=oBGlz/XZ0g2AF1bkdUcJt8PrhgnflsQV7r4zoJ62DjU=; b=2tu1Otw5NFS7On65E9PikUH4qXhKIhS8Zjxv+l3Iw2JH/dBRCaNLhLduva7FfPseJp TTvkA+nibsFV+BnzD3/V1eFHSJ4AGYvgThsOHT4yPmNbuiu/PTJ/GAKboD5OD4CJwyT0 roVZqF3iumO2LJDAeen9Ac6w0O2ZvEV+fIKtD1eMmlkXizl/2LxDEooh/sUCmFTyAP5L MmxhwlC8f8PFN+KtKVKmYConA0aTmY+1D7ZiVw9KP5Q+85mMeRVMy0D3ILyI9n87EshC xkcX0JFGH2K9MuFy4OwDZ3I4QAxS3i8Lmh4w/YJKH3vMkbl93oRN6TOfb69IkFtCNKQH wodg== X-Gm-Message-State: AOAM531K6g9Fk87lkg+BbdR0cFUzlBItWT1W4Mrn1M/tuwDZC08alCB1 9yB2lPxKoFzPSEssCL2tfPypyA== X-Google-Smtp-Source: ABdhPJwyb3UzJE3H2o+5MOjuYowb5FnYpDelI1Vh3iim6/zAHLXWl/6c2whZIPh1H1ByKhWAw2P6cw== X-Received: by 2002:a63:f513:: with SMTP id w19mr11000300pgh.231.1631540366015; Mon, 13 Sep 2021 06:39:26 -0700 (PDT) Received: from [192.168.1.11] ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id q2sm7074502pjo.27.2021.09.13.06.39.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Sep 2021 06:39:25 -0700 (PDT) Subject: Re: [PATCH v2 02/12] target/arm: Enforce that FPDSCR.LTPSIZE is 4 on inbound migration To: Peter Maydell , qemu-arm@nongnu.org, qemu-devel@nongnu.org References: <20210913095440.13462-1-peter.maydell@linaro.org> <20210913095440.13462-3-peter.maydell@linaro.org> From: Richard Henderson Message-ID: Date: Mon, 13 Sep 2021 06:39:24 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210913095440.13462-3-peter.maydell@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.google.com X-Spam_score_int: -40 X-Spam_score: -4.1 X-Spam_bar: ---- X-Spam_report: (-4.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=-1.969, 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: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 9/13/21 2:54 AM, Peter Maydell wrote: > Architecturally, for an M-profile CPU with the LOB feature the > LTPSIZE field in FPDSCR is always constant 4. QEMU's implementation > enforces this everywhere, except that we don't check that it is true > in incoming migration data. > > We're going to add come in gen_update_fp_context() which relies on "code" > the "always 4" property. Since this is TCG-only, we don't actually > need to be robust to bogus incoming migration data, and the effect of > it being wrong would be wrong code generation rather than a QEMU > crash; but if it did ever happen somehow it would be very difficult > to track down the cause. Add a check so that we fail the inbound > migration if the FPDSCR.LTPSIZE value is incorrect. > > Signed-off-by: Peter Maydell > --- Reviewed-by: Richard Henderson r~