Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp81179pxy; Wed, 21 Apr 2021 19:14:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYmO3I8qz2Gqfh2AsEtjhzSXB87/9ZLO3ODbfEAeTK3oDGL2wFMmb0PPXLPXqMecqhkVnU X-Received: by 2002:a63:78cc:: with SMTP id t195mr1120618pgc.196.1619057667593; Wed, 21 Apr 2021 19:14:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619057667; cv=none; d=google.com; s=arc-20160816; b=nTf86hFn56KPH1vhhh/itXkabriXc3XcF27t1Iu9sZFQokBSeS64uSQn+An6d2QrZ8 FprwGO2+3wvnldmFY1IiqN/f3lGAq6XqIJvf9ANtaMQH+rfNxNSgSLvfhSo1JWDZECKF 0Np4Q66mTGEdyV7dKBAxX5+9nu48XrdFWpHBI3xYX7EU832AjT6FXkf1Fv0aH4ru1Aoc XAO9nk8gbnzTKvQ5ujL1cDLxuvaC26/laSahezcF1xKvS6w5VFucpRfv2GNDGRLOJwwP V4FX/YzU0k/s053W9blITcbx08SrasJD8lyBvsGzVP+UDN6oAZVVXsPkMyRn7zLsZ7Lw civg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:reply-to:dkim-signature; bh=9FTkqe36BRI/gipCYRepnZSpLm1Jj8+DXD4OAejjwDk=; b=UbkWi/SDUjEis4CNQx1Ep/c8HDcNUEiJrl+GDGgtNpgga97u9ejDUBx0Hl7Y/f/sQ/ KqqTtXrXoTMhcHKFgGd8nfVz7BY1/VjKpoy4oHyNArLQzsD18faEpp4slWHa26L6kA6Y lS9W+RgmbRopm13aCjN5se/b7PqYvgSU/d4QwW94qYfQ0iwy0I9wkwY9q9OreYU5fOBR 1SgRfRmz8vihgF3ab2mAH73ZaQ0e7lLDsZNeAU1Fmjy9t99TLK427DEt87Cr745BAfoy ALD6wNshktlaAk9IJ6k/FkGXg/S2nVDBQ4QjGsEwlV0KPQNjovfC90mOwLiVyGKiu0p4 rp2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=tdxpEit4; 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 u13si1741703pgf.212.2021.04.21.19.14.15; Wed, 21 Apr 2021 19:14:27 -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=tdxpEit4; 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 S234773AbhDVCMs (ORCPT + 99 others); Wed, 21 Apr 2021 22:12:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234600AbhDVCM2 (ORCPT ); Wed, 21 Apr 2021 22:12:28 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19269C061346 for ; Wed, 21 Apr 2021 19:11:53 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id s8-20020a5b04480000b029049fb35700b9so18237855ybp.5 for ; Wed, 21 Apr 2021 19:11:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=reply-to:date:in-reply-to:message-id:mime-version:references :subject:from:to:cc; bh=9FTkqe36BRI/gipCYRepnZSpLm1Jj8+DXD4OAejjwDk=; b=tdxpEit4hTqZAjq5Uan7G+ZYbUeY8vleV7S9D2L82o0kqTm6weZ4AScDOZBS5fUsX7 JAOT/zpBZjmIV6mzN18RQNjdo/vVSaVzqQVn6WmkwoiFHVtPxzVRM6J5zRb7263SaoXJ LqMvRrK4DI7UIVZQoPjpcqTBJq+77NFStU04xT3TNg/QcFa5L0zww7BRNpajztD0z/Pp Ov+dbCiKHg6BYdpC72RYwjmApHXfwkDFhc5hS2LkMqDb7GSFUVHpCa7xXyt8ickY6xc4 q5y7TXuOg8SaMCUrSVKaS0jhEzWRFsz1tYTH7pk5ArOjbFV6tDSj5ir2ZF8+PoMeSG6V HSPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:date:in-reply-to:message-id :mime-version:references:subject:from:to:cc; bh=9FTkqe36BRI/gipCYRepnZSpLm1Jj8+DXD4OAejjwDk=; b=IzDa3l4EFV32lfdcssOt7/NLVyLaw7o3YUdt52P1jFld4Fon0i3eFC5uBF7r7ti3bE tU/Yr9Mw2YTAX0bbCeU3LZxKRhtG7Qe/gTBtjoyidKboVX0Qy4Uh1j0YTV7e4gBDEl/m AdsTy+8qHw8VNfygsrZrkoW7PnmNau4qNYVcVNEHPnNjo7gcORs0rwKNAgFx/9Q5eTFW EbxCPsysmA6ubacR1RfbjAnjUpwxIr6eohwp5qpphczWbIftfP8QQmb0R5c16m+7dlle zOv0WdJWMPux7MIzGGtQHlz7deh0KGz5WGEA64yJJudKOfuIREM0+D6zY0wgbLRLyaaP cmCA== X-Gm-Message-State: AOAM533CnkuIen//sU2C/FFgiFJz6LEOJUJaHtRQy0/vQB9Q7d380Hpv +dg3T+mVyBUEZSCx7dUjYJ7VpqHoaCc= X-Received: from seanjc798194.pdx.corp.google.com ([2620:15c:f:10:e012:374c:592:6194]) (user=seanjc job=sendgmr) by 2002:a25:d4d2:: with SMTP id m201mr1276145ybf.301.1619057512219; Wed, 21 Apr 2021 19:11:52 -0700 (PDT) Reply-To: Sean Christopherson Date: Wed, 21 Apr 2021 19:11:21 -0700 In-Reply-To: <20210422021125.3417167-1-seanjc@google.com> Message-Id: <20210422021125.3417167-12-seanjc@google.com> Mime-Version: 1.0 References: <20210422021125.3417167-1-seanjc@google.com> X-Mailer: git-send-email 2.31.1.498.g6c1eba8ee3d-goog Subject: [PATCH v5 11/15] KVM: SVM: Explicitly check max SEV ASID during sev_hardware_setup() From: Sean Christopherson To: Paolo Bonzini , Dave Hansen , Andy Lutomirski , Peter Zijlstra Cc: Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Borislav Petkov , Tom Lendacky , Brijesh Singh Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Query max_sev_asid directly after setting it instead of bouncing through its wrapper, svm_sev_enabled(). Using the wrapper is unnecessary obfuscation. No functional change intended. Reviewed by: Tom Lendacky Reviewed-by: Brijesh Singh Signed-off-by: Sean Christopherson --- arch/x86/kvm/svm/sev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c index bd26e564549c..8efbd23f771b 100644 --- a/arch/x86/kvm/svm/sev.c +++ b/arch/x86/kvm/svm/sev.c @@ -1799,8 +1799,7 @@ void __init sev_hardware_setup(void) /* Maximum number of encrypted guests supported simultaneously */ max_sev_asid = ecx; - - if (!svm_sev_enabled()) + if (!max_sev_asid) goto out; /* Minimum ASID value that should be used for SEV guest */ -- 2.31.1.498.g6c1eba8ee3d-goog