Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3933834pxu; Tue, 20 Oct 2020 04:32:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxn3aH4EQMyz9cp07ZE/0fjJBmWwwsnRi0ysAg68qlgJdC006gqbTmAWBkLq2FhL8uzRpm X-Received: by 2002:a17:906:57cd:: with SMTP id u13mr2689538ejr.201.1603193541698; Tue, 20 Oct 2020 04:32:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603193541; cv=none; d=google.com; s=arc-20160816; b=HnpzElOQNDZ6d7mzZLd0YWRgsHau4o/i6UBo3PgfqO2qfCovkBn3kuNWNc0AhX1+YB EpTgYUWbf09p1LRQEBzhuJD+8LoMKJ3YbuGlHEFLX30PnaTJ1qgoBnHLrtX7+sTs7126 3o/ebEl8FvKQfHwwyEk7AzgeFWA3NGqqoklIRgyUShC/DfTVkDoKfvvbaepUByczToCZ 4sT9HHpPU31+CWrhM0woS6FncxTOhk+jMbqGXyYMDSo50DAV/ft0PhgDcPP+hm2WTaJA FMhUhmGJEYUZdPd/spVKISJARjiCi9alRTjf8QghtCoy1vn8eGoeStjOanI+0UQj1V3/ upDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=q96jnE0zL/+3eV1zXo6SJcOjLpLSsjofFz0lkEdY9WI=; b=V1VBnLh92pzG7UIvkyljiExnay/gFt3Hl/NMjT9aaeU2SXLORI6gA2qkuEGPG6t+eb 4HQP9nSKX6am6HXes3ItOR5lYU/hJy63hU5G2dakWyUtmKiZJ01QbUAA1c8Y5c9a9CMq E8hANuaFs0SmTZBbvSmqwfFDnxQcNlEnUeI2Bu35DP2Inw659uoVSV8yAS2hhIGNXNfb gGrj5u8RPJ4ZR0DsfzMDJ607dwRCrFhsv/0RDbC/D4J8M1qcUdvdUS+6WrFvaHnz4Mft nCHW9L4AnNMXfu+b2JQTmRY8EdH5AlC8tiQXueYHOz1qf1lhHPXRjtOosBWlbX08D3LQ Z8qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fOzj4D5z; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u18si1058248edf.133.2020.10.20.04.31.59; Tue, 20 Oct 2020 04:32:21 -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=@redhat.com header.s=mimecast20190719 header.b=fOzj4D5z; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393231AbgJTKey (ORCPT + 99 others); Tue, 20 Oct 2020 06:34:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:42456 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392120AbgJTKex (ORCPT ); Tue, 20 Oct 2020 06:34:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603190092; 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=q96jnE0zL/+3eV1zXo6SJcOjLpLSsjofFz0lkEdY9WI=; b=fOzj4D5z7YBxhlyNDi/Y6ONpjdIv9jDaJ4ynA+JTWmkFa08kbi+/iKWZb6n4QxmbGXekpJ i694eWgV3/jW9xRTXIvGKbu9H25cQWRikL+ieOS2eQYg67IQZQ/Lr1AJLNiH1tU2qbiSKL 56KjDtua4nP/jgexk+MXggCal1zEByU= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-284-sXH1ULZoMuOw_ewUlA1O6w-1; Tue, 20 Oct 2020 06:34:50 -0400 X-MC-Unique: sXH1ULZoMuOw_ewUlA1O6w-1 Received: by mail-wm1-f69.google.com with SMTP id c204so300124wmd.5 for ; Tue, 20 Oct 2020 03:34:50 -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:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=q96jnE0zL/+3eV1zXo6SJcOjLpLSsjofFz0lkEdY9WI=; b=HaGpaTjVVuBUZEiUQxLJqsg84XzsZuWWtFSKjPeQBP8n94azQJVDVUZe4EdCL1F/03 SA9EqylryVrlahTzeAYqzxak5UiPdj2Wg6teaPJZlizVkbnHk+IOzJBS3GJNJmeLayne S62BUHw+sSgJ7UWdu9MtbVf61CocMTBjjVRer97cX5AM/nh1cLEDNLQkzbBryt6TtrXN nGIKJkuwNtUoAfpqOD69Dw/AU14VJ3wHIHEr7wMZ0sfH9J+vfIzkck7uBrIh3cisr095 AliBOpdHEpvPP/dC+6RBkBfdGNl5zuobyE8oskbRpRqLM/6p/psSfbSRP/QSx0Ee6LjE 5lsQ== X-Gm-Message-State: AOAM531oPvEIkhCliNzxvXDGT50I+Qlw0cUv139apGnsd6LPTmExSqOL rwRKFDqKqNCjZLeqO5E4usxJYgGm9ioXfz47X4z/OHB8IRXMjI1P2olPYx2TMc4ocfvZrNB+WLK 3U7eShldyYBHQC/eOkL2NeQdM X-Received: by 2002:a1c:87:: with SMTP id 129mr2170664wma.103.1603190089055; Tue, 20 Oct 2020 03:34:49 -0700 (PDT) X-Received: by 2002:a1c:87:: with SMTP id 129mr2170619wma.103.1603190088421; Tue, 20 Oct 2020 03:34:48 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x81sm2016034wmb.11.2020.10.20.03.34.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Oct 2020 03:34:47 -0700 (PDT) Subject: Re: [PATCH] KVM: VMX: Forbid userspace MSR filters for x2APIC To: Alexander Graf Cc: "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , Aaron Lewis , Peter Xu , Sean Christopherson References: <20201019170519.1855564-1-pbonzini@redhat.com> <618E2129-7AB5-4F0D-A6C9-E782937FE935@amazon.de> From: Paolo Bonzini Message-ID: <6edd5e08-92c2-40ff-57be-37b92d1ca2bc@redhat.com> Date: Tue, 20 Oct 2020 12:34:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/10/20 11:48, Alexander Graf wrote: > >     count: 1, >     default_allow: false, >     ranges: [ >         { >             flags: KVM_MSR_FILTER_READ, >             nmsrs: 1, >             base: MSR_EFER, >             bitmap: { 1 }, >         }, >     ], > } > > That filter would set all x2apic registers to "deny", but would not be > caught by the code above. Conversely, a range that explicitly allows > x2apic ranges with default_allow=0 would be rejected by this patch. Yes, but the idea is that x2apic registers are always allowed, even overriding default_allow, and therefore it makes no sense to have them in a range. The patch is only making things fail early for userspace, the policy is defined by Sean's patch. Paolo