Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp8866pxy; Tue, 4 May 2021 17:13:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzE4RqoyKHgGAClwo+ccTrI3gb6f4EVASjKEhldlZNMgIjgUyIucuIQkREVPaEstvEithpw X-Received: by 2002:a63:5b20:: with SMTP id p32mr3560213pgb.173.1620173621444; Tue, 04 May 2021 17:13:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620173621; cv=none; d=google.com; s=arc-20160816; b=HLLSJOMwNBpSxuqD5iuboxB5qSjy3Iud6eG7sWz4KXmxvrfFpWvdnYtzfPQSba2xCF mGlUmwWwtAxvNsaH+KZJybNDSuJwcid7J39s6z6yH5Guu1mfPIoyWEdGsizGX8xgMUnX IZmvB8Ki7ZfnKi1Ah6JydTZ7vwP3yu4U3o68k9rWJAJG9iWazGEZ00R+EiwykrB9Lot1 DdVPg9/yEsQoWcE1k2SVvUvDCL/Zd3KhaT4Kc5onXRpZzwDqvno4hzbrweVc9R1uT+lm jETgNKZnvynTQc6Dlc1i6Aef8jFnyx0UGlZQP7qEQQsTHeB0oTUY8UyxFc/JqMrkeFhu 917Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=7ZG1nWXtzTYTaXrMK1FVDEfdYcnwUzz0W/Bp4Vm63w8=; b=JO066J6pVHWkUcoptQ/71gYtymmXyIC263yVjcdUWwpQ8F3mjbhLuR5Xr5fskFYLGf f2C/HOzwhYLi/xcl4LnT6K1475LwK9g61lqI/V1Wj7qZVEr2G5lf+laiOovIr7HD7Y8V uADAEGcNNy4rHrU+ryQ1Fstyml+jYLGfOtrYppl33WGdCfGLLezqYWE89nf9RlJzeTR5 ZKYhEl25LKD/1CH69K+iG1sIRn5Os/yh8Oh8Kf1DIwFEISKd92kv6cYnC3nj7CDR2xgS GDtisw+B2vSIkzN1DRmqbuWn4rancfYrdwWgWwWUs+YCanwouBB3phE/gKXVmBwWIO6Q Ew+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="W0/NtpO4"; 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 q9si5403046pls.236.2021.05.04.17.13.29; Tue, 04 May 2021 17:13:41 -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=20161025 header.b="W0/NtpO4"; 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 S231435AbhEDXhz (ORCPT + 99 others); Tue, 4 May 2021 19:37:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231430AbhEDXhy (ORCPT ); Tue, 4 May 2021 19:37:54 -0400 Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4EEFC061574 for ; Tue, 4 May 2021 16:36:58 -0700 (PDT) Received: by mail-oi1-x232.google.com with SMTP id t8so583098oij.0 for ; Tue, 04 May 2021 16:36:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7ZG1nWXtzTYTaXrMK1FVDEfdYcnwUzz0W/Bp4Vm63w8=; b=W0/NtpO49BkFw56cUrtxd4cEfAJIY00IrrdCRRM83zOAeUgsB5GNY/mRrQ9guQ+GCu zt+IJvmorwCO7B/VnqnHGwHqgBURRJbU4N9fAgchjHtd3fM8mwQ3UelDSkOAA8+3qMf8 r9JZMox/04J0poAyl2fdpSvJp4JNeW+aKECRZEie7GHgopXF8ef5KvuID8N/VIJ3vacw /pAZnyCOMa76HYaURuL4TrKT5xRQmbHMuP/59JFIL5CjKdSjWfNmpOhrGkgBJEeFKtJR 3qFalKYZueX64+3yV8ur8yG1/8AgITMp2LXEsXIZN2c/2iR9N87REuOR7ayWiX89ltLq MGAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7ZG1nWXtzTYTaXrMK1FVDEfdYcnwUzz0W/Bp4Vm63w8=; b=CF5BsgFLHh0TrrA3OSeMyAz+4j+9NQCInh0TsxLcdDMoPYrAtpV1lO1wXwv0OEh4i6 zbJxxMQ/VybgHt6gLPFsSE0BZ4R5BAkG8qb1oa+3t+JeXDPN0pDisqE7adsKWwlccHxV oo/88maF7V7wGVqyRJkkUdHmbr1TSjyFTTBlBi3Wn1ANfnTOzX4+Pdc3VZqH+NPloKXl XD6ubWhhdGq8700GTfA8+E//4bzbw4EEjMcfQZzyR2gH80pHSmcSmNv8ekuXb38TdAnG 8FHrAIx7X8+w31/6QI7Oyfe9Ewxx/3c2i5uRB/NPGLIUEtSpv+demubulo+YlxL5IOpk vt0A== X-Gm-Message-State: AOAM533C5s9z62w4eSX7STwJRtyCIH78Fd3sRqUgfsa/e7vSBYAIRQMW DtmyW2n5hu3Bl619dz4GqLXsW7vTbU8Vwm57QgirCg== X-Received: by 2002:a05:6808:b2f:: with SMTP id t15mr4766153oij.6.1620171418015; Tue, 04 May 2021 16:36:58 -0700 (PDT) MIME-Version: 1.0 References: <20210504171734.1434054-1-seanjc@google.com> <20210504171734.1434054-6-seanjc@google.com> In-Reply-To: <20210504171734.1434054-6-seanjc@google.com> From: Jim Mattson Date: Tue, 4 May 2021 16:36:46 -0700 Message-ID: Subject: Re: [PATCH 05/15] KVM: VMX: Disable preemption when probing user return MSRs To: Sean Christopherson Cc: Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm list , LKML , Xiaoyao Li , Reiji Watanabe Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 4, 2021 at 10:17 AM Sean Christopherson wrote: > > Disable preemption when probing a user return MSR via RDSMR/WRMSR. If > the MSR holds a different value per logical CPU, the WRMSR could corrupt > the host's value if KVM is preempted between the RDMSR and WRMSR, and > then rescheduled on a different CPU. > > Opportunistically land the helper in common x86, SVM will use the helper > in a future commit. > > Fixes: 4be534102624 ("KVM: VMX: Initialize vmx->guest_msrs[] right after allocation") > Cc: stable@vger.kernel.org > Cc: Xiaoyao Li > Signed-off-by: Sean Christopherson Reviewed-by: Jim Mattson