From mboxrd@z Thu Jan 1 00:00:00 1970 From: Izik Eidus Subject: Re: [PATCH 2/2] KVM: VMX: Enable memory mapped TPR shadow(FlexPriority) Date: Fri, 26 Oct 2007 10:25:08 +0200 Message-ID: <4721A464.2000003@qumranet.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: "Yang, Sheng" Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Yang, Sheng wrote: > > +static int alloc_apic_access_page(struct kvm *kvm) > +{ > + struct kvm_userspace_memory_region kvm_userspace_mem; > + int r; > + > + r = -EFAULT; > + /* Top memslot for apic access page */ > + if (kvm->nmemslots == KVM_MEMORY_SLOTS) > + return r; > + kvm_userspace_mem.slot = kvm->nmemslots + 1; > + kvm_userspace_mem.flags = 0; > + kvm_userspace_mem.guest_phys_addr = 0xfee00000ULL; > + kvm_userspace_mem.memory_size = PAGE_SIZE; > + r = kvm_set_memory_region(kvm, &kvm_userspace_mem, 0); > + if (r) > + return r; > + kvm->apic_access_page = gfn_to_page(kvm, 0xfee00); > + return 0; > +} you probably want to use slot number 9 (every slot above KVM_MEMORY_SLOT and below KVM_MEMORY_SLOT + KVM+PRIVATE_MEM_SLOTS are private slots that meant to be used like you use them in your patch,) using the number 9 slot will make the slot invisible to the guest and insure that at runtime the user can still allocate and remove slots without clashing with your slots. > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > ------------------------------------------------------------------------ > > _______________________________________________ > kvm-devel mailing list > kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org > https://lists.sourceforge.net/lists/listinfo/kvm-devel > ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/