From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Gabriel L. Somlo" Subject: Re: RFC: ioapic polarity vs. qemu os-x guest Date: Mon, 17 Feb 2014 19:58:34 -0500 Message-ID: <20140218005833.GA7676@crash.ini.cmu.edu> References: <20140214220600.GI29329@ERROL.INI.CMU.EDU> <2CEB9F8C-E983-4182-A514-44EC568E18D8@suse.de> <20140216114151.GB30056@redhat.com> <1392562020.15608.437.camel@ul30vt.home> <20140216162300.GI30056@redhat.com> <20140217175659.GP29329@ERROL.INI.CMU.EDU> <20140217180136.GQ29329@ERROL.INI.CMU.EDU> <53024F93.3040709@redhat.com> <20140217193808.GR29329@ERROL.INI.CMU.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "Michael S. Tsirkin" , Alex Williamson , Alexander Graf , "kvm@vger.kernel.org" , "qemu-devel@nongnu.org" , "eddie.dong@intel.com" To: Paolo Bonzini Return-path: Received: from mail-qa0-f41.google.com ([209.85.216.41]:54467 "EHLO mail-qa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753811AbaBRA6l (ORCPT ); Mon, 17 Feb 2014 19:58:41 -0500 Received: by mail-qa0-f41.google.com with SMTP id w8so22890979qac.28 for ; Mon, 17 Feb 2014 16:58:41 -0800 (PST) Content-Disposition: inline In-Reply-To: <20140217193808.GR29329@ERROL.INI.CMU.EDU> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Feb 17, 2014 at 02:38:09PM -0500, Gabriel L. Somlo wrote: > Oh, I think I'm starting to comprehend the problem here. The bits of > "*irq_state" are indexed by "irq_source_id", which is dynamically > assigned by kvm_request_irq_source_id(). > > So, doing the OR thing when assuming always-active-high makes > sense. Doing AND based on an active-low assumption doesn't make > sense, because there could ALWAYS be 0 bits that just weren't > allocated (yet), and I'm having trouble imagining how I'd keep > track of where the current allocation boundary is in a sane way :) Hmm, I thought maybe I could use kvm->arch.irq_sources_bitmap, but that's global across the whole VM, whereas irq_state belongs to one given GSI. So, the per-GSI bitmap is sparse, so it's at least as bad as I thought earlier, if not worse :) Am I missing anything that would put this in a better light ? Thanks, --Gabriel