summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-04-22Snap for 4736748 from d2cc2b74f161d88bc0622b03d48ef176fefee03a to pi-releaseandroid-wear-9.0.0_r9android-wear-9.0.0_r8android-wear-9.0.0_r7android-wear-9.0.0_r6android-wear-9.0.0_r5android-wear-9.0.0_r4android-wear-9.0.0_r34android-wear-9.0.0_r33android-wear-9.0.0_r32android-wear-9.0.0_r31android-wear-9.0.0_r30android-wear-9.0.0_r3android-wear-9.0.0_r29android-wear-9.0.0_r28android-wear-9.0.0_r27android-wear-9.0.0_r26android-wear-9.0.0_r25android-wear-9.0.0_r24android-wear-9.0.0_r23android-wear-9.0.0_r22android-wear-9.0.0_r21android-wear-9.0.0_r20android-wear-9.0.0_r2android-wear-9.0.0_r19android-wear-9.0.0_r18android-wear-9.0.0_r17android-wear-9.0.0_r16android-wear-9.0.0_r15android-wear-9.0.0_r14android-wear-9.0.0_r13android-wear-9.0.0_r12android-wear-9.0.0_r11android-wear-9.0.0_r10android-wear-9.0.0_r1android-vts-9.0_r9android-vts-9.0_r8android-vts-9.0_r7android-vts-9.0_r6android-vts-9.0_r5android-vts-9.0_r4android-vts-9.0_r19android-vts-9.0_r18android-vts-9.0_r17android-vts-9.0_r16android-vts-9.0_r15android-vts-9.0_r14android-vts-9.0_r13android-vts-9.0_r12android-vts-9.0_r11android-vts-9.0_r10android-security-9.0.0_r76android-security-9.0.0_r75android-security-9.0.0_r74android-security-9.0.0_r73android-security-9.0.0_r72android-security-9.0.0_r71android-security-9.0.0_r70android-security-9.0.0_r69android-security-9.0.0_r68android-security-9.0.0_r67android-security-9.0.0_r66android-security-9.0.0_r65android-security-9.0.0_r64android-security-9.0.0_r63android-security-9.0.0_r62android-cts-9.0_r9android-cts-9.0_r8android-cts-9.0_r7android-cts-9.0_r6android-cts-9.0_r5android-cts-9.0_r4android-cts-9.0_r3android-cts-9.0_r20android-cts-9.0_r2android-cts-9.0_r19android-cts-9.0_r18android-cts-9.0_r17android-cts-9.0_r16android-cts-9.0_r15android-cts-9.0_r14android-cts-9.0_r13android-cts-9.0_r12android-cts-9.0_r11android-cts-9.0_r10android-cts-9.0_r1android-9.0.0_r9android-9.0.0_r8android-9.0.0_r7android-9.0.0_r61android-9.0.0_r60android-9.0.0_r6android-9.0.0_r59android-9.0.0_r58android-9.0.0_r57android-9.0.0_r56android-9.0.0_r55android-9.0.0_r54android-9.0.0_r53android-9.0.0_r52android-9.0.0_r51android-9.0.0_r50android-9.0.0_r5android-9.0.0_r49android-9.0.0_r48android-9.0.0_r3android-9.0.0_r2android-9.0.0_r18android-9.0.0_r17android-9.0.0_r10android-9.0.0_r1security-pi-releasepie-vts-releasepie-security-releasepie-s2-releasepie-release-2pie-releasepie-r2-s2-releasepie-r2-s1-releasepie-r2-releasepie-platform-releasepie-gsipie-cuttlefish-testingpie-cts-releaseandroid-build-team Robot
Change-Id: I41f644223454c399aa11065fb959f58440db94f2
2018-04-20apf: Tweak the interpreter data addressing schemeandroid-9.0.0_r47android-9.0.0_r46android-9.0.0_r45android-9.0.0_r44android-9.0.0_r43android-9.0.0_r42android-9.0.0_r41android-9.0.0_r40android-9.0.0_r39android-9.0.0_r38android-9.0.0_r37android-9.0.0_r36android-9.0.0_r35android-9.0.0_r34android-9.0.0_r33android-9.0.0_r32android-9.0.0_r31android-9.0.0_r30android-9.0.0_r22android-9.0.0_r21android-9.0.0_r20android-9.0.0_r19android-9.0.0_r16android-9.0.0_r12android-9.0.0_r11pie-qpr3-s1-releasepie-qpr3-releasepie-qpr3-b-releasepie-qpr2-releasepie-qpr1-s3-releasepie-qpr1-s2-releasepie-qpr1-s1-releasepie-qpr1-releasepie-dr1-releasepie-dr1-devpie-devpie-b4s4-releasepie-b4s4-devBernie Innocenti
After releasing APFv3, we realized that addressing memory from the top could be simplified by adjusting a few details: 1) The APF interpreter now receives a single unified buffer containing both the program bytecode and the data segment, unambiguously matching the memory layout seen by installApfPacketFilter() and readApfPacketFilter(). 2) Data address zero coincides with the beginning of the APF program, thus decoupling data addresses from the length of the program (which could change between invokations of installApfPacketFilter()). This simplifies the ApfGenerator by not requiring a data relocation step similar to jump relocation. 3) For convenience, the interpreter pre-fills one volatile memory slot with the total size of the APF buffer. The APF program can load this value into a register to efficiently write near the end of the data segment, thus allowing the program-data boundary to shift freely. 4) Negative addresses wrap around the end of the data buffer, such that address -1 coincides with the last byte of the buffer. 5) The immediate offet of LDDW and SDDW are now sign-extended, such that small negative offsets can be encoded as a 1-byte immediate. This, combined with the modular addressing at (4), can be used to address memory cells near the end of the data region with 2-byte opcodes. Overall, the above changes allow building a simple 32bit counter with a sequence more or less like this: 2 li R1, -4 ; R1 = -4 (last 32bit word of data) 1 lddw R0, [R1 + 0] ; R0 = old counter value 2 add R0, 42 ; Increment counter by some value 1 stdw R0, [R1 + 0] ; Write back the new value Total: 6 bytes. Note how the above bytecode is independent of the actual size of the program and data segments. To reduce bytecode size, the counter increment sequence can be moved to an "IncrementAndDrop" trampoline, taking only 2 bytes more than a direct jump to DROP: 2 li R1, -12 ; R0 = counter offset (third to last counter) 3 jmp CountAndDrop ; (could be 2 bytes if jumping nearby) ... CountAndDrop: 1 lddw R0, [R1+0] ; R0 = old counter value 2 add R0, 1 ; Increment counter 1 stdw R0, [R1+0] ; Write back updated value 3 jmp DROP ; cya! Adding a 1-byte INC instruction would make things a little nicer. Change-Id: Ia9b25e49e127a48d7344ddc60b17c93d6421ab7d Bug: 73804303 Test: runtest -x tests/net/java/android/net/apf/ApfTest.java (cherry picked from commit 17c1fbc9e98e380e508fa83d0f927bc742a5161b)
2018-04-03Snap for 4696032 from 5a1f7799656e73736b9a07ee564b9349c4a1b40f to pi-releaseandroid-build-team Robot
Change-Id: If50a0682e77085adb03ddd990f75b682683927ad
2018-04-02apf: Fix bound-checking to allow accessing the last data byte.Bernie Innocenti
Bug: 73804303 Test: runtest -x frameworks/base/tests/net/java/android/net/apf/ApfTest.java Merged-In: I3543eedac5998d6a1b16010b5dc8865e9cc24b5b Change-Id: I3543eedac5998d6a1b16010b5dc8865e9cc24b5b (cherry picked from commit 7024456a1fb07f0a88ed8dbeeba41c21a4a40304)
2018-04-02Fix compilation error for printf args.Erik Kline
Test: make apf_run works Bug: 73804303 Merged-In: I6fd47d0a1fe4a73f2bad85a79566b40426f56eb2 Merged-In: I31a2a77c7025f6aa7abea40344622865567fa0a5 Change-Id: Icd4b5d051ba55439a5ce346c0bc61a95da6cc03f (cherry picked from commit 7a1d9a6dbddaa46e8b74859952a58b55ddcd5801)
2018-04-02Add APF opcodes to read/write data memory (take 2)Bernie Innocenti
The new opcodes are LDDW (LoaD Data Word) and STDW (STore Data Word) The only supported addressing mode is register-indirect with immediate offset (register value + immediate value). Since there's a single register bit encoded in the opcode, the other register is implicitly used for the address operand. Hence, the following variations are possible: lddw R0, [1234]R1 ; R0 = *(R1 + 1234) lddw R1, [1234]R0 ; R1 = *(R0 + 1234) stdw R0, [1234]R1 ; *(R1 + 1234) = R0 stdw R1, [1234]R0 ; *(R0 + 1234) = R1 The immediate can also be specified to be length 0, making the memory access equivalent to a plain register-indirect with no offset. lddw R0, R1 ; R0 = *R1 lddw R1, R0 ; R1 = *R0 stdw R0, R1 ; *R1 = R0 stdw R1, R0 ; *R0 = R1 The encoding of the above instructions is a single byte, making a typical counter increment more efficient, especially when the address requires a multi-byte immediate: ldh R1, 1234 ; address of our packet counter (3 bytes) lddw R0, R1 ; load the counter from address 1234 (1 byte) add R0, 1 ; increment the counter (2 bytes) stdw R0, R1 ; write-back to data ram (1 byte) Total: 7 bytes. Defining a separate INCW instruction would reduce the above sequence down to 3 bytes (or 4 bytes if using an EXT opcode to avoid wasting opcodes). This optimization can be added at a later point if the data access patterns of production APF code justify it. Bug: 73804303 Test: runtest -x tests/net/java/android/net/apf/ApfTest.java Merged-In: I4bea29ea701cc11dc61cdcf60cc824bbe14b24f6 Merged-In: Ibbd427e12987a1eef63b41d816af05a1bd9f9170 Change-Id: Ibbd427e12987a1eef63b41d816af05a1bd9f9170 (cherry picked from commit 75410970184bf98626342588ba2eabf79cda6d38)
2017-07-11Add OWNERS file for Android core networking am: 89639347f9 am: 063c56133a ↵android-wear-8.0.0_r1android-p-preview-1android-o-mr1-iot-preview-7oreo-mr1-devo-mr1-iot-preview-7Hugo Benichi
am: 904be69da9 am: 1bc3e766dd Change-Id: I3a980446e96b2cc4cb2ac3b6a14de47c6184ea68
2017-07-11Add OWNERS file for Android core networking am: 89639347f9 am: 063c56133aandroid-o-mr1-iot-preview-6o-mr1-iot-preview-6Hugo Benichi
am: 904be69da9 Change-Id: Ib922e727598464781bb5854c0d9fd774532e3aa2
2017-07-11Add OWNERS file for Android core networking am: 89639347f9Hugo Benichi
am: 063c56133a Change-Id: Ie2e182db99e90e84aa36089871f97fcc7b5511ea
2017-07-11Add OWNERS file for Android core networkingandroid-o-mr1-preview-2android-o-mr1-preview-1Hugo Benichi
am: 89639347f9 Change-Id: I59617e8cf950aace37d97dad0ed94f4f67065b2d
2017-07-07Add OWNERS file for Android core networkingandroid-o-preview-4android-o-iot-preview-5o-iot-preview-5Hugo Benichi
Bug: 63408147 Test: builds Change-Id: I96ac2a04e3a991af7429db1d32a00f69532e3765
2016-12-05Fix possible out of bound for program array am: f7cea66b5e am: dc89abf313 ↵android-vts-8.0_r9android-vts-8.0_r8android-vts-8.0_r7android-vts-8.0_r6android-vts-8.0_r2android-vts-8.0_r13android-vts-8.0_r12android-vts-8.0_r11android-vts-8.0_r10android-vts-8.0_r1android-security-8.0.0_r54android-security-8.0.0_r53android-security-8.0.0_r52android-cts-8.0_r9android-cts-8.0_r8android-cts-8.0_r7android-cts-8.0_r6android-cts-8.0_r5android-cts-8.0_r4android-cts-8.0_r3android-cts-8.0_r26android-cts-8.0_r25android-cts-8.0_r24android-cts-8.0_r23android-cts-8.0_r22android-cts-8.0_r21android-cts-8.0_r20android-cts-8.0_r2android-cts-8.0_r19android-cts-8.0_r18android-cts-8.0_r17android-cts-8.0_r16android-cts-8.0_r15android-cts-8.0_r14android-cts-8.0_r13android-cts-8.0_r12android-cts-8.0_r11android-cts-8.0_r10android-cts-8.0_r1android-8.0.0_r9android-8.0.0_r7android-8.0.0_r51android-8.0.0_r50android-8.0.0_r49android-8.0.0_r48android-8.0.0_r47android-8.0.0_r46android-8.0.0_r45android-8.0.0_r44android-8.0.0_r43android-8.0.0_r42android-8.0.0_r41android-8.0.0_r40android-8.0.0_r4android-8.0.0_r39android-8.0.0_r38android-8.0.0_r37android-8.0.0_r36android-8.0.0_r35android-8.0.0_r34android-8.0.0_r33android-8.0.0_r32android-8.0.0_r31android-8.0.0_r30android-8.0.0_r3android-8.0.0_r29android-8.0.0_r28android-8.0.0_r27android-8.0.0_r26android-8.0.0_r25android-8.0.0_r24android-8.0.0_r23android-8.0.0_r22android-8.0.0_r21android-8.0.0_r2android-8.0.0_r17android-8.0.0_r16android-8.0.0_r15android-8.0.0_r13android-8.0.0_r12android-8.0.0_r11android-8.0.0_r10android-8.0.0_r1security-oc-releaseoreo-vts-releaseoreo-security-releaseoreo-releaseoreo-r6-releaseoreo-r5-releaseoreo-r4-releaseoreo-r3-releaseoreo-r2-releaseoreo-dr3-releaseoreo-dr2-releaseoreo-dr1-releaseoreo-dr1-devoreo-devoreo-cts-releaseManoj Gupta
am: 1f1b66837c am: b75c9f3714 Change-Id: I64dbd692498a2e5e79ab5ebec46811a2b5fc8a0e
2016-12-05Fix possible out of bound for program array am: f7cea66b5e am: dc89abf313android-wear-o-preview-4android-wear-o-preview-3android-o-preview-3android-o-preview-2android-n-iot-preview-4n-iot-preview-4Manoj Gupta
am: 1f1b66837c Change-Id: Ic08fc90a57971d0278f79fc330647cce23bd09e2
2016-12-05Fix possible out of bound for program array am: f7cea66b5eManoj Gupta
am: dc89abf313 Change-Id: Id832ed1c7cc7a88fed0361359f9dda714bc95cdc
2016-12-05Fix possible out of bound for program arrayandroid-o-preview-1o-previewManoj Gupta
am: f7cea66b5e Change-Id: Ic528a59aceb5c8a368c195d6de4fc9e3384292e4
2016-11-08Fix possible out of bound for program arrayManoj Gupta
Fixes warnings: hardware/google/apf/apf_disassembler.c:136:48: warning: The right operand of '|' is a garbage value hardware/google/apf/apf_disassembler.c:96:32: warning: The right operand of '|' is a garbage value Test: Builds without above 2 warnings Change-Id: I8a05e575c04dd74e29dfc845c6a7a58c10cbe380
2016-07-28Add host executable to try running an APF program against a packet. am: ↵Paul Jensen
f9491fa279 am: f80b9d17d3 am: 0b6f2a6cd6 Change-Id: I31fb92f18ed44e11019fc98d8af76fc46f9b55e1
2016-07-27Add host executable to try running an APF program against a packet. am: ↵Paul Jensen
f9491fa279 am: f80b9d17d3 Change-Id: I1493ee8fe134c25fb368757beed4b3752365835a
2016-07-27Add host executable to try running an APF program against a packet.android-7.1.2_r9android-7.1.2_r8android-7.1.2_r6android-7.1.2_r5android-7.1.2_r4android-7.1.2_r39android-7.1.2_r38android-7.1.2_r37android-7.1.2_r36android-7.1.2_r33android-7.1.2_r32android-7.1.2_r30android-7.1.2_r3android-7.1.2_r29android-7.1.2_r28android-7.1.2_r27android-7.1.2_r25android-7.1.2_r24android-7.1.2_r23android-7.1.2_r2android-7.1.2_r19android-7.1.2_r18android-7.1.2_r17android-7.1.2_r16android-7.1.2_r15android-7.1.2_r14android-7.1.2_r13android-7.1.2_r12android-7.1.2_r11android-7.1.2_r10android-7.1.2_r1nougat-mr2.3-releasenougat-mr2.2-releasenougat-mr2.1-releasenougat-mr2-security-releasenougat-mr2-releasenougat-mr2-pixel-releasenougat-mr2-devPaul Jensen
am: f9491fa279 Change-Id: I5aa3f0082621dc4da828d575c7df383e8dacc55b
2016-07-27Add host executable to try running an APF program against a packet. am: ↵Paul Jensen
f9491fa279 am: f5e8b86e2c Change-Id: Iec1f4d59ba44e53ccba25995aa7404e12c5895e2
2016-07-27Add host executable to try running an APF program against a packet.Paul Jensen
am: f9491fa279 Change-Id: Ia042800508bb055b14e2e385b406cfdc8138d251
2016-07-27Add host executable to try running an APF program against a packet.android-cts_7.1_r1android-cts-7.1_r9android-cts-7.1_r8android-cts-7.1_r7android-cts-7.1_r6android-cts-7.1_r5android-cts-7.1_r4android-cts-7.1_r3android-cts-7.1_r29android-cts-7.1_r28android-cts-7.1_r27android-cts-7.1_r26android-cts-7.1_r25android-cts-7.1_r24android-cts-7.1_r23android-cts-7.1_r22android-cts-7.1_r21android-cts-7.1_r20android-cts-7.1_r2android-cts-7.1_r19android-cts-7.1_r18android-cts-7.1_r17android-cts-7.1_r16android-cts-7.1_r15android-cts-7.1_r14android-cts-7.1_r13android-cts-7.1_r12android-cts-7.1_r11android-cts-7.1_r10android-cts-7.1_r1android-7.1.1_r9android-7.1.1_r8android-7.1.1_r7android-7.1.1_r61android-7.1.1_r60android-7.1.1_r6android-7.1.1_r59android-7.1.1_r58android-7.1.1_r57android-7.1.1_r56android-7.1.1_r55android-7.1.1_r54android-7.1.1_r53android-7.1.1_r52android-7.1.1_r51android-7.1.1_r50android-7.1.1_r49android-7.1.1_r48android-7.1.1_r47android-7.1.1_r46android-7.1.1_r45android-7.1.1_r44android-7.1.1_r43android-7.1.1_r42android-7.1.1_r41android-7.1.1_r40android-7.1.1_r4android-7.1.1_r39android-7.1.1_r38android-7.1.1_r35android-7.1.1_r33android-7.1.1_r32android-7.1.1_r31android-7.1.1_r3android-7.1.1_r28android-7.1.1_r27android-7.1.1_r26android-7.1.1_r25android-7.1.1_r24android-7.1.1_r23android-7.1.1_r22android-7.1.1_r21android-7.1.1_r20android-7.1.1_r2android-7.1.1_r17android-7.1.1_r16android-7.1.1_r15android-7.1.1_r14android-7.1.1_r13android-7.1.1_r12android-7.1.1_r11android-7.1.1_r10android-7.1.1_r1android-7.1.0_r7android-7.1.0_r6android-7.1.0_r5android-7.1.0_r4android-7.1.0_r3android-7.1.0_r2android-7.1.0_r1nougat-mr1.8-releasenougat-mr1.7-releasenougat-mr1.6-releasenougat-mr1.5-releasenougat-mr1.4-releasenougat-mr1.3-releasenougat-mr1.2-releasenougat-mr1.1-releasenougat-mr1-volantis-releasenougat-mr1-security-releasenougat-mr1-releasenougat-mr1-flounder-releasenougat-mr1-devnougat-mr1-cts-releasenougat-dr1-releasePaul Jensen
This program is just for debugging purposes and isn't shipped. Bug: 30138831 Change-Id: I8b943c1333db4addb729830f7e15e32653fe7ca4
2016-05-24Make the APF disassembler print pass and drop labels in jumps. am: ↵Lorenzo Colitti
1017073e88 am: ae7070075e am: 696f753aec * commit '696f753aec519420dd172e5cbe0aaa367efc7ca9': Make the APF disassembler print pass and drop labels in jumps. Change-Id: I898d8292780fe98a97114451e7053384a20be094
2016-05-24Make the APF disassembler print pass and drop labels in jumps. am: 1017073e88Lorenzo Colitti
am: ae7070075e * commit 'ae7070075ebcbc8e262bc8897616f4b671e38d46': Make the APF disassembler print pass and drop labels in jumps. Change-Id: Ia19583e3ff436b20f93b600f659448af9af81f1f
2016-05-24Make the APF disassembler print pass and drop labels in jumps.Lorenzo Colitti
am: 1017073e88 * commit '1017073e88c658cb7b88c8272b396d7998d61b13': Make the APF disassembler print pass and drop labels in jumps. Change-Id: Ic60b78bea98891f4d36a95f43a467e5845125d6b
2016-05-23Make the APF disassembler print pass and drop labels in jumps.nougat-devLorenzo Colitti
Also add a host executable target for it so it doesn't bitrot. Bug: 26238573 Change-Id: I078d50a4c3896b381b2744ae5c75989b99b14d5d
2016-05-19Add APF disassembler for testing purposes. am: 497d4ee96c am: 63269f85d4Paul Jensen
am: 4adcbdf494 * commit '4adcbdf494d8d85a5a1a3cf4bafd26201503e692': Add APF disassembler for testing purposes. Change-Id: Ida886813a43eab4a84bb218557357205af504dd2
2016-05-19Add APF disassembler for testing purposes. am: 497d4ee96cPaul Jensen
am: 63269f85d4 * commit '63269f85d445700a637be6297e7083259189a460': Add APF disassembler for testing purposes. Change-Id: I7bbed949782ebdc4e83c34b9b713bd9706a8620a
2016-05-19Add APF disassembler for testing purposes.Paul Jensen
am: 497d4ee96c * commit '497d4ee96c2459750e06c5c6a445dfaf0ced18fa': Add APF disassembler for testing purposes. Change-Id: I8d546b235b7d9b2140e8a01857099e9f021ac8e8
2016-05-10Add APF disassembler for testing purposes.Paul Jensen
This change involves no functional change to the APF interpreter. Bug: 26238573 Change-Id: I64bbccd4223c340e7dd6794ad48df12aae6ab78f
2016-02-15Make APF interpreter compile without C99 features.Paul Jensen
am: d0f1e60dcd * commit 'd0f1e60dcd609299fc4defb847e0729a5554d488': Make APF interpreter compile without C99 features.
2016-02-12Make APF interpreter compile without C99 features.Paul Jensen
This code is built by third-parties in build environments without C99 features, so get it building cleanly in those environments. Change-Id: Ic54807348282696d3dd588323fa06a7ead4aa74d
2016-02-02Avoid compiler errors and enforce all warnings/errors.Paul Jensen
am: 51d3c5fa9c * commit '51d3c5fa9c0ad7dd551c05b06a62ecec09c029d8': Avoid compiler errors and enforce all warnings/errors.
2016-02-02Avoid compiler errors and enforce all warnings/errors.Paul Jensen
Change-Id: I13305afc93942be7dbca0ae123aedf76c7a88135
2016-01-29Android packet filter interpreterPaul Jensen
am: e1caf6d87d * commit 'e1caf6d87d16f7dfbc83a5501d4ecfb85faa83f3': Android packet filter interpreter Initial empty repository
2016-01-29Android packet filter interpreterPaul Jensen
Bug: 26238573 Change-Id: I67fca3eb41d4afcc3fe522c55239e1c02fde3e51
2016-01-15Initial empty repositoryBill Rassieur
2016-01-15Initial empty repositoryBill Rassieur