Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp19521imm; Thu, 4 Oct 2018 14:45:36 -0700 (PDT) X-Google-Smtp-Source: ACcGV63BULjiUitWUsTtp0XKKLxHi95zx+is89MBUn14goKIbEmSXCxWeanzMBrVdI1CJE0u75QG X-Received: by 2002:a62:579c:: with SMTP id i28-v6mr8538114pfj.158.1538689536343; Thu, 04 Oct 2018 14:45:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538689536; cv=none; d=google.com; s=arc-20160816; b=n2XRszLu4ootH6IQbwxx/ymYJxCnlg6xOejtAcLQDer8Z640ImNZ7Jmg5+cEKp1URA HcXl5hj//oj9gmMCZzQ5oyOdmsU2GOMhw3+wq4KseL5nolNuBrNqhbGi/Oz35cEmql7k BR8MZvVxOcTLgojj3y2zo0+G6MdluplLVQai/IUAqSbR9koJ/+5ED5CYqRRv49qq33UO W/rOPBunxXF+0Tk0tjTGujQTEWokxzatHSweV5rEzi4F5Vsaiik/DXArG/Cz8HHUpkfw HufGJFznEg1KlWW0f4P5DgX1kbQ6ZeN5Brg1z6BH15N6Lipa/M4Z16roqHgjYOTn/g1r y67w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=3XmnCjpPDiDjJtlj2TOiThchXZVqLoEp2OkcOxqpGoc=; b=klREhMo2uKac8mBU1W4ViUGPHn/WguzXN2lsFV2VN1SIez7vYgk0eHw6NwyDQGDPL2 Sf1aHN5k7B+qoq7cYcwIAhWr0dKOAheOoSsf/EyOxzHIC9xrG8MuBb6tIyS9qRJPc8ML XoCBG1RVuiK3z5BPCdn5aLVCpBqDEvzbMp0G+IpILpzLEMIS4O006+m7vGVil3i4IU4I rZ1ZX6s50QlcRzCjj1nEW6KCCKLabGbdDjU3FiTQO1AmJsC4M666sZWI0KblUWlw6zVF 3UrA72OmvcfFPWfbcDOLErXlxL8J3bEb3NCKENsj9QZFdn9vacEumgMwpaUdI8MXDyvP kd2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wnkJ+PWM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5-v6si6277347ple.392.2018.10.04.14.45.21; Thu, 04 Oct 2018 14:45:36 -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; dkim=pass header.i=@kernel.org header.s=default header.b=wnkJ+PWM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727713AbeJEEkY (ORCPT + 99 others); Fri, 5 Oct 2018 00:40:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:38704 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726570AbeJEEkY (ORCPT ); Fri, 5 Oct 2018 00:40:24 -0400 Received: from localhost (unknown [198.217.64.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C5DE52084D; Thu, 4 Oct 2018 21:45:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1538689506; bh=TBDH52oXLGpbJqeoXn5KDMMnjVm25f9U8ZQrhDPkHIo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=wnkJ+PWMIALHGow8GbHnMYmEUTkxwN6wjE6ivi9zP7KqXilyyzRzIYatZAA1TJNiJ Z4mNGXzh8fRi8fY6jgSSLeFe3NBjc4ZeIqpYEjwpIGfTfyPD+IqzSgcRRPD0UF26gA ol8c/o0I1t7HIRjZZFIyP8rJfUTcc0vYXbRL1EVE= From: Andy Lutomirski To: x86@kernel.org Cc: LKML , Andy Lutomirski Subject: [PATCH 1/3] x86/vdso: Remove "memory" clobbers in the vDSO syscall fallbacks Date: Thu, 4 Oct 2018 14:44:43 -0700 Message-Id: <3a7438f5fb2422ed881683d2ccffd7f987b2dc44.1538689401.git.luto@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When a vDSO clock function falls back to the syscall, no special barriers or ordering is needed, and the syscall fallbacks don't clobber any memory that is not explicitly listed in the asm constraints. Remove the "memory" clobber. This causes minor changes to the generated code, but otherwise has no obvious performance impact. I think it's nice to have, though, since it may help the optimizer in the future. Signed-off-by: Andy Lutomirski --- arch/x86/entry/vdso/vclock_gettime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/entry/vdso/vclock_gettime.c b/arch/x86/entry/vdso/vclock_gettime.c index b7ccbff26a3f..18c8a78d1ec9 100644 --- a/arch/x86/entry/vdso/vclock_gettime.c +++ b/arch/x86/entry/vdso/vclock_gettime.c @@ -45,7 +45,7 @@ notrace static long vdso_fallback_gettime(long clock, struct timespec *ts) long ret; asm ("syscall" : "=a" (ret), "=m" (*ts) : "0" (__NR_clock_gettime), "D" (clock), "S" (ts) : - "memory", "rcx", "r11"); + "rcx", "r11"); return ret; } @@ -62,7 +62,7 @@ notrace static long vdso_fallback_gettime(long clock, struct timespec *ts) "mov %%edx, %%ebx \n" : "=a" (ret), "=m" (*ts) : "0" (__NR_clock_gettime), [clock] "g" (clock), "c" (ts) - : "memory", "edx"); + : "edx"); return ret; } -- 2.17.1