From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Lutomirski Subject: Re: Non-exiting rdpmc on KVM guests? Date: Tue, 21 Apr 2015 14:10:53 -0700 Message-ID: References: <20150421150514.GC3182@worktop.meeting.verilan.com> <55367BB6.3050103@redhat.com> <20150421205139.GA2898@worktop.Skamania.guest> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Paolo Bonzini , Andy Lutomirski , kvm list To: Peter Zijlstra Return-path: Received: from mail-lb0-f182.google.com ([209.85.217.182]:36732 "EHLO mail-lb0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932723AbbDUVLP (ORCPT ); Tue, 21 Apr 2015 17:11:15 -0400 Received: by lbbqq2 with SMTP id qq2so165370581lbb.3 for ; Tue, 21 Apr 2015 14:11:14 -0700 (PDT) In-Reply-To: <20150421205139.GA2898@worktop.Skamania.guest> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Apr 21, 2015 at 1:51 PM, Peter Zijlstra wrote: > On Tue, Apr 21, 2015 at 06:32:54PM +0200, Paolo Bonzini wrote: > >> However, if you take into account that RDPMC can also be used >> to read an inactive counter, and that multiple guests "fight" for the >> same host counters, it's even harder to ensure that the guest counter >> indices match those on the host. > > That doesn't make sense, only a single vcpu task will ever run at any > one time. > > There cannot be inter guest counter contention. Only the host can > compete for the same resources. One question is whether we care if we leak unrelated counters to the guest. (We already leak them to unrelated user tasks, so this is hopefully not a big deal. OTOH, the API is different for guests.) Another question is whether it's even worth trying to optimize this. --Andy