Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755548AbdDJROY (ORCPT ); Mon, 10 Apr 2017 13:14:24 -0400 Received: from mail-co1nam03on0096.outbound.protection.outlook.com ([104.47.40.96]:9488 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752529AbdDJROW (ORCPT ); Mon, 10 Apr 2017 13:14:22 -0400 From: Jork Loeser To: Vitaly Kuznetsov CC: "devel@linuxdriverproject.org" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , KY Srinivasan , "Haiyang Zhang" , Stephen Hemminger , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Steven Rostedt Subject: RE: [PATCH 2/7] x86/hyper-v: fast hypercall implementation Thread-Topic: [PATCH 2/7] x86/hyper-v: fast hypercall implementation Thread-Index: AQHSr5HoZRPhelnvPUu9nkW1D8tTuqG6TdlggAQG1hmAAF5VjYAAJBQA Date: Mon, 10 Apr 2017 17:14:14 +0000 Message-ID: References: <20170407112701.17157-1-vkuznets@redhat.com> <20170407112701.17157-3-vkuznets@redhat.com> <87vaqc8wbt.fsf@vitty.brq.redhat.com> <87mvboqq2u.fsf@vitty.brq.redhat.com> In-Reply-To: <87mvboqq2u.fsf@vitty.brq.redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=microsoft.com; x-originating-ip: [50.125.67.66] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;CY4PR21MB0631;7:MRvRnpGZmJn6GUXACB0x3ItM0qngHGP5Osj3/kwkoBgCvVoIIH8lP/0s73YhCOTnS75qny3N5nv7MqLHbmtWFfnkSBBbSytFCEHzSZ7Mc0Cc8e1Ttvv72vW7sFA/Rg3hgAXYFIlMsQRfvShyHj2ibxbGc+U7VAXs13nz6HJOPNV4Ts66lP2Rzi6xG3402vgXrRbkDEE0gRAohb8EoEPM8+uxs2HfXNdoqRir5TY+6y1i/6yEnV0NCx6n2eyXP5CikQp5131Z4pJCcj+PfzF5tHl/HqA4Ue6TGq61YqhdEpZM2Yky6RVBGDfnyM/huXZ0JBTnkWQfkJ1v6GccjmbjlIdGrxEsfkVzS+n6KG90A40= x-ms-office365-filtering-correlation-id: 83bc1e1a-6c99-4c51-9795-08d48035036e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081);SRVR:CY4PR21MB0631; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041248)(201703131423075)(201702281528075)(201703061421075)(20161123560025)(20161123555025)(20161123564025)(20161123562025)(6072148);SRVR:CY4PR21MB0631;BCL:0;PCL:0;RULEID:;SRVR:CY4PR21MB0631; x-forefront-prvs: 027367F73D x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39400400002)(39410400002)(39860400002)(39840400002)(39850400002)(39450400003)(13464003)(6916009)(8990500004)(10290500002)(2900100001)(5005710100001)(86362001)(2950100002)(33656002)(229853002)(10090500001)(9686003)(54906002)(55016002)(99286003)(2906002)(53936002)(93886004)(122556002)(6506006)(6436002)(77096006)(8936002)(4326008)(25786009)(110136004)(38730400002)(8676002)(3846002)(6116002)(102836003)(66066001)(81166006)(3660700001)(6246003)(3280700002)(7696004)(189998001)(74316002)(50986999)(305945005)(5660300001)(54356999)(76176999)(7736002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR21MB0631;H:CY4PR21MB0631.namprd21.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Apr 2017 17:14:14.3762 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0631 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v3AHEp9X019569 Content-Length: 1242 Lines: 43 > -----Original Message----- > From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com] > Vitaly Kuznetsov writes: > > > Jork Loeser writes: > > > > [snip] > > > > >>> + } > >>> +#else > >>> + { > >>> + u32 hv_status_hi, hv_status_lo; > >>> + > >>> + __asm__ __volatile__ ("call *%6" > >>> + : "=d"(hv_status_hi), > >>> + "=a"(hv_status_lo) : > >>> + "d" (control.as_uint32_hi), > >>> + "a" (control.as_uint32_lo), > >>> + "c" ((u32)input1), > >>> + "b" ((u32)(input1 >> 32)), > >>> + "m" (hv_hypercall_pg) > >>> + : "cc"); > >>> + > >>> + return hv_status_lo | ((u64)hv_status_hi << 32); > >>> + } > >>> +#endif > >> Please clobber ECX, EDI and ESI for x86. Clobber memory as well? > > > > ECX is already in listed in inputs (lower part of input1) so it's > > automatically clobbered. I'll add EDI and ESI to clobbers here, thanks! > > Oh, I see what you mean - hypervisor is allowed to write to ecx too, we need > to pass it with '+'. Will do, thanks! Yes, thank you Vitaly! As for memory clobber, we would want that if there were hypercalls that modify memory and can issued via the "fast" ABI. If there are not, we are fine. Regards, Jork