Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp628707iof; Mon, 6 Jun 2022 09:38:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjWooC023MEpHkw2Rf+bQOA/fmZ+7fyRVGOKO4aiIVGVbPT1r1lx8bo/8n/HWdwwObyG8s X-Received: by 2002:a17:90a:9914:b0:1db:d10f:1fcf with SMTP id b20-20020a17090a991400b001dbd10f1fcfmr62208628pjp.241.1654533489664; Mon, 06 Jun 2022 09:38:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654533489; cv=none; d=google.com; s=arc-20160816; b=CcVLqo/O93R7iPoFKtp4Fqvqaf3SHBGHVOwH6UwhkLxfby56EpJoO3mum9E2Uc54/q H9DacyraBTdod9jHsq9NDFVSoJQNTQbLLnHgHxlfuYoexfHTRQ+KnfJta1xgchmi7Wl5 bLvUM4U2m7doAGoQml1DqY4olP1b5l7SkXilWSUp9wupDKorB3Z1vXaVUCrHRRbm5PdB imWKpK07dS3cN+ACahmnP515ZLdUwRktR2LwTFi5SSo0CrcDirovedI21LHfBc1/ciS1 05zExUrgedfzLqAhKqRpEa3pIaSjwLzxDDqBV0P2HmB+mNVbKeKPIBJRwMhDyY0xMCFQ wAZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=J0ZUO9BPOkOuAPGkk2Pz+5mNS4xSTxe1mTSmQ0cCQME=; b=DEpkrPCsxokwXZE8reUM28br5j0O20KuWI18n64jDuYee94Ne4DKeZOGX6p5TBU70F T706swDxQ0IZnztTUeh0eEqCRfWbKGUb42PdSD0IGfpqyej5dDT+ePpkrADG5ZV7yF0i aVFp4s+jetIMiT9XDS9fSzCjR9z67KoUUuqhlWICLY+Qfg69f5hTidizMBjs4kSHS0eg IoFa1fCmJqlVvrN9fsZu9y8qzVBrukVz3ot02GXMjKrPc1Ia6/AWGVw6b7QkL7oHmcIb 3jvAWjHhlaTWu81HR1qj6ZFgJK7KRLrGOMiZKT58VvrVLbUQM50yfqPr7s3pNLTryo5B 2jeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KEWXi00l; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id t10-20020a17090a2f8a00b001e325d12d95si19331085pjd.103.2022.06.06.09.38.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 09:38:09 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KEWXi00l; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1D54A1C2D55; Mon, 6 Jun 2022 09:18:33 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241528AbiFFQSX (ORCPT + 99 others); Mon, 6 Jun 2022 12:18:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241522AbiFFQSU (ORCPT ); Mon, 6 Jun 2022 12:18:20 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2723D1B607E for ; Mon, 6 Jun 2022 09:18:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654532298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=J0ZUO9BPOkOuAPGkk2Pz+5mNS4xSTxe1mTSmQ0cCQME=; b=KEWXi00lU6ZtrgsQKu6kWt3Tm0fvKpnJLt58bkjxSLq529/m1PqVfz4AEksmWJl56XhL/A ssUuARFi2MIzSvxuSy2QOaJ6IAa3W4JFgS++Yuze0/uWwwUeKJDkwGjnlu43wmE/4mklya DYBynii0erxnrx7Yez9F1VPkfysCaH0= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-503-MXTbn1vQN26BHNERoTOF_A-1; Mon, 06 Jun 2022 12:18:16 -0400 X-MC-Unique: MXTbn1vQN26BHNERoTOF_A-1 Received: by mail-wr1-f69.google.com with SMTP id bv8-20020a0560001f0800b002183c5d5c26so841994wrb.20 for ; Mon, 06 Jun 2022 09:18:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=J0ZUO9BPOkOuAPGkk2Pz+5mNS4xSTxe1mTSmQ0cCQME=; b=0INA1j4b3yUtJNYX+C8iFYZqJxDpzHP1A/jOr1+zZSAJVqbHJILjVPVIFPGUucLySO Bi1qBFiDJbOH0gW7E8IwQr+zOMyDopXPpRQdRlVp9Qim4vejWlFy0umTahtzDBi2ZMGy DpcQjFaF++sJ5WDAeQee/uMOoRzWkrmZA4jeDyiyFILGburPhbByklidw9PMMKLx92WN YaAFQMokYkHouKDwl53O9AoJqgqIg0ZBcdceGNDCMfShQKUq6wuPjhMRVtePzxTTx5eY Sr8hPH0K2EaZLclpbRVCJgNPLXesxJxo2k2QeRsr7tZ/w94Itvzot9+1xJNHxZqCEwLd QYvA== X-Gm-Message-State: AOAM533oMCkwGTibuBSg124PIQv5/zdgk9kh10G8YaVm8yzUAmpDIq4C YKsKH5AXZxQ5pI4Iwx7vYKeoT4dyWAFPpgeX2XMpuYa0yy4bWWmKtTHZrT4IfFI8RWHEtkhrqhA Q5FYNDvGqGcvfDmSEqnNpJRw9 X-Received: by 2002:a7b:c012:0:b0:39c:529a:7590 with SMTP id c18-20020a7bc012000000b0039c529a7590mr4431373wmb.6.1654532295409; Mon, 06 Jun 2022 09:18:15 -0700 (PDT) X-Received: by 2002:a7b:c012:0:b0:39c:529a:7590 with SMTP id c18-20020a7bc012000000b0039c529a7590mr4431330wmb.6.1654532295117; Mon, 06 Jun 2022 09:18:15 -0700 (PDT) Received: from ?IPV6:2001:b07:6468:f312:9af8:e5f5:7516:fa89? ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.googlemail.com with ESMTPSA id u12-20020a05600c210c00b003942a244f39sm15167933wml.18.2022.06.06.09.18.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Jun 2022 09:18:14 -0700 (PDT) Message-ID: <2d9ba70b-ac18-a461-7a57-22df2c0165c6@redhat.com> Date: Mon, 6 Jun 2022 18:18:12 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH AUTOSEL 5.16 07/28] x86/kvm/fpu: Limit guest user_xfeatures to supported bits of XCR0 Content-Language: en-US To: Peter Xu Cc: Sasha Levin , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Leonardo Bras , tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, chang.seok.bae@intel.com, luto@kernel.org, kvm@vger.kernel.org, Sean Christopherson References: <20220301201344.18191-1-sashal@kernel.org> <20220301201344.18191-7-sashal@kernel.org> <5f2b7b93-d4c9-1d59-14df-6e8b2366ca8a@redhat.com> From: Paolo Bonzini In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/3/22 20:40, Peter Xu wrote: > I'm not really sure whether this is a bug or by design - do we require this > patch to be applied to all stable branches to make the guest not crash > after migration, or it is unexpected? Yes, we do, though the only reported bug was for PKRU. > However there seems to be something missing at least to me, on why it'll > fail a migration from 5.15 (without this patch) to 5.18 (with this patch). > In my test case, user_xfeatures will be 0x7 (FP|SSE|YMM) if without this > patch, but 0x0 if with it. What CPU model are you using for the VM? For example, if the source lacks this patch but the destination has it, the source will transmit YMM registers, but the destination will fail to set them if they are not available for the selected CPU model. See the commit message: "As a bonus, it will also fail if userspace tries to set fpu features (with the KVM_SET_XSAVE ioctl) that are not compatible to the guest configuration. Such features will never be returned by KVM_GET_XSAVE or KVM_GET_XSAVE2." Paolo