Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2886582imm; Tue, 4 Sep 2018 11:35:00 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaIGRs22XTc0ILImH181o4ZGnw4OK+3E+hogJ4leBdffd73SuIGBX9f2svqT5ohtQJmlU20 X-Received: by 2002:a63:2787:: with SMTP id n129-v6mr23293806pgn.220.1536086100450; Tue, 04 Sep 2018 11:35:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536086100; cv=none; d=google.com; s=arc-20160816; b=WBsiVwuBk0izvFtyA3SqjIk5X7zXus+klnJgHdTRMtY/0WVRwPAMPMd2CFmKZo+BZ2 rOzgrk2iiarTaA+ceCjZ/4neEj1ivFNKa+9tFJ8qb52bYPzd2qm6isTQSCcBvEU9pq3e 7a1R00lf1oQ5G4dmBoSgc2Ld3lACT0r1rr+g/BVar6WWY8HwJhekXl5//0tAYvY/g237 xV/7SvLrlc2qvXwTkeOR2arZFUzuFACKOJ7jJfnVWR+2E27Fcr0AgzZXcF5LyROyFqTU 7o8qhWoUsA6IKoVCk8qYck7Sipys9saaOu7UhtdLgAtZve1ROBY23uI8GYh3t/uA7noy GmZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=2Al2MB4RFPlOK8A7W5u7gD4a/22998d0e+OoM5HVBaM=; b=RLHYU/KubmNl/cJbP2pcUqYMK1mpBQw078SRIJZTamKhp/PR/R9HjRkL19Rfm2mvPx LkFr6K7nitRCmeByT7wDPcz267iGRhkdgwBr8hH0ERgnnJYDJGhFnmMjGUwA+hKH2Qi6 71rtdR+8TDKVQtMBzjvRACNYpauD8JXswkZMxwTuKUt3Z8R15uPQX+FSKuO1VL2IRhSJ gobu6EYwOHdzKjxT89mfYH1X+bgdo19JbtaM39X0KTR0q+eM6U2PsI4ysVAg5wUv8dHR 7PViN9MC1kbLIyb7l1IuyBYa2Xt7xMgKbjYkDeZ+DKvHC7f0ZZWKADH7XY74QLoGEhxk cH3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w133-v6si23150620pfd.313.2018.09.04.11.34.44; Tue, 04 Sep 2018 11:35:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727844AbeIDW7q (ORCPT + 99 others); Tue, 4 Sep 2018 18:59:46 -0400 Received: from mail.skyhub.de ([5.9.137.197]:55784 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726507AbeIDW7q (ORCPT ); Tue, 4 Sep 2018 18:59:46 -0400 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (blast.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id uwAH3MIH5ESy; Tue, 4 Sep 2018 20:33:08 +0200 (CEST) Received: from zn.tnic (p200300EC2BC9A500329C23FFFEA6A903.dip0.t-ipconnect.de [IPv6:2003:ec:2bc9:a500:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id EF84D1EC02C1; Tue, 4 Sep 2018 20:33:07 +0200 (CEST) Date: Tue, 4 Sep 2018 20:33:01 +0200 From: Borislav Petkov To: Pu Wen Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, thomas.lendacky@amd.com, pbonzini@redhat.com, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Subject: Re: [PATCH v5 08/16] x86/apic: add modern APIC support for Hygon Message-ID: <20180904183301.GN32615@zn.tnic> References: <969a367a0b2d58f3e68bc6f97b6e8238e2390991.1535459013.git.puwen@hygon.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <969a367a0b2d58f3e68bc6f97b6e8238e2390991.1535459013.git.puwen@hygon.cn> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 29, 2018 at 08:44:30PM +0800, Pu Wen wrote: > Hygon processors use modern APIC, so just return in modern_apic() and > sync_Arb_IDs(). And should break in switch case in detect_init_API(). > > When running on 32 bit mode, should set bigsmp if there are more than > 8 cores. > > Signed-off-by: Pu Wen > --- > arch/x86/kernel/apic/apic.c | 19 ++++++++++++++----- > arch/x86/kernel/apic/probe_32.c | 1 + > 2 files changed, 15 insertions(+), 5 deletions(-) > > diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c > index 84132ed..a62968e 100644 > --- a/arch/x86/kernel/apic/apic.c > +++ b/arch/x86/kernel/apic/apic.c > @@ -220,10 +220,15 @@ static inline int lapic_is_integrated(void) > */ > static int modern_apic(void) > { > - /* AMD systems use old APIC versions, so check the CPU */ > - if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD && > - boot_cpu_data.x86 >= 0xf) > + /* > + * Old AMD systems use old APIC versions, newer AMD systems > + * and Hygon systems use modern APIC, so check the CPU > + */ > + if ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD && > + boot_cpu_data.x86 >= 0xf) || > + boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) > return 1; Those compound conditionals are not nice to read. Just add yours underneath: if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD && boot_cpu_data.x86 >= 0xf) return 1; if (boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) return 1; Do that where applicable and where it makes sense, syntax-wise to have a separate vendor == HYGON check in the other patches too. Thx. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.