From owner-svn-src-head@freebsd.org Mon Aug 14 06:47:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D4E8DD8B91; Mon, 14 Aug 2017 06:47:03 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-pg0-x22c.google.com (mail-pg0-x22c.google.com [IPv6:2607:f8b0:400e:c05::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2E627055D; Mon, 14 Aug 2017 06:47:02 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-pg0-x22c.google.com with SMTP id l64so41032215pge.5; Sun, 13 Aug 2017 23:47:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=n1w1cjqfdSH1dCuIi73a7rCgOQs6bPxBfPKEaTUl9Y8=; b=j5GUbp6kaRcW43oYsSiVYKvEJWIN+De1KPo9ZFrzjn1ZOzrtQBymqIlmBZCpy4tuTL 1SYQsQkZCfPXp/11BqCNcW8lgVforQ7o4y3kpigKlcpcD3ntv2jPMq1B5f6zKqHp4wK5 7+93hNnNtjxVsHCjI3PpXSKVD8VTQstHLANlIzQyDTBEn7k7tGHLWFoW7iur6BQ+ypyj ZumAaYORllTRU/UuUBQfRd7GZ16ABtQUkrlkVx5XoTOJN3qUhHYFkIs0/fLtx4SZ7Ux4 HDqsgObDYYI5u/e/CabWvVVaJ6lAduZCW7yOQqAtPXwX0AgCYywCy1YcRTUPonPFYNm6 Rxdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=n1w1cjqfdSH1dCuIi73a7rCgOQs6bPxBfPKEaTUl9Y8=; b=jpIRzlLaLg55m0DaY24pL1psT26lm/2fwilGcRsItgjWlUkc3KEq/0zHJstsSAd2X3 VfQaaKc6MMcZ+CJs/+RGuNBj+Ly8p7057mfkhXsoSvj2MxbeoVLrjA8DomoyX/q9W2To Zs6GIDznFO03OTnugdlIHdJrEotE1RX43hUW0fEsk3C9TTa0+SmzxpgzjLgRNFzQKzuT T1ViS0kI/whtz1JGxudq3s7prGQA1s8UQeKHWGgYMNJ5g76zW2xEixAMTAqMV6COdLwP rOMBHwBXBGrkuyWtSFnYC7wV2cIYkoaOlms2fcG1PVO2CpoFXfLxiRf3WKuXsKtadYn7 L49g== X-Gm-Message-State: AHYfb5jICWAc5KPxi2DNjWbsTS/ix01PXxVpkL4nw0mt6tBzHzqbvu6h +dn25eXfBsY7s555zb8j24A+UYsDoA== X-Received: by 10.84.231.2 with SMTP id f2mr27136813plk.253.1502693222276; Sun, 13 Aug 2017 23:47:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.128.28 with HTTP; Sun, 13 Aug 2017 23:47:01 -0700 (PDT) In-Reply-To: References: <201708091809.v79I9924028330@repo.freebsd.org> From: Sepherosa Ziehau Date: Mon, 14 Aug 2017 14:47:01 +0800 Message-ID: Subject: Re: svn commit: r322323 - in head/sys: amd64/amd64 i386/include x86/include x86/x86 To: Jung-uk Kim Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2017 06:47:03 -0000 I just MFCed it to stable/11. Please MFC it to stable/10. On Mon, Aug 14, 2017 at 2:28 PM, Sepherosa Ziehau wrote: > Please MFC this to 10-stable/11-stable. > > Thanks, > sephe > > On Thu, Aug 10, 2017 at 2:09 AM, Jung-uk Kim wrote: >> Author: jkim >> Date: Wed Aug 9 18:09:09 2017 >> New Revision: 322323 >> URL: https://svnweb.freebsd.org/changeset/base/322323 >> >> Log: >> Split identify_cpu() into two functions for amd64 as we do for i386. This >> reduces diff between amd64 and i386. Also, it fixes a regression introduced >> in r322076, i.e., identify_hypervisor() failed to identify some hypervisors. >> This function assumes cpu_feature2 is already initialized. >> >> Reported by: dexuan >> Tested by: dexuan >> >> Modified: >> head/sys/amd64/amd64/machdep.c >> head/sys/i386/include/md_var.h >> head/sys/x86/include/x86_var.h >> head/sys/x86/x86/identcpu.c >> >> Modified: head/sys/amd64/amd64/machdep.c >> ============================================================================== >> --- head/sys/amd64/amd64/machdep.c Wed Aug 9 18:06:27 2017 (r322322) >> +++ head/sys/amd64/amd64/machdep.c Wed Aug 9 18:09:09 2017 (r322323) >> @@ -1537,6 +1537,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) >> >> kmdp = init_ops.parse_preload_data(modulep); >> >> + identify_cpu(); >> identify_hypervisor(); >> >> /* Init basic tunables, hz etc */ >> @@ -1643,7 +1644,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) >> != NULL) >> vty_set_preferred(VTY_VT); >> >> - identify_cpu(); /* Final stage of CPU initialization */ >> + finishidentcpu(); /* Final stage of CPU initialization */ >> initializecpu(); /* Initialize CPU registers */ >> initializecpucache(); >> >> >> Modified: head/sys/i386/include/md_var.h >> ============================================================================== >> --- head/sys/i386/include/md_var.h Wed Aug 9 18:06:27 2017 (r322322) >> +++ head/sys/i386/include/md_var.h Wed Aug 9 18:09:09 2017 (r322323) >> @@ -59,7 +59,6 @@ void doreti_popl_es(void) __asm(__STRING(doreti_popl_e >> void doreti_popl_es_fault(void) __asm(__STRING(doreti_popl_es_fault)); >> void doreti_popl_fs(void) __asm(__STRING(doreti_popl_fs)); >> void doreti_popl_fs_fault(void) __asm(__STRING(doreti_popl_fs_fault)); >> -void finishidentcpu(void); >> void fill_based_sd(struct segment_descriptor *sdp, uint32_t base); >> void i686_pagezero(void *addr); >> void sse2_pagezero(void *addr); >> >> Modified: head/sys/x86/include/x86_var.h >> ============================================================================== >> --- head/sys/x86/include/x86_var.h Wed Aug 9 18:06:27 2017 (r322322) >> +++ head/sys/x86/include/x86_var.h Wed Aug 9 18:09:09 2017 (r322323) >> @@ -115,6 +115,7 @@ void cpu_probe_amdc1e(void); >> void cpu_setregs(void); >> void dump_add_page(vm_paddr_t); >> void dump_drop_page(vm_paddr_t); >> +void finishidentcpu(void); >> void identify_cpu(void); >> void identify_hypervisor(void); >> void initializecpu(void); >> >> Modified: head/sys/x86/x86/identcpu.c >> ============================================================================== >> --- head/sys/x86/x86/identcpu.c Wed Aug 9 18:06:27 2017 (r322322) >> +++ head/sys/x86/x86/identcpu.c Wed Aug 9 18:09:09 2017 (r322323) >> @@ -1372,23 +1372,12 @@ fix_cpuid(void) >> return (false); >> } >> >> -/* >> - * Final stage of CPU identification. >> - */ >> -#ifdef __i386__ >> +#ifdef __amd64__ >> void >> -finishidentcpu(void) >> -#else >> -void >> identify_cpu(void) >> -#endif >> { >> - u_int regs[4], cpu_stdext_disable; >> -#ifdef __i386__ >> - u_char ccr3; >> -#endif >> + u_int regs[4]; >> >> -#ifdef __amd64__ >> do_cpuid(0, regs); >> cpu_high = regs[0]; >> ((u_int *)&cpu_vendor)[0] = regs[1]; >> @@ -1401,6 +1390,18 @@ identify_cpu(void) >> cpu_procinfo = regs[1]; >> cpu_feature = regs[3]; >> cpu_feature2 = regs[2]; >> +} >> +#endif >> + >> +/* >> + * Final stage of CPU identification. >> + */ >> +void >> +finishidentcpu(void) >> +{ >> + u_int regs[4], cpu_stdext_disable; >> +#ifdef __i386__ >> + u_char ccr3; >> #endif >> >> cpu_vendor_id = find_cpu_vendor_id(); >> _______________________________________________ >> svn-src-all@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/svn-src-all >> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > > > > -- > Tomorrow Will Never Die -- Tomorrow Will Never Die