Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1598547ybx; Sat, 2 Nov 2019 02:54:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqwHScrCIKGRssnpguXOPeeWtfAF+YsNz/z2Cx3Exhi+vKDQs/W+fE3ia9JDkJ6oSXOgclhe X-Received: by 2002:a17:906:5502:: with SMTP id r2mr14455439ejp.3.1572688473740; Sat, 02 Nov 2019 02:54:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572688473; cv=none; d=google.com; s=arc-20160816; b=OsbNEoD7Er0RUTGB6SO8ZBJytc7vmuWjNWrVaJAZz1CAswF2NH3wsa/J4gcSIyNA5q 6JqV3j7FxITrTZWIWn+PHXYQnAlmo3IiweedmSTwaitUCemeceeAQcv77Xd+h8/HDtiI jq5LzjXm9fUuDJihtimbdnYT4IU/1KPlTEq6VmDWikG19qvg9g41zlyDH+jo2pHD52yu QmgEnqrY7qOiOvauP9/xkIfG37YJAqb2kRAE42RKkojdlGc/cEAQJHeDcM+dKejXajhJ DbSxF6lyX8uz3ocunGZEYPnUe/QOzr1LcVwCOv6DCsSi2wAVQ246eXBf3Tq3hZzTvoOv WWDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:openpgp:from:references:cc:to:subject; bh=l8qAdWRObZ9diNurmyFj32RwamTbc6O7HnqjMAubn+g=; b=pDeooHu3Ook7GkLbd4l4pHipCDxvwdl7eKMflhz5PPCflDropc/7IqCWxDNy49Z4T9 d/4WIc+nDZkXqJOz3IBgUbucJqUY6HaNB+7QKv1u1tjnv7kvuX5jjF636z2qmQ4MYNx1 hEni7dqvRihhd7VZyP12Hg7OxezZf0ANoilyZT7oDbuD3CYM8WABnZCxaqDxZvHn/Uu4 3PdFn0LX3XmEMAKQYq4Yep0Prvg9EfpTPRiyDEsTLbWjYRzAVhNMZff2kUhxlnJ1tKfV OeyMJ0s6SaT1Sr4GTuNXhBpPCIdxqNyNxfgRTZz/SY28Q4MuegCGCzU3jISTrukkiajb w2ow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r25si3911197eji.283.2019.11.02.02.53.35; Sat, 02 Nov 2019 02:54:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727091AbfKBJvb (ORCPT + 99 others); Sat, 2 Nov 2019 05:51:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48050 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726670AbfKBJvb (ORCPT ); Sat, 2 Nov 2019 05:51:31 -0400 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A302D85A07 for ; Sat, 2 Nov 2019 09:51:30 +0000 (UTC) Received: by mail-wr1-f72.google.com with SMTP id t2so7007352wri.18 for ; Sat, 02 Nov 2019 02:51:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=l8qAdWRObZ9diNurmyFj32RwamTbc6O7HnqjMAubn+g=; b=F/4kmTglVBiuG5IX8kiCRKCTSlknKlq+DHJS3l7yRRHw42DE3CnnpfAO+/CcY4m+Az 1NaVtqBxGjpY76B6EGmAXyM2zuC+oyuRBpQInlN8M7tED930bPQ5YWBBL3pTXAcWVgF1 Zi+FcQKByXUdaZYG4Ma/LcXq3ZorDWR5VIeKKGAAlWJJ9C5fk9CPR1iAi7ztdXjq7vAX m2Z7LSxVlvswkERBoR4OvljvnvbVcA5DRLQNjEkT7A9m+9167b9XQZcsXE3ZhoYDZEqt bmOOlRsE5jDwCst9zk0ubEaPJZ1Slazr0GlQbyqrbSlCuhZHHydkJy/RkY0IL+H3Qt11 NfCQ== X-Gm-Message-State: APjAAAUPPHXuQZWf6sxJ1NM1tRbBQadgJGmb+f59MAJXS8bSD6VlTT48 OC7HKCdR69EDMtYLx91dpp+ptmsvRYltbEVI7GewNGZ+kuZ8Tbesey/Z0nxHhRyQ/euzLxJqSAR vsxYOa11+vtxdPPTOKlpgeSpo X-Received: by 2002:a5d:69c8:: with SMTP id s8mr14694472wrw.167.1572688289338; Sat, 02 Nov 2019 02:51:29 -0700 (PDT) X-Received: by 2002:a5d:69c8:: with SMTP id s8mr14694452wrw.167.1572688289015; Sat, 02 Nov 2019 02:51:29 -0700 (PDT) Received: from [192.168.42.35] (mob-31-159-163-247.net.vodafone.it. [31.159.163.247]) by smtp.gmail.com with ESMTPSA id d20sm14673270wra.4.2019.11.02.02.51.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 02 Nov 2019 02:51:28 -0700 (PDT) Subject: Re: [PATCH v4 03/17] kvm: x86: Introduce APICv deactivate bits To: "Suthikulpanit, Suravee" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" Cc: "rkrcmar@redhat.com" , "joro@8bytes.org" , "vkuznets@redhat.com" , "rkagan@virtuozzo.com" , "graf@amazon.com" , "jschoenh@amazon.de" , "karahmed@amazon.de" , "rimasluk@amazon.com" , "Grimm, Jon" References: <1572648072-84536-1-git-send-email-suravee.suthikulpanit@amd.com> <1572648072-84536-4-git-send-email-suravee.suthikulpanit@amd.com> From: Paolo Bonzini Openpgp: preference=signencrypt Message-ID: Date: Sat, 2 Nov 2019 10:51:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <1572648072-84536-4-git-send-email-suravee.suthikulpanit@amd.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/11/19 23:41, Suthikulpanit, Suravee wrote: > + unsigned long apicv_deact_msk; No abbrev fld names. :) I can change this to something like apicv_inhibit_reasons if there are no other issues (and likewise s/APICV_DEACT_BIT_/APICV_INHIBIT_REASON_/). > > +bool kvm_apicv_activated(struct kvm *kvm) > +{ > + return (READ_ONCE(kvm->arch.apicv_deact_msk) == 0); > +} Using READ_ONCE introduces a risk of races. I'll check during a more thorough review if it's worth introducing separate kvm_apicv_active and kvm_apicv_active_nolock functions. Paolo