Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1101457pxb; Tue, 14 Sep 2021 16:48:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwc6BtyY+1agXvmPye1CitHnm+ZlqD/xeR1A9oX+DTbrML31vbtfWwXht6Lau1SkQm4e05s X-Received: by 2002:a05:6512:a8f:: with SMTP id m15mr14299139lfu.635.1631663307007; Tue, 14 Sep 2021 16:48:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631663307; cv=none; d=google.com; s=arc-20160816; b=To5qW9uRVqS0qGOFYxSUx0Hys4wNPC4/k57Z8nc6ed3m6URc+BoV/jSKQzZFNtz/lU jp770m2V9zomDIulSmFK+lleF+5/S8Amj1WCVB8K4cIVDOR0ii4sro8jbarajPJ9OlSZ Fb0RRQJzqTGSm0ti9oDtqiYzgurWrXw48HP1ibm5ooc2fhyjjBz3+LgRE41xcG3+OJwy f+EeYTt+Hw5w3MSx6/4yH5LMCjaId7JcUwzPzL6wcAF9GHTFJ22o3WiwKi3iXereakJa pEW15zn7tAiHY1PEPav2lyXREIL4VfrG7DHeD17/8Z4CAURHJt43J5OPBQVMLHQD+SSQ nNzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=8O+Hy6We6pSl0DNT8xui4/8ZZ/lZgMhSAyPrG/8P2Ww=; b=L93Kc7hW7fRsjJP/a6hE7+73XlW+2ZEPdPnT5fUlkCBHJgQA0F7aI82qTlxBjAud0B mA5xv2LBCJSKEA7qv+/s5prrSqcIpXlN6bOEUufebgudM5ZYeSkF9mBy1EJZCmKdjdjM FXJSfLI1qU33vhSA7Ws3YeR1cWrZ/a5Wvks24Rt/XSi+lQ7dTmcpEx2R5ZxkoJh2gAUK Zsky9LOOYvGisrwNl/I4PSP/oLsYyLo8olPiComs/QmPV23qhsornvretNMRITNo1wMw y26irNFqwVScMzKKw+YiljNhdrhngoh6II/7JCFW2NaVSmhQb2h0FBlEMxzAs7C2rSID k2Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=oBbEAG+7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q25si5305534lfb.368.2021.09.14.16.47.59; Tue, 14 Sep 2021 16:48:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=oBbEAG+7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235968AbhINXow (ORCPT + 99 others); Tue, 14 Sep 2021 19:44:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235798AbhINXou (ORCPT ); Tue, 14 Sep 2021 19:44:50 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D434AC061762 for ; Tue, 14 Sep 2021 16:43:30 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id c4so468787pls.6 for ; Tue, 14 Sep 2021 16:43:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=8O+Hy6We6pSl0DNT8xui4/8ZZ/lZgMhSAyPrG/8P2Ww=; b=oBbEAG+7FvjkbqO7CpvRLFUIxM3766nu3aMkROo6iWBNl+TYiwyE3gtvbgifiEov3l 2Gq682Im2gXqCtjoMObMjTRSsP+KYH/KoviNQzjlvP/qqw+cFHzSPBfVUzhciitBkEMf QstU8wTvI4+7x9gztxTlEhQv1RUiS4pBfuP+otYpBsQJxscX/Xnh6GT/c3k8aG4KKvBJ 9Vag7UGjME5jWsPFG0J4KmhykpaX+b2ydeG/za6E6zL3r8w2ohtyp8MGw++ceNfpPws0 OVJYrvSM/1tKBRHoZfvWibTBQOJMZ/t3efk2/xjycZ2Z2uBqAdX546KLbLMwFiyZOolx Ky/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=8O+Hy6We6pSl0DNT8xui4/8ZZ/lZgMhSAyPrG/8P2Ww=; b=pbdtX84YfZWEONuA1kFdbXsennYJKhPBxlPsvcUYB0CK2NTJjBXMUOEyh5Z+rmNgaU HMgkn2LVHpPsIKvaB7wyQBU5BnBd/XLD3CUdLImgWX29Q+opzp8o8DRJClCxwwLbhmHL u89UsylYdE5NSPO07dqdtB+KO4eLwXi0Q2brL8thGfcYBBmbajWBsilY+GmVYUf+p9q8 H5Ozozobic1lpzeLCqtAry7Avb6NmfgbcnxY7XhjclexXb+okjZ8zzCVBLHxg9IGLfpj 16Oizsbn2Hu+Z2BZ2orx/11t7l+kkVWtMyha1q3LtOktY5FypJn+upFvq2gzXQe6e64R NFCA== X-Gm-Message-State: AOAM533k3BRxcFyBC5jj9GinN/gKjs5V+xOUCQ4cNAioFBdb1cEJBrim NQO1UNgLgOJTjJmtehbkmwXmvQ== X-Received: by 2002:a17:90a:f002:: with SMTP id bt2mr4963401pjb.207.1631663010164; Tue, 14 Sep 2021 16:43:30 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id v23sm11084092pff.155.2021.09.14.16.43.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Sep 2021 16:43:29 -0700 (PDT) Date: Tue, 14 Sep 2021 23:43:25 +0000 From: Sean Christopherson To: Peter Gonda Cc: kvm list , Marc Orr , Paolo Bonzini , Brijesh Singh , stable@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] KVM: SEV: Acquire vcpu mutex when updating VMSA Message-ID: References: <20210914200639.3305617-1-pgonda@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 14, 2021, Peter Gonda wrote: > That looks reasonable to me. I didn't know if changes headed for LTS > should be smaller so I avoided doing this refactor. From: > https://www.kernel.org/doc/html/v4.11/process/stable-kernel-rules.html#stable-kernel-rules > seems to say less than 100 lines is ideal. Most the rules are more like guidelines ;-) In seriousness, there's a balance to be had between minimizing the diff and keeping everything maintainable. E.g. if the fix is kept small and then the upstream code is immediately refactored, any future fixes to the refactored code will be harder to backport. And the actual fix would also be poorly tested in upstream since folks would be testing the refactored version of the code. > I guess this could also be a "theoretical race condition” anyways so maybe > not for LTS anyways. If there's doubt, write a test :-) The "theoretical race condition" thing is to discourage people from backporting fixes for ridiculously tiny windows that may or may not be exploitable. This is a giant gaping chasm that userspace can drive a car through, e.g. literally "do KVM_RUN at the same time".