From patchwork Mon Jan 6 08:22:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 3436381 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 236899F163 for ; Mon, 6 Jan 2014 08:23:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 58C75201B4 for ; Mon, 6 Jan 2014 08:23:35 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3E4842018A for ; Mon, 6 Jan 2014 08:23:34 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W05Sp-0006AB-UL; Mon, 06 Jan 2014 08:23:12 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W05Sl-0003GZ-Kz; Mon, 06 Jan 2014 08:23:07 +0000 Received: from mail-wi0-f177.google.com ([209.85.212.177]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W05SV-0003C6-8v for linux-arm-kernel@lists.infradead.org; Mon, 06 Jan 2014 08:22:52 +0000 Received: by mail-wi0-f177.google.com with SMTP id cc10so2504721wib.10 for ; Mon, 06 Jan 2014 00:22:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GExGrg52X2H9EWL0U1CoDfFNwiF2v6VuFSCX0nu9pXo=; b=OC/jf2RIACHFl/OOAHNrYrFLIlHE8UHIAz97457GnI6lSYZVkw7MXeI7wttCAFZ5yT vVT8V2PQa48o5UkNkDv8aXLIEfIkI6k6Y0qy1zVHcadHZ4/oqpmjesk8iZ66M/sDGm4x q8VRzJFMITK1XFNdpqPTfCI1ud5taSjIpHOTRNPKA0zpqFAZ7BbYuQZnyYK3wSt2ugSe iuAR33KY/8aEEqNxOicPNtBn0qEUAh+NDxdOPYXujHs5klABllsoIzegvgWJBS7mdxMe XZogY6WCoLFRjYV9yf2j6PP+ktsMmPNDwogrGaiLYqAF4P3kEIrkuwcQSWMfzlD407sI rjlQ== X-Gm-Message-State: ALoCoQlMY1JJWI0GJK1kVaqZae6r02wfEUpQomcXELTdQiHvLizF8jcdVzwkE5TaYJE/rKzwD93n X-Received: by 10.194.2.11 with SMTP id 11mr271027wjq.82.1388996548319; Mon, 06 Jan 2014 00:22:28 -0800 (PST) Received: from ards-mac-mini.local (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by mx.google.com with ESMTPSA id ci4sm41930498wjc.21.2014.01.06.00.22.27 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 06 Jan 2014 00:22:27 -0800 (PST) From: Ard Biesheuvel To: catalin.marinas@arm.com, will.deacon@arm.com, gregkh@linuxfoundation.org, akpm@linux-foundation.org, hpa@zytor.com, ak@linux.intel.com Subject: [PATCH 4/8] x86: align with generic cpu modalias Date: Mon, 6 Jan 2014 09:22:12 +0100 Message-Id: <1388996536-27014-5-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1388996536-27014-1-git-send-email-ard.biesheuvel@linaro.org> References: <1388996536-27014-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140106_032251_410499_F969FE1E X-CRM114-Status: UNSURE ( 8.66 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) Cc: Ard Biesheuvel , herbert@gondor.apana.org.au, nico@linaro.org, x86@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Align with the new generic 'cpu:type:...:features:...' modalias by moving the 'x86' prefix and the vendor/family/model IDs into the 'type' field. Signed-off-by: Ard Biesheuvel --- arch/x86/kernel/cpu/match.c | 3 +-- scripts/mod/file2alias.c | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/cpu/match.c b/arch/x86/kernel/cpu/match.c index ab6082a9020e..82e92b2185f6 100644 --- a/arch/x86/kernel/cpu/match.c +++ b/arch/x86/kernel/cpu/match.c @@ -56,8 +56,7 @@ ssize_t arch_print_cpu_modalias(struct device *dev, int i, n; char *buf = bufptr; - n = snprintf(buf, size, "x86cpu:vendor:%04X:family:%04X:" - "model:%04X:feature:", + n = snprintf(buf, size, "cpu:type:x86,ven%04Xfam%04Xmod%04X:feature:", boot_cpu_data.x86_vendor, boot_cpu_data.x86, boot_cpu_data.x86_model); diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 8a69005228d8..5fdad833f951 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -1110,7 +1110,7 @@ static int do_amba_entry(const char *filename, } ADD_TO_DEVTABLE("amba", amba_id, do_amba_entry); -/* LOOKS like x86cpu:vendor:VVVV:family:FFFF:model:MMMM:feature:*,FEAT,* +/* LOOKS like cpu:type:x86,venVVVVfamFFFFmodMMMM:feature:*,FEAT,* * All fields are numbers. It would be nicer to use strings for vendor * and feature, but getting those out of the build system here is too * complicated. @@ -1124,10 +1124,10 @@ static int do_x86cpu_entry(const char *filename, void *symval, DEF_FIELD(symval, x86_cpu_id, model); DEF_FIELD(symval, x86_cpu_id, vendor); - strcpy(alias, "x86cpu:"); - ADD(alias, "vendor:", vendor != X86_VENDOR_ANY, vendor); - ADD(alias, ":family:", family != X86_FAMILY_ANY, family); - ADD(alias, ":model:", model != X86_MODEL_ANY, model); + strcpy(alias, "cpu:type:x86,"); + ADD(alias, "ven", vendor != X86_VENDOR_ANY, vendor); + ADD(alias, "fam", family != X86_FAMILY_ANY, family); + ADD(alias, "mod", model != X86_MODEL_ANY, model); strcat(alias, ":feature:*"); if (feature != X86_FEATURE_ANY) sprintf(alias + strlen(alias), "%04X*", feature);