[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH RFC 3/6] x86/ioapic: RTE modifications must use ioapic_write_entry


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 3 Jun 2022 15:34:33 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=N+PYYSk4JB9FNIbJmOdNxrClAU6r3UY0d+7IVas+AGM=; b=m0rhoSkto9Q7Rhmz+JGZBWYu3zUC1umKR8GuF499R55SyP/jFHxYDFiaSocYkWOQKsKZJKwkSM96Za+Ron0yrLq/KSuBDY8gkIaf4yL4MHRstKUXgQ3KYa8qZhya/ctInjEet73gtHyem72vWPc2ub9Agpw4+HcXhdnE6fJvbmHN2DJCPaZT2d3igQWIUbOadbt7sITB2A4CKPIfkJJLjPhRnaoHggn/vSiLovTqAkKdEC/PiEU+Szn8lHMeHDVlS1YWksBNvSZohLE+hzz7FY486cpAv5YQ6rbHlDvMsROEC2tiWBY+Q2CyclFH0YozcnalymNOk6KzoWjurV0Pag==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eXN7Ef71MRwX+HHK/NpAPMYrqZMNsYYSa+nseApM98shQw2zBxqK1rwiI/oRYfuIyHtr6/8IDjGVhRbrv4MSrJPWr1GukVAKQCou9n9eqS134IfKy06Sk9KUHxZodiNOCXzoML8grjN78SSyeCNluaUIOt6GvEGB9J7LMtfuSlDIczkMeu5YYLXBCyKdhy1+gXorsSlioyHPXSb93MqJ1gV56G9RYBaGvbECu+P5wnkcoSRhkVdQQT+V9+BnUarvXy6iKQVSCktMH9tc1gQyrnRiH78vCjVoG4YCxClNEufsYauCjonHF217cqORVqXNlwUb8O8nXo581NKX+D5q1g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 03 Jun 2022 13:34:45 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 21.04.2022 15:21, Roger Pau Monne wrote:
> Do not allow to write to RTE registers using io_apic_write and instead
> require changes to RTE to be performed using ioapic_write_entry.

Hmm, this doubles the number of MMIO access in affected code fragments.

> --- a/xen/arch/x86/include/asm/io_apic.h
> +++ b/xen/arch/x86/include/asm/io_apic.h
> @@ -161,22 +161,11 @@ static inline void __io_apic_write(unsigned int apic, 
> unsigned int reg, unsigned
>  
>  static inline void io_apic_write(unsigned int apic, unsigned int reg, 
> unsigned int value)
>  {
> -    if ( ioapic_reg_remapped(reg) )
> -        return iommu_update_ire_from_apic(apic, reg, value);
> +    /* RTE writes must use ioapic_write_entry. */
> +    BUG_ON(reg >= 0x10);
>      __io_apic_write(apic, reg, value);
>  }
>  
> -/*
> - * Re-write a value: to be used for read-modify-write
> - * cycles where the read already set up the index register.
> - */
> -static inline void io_apic_modify(unsigned int apic, unsigned int reg, 
> unsigned int value)
> -{
> -    if ( ioapic_reg_remapped(reg) )
> -        return iommu_update_ire_from_apic(apic, reg, value);
> -    *(IO_APIC_BASE(apic) + 4) = value;
> -}

While the last caller goes away, I don't think this strictly needs to
be dropped (but could just gain a BUG_ON() like you do a few lines up)?

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.