From patchwork Thu Nov 21 15:42:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 3219561 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D7DC7C045B for ; Thu, 21 Nov 2013 15:46:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 32D4B20374 for ; Thu, 21 Nov 2013 15:46:04 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C30C120752 for ; Thu, 21 Nov 2013 15:45:58 +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 1VjWQl-0007FW-5P; Thu, 21 Nov 2013 15:44:36 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VjWPk-0006dC-QJ; Thu, 21 Nov 2013 15:43:32 +0000 Received: from mail-we0-f171.google.com ([74.125.82.171]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VjWPN-0006Zb-OR for linux-arm-kernel@lists.infradead.org; Thu, 21 Nov 2013 15:43:11 +0000 Received: by mail-we0-f171.google.com with SMTP id q58so5149709wes.30 for ; Thu, 21 Nov 2013 07:42:47 -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=sFosebwLUZk3ryEtxv6USI3HyCelG0DJWRYKCMi+Ef0=; b=c8LRKmc6R+biUtoDWpmpvXjruPD2Lkga7hFYmzNXVPhEejK2k4La2cW56fLn6P3FVj Xx/x2m6apcHBQ2mgjrwnW6mNTcD1jko8fUIf8m6dli71gzN/NkVoFd0vp0BPJyVzdicf JxgidXUWGYc0A41q9SKu9e9041GTSbvi8fkiupNo1pXKwYFw/4GDkEvFoO/iFhiPnj3Y lrVwkzKOfoWAYxwQdXWRHRbngPP5WbXqclVuCKLkmjxcrloo+9e/9SK9thOwLtM17iV0 3GlnCKVaX20LghZ8dLnJy/ZuBawXLo+QhBVMWKUkwENYLvJO7H5q2MMFK+wdnEUTwjPS qUMQ== X-Gm-Message-State: ALoCoQmykDcXCPFyaTwORVGoi4fNeEkacBvH3JbcfZDWQyMgeBgqLEt8ZK13f/TnbBd8KkDCO4wE X-Received: by 10.180.83.1 with SMTP id m1mr6403671wiy.9.1385048567669; Thu, 21 Nov 2013 07:42:47 -0800 (PST) Received: from localhost.localdomain (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by mx.google.com with ESMTPSA id dn2sm6329879wid.1.2013.11.21.07.42.46 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Nov 2013 07:42:47 -0800 (PST) From: Ard Biesheuvel To: x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/4] x86: align with generic cpu modalias Date: Thu, 21 Nov 2013 16:42:31 +0100 Message-Id: <1385048552-12528-4-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1385048552-12528-1-git-send-email-ard.biesheuvel@linaro.org> References: <1385048552-12528-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131121_104309_966763_F167667B X-CRM114-Status: GOOD ( 10.49 ) X-Spam-Score: -2.6 (--) Cc: ak@linux.intel.com, catalin.marinas@arm.com, Ard Biesheuvel , gregkh@linuxfoundation.org, mingo@redhat.com, hpa@zytor.com, akpm@linux-foundation.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.7 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 ab6082a..82e92b2 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 efc7abe..856c343 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);